Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-sfa-module-job
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-sfa-module-job
Commits
36c3cd75
提交
36c3cd75
authored
2月 05, 2025
作者:
吕本才
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化代码,job业务直接查询dao层,job中去掉service
上级
40cc31a3
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
350 行增加
和
116 行删除
+350
-116
FinanceOrderDetailSyncController.java
.../controller/finance/FinanceOrderDetailSyncController.java
+2
-2
FinanceBaseZbjTypeDao.java
...a/com/sfa/job/domain/order/dao/FinanceBaseZbjTypeDao.java
+7
-0
FinanceOrderDetailDao.java
...a/com/sfa/job/domain/order/dao/FinanceOrderDetailDao.java
+10
-0
FinianceBaseProductDao.java
.../com/sfa/job/domain/order/dao/FinianceBaseProductDao.java
+3
-5
FinianceBaseProductDaoImpl.java
...job/domain/order/dao/impl/FinianceBaseProductDaoImpl.java
+11
-19
FinianceOrderDetailDaoImpl.java
...job/domain/order/dao/impl/FinianceOrderDetailDaoImpl.java
+29
-0
FinanceOrderDetailMapper.java
...sfa/job/domain/order/mapper/FinanceOrderDetailMapper.java
+4
-0
FinanceSyncOrderDetailDto.java
.../com/sfa/job/pojo/response/FinanceSyncOrderDetailDto.java
+1
-0
FinanceBaseZbjTypeService.java
.../com/sfa/job/service/order/FinanceBaseZbjTypeService.java
+0
-12
FinanceOrderDetailService.java
.../com/sfa/job/service/order/FinanceOrderDetailService.java
+0
-7
FinanceBaseZbjTypeServiceImpl.java
...job/service/order/impl/FinanceBaseZbjTypeServiceImpl.java
+0
-35
FinanceOrderDetailServiceImpl.java
...job/service/order/impl/FinanceOrderDetailServiceImpl.java
+0
-22
FinanceOrderSyncServiceImpl.java
...a/job/service/order/impl/FinanceOrderSyncServiceImpl.java
+23
-14
WangdiantongUtil.java
src/main/java/com/sfa/job/util/WangdiantongUtil.java
+2
-0
FinanceOrderDetailMapper.xml
src/main/resources/mapper/order/FinanceOrderDetailMapper.xml
+258
-0
没有找到文件。
src/main/java/com/sfa/job/controller/finance/FinanceOrderDetailSyncController.java
浏览文件 @
36c3cd75
...
...
@@ -24,8 +24,8 @@ public class FinanceOrderDetailSyncController extends BaseController {
@Autowired
private
FinanceOrderSyncService
syncService
;
@GetMapping
(
"/syncWan
diantongOrderDea
tail"
)
public
FinanceSyncOrderDetailDto
syncWan
diantongOrderDea
tail
(
Date
startTime
,
Date
endTime
)
{
@GetMapping
(
"/syncWan
gdiantongOrderDe
tail"
)
public
FinanceSyncOrderDetailDto
syncWan
gdiantongOrderDe
tail
(
Date
startTime
,
Date
endTime
)
{
log
.
info
(
"接口开始同步-旺店通订单明细api接口数据"
);
// 可以传参开始时间和结束时间,用于补充特定时间的数据采集
FinanceSyncOrderDetailDto
detailDto
=
syncService
.
syncWangdiantongOrder
(
startTime
,
endTime
,
1
);
...
...
src/main/java/com/sfa/job/domain/order/dao/FinanceBaseZbjTypeDao.java
0 → 100644
浏览文件 @
36c3cd75
package
com
.
sfa
.
job
.
domain
.
order
.
dao
;
import
java.util.Map
;
public
interface
FinanceBaseZbjTypeDao
{
Map
<
String
,
String
>
selectBaseZbjType
();
}
src/main/java/com/sfa/job/domain/order/dao/FinanceOrderDetailDao.java
0 → 100644
浏览文件 @
36c3cd75
package
com
.
sfa
.
job
.
domain
.
order
.
dao
;
import
com.sfa.job.domain.order.entity.FinanceOrderDetail
;
import
java.util.List
;
public
interface
FinanceOrderDetailDao
{
void
saveOrUpdateBatch
(
List
<
FinanceOrderDetail
>
mergeList
);
}
src/main/java/com/sfa/job/
service/order/FinanceBaseProductService
.java
→
src/main/java/com/sfa/job/
domain/order/dao/FinianceBaseProductDao
.java
浏览文件 @
36c3cd75
package
com
.
sfa
.
job
.
service
.
order
;
package
com
.
sfa
.
job
.
domain
.
order
.
dao
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.sfa.job.domain.order.entity.FinanceBaseProduct
;
import
java.util.Map
;
public
interface
FinanceBaseProductService
extends
IService
<
FinanceBaseProduct
>
{
public
interface
FinianceBaseProductDao
{
Map
<
String
,
FinanceBaseProduct
>
selectBaseProduct
();
}
src/main/java/com/sfa/job/
service/order/impl/FinanceBaseProductService
Impl.java
→
src/main/java/com/sfa/job/
domain/order/dao/impl/FinianceBaseProductDao
Impl.java
浏览文件 @
36c3cd75
package
com
.
sfa
.
job
.
service
.
order
.
impl
;
package
com
.
sfa
.
job
.
domain
.
order
.
dao
.
impl
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.sfa.job.domain.order.dao.FinianceBaseProductDao
;
import
com.sfa.job.domain.order.entity.FinanceBaseProduct
;
import
com.sfa.job.domain.order.mapper.FinanceBaseProductMapper
;
import
com.sfa.job.service.order.FinanceBaseProductService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Repository
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@DS
(
"Bi"
)
@Repository
public
class
FinianceBaseProductDaoImpl
implements
FinianceBaseProductDao
{
/**
* 旺店通订单Service业务层处理
*
* @author lvbencai
* @date 2025年01月07日17:00:16
*/
@DS
(
"bi"
)
@Slf4j
@Service
public
class
FinanceBaseProductServiceImpl
extends
ServiceImpl
<
FinanceBaseProductMapper
,
FinanceBaseProduct
>
implements
FinanceBaseProductService
{
@Autowired
FinanceBaseProductMapper
mapper
;
@Override
public
Map
<
String
,
FinanceBaseProduct
>
selectBaseProduct
()
{
// 查询所有商品
List
<
FinanceBaseProduct
>
list
=
list
()
;
List
<
FinanceBaseProduct
>
list
=
mapper
.
selectList
(
new
LambdaQueryWrapper
<>())
;
// 以料号为key,商品对象为value,放入map中
Map
<
String
,
FinanceBaseProduct
>
map
=
list
.
stream
()
.
collect
(
HashMap:
:
new
,
(
k
,
v
)
->
k
.
put
(
v
.
getPrdCode
(),
v
),
HashMap:
:
putAll
);
return
map
;
}
}
src/main/java/com/sfa/job/domain/order/dao/impl/FinianceOrderDetailDaoImpl.java
0 → 100644
浏览文件 @
36c3cd75
package
com
.
sfa
.
job
.
domain
.
order
.
dao
.
impl
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
com.sfa.job.domain.order.dao.FinanceOrderDetailDao
;
import
com.sfa.job.domain.order.entity.FinanceOrderDetail
;
import
com.sfa.job.domain.order.mapper.FinanceOrderDetailMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@DS
(
"Bi"
)
@Repository
public
class
FinianceOrderDetailDaoImpl
implements
FinanceOrderDetailDao
{
private
static
final
int
BATCH_SIZE
=
1000
;
@Autowired
private
FinanceOrderDetailMapper
financeOrderDetailMapper
;
@Override
public
void
saveOrUpdateBatch
(
List
<
FinanceOrderDetail
>
mergeList
)
{
for
(
int
i
=
0
;
i
<
mergeList
.
size
();
i
+=
BATCH_SIZE
)
{
int
toIndex
=
Math
.
min
(
i
+
BATCH_SIZE
,
mergeList
.
size
());
List
<
FinanceOrderDetail
>
batchLists
=
mergeList
.
subList
(
i
,
toIndex
);
financeOrderDetailMapper
.
saveOrUpdateBatch
(
batchLists
);
}
}
}
src/main/java/com/sfa/job/domain/order/mapper/FinanceOrderDetailMapper.java
浏览文件 @
36c3cd75
...
...
@@ -4,8 +4,12 @@ package com.sfa.job.domain.order.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.sfa.job.domain.order.entity.FinanceOrderDetail
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
@Mapper
public
interface
FinanceOrderDetailMapper
extends
BaseMapper
<
FinanceOrderDetail
>
{
void
saveOrUpdateBatch
(
@Param
(
value
=
"list"
)
List
<
FinanceOrderDetail
>
mergeList
);
}
src/main/java/com/sfa/job/pojo/response/FinanceSyncOrderDetailDto.java
浏览文件 @
36c3cd75
...
...
@@ -19,5 +19,6 @@ public class FinanceSyncOrderDetailDto {
private
String
batchNo
;
private
Integer
pageNo
;
private
Integer
totalCount
;
private
String
message
;
}
src/main/java/com/sfa/job/service/order/FinanceBaseZbjTypeService.java
deleted
100644 → 0
浏览文件 @
40cc31a3
package
com
.
sfa
.
job
.
service
.
order
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.sfa.job.domain.order.entity.FinanceBaseZbjType
;
import
java.util.Map
;
public
interface
FinanceBaseZbjTypeService
extends
IService
<
FinanceBaseZbjType
>
{
Map
<
String
,
String
>
selectBaseZbjType
();
}
src/main/java/com/sfa/job/service/order/FinanceOrderDetailService.java
deleted
100644 → 0
浏览文件 @
40cc31a3
package
com
.
sfa
.
job
.
service
.
order
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.sfa.job.domain.order.entity.FinanceOrderDetail
;
public
interface
FinanceOrderDetailService
extends
IService
<
FinanceOrderDetail
>
{
}
src/main/java/com/sfa/job/service/order/impl/FinanceBaseZbjTypeServiceImpl.java
deleted
100644 → 0
浏览文件 @
40cc31a3
package
com
.
sfa
.
job
.
service
.
order
.
impl
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.sfa.job.domain.order.entity.FinanceBaseZbjType
;
import
com.sfa.job.domain.order.mapper.FinanceBaseZbjTypeMapper
;
import
com.sfa.job.service.order.FinanceBaseZbjTypeService
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 旺店通订单Service业务层处理
*
* @author lvbencai
* @date 2025年01月07日17:00:16
*/
@DS
(
"bi"
)
@Service
public
class
FinanceBaseZbjTypeServiceImpl
extends
ServiceImpl
<
FinanceBaseZbjTypeMapper
,
FinanceBaseZbjType
>
implements
FinanceBaseZbjTypeService
{
@Override
public
Map
<
String
,
String
>
selectBaseZbjType
()
{
List
<
FinanceBaseZbjType
>
list
=
list
();
// 以fenxiaoName为key,直播间渠道类型为value,放入map中
Map
<
String
,
String
>
map
=
list
.
stream
()
.
collect
(
HashMap:
:
new
,
(
k
,
v
)
->
k
.
put
(
v
.
getFenxiaoName
(),
v
.
getZbjQdType
()),
HashMap:
:
putAll
);
return
map
;
}
}
src/main/java/com/sfa/job/service/order/impl/FinanceOrderDetailServiceImpl.java
deleted
100644 → 0
浏览文件 @
40cc31a3
package
com
.
sfa
.
job
.
service
.
order
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.sfa.job.domain.order.entity.FinanceOrderDetail
;
import
com.sfa.job.domain.order.mapper.FinanceOrderDetailMapper
;
import
com.sfa.job.service.order.FinanceOrderDetailService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
/**
* 旺店通订单明细Service业务层处理
*
* @author lvbencai
* @date 2025年01月07日17:00:16
*/
// 指定不同的数据源
//@DS("bi")
@Slf4j
@Service
public
class
FinanceOrderDetailServiceImpl
extends
ServiceImpl
<
FinanceOrderDetailMapper
,
FinanceOrderDetail
>
implements
FinanceOrderDetailService
{
}
src/main/java/com/sfa/job/service/order/impl/FinanceOrderSyncServiceImpl.java
浏览文件 @
36c3cd75
...
...
@@ -8,17 +8,12 @@ import com.baomidou.dynamic.datasource.annotation.DS;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.sfa.common.core.exception.ServiceException
;
import
com.sfa.common.core.utils.DateUtils
;
import
com.sfa.job.domain.order.dao.CollectErrorInfoDao
;
import
com.sfa.job.domain.order.dao.CollectOrderLogInfoDao
;
import
com.sfa.job.domain.order.dao.IProductDao
;
import
com.sfa.job.domain.order.dao.*
;
import
com.sfa.job.domain.order.entity.*
;
import
com.sfa.job.domain.order.mapper.FinanceOrderMapper
;
import
com.sfa.job.pojo.request.WangdiantongQueryVO
;
import
com.sfa.job.pojo.response.FinanceSyncOrderDetailDto
;
import
com.sfa.job.pojo.response.WangdiantongQueryDto
;
import
com.sfa.job.service.order.FinanceBaseProductService
;
import
com.sfa.job.service.order.FinanceBaseZbjTypeService
;
import
com.sfa.job.service.order.FinanceOrderDetailService
;
import
com.sfa.job.service.order.FinanceOrderSyncService
;
import
com.sfa.job.util.WangdiantongUtil
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -45,11 +40,12 @@ public class FinanceOrderSyncServiceImpl extends ServiceImpl<FinanceOrderMapper,
WangdiantongUtil
wangdiantongUtil
;
@Autowired
FinanceOrderDetailService
detailService
;
// FinanceOrderDetailService detailService;
FinanceOrderDetailDao
detailDao
;
@Autowired
Fin
anceBaseProductService
baseProductService
;
Fin
ianceBaseProductDao
baseProductDao
;
@Autowired
FinanceBaseZbjType
Service
baseZbjTypeService
;
FinanceBaseZbjType
Dao
baseZbjTypeDao
;
@Autowired
CollectOrderLogInfoDao
orderLogInfoDao
;
@Autowired
...
...
@@ -95,10 +91,12 @@ public class FinanceOrderSyncServiceImpl extends ServiceImpl<FinanceOrderMapper,
}
}
// 调用查询旺店通接口api 获取最新日期前的
一个
小时
// 调用查询旺店通接口api 获取最新日期前的
2
小时
Date
currentLatest
=
DateUtils
.
addHours
(
new
Date
(),
-
2
);
if
(
currentLatest
.
compareTo
(
startTime
)
<
0
)
{
throw
new
ServiceException
(
"开始时间不能大于当前时间"
);
detailDto
.
setMessage
(
String
.
format
(
"开始时间%s不能大于当前时间%s"
,
startTime
,
currentLatest
));
log
.
warn
(
detailDto
.
getMessage
());
return
detailDto
;
}
if
(
ObjectUtils
.
isEmpty
(
endTime
))
{
...
...
@@ -121,9 +119,9 @@ public class FinanceOrderSyncServiceImpl extends ServiceImpl<FinanceOrderMapper,
List
<
FinanceOrder
>
orders
=
JSONArray
.
parseArray
(
orderAllArray
.
toString
(),
FinanceOrder
.
class
,
JSONReader
.
Feature
.
SupportSmartMatch
);
// 基础数据 直播间分类数据+成本、规格、口味
Map
<
String
,
FinanceBaseProduct
>
baseProductMap
=
baseProduct
Service
.
selectBaseProduct
();
Map
<
String
,
FinanceBaseProduct
>
baseProductMap
=
baseProduct
Dao
.
selectBaseProduct
();
Map
<
String
,
String
>
baseZbjType
=
baseZbjType
Service
.
selectBaseZbjType
();
Map
<
String
,
String
>
baseZbjType
=
baseZbjType
Dao
.
selectBaseZbjType
();
// 系列
List
<
PrdInfo
>
prdInfos
=
productDao
.
selectProdSeries
();
// 转换成map
...
...
@@ -177,6 +175,9 @@ public class FinanceOrderSyncServiceImpl extends ServiceImpl<FinanceOrderMapper,
orderDetail
.
setZbjId
(
orderDetail
.
getZbjId
(
orderDetail
.
getRemark
(),
sameDetail
));
orderDetail
.
setZbjZbId
(
orderDetail
.
getZbjZbId
(
orderDetail
.
getFenxiaoId
(),
orderDetail
.
getRemark
(),
sameDetail
));
orderDetail
.
setZbjSaleType
(
orderDetail
.
getZbjSaleType
(
orderDetail
.
getRemark
(),
sameDetail
));
orderDetail
.
setFenxiaoId
(
orderDetail
.
getZbjZbId
());
orderDetail
.
setFenxiaoName
(
orderDetail
.
getZbjName
());
// 确定分销商类型
orderDetail
.
setZbjQdType
(
orderDetail
.
getZbjQdType
(
orderDetail
.
getFenxiaoId
(),
orderDetail
.
getZbjZbId
(),
baseZbjType
));
if
(
ObjectUtils
.
isNotEmpty
(
orderDetail
.
getZbjName
()))
{
...
...
@@ -192,6 +193,14 @@ public class FinanceOrderSyncServiceImpl extends ServiceImpl<FinanceOrderMapper,
orderDetail
.
setStandardCost
(
ObjectUtils
.
isNotEmpty
(
baseProductMap
.
get
(
orderDetail
.
getGoodsNo
()))
?
baseProductMap
.
get
(
orderDetail
.
getGoodsNo
()).
getStandardCost
()
:
new
BigDecimal
(
0
)
// (ObjectUtils.isNotEmpty(order.getGoodsTypeCount()) && (order.getGoodsTypeCount().signum()!= 0) ? order.getGoodsCost().divide(order.getGoodsTypeCount()).setScale(4, BigDecimal.ROUND_HALF_UP) : new BigDecimal(0))
);
orderDetail
.
setSumActualCost
(
ObjectUtils
.
isNotEmpty
(
baseProductMap
.
get
(
orderDetail
.
getGoodsNo
()))
?
baseProductMap
.
get
(
orderDetail
.
getGoodsNo
()).
getActualCost
().
multiply
(
orderDetail
.
getNum
())
:
new
BigDecimal
(
0
));
orderDetail
.
setSumStandardCost
(
ObjectUtils
.
isNotEmpty
(
baseProductMap
.
get
(
orderDetail
.
getGoodsNo
()))
?
baseProductMap
.
get
(
orderDetail
.
getGoodsNo
()).
getStandardCost
().
multiply
(
orderDetail
.
getNum
())
:
new
BigDecimal
(
0
)
// (ObjectUtils.isNotEmpty(order.getGoodsTypeCount()) && (order.getGoodsTypeCount().signum()!= 0) ? order.getGoodsCost().divide(order.getGoodsTypeCount()).setScale(4, BigDecimal.ROUND_HALF_UP) : new BigDecimal(0))
);
}
...
...
@@ -200,7 +209,7 @@ public class FinanceOrderSyncServiceImpl extends ServiceImpl<FinanceOrderMapper,
log
.
info
(
"开始插入订单详情数据,数量:{}"
,
mergeList
.
size
());
// 批量插入
detail
Service
.
saveOrUpdateBatch
(
mergeList
);
detail
Dao
.
saveOrUpdateBatch
(
mergeList
);
log
.
info
(
"插入订单和订单详情完成,批次{}开始时间{},结束时间{},订单数量:{},详情数量:{}"
,
batchNo
,
DateUtil
.
formatDateTime
(
startTime
),
DateUtil
.
formatDateTime
(
endTime
),
orders
.
size
(),
mergeList
.
size
());
...
...
src/main/java/com/sfa/job/util/WangdiantongUtil.java
浏览文件 @
36c3cd75
...
...
@@ -34,6 +34,8 @@ public class WangdiantongUtil {
int
maxDealCount
=
500
;
int
size
=
0
;
int
pageNo
=
beginPageNo
.
get
();
// 出现了查询的分页数量不足的情况
int
maxPage
=
0
;
do
{
...
...
src/main/resources/mapper/order/FinanceOrderDetailMapper.xml
0 → 100644
浏览文件 @
36c3cd75
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.sfa.job.domain.order.mapper.FinanceOrderDetailMapper"
>
<insert
id=
"saveOrUpdateBatch"
parameterType=
"java.util.List"
>
insert into finance_order_detail(
<include
refid=
"Base_Column_List"
></include>
)
values
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(
#{item.tradeId}, #{item.recId}, #{item.platformId}, #{item.srcOid}, #{item.srcTid},
#{item.payStatus}, #{item.refundStatus}, #{item.platformStatus}, #{item.deliveryTerm},
#{item.num}, #{item.price}, #{item.refundNum}, #{item.orderPrice}, #{item.sharePrice},
#{item.adjust}, #{item.discount}, #{item.shareAmount}, #{item.taxRate}, #{item.goodsName},
#{item.goodsNo}, #{item.specName}, #{item.specNo}, #{item.specCode}, #{item.suiteNo},
#{item.suiteName}, #{item.suiteNum}, #{item.suiteAmount}, #{item.suiteDiscount},
#{item.apiGoodsName}, #{item.apiSpecName}, #{item.apiGoodsId}, #{item.apiSpecId},
#{item.goodsId}, #{item.specId}, #{item.commission}, #{item.goodsType}, #{item.fromMask},
#{item.remark}, #{item.modified}, #{item.created}, #{item.prop1}, #{item.prop2},
#{item.weight}, #{item.imgUrl}, #{item.actualNum}, #{item.barcode}, #{item.paid},
#{item.suiteId}, #{item.bindOid}, #{item.printSuiteMode}, #{item.flag}, #{item.stockState},
#{item.isConsigned}, #{item.isReceived}, #{item.cid}, #{item.modifiedDate}, #{item.createdDate},
#{item.sharePostPrice}, #{item.invoiceContent}, #{item.payTime}, #{item.shortName},
#{item.fenxiaoNick}, #{item.fenxiaoId}, #{item.fenxiaoName}, #{item.batchNo},
#{item.startTime}, #{item.endTime}, #{item.tradeNo}, #{item.shopNo}, #{item.shopName},
#{item.shopRemark}, #{item.tradeStatus}, #{item.tradeTime}, #{item.consignTime},
#{item.receiverArea}, #{item.zbjName}, #{item.zbjId}, #{item.zbjZbId}, #{item.zbjSaleType},
#{item.zbjQdType}, #{item.receivable}, #{item.specNameErp}, #{item.flavorErp},
#{item.syncType}, #{item.actualCost}, #{item.standardCost}, #{item.sumActualCost}, #{item.sumStandardCost},
#{item.series}, #{item.delFlag}
)
</foreach>
ON DUPLICATE KEY UPDATE
trade_id = VALUES(trade_id),
platform_id = VALUES(platform_id),
src_oid = VALUES(src_oid),
src_tid = VALUES(src_tid),
pay_status = VALUES(pay_status),
refund_status = VALUES(refund_status),
platform_status = VALUES(platform_status),
delivery_term = VALUES(delivery_term),
num = VALUES(num),
price = VALUES(price),
refund_num = VALUES(refund_num),
order_price = VALUES(order_price),
share_price = VALUES(share_price),
adjust = VALUES(adjust),
discount = VALUES(discount),
share_amount = VALUES(share_amount),
tax_rate = VALUES(tax_rate),
goods_name = VALUES(goods_name),
goods_no = VALUES(goods_no),
spec_name = VALUES(spec_name),
spec_no = VALUES(spec_no),
spec_code = VALUES(spec_code),
suite_no = VALUES(suite_no),
suite_name = VALUES(suite_name),
suite_num = VALUES(suite_num),
suite_amount = VALUES(suite_amount),
suite_discount = VALUES(suite_discount),
api_goods_name = VALUES(api_goods_name),
api_spec_name = VALUES(api_spec_name),
api_goods_id = VALUES(api_goods_id),
api_spec_id = VALUES(api_spec_id),
goods_id = VALUES(goods_id),
spec_id = VALUES(spec_id),
commission = VALUES(commission),
goods_type = VALUES(goods_type),
from_mask = VALUES(from_mask),
remark = VALUES(remark),
modified = VALUES(modified),
created = VALUES(created),
prop1 = VALUES(prop1),
prop2 = VALUES(prop2),
weight = VALUES(weight),
img_url = VALUES(img_url),
actual_num = VALUES(actual_num),
barcode = VALUES(barcode),
paid = VALUES(paid),
suite_id = VALUES(suite_id),
bind_oid = VALUES(bind_oid),
print_suite_mode = VALUES(print_suite_mode),
flag = VALUES(flag),
stock_state = VALUES(stock_state),
is_consigned = VALUES(is_consigned),
is_received = VALUES(is_received),
cid = VALUES(cid),
modified_date = VALUES(modified_date),
created_date = VALUES(created_date),
share_post_price = VALUES(share_post_price),
invoice_content = VALUES(invoice_content),
pay_time = VALUES(pay_time),
short_name = VALUES(short_name),
fenxiao_nick = VALUES(fenxiao_nick),
fenxiao_id = VALUES(fenxiao_id),
fenxiao_name = VALUES(fenxiao_name),
batch_no = VALUES(batch_no),
start_time = VALUES(start_time),
end_time = VALUES(end_time),
trade_no = VALUES(trade_no),
shop_no = VALUES(shop_no),
shop_name = VALUES(shop_name),
shop_remark = VALUES(shop_remark),
trade_status = VALUES(trade_status),
trade_time = VALUES(trade_time),
consign_time = VALUES(consign_time),
receiver_area = VALUES(receiver_area),
zbj_name = VALUES(zbj_name),
zbj_id = VALUES(zbj_id),
zbj_zb_id = VALUES(zbj_zb_id),
zbj_sale_type = VALUES(zbj_sale_type),
zbj_qd_type = VALUES(zbj_qd_type),
receivable = VALUES(receivable),
spec_name_erp = VALUES(spec_name_erp),
flavor_erp = VALUES(flavor_erp),
sync_type = VALUES(sync_type),
actual_cost = VALUES(actual_cost),
standard_cost = VALUES(standard_cost),
sum_actual_cost = VALUES(sum_actual_cost),
sum_standard_cost = VALUES(sum_standard_cost),
series = VALUES(series),
del_flag = VALUES(del_flag)
</insert>
<!-- 根据 rec_id 查询单条记录 -->
<select
id=
"selectByRecId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
></include>
from finance_order_detail
where rec_id = #{recId}
</select>
<!-- 根据 rec_id 删除记录 -->
<delete
id=
"deleteByRecId"
parameterType=
"java.lang.Long"
>
delete
from finance_order_detail
where rec_id = #{recId}
</delete>
<sql
id=
"Base_Column_List"
>
trade_id, rec_id, platform_id, src_oid, src_tid, pay_status, refund_status, platform_status, delivery_term,
num, price, refund_num, order_price, share_price, adjust, discount, share_amount, tax_rate,
goods_name, goods_no, spec_name, spec_no, spec_code, suite_no, suite_name, suite_num, suite_amount,
suite_discount, api_goods_name, api_spec_name, api_goods_id, api_spec_id, goods_id, spec_id,
commission, goods_type, from_mask, remark, modified, created, prop1, prop2, weight, img_url,
actual_num, barcode, paid, suite_id, bind_oid, print_suite_mode, flag, stock_state, is_consigned,
is_received, cid, modified_date, created_date, share_post_price, invoice_content, pay_time, short_name,
fenxiao_nick, fenxiao_id, fenxiao_name, batch_no, start_time, end_time, trade_no, shop_no, shop_name,
shop_remark, trade_status, trade_time, consign_time, receiver_area, zbj_name, zbj_id, zbj_zb_id,
zbj_sale_type, zbj_qd_type, receivable, spec_name_erp, flavor_erp, sync_type, actual_cost,
standard_cost, sum_actual_cost, sum_standard_cost, series, del_flag
</sql>
<!-- 通用查询结果映射 -->
<resultMap
id=
"BaseResultMap"
type=
"com.sfa.job.domain.order.entity.FinanceOrderDetail"
>
<id
column=
"rec_id"
property=
"recId"
jdbcType=
"BIGINT"
/>
<result
column=
"trade_no"
property=
"tradeNo"
jdbcType=
"VARCHAR"
/>
<result
column=
"trade_id"
property=
"tradeId"
jdbcType=
"BIGINT"
/>
<result
column=
"platform_id"
property=
"platformId"
jdbcType=
"INTEGER"
/>
<result
column=
"src_oid"
property=
"srcOid"
jdbcType=
"VARCHAR"
/>
<result
column=
"src_tid"
property=
"srcTid"
jdbcType=
"VARCHAR"
/>
<result
column=
"pay_status"
property=
"payStatus"
jdbcType=
"INTEGER"
/>
<result
column=
"refund_status"
property=
"refundStatus"
jdbcType=
"INTEGER"
/>
<result
column=
"platform_status"
property=
"platformStatus"
jdbcType=
"INTEGER"
/>
<result
column=
"delivery_term"
property=
"deliveryTerm"
jdbcType=
"INTEGER"
/>
<result
column=
"num"
property=
"num"
jdbcType=
"DECIMAL"
/>
<result
column=
"price"
property=
"price"
jdbcType=
"DECIMAL"
/>
<result
column=
"refund_num"
property=
"refundNum"
jdbcType=
"DECIMAL"
/>
<result
column=
"order_price"
property=
"orderPrice"
jdbcType=
"DECIMAL"
/>
<result
column=
"share_price"
property=
"sharePrice"
jdbcType=
"DECIMAL"
/>
<result
column=
"adjust"
property=
"adjust"
jdbcType=
"DECIMAL"
/>
<result
column=
"discount"
property=
"discount"
jdbcType=
"DECIMAL"
/>
<result
column=
"share_amount"
property=
"shareAmount"
jdbcType=
"DECIMAL"
/>
<result
column=
"tax_rate"
property=
"taxRate"
jdbcType=
"DECIMAL"
/>
<result
column=
"goods_name"
property=
"goodsName"
jdbcType=
"VARCHAR"
/>
<result
column=
"goods_no"
property=
"goodsNo"
jdbcType=
"VARCHAR"
/>
<result
column=
"spec_name"
property=
"specName"
jdbcType=
"VARCHAR"
/>
<result
column=
"spec_no"
property=
"specNo"
jdbcType=
"VARCHAR"
/>
<result
column=
"spec_code"
property=
"specCode"
jdbcType=
"VARCHAR"
/>
<result
column=
"suite_no"
property=
"suiteNo"
jdbcType=
"VARCHAR"
/>
<result
column=
"suite_name"
property=
"suiteName"
jdbcType=
"VARCHAR"
/>
<result
column=
"suite_num"
property=
"suiteNum"
jdbcType=
"DECIMAL"
/>
<result
column=
"suite_amount"
property=
"suiteAmount"
jdbcType=
"DECIMAL"
/>
<result
column=
"suite_discount"
property=
"suiteDiscount"
jdbcType=
"DECIMAL"
/>
<result
column=
"api_goods_name"
property=
"apiGoodsName"
jdbcType=
"VARCHAR"
/>
<result
column=
"api_spec_name"
property=
"apiSpecName"
jdbcType=
"VARCHAR"
/>
<result
column=
"api_goods_id"
property=
"apiGoodsId"
jdbcType=
"VARCHAR"
/>
<result
column=
"api_spec_id"
property=
"apiSpecId"
jdbcType=
"VARCHAR"
/>
<result
column=
"goods_id"
property=
"goodsId"
jdbcType=
"INTEGER"
/>
<result
column=
"spec_id"
property=
"specId"
jdbcType=
"INTEGER"
/>
<result
column=
"commission"
property=
"commission"
jdbcType=
"DECIMAL"
/>
<result
column=
"goods_type"
property=
"goodsType"
jdbcType=
"INTEGER"
/>
<result
column=
"from_mask"
property=
"fromMask"
jdbcType=
"INTEGER"
/>
<result
column=
"remark"
property=
"remark"
jdbcType=
"VARCHAR"
/>
<result
column=
"modified"
property=
"modified"
jdbcType=
"VARCHAR"
/>
<result
column=
"created"
property=
"created"
jdbcType=
"VARCHAR"
/>
<result
column=
"prop1"
property=
"prop1"
jdbcType=
"VARCHAR"
/>
<result
column=
"prop2"
property=
"prop2"
jdbcType=
"VARCHAR"
/>
<result
column=
"weight"
property=
"weight"
jdbcType=
"DECIMAL"
/>
<result
column=
"actual_num"
property=
"actualNum"
jdbcType=
"DECIMAL"
/>
<result
column=
"barcode"
property=
"barcode"
jdbcType=
"VARCHAR"
/>
<result
column=
"paid"
property=
"paid"
jdbcType=
"DECIMAL"
/>
<result
column=
"suite_id"
property=
"suiteId"
jdbcType=
"INTEGER"
/>
<result
column=
"bind_oid"
property=
"bindOid"
jdbcType=
"VARCHAR"
/>
<result
column=
"print_suite_mode"
property=
"printSuiteMode"
jdbcType=
"INTEGER"
/>
<result
column=
"flag"
property=
"flag"
jdbcType=
"INTEGER"
/>
<result
column=
"stock_state"
property=
"stockState"
jdbcType=
"INTEGER"
/>
<result
column=
"is_consigned"
property=
"isConsigned"
jdbcType=
"TINYINT"
/>
<result
column=
"is_received"
property=
"isReceived"
jdbcType=
"INTEGER"
/>
<result
column=
"cid"
property=
"cid"
jdbcType=
"INTEGER"
/>
<result
column=
"modified_date"
property=
"modifiedDate"
jdbcType=
"VARCHAR"
/>
<result
column=
"created_date"
property=
"createdDate"
jdbcType=
"VARCHAR"
/>
<result
column=
"share_post_price"
property=
"sharePostPrice"
jdbcType=
"DECIMAL"
/>
<result
column=
"invoice_content"
property=
"invoiceContent"
jdbcType=
"VARCHAR"
/>
<result
column=
"pay_time"
property=
"payTime"
jdbcType=
"VARCHAR"
/>
<result
column=
"short_name"
property=
"shortName"
jdbcType=
"VARCHAR"
/>
<result
column=
"fenxiao_nick"
property=
"fenxiaoNick"
jdbcType=
"VARCHAR"
/>
<result
column=
"fenxiao_id"
property=
"fenxiaoId"
jdbcType=
"VARCHAR"
/>
<result
column=
"fenxiao_name"
property=
"fenxiaoName"
jdbcType=
"VARCHAR"
/>
<result
column=
"batch_no"
property=
"batchNo"
jdbcType=
"VARCHAR"
/>
<result
column=
"del_flag"
property=
"delFlag"
jdbcType=
"CHAR"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"start_time"
property=
"startTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"end_time"
property=
"endTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"shop_no"
property=
"shopNo"
jdbcType=
"VARCHAR"
/>
<result
column=
"shop_name"
property=
"shopName"
jdbcType=
"VARCHAR"
/>
<result
column=
"shop_remark"
property=
"shopRemark"
jdbcType=
"VARCHAR"
/>
<result
column=
"trade_status"
property=
"tradeStatus"
jdbcType=
"INTEGER"
/>
<result
column=
"trade_time"
property=
"tradeTime"
jdbcType=
"VARCHAR"
/>
<result
column=
"consign_time"
property=
"consignTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"receiver_area"
property=
"receiverArea"
jdbcType=
"VARCHAR"
/>
<result
column=
"zbj_name"
property=
"zbjName"
jdbcType=
"VARCHAR"
/>
<result
column=
"zbj_id"
property=
"zbjId"
jdbcType=
"VARCHAR"
/>
<result
column=
"zbj_zb_id"
property=
"zbjZbId"
jdbcType=
"VARCHAR"
/>
<result
column=
"zbj_sale_type"
property=
"zbjSaleType"
jdbcType=
"VARCHAR"
/>
<result
column=
"zbj_qd_type"
property=
"zbjQdType"
jdbcType=
"VARCHAR"
/>
<result
column=
"receivable"
property=
"receivable"
jdbcType=
"DECIMAL"
/>
<result
column=
"spec_name_erp"
property=
"specNameErp"
jdbcType=
"VARCHAR"
/>
<result
column=
"flavor_erp"
property=
"flavorErp"
jdbcType=
"VARCHAR"
/>
<result
column=
"sync_type"
property=
"syncType"
jdbcType=
"TINYINT"
/>
<result
column=
"actual_cost"
property=
"actualCost"
jdbcType=
"DECIMAL"
/>
<result
column=
"standard_cost"
property=
"standardCost"
jdbcType=
"DECIMAL"
/>
<result
column=
"share_amount_sum"
property=
"shareAmountSum"
jdbcType=
"DECIMAL"
/>
<result
column=
"actual_cost_sum"
property=
"actualCostSum"
jdbcType=
"DECIMAL"
/>
<result
column=
"standard_cost_sum"
property=
"standardCostSum"
jdbcType=
"DECIMAL"
/>
<result
column=
"share_amount_diff_sum"
property=
"shareAmountDiffSum"
jdbcType=
"DECIMAL"
/>
<result
column=
"query_type"
property=
"queryType"
jdbcType=
"VARCHAR"
/>
</resultMap>
</mapper>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论