mirror of
https://gitee.com/guchengwuyue/crm.git
synced 2025-12-06 17:08:28 +08:00
合同拒绝增加库存回退
This commit is contained in:
parent
c8ae17c7c9
commit
dfd14aec30
@ -363,6 +363,11 @@ public class CrmContractServiceImpl implements CrmContractService {
|
||||
crmContractDO.setCheckAdminId("");
|
||||
crmContractDO.setFlowAdminId(new ArrayList<>());
|
||||
crmFlowLogDO.setRemark(checkInfoVO.getRemark());
|
||||
//回退库存
|
||||
List<CrmContractProductDO> list = contractProductMapper
|
||||
.selectList(new LambdaQueryWrapper<CrmContractProductDO>()
|
||||
.eq(CrmContractProductDO::getContractId,crmContractDO.getId()));
|
||||
list.forEach(product -> incProductStock(product.getNums(),product.getProductId(),product.getProductAttrUnique()));
|
||||
}
|
||||
contractMapper.updateById(crmContractDO);
|
||||
//存入审批日志
|
||||
@ -376,6 +381,22 @@ public class CrmContractServiceImpl implements CrmContractService {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加库存 减少销量
|
||||
*
|
||||
* @param num 数量
|
||||
* @param productId 商品id
|
||||
* @param unique sku唯一值
|
||||
*/
|
||||
private void incProductStock(Integer num, Long productId, String unique) {
|
||||
//处理属性sku
|
||||
if (StrUtil.isNotEmpty(unique)) {
|
||||
storeProductAttrValueMapper.incStockDecSales(num, productId, unique);
|
||||
}
|
||||
//先处理商品库存,活动商品也要处理,因为共享库存
|
||||
storeProductMapper.incStockDecSales(num, productId);
|
||||
}
|
||||
|
||||
private void createContractProductList(Long contractId, List<CrmContractProductDO> list) {
|
||||
list.forEach(o -> {
|
||||
o.setContractId(contractId);
|
||||
|
||||
@ -46,12 +46,12 @@ spring:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://127.0.0.1:3306/yshop-crm?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
url: jdbc:mysql://127.0.0.1:3306/yshop-crm-open?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
username: root
|
||||
password: root
|
||||
slave: # 模拟从库,可根据自己需要修改
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:mysql://127.0.0.1:3306/yshop-crm?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
url: jdbc:mysql://127.0.0.1:3306/yshop-crm-open?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
username: root
|
||||
password: root
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user