|
@@ -273,10 +273,10 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
|
|
warehouseInOutInfo1.setGrade(qualityInspectionManagement.getGrade());
|
|
warehouseInOutInfo1.setGrade(qualityInspectionManagement.getGrade());
|
|
//潮粮取纯重,干粮取净重
|
|
//潮粮取纯重,干粮取净重
|
|
if("潮粮".equals(paymentManagement1.getType())){
|
|
if("潮粮".equals(paymentManagement1.getType())){
|
|
- warehouseInOutInfo1.setPureWeight(paymentManagement.getPureWeight());
|
|
|
|
- warehouseInOutInfo1.setNetWeight(paymentManagement.getPureWeight());
|
|
|
|
|
|
+ warehouseInOutInfo1.setPureWeight(paymentManagement.getPureWeight()/1000);
|
|
|
|
+ warehouseInOutInfo1.setNetWeight(paymentManagement.getPureWeight()/1000);
|
|
}else{
|
|
}else{
|
|
- warehouseInOutInfo1.setNetWeight(paymentManagement.getNetWeight());
|
|
|
|
|
|
+ warehouseInOutInfo1.setNetWeight(paymentManagement.getNetWeight()/1000);
|
|
}
|
|
}
|
|
warehouseInOutInfo1.setStatusFlag("3");
|
|
warehouseInOutInfo1.setStatusFlag("3");
|
|
warehouseInOutInfoService.insert(warehouseInOutInfo1);
|
|
warehouseInOutInfoService.insert(warehouseInOutInfo1);
|
|
@@ -290,7 +290,7 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
|
|
if (warehousePositionStorageInfo != null) {
|
|
if (warehousePositionStorageInfo != null) {
|
|
original = warehousePositionStorageInfo.getStorage();
|
|
original = warehousePositionStorageInfo.getStorage();
|
|
// 更新库存量
|
|
// 更新库存量
|
|
- warehousePositionStorageInfo.setStorage(warehousePositionStorageInfo.getStorage() + warehouseInOutInfo1.getNetWeight());
|
|
|
|
|
|
+ warehousePositionStorageInfo.setStorage(warehousePositionStorageInfo.getStorage() + warehouseInOutInfo1.getNetWeight()/1000);
|
|
warehousePositionStorageInfoService.updateById(warehousePositionStorageInfo);
|
|
warehousePositionStorageInfoService.updateById(warehousePositionStorageInfo);
|
|
}
|
|
}
|
|
// 没有货
|
|
// 没有货
|
|
@@ -301,7 +301,7 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
|
|
warehousePositionStorageInfo1.setPositionId(warehouseInOutInfo1.getPositionId());
|
|
warehousePositionStorageInfo1.setPositionId(warehouseInOutInfo1.getPositionId());
|
|
warehousePositionStorageInfo1.setBinNumber(warehouseInOutInfo1.getBinNumber());
|
|
warehousePositionStorageInfo1.setBinNumber(warehouseInOutInfo1.getBinNumber());
|
|
warehousePositionStorageInfo1.setGoodsName(warehouseInOutInfo1.getGoodsName());
|
|
warehousePositionStorageInfo1.setGoodsName(warehouseInOutInfo1.getGoodsName());
|
|
- warehousePositionStorageInfo1.setStorage(warehouseInOutInfo1.getNetWeight());
|
|
|
|
|
|
+ warehousePositionStorageInfo1.setStorage(warehouseInOutInfo1.getNetWeight()/1000);
|
|
warehousePositionStorageInfoService.insert(warehousePositionStorageInfo1);
|
|
warehousePositionStorageInfoService.insert(warehousePositionStorageInfo1);
|
|
}
|
|
}
|
|
WarehouseInOutDetail warehouseInOutDetail = new WarehouseInOutDetail();
|
|
WarehouseInOutDetail warehouseInOutDetail = new WarehouseInOutDetail();
|
|
@@ -325,7 +325,7 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
|
|
weightedDetails.setGrainType(warehouseInOutInfo1.getType());
|
|
weightedDetails.setGrainType(warehouseInOutInfo1.getType());
|
|
weightedDetails.setInTypeKey(warehouseInOutInfo1.getInOutTypeKey());
|
|
weightedDetails.setInTypeKey(warehouseInOutInfo1.getInOutTypeKey());
|
|
weightedDetails.setInType(warehouseInOutInfo1.getInOutType());
|
|
weightedDetails.setInType(warehouseInOutInfo1.getInOutType());
|
|
- weightedDetails.setNetWeight(warehouseInOutInfo1.getNetWeight());
|
|
|
|
|
|
+ weightedDetails.setNetWeight(warehouseInOutInfo1.getNetWeight()/1000);
|
|
weightedDetails.setPureWeight(warehouseInOutInfo1.getPureWeight());
|
|
weightedDetails.setPureWeight(warehouseInOutInfo1.getPureWeight());
|
|
weightedDetails.setUnitPrice(warehouseInOutInfo1.getCost());
|
|
weightedDetails.setUnitPrice(warehouseInOutInfo1.getCost());
|
|
weightedDetails.setDeductionAmount(warehouseInOutInfo1.getDeductionAmount());
|
|
weightedDetails.setDeductionAmount(warehouseInOutInfo1.getDeductionAmount());
|
|
@@ -340,7 +340,7 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
|
|
weightedDetails.setCostBefore(weightedDetailsList.get(0).getCostBefore());
|
|
weightedDetails.setCostBefore(weightedDetailsList.get(0).getCostBefore());
|
|
}
|
|
}
|
|
// 计算新加权成本
|
|
// 计算新加权成本
|
|
- Float newCost = (paymentManagement.getActualPayment() + original * weightedDetails.getCostBefore()) / (warehouseInOutInfo1.getNetWeight() + original);
|
|
|
|
|
|
+ Float newCost = (paymentManagement.getActualPayment() + original * weightedDetails.getCostBefore()) / (warehouseInOutInfo1.getNetWeight()/1000 + original);
|
|
|
|
|
|
weightedDetails.setCostAfter(newCost);
|
|
weightedDetails.setCostAfter(newCost);
|
|
|
|
|
|
@@ -631,6 +631,33 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
|
|
return "OK";
|
|
return "OK";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public String selectTaskId(PaymentManagement paymentManagement) {
|
|
|
|
+ String taskIdNull="";
|
|
|
|
+ List<PaymentManagement> paymentManagementList=this.selectList(new EntityWrapper<PaymentManagement>()
|
|
|
|
+ .eq("management_type",paymentManagement.getManagementType())
|
|
|
|
+ .eq("comp_id",paymentManagement.getCompId())
|
|
|
|
+ .eq("warehouse_name",paymentManagement.getWarehouseName()));
|
|
|
|
+ if (!CollectionUtils.isEmpty(paymentManagementList)){
|
|
|
|
+ for (PaymentManagement paymentManagement1:paymentManagementList) {
|
|
|
|
+ String taskId = "";
|
|
|
|
+ // 只有待审核状态才有taskId
|
|
|
|
+ if (StringUtils.isNotBlank(paymentManagement1.getWorkflowId())) {
|
|
|
|
+ JSONObject jsonObject = workflowService.getActiveTask(Lists.newArrayList(paymentManagement1.getWorkflowId()), paymentManagement1.getId());
|
|
|
|
+ taskId = jsonObject.getString("taskId");
|
|
|
|
+ paymentManagement1.setTaskId(taskId);
|
|
|
|
+ }
|
|
|
|
+ if (paymentManagement1.getTaskId()!=null){
|
|
|
|
+ taskIdNull="true";
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ taskIdNull="false";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return taskIdNull;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
private List<String> getResourceIdList() {
|
|
private List<String> getResourceIdList() {
|
|
User currentUser = AuthSecurityUtils.getCurrentUserInfo();
|
|
User currentUser = AuthSecurityUtils.getCurrentUserInfo();
|