修复盘点
This commit is contained in:
1 parent
e74c37b957
commit
55241e81b1
1 file changed
+21
-1
+21
-1
@@ -10,7 +10,12 @@ import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.flow.task.api.feign.RemoteFlowApiFlowService;
|
||||
import com.bsd.pjcloud.flow.task.constant.TaskCheckStatusEnum;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessInstanceParamDto;
|
||||
import com.bsd.pjcloud.flow.task.entity.Process;
|
||||
import com.bsd.pjcloud.supermarket.constant.OrderTypeEnum;
|
||||
import com.bsd.pjcloud.supermarket.constant.SupermarketFlowConstant;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgdd.SmCgDDSaveItemDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.inventoryrecords.*;
|
||||
import com.bsd.pjcloud.supermarket.entity.*;
|
||||
@@ -53,6 +58,8 @@ public class SmErpInventoryRecordsServiceImpl extends ServiceImpl<SmErpInventory
|
||||
private final RemoteUserService remoteUserService;
|
||||
|
||||
private final SmErpSupplierMapper smErpSupplierMapper;
|
||||
|
||||
private final RemoteFlowApiFlowService remoteFlowApiFlowService;
|
||||
@Override
|
||||
@Transactional
|
||||
public Object saveInventoryRecord(InventoryRecordSaveDTO inventoryRecordSaveDTO) {
|
||||
@@ -67,6 +74,17 @@ public class SmErpInventoryRecordsServiceImpl extends ServiceImpl<SmErpInventory
|
||||
//计算主表总金额
|
||||
int sum = items.stream().mapToInt(InventoryRecordSaveItemDTO::getTotalAmount).sum();
|
||||
smErpCgDdEntity.setTotalAmount(sum);
|
||||
|
||||
//发起流程
|
||||
R<Process> processR = remoteFlowApiFlowService.getProcessByBusinessKey(SupermarketFlowConstant.SUPERMARKET_BHSQ_FLOW);
|
||||
String flowId = processR.getData().getFlowId();
|
||||
ProcessInstanceParamDto processInstanceParamDto = new ProcessInstanceParamDto();
|
||||
processInstanceParamDto.setFlowId(flowId);
|
||||
R<String> stringR = remoteFlowApiFlowService.startProcessInstance(processInstanceParamDto);
|
||||
String processInstanceId = stringR.getData();
|
||||
smErpCgDdEntity.setProcessInstanceId(processInstanceId);
|
||||
smErpCgDdEntity.setCheckStatus(TaskCheckStatusEnum.PADDING.getCode());
|
||||
|
||||
int insert = baseMapper.insert(smErpCgDdEntity);
|
||||
|
||||
List<SmErpInventoryRecordsItemEntity> cgPlanItemEntities = BeanUtils.toBean(items, SmErpInventoryRecordsItemEntity.class);
|
||||
@@ -468,10 +486,12 @@ public class SmErpInventoryRecordsServiceImpl extends ServiceImpl<SmErpInventory
|
||||
Double profit = item.getProfit();
|
||||
updateStockDTO.setIncrCount(profit);
|
||||
smErpInventoryRecordsItemEntity.setQuantity(profit);
|
||||
}else if (orderType.equals(OrderTypeEnum.CK.getType())){
|
||||
}else if (orderType.equals(OrderTypeEnum.CK.getType())) {
|
||||
Double loss = item.getLoss();
|
||||
updateStockDTO.setIncrCount(loss);
|
||||
smErpInventoryRecordsItemEntity.setQuantity(loss);
|
||||
}else if (orderType.equals(OrderTypeEnum.No.getType())){
|
||||
//无需更新库存
|
||||
}else {
|
||||
throw new RuntimeException("订单类型错误");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user