|
@@ -119,32 +119,44 @@ public class ContractAppServiceImpl implements ContractAppService {
|
|
List<BuyReportDO> buyReportDOS = buyReportMapper.selectList(new EntityWrapper<BuyReportDO>().eq("contract_no", contractNo));
|
|
List<BuyReportDO> buyReportDOS = buyReportMapper.selectList(new EntityWrapper<BuyReportDO>().eq("contract_no", contractNo));
|
|
for(BuyReportDO buyReportDO : buyReportDOS){
|
|
for(BuyReportDO buyReportDO : buyReportDOS){
|
|
if(buyReportDO.getBuy() == 0){
|
|
if(buyReportDO.getBuy() == 0){
|
|
- // 查询任务表
|
|
|
|
- List<TaskDO> taskDOList = taskMapper.selectList(new EntityWrapper<TaskDO>().eq("report_id", buyReportDO.getId()).eq("task_type", "入库任务").eq("task_status",TaskStatusType.STATUS2.getCode()));
|
|
|
|
- if (CollectionUtils.isNotEmpty(taskDOList)) {
|
|
|
|
- for (TaskDO taskDO : taskDOList) {
|
|
|
|
- TaskDTO taskDTO = new TaskDTO();
|
|
|
|
- // 结算单价
|
|
|
|
- Double sumTotalSingal = Double.valueOf(buyReportDO.getUnitPrice1()) * taskDO.getNetWeight();
|
|
|
|
- sumTotal = sumTotal + sumTotalSingal;
|
|
|
|
- taskDTO.setSumPrice(sumTotalSingal);
|
|
|
|
- payMoney = payMoney + (buyReportDO.getMoney() - buyReportDO.getNotMoney());
|
|
|
|
- taskDTO.setCarNo(taskDO.getCarNo());
|
|
|
|
- taskDTO.setNetWeight(taskDO.getNetWeight());
|
|
|
|
- sumNet = sumNet + taskDO.getNetWeight();
|
|
|
|
- taskDTOList.add(taskDTO);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ TaskDTO taskDTO = new TaskDTO();
|
|
|
|
+ // 结算单价
|
|
|
|
+ Double sumTotalSingal = Double.valueOf(buyReportDO.getMoney()) ;
|
|
|
|
+ sumTotal = sumTotal + sumTotalSingal;
|
|
|
|
+ taskDTO.setSumPrice(sumTotalSingal);
|
|
|
|
+ payMoney = payMoney + (buyReportDO.getMoney() - buyReportDO.getNotMoney());
|
|
|
|
+ taskDTO.setCarNo(buyReportDO.getCarNo());
|
|
|
|
+ taskDTO.setNetWeight(buyReportDO.getNetWeight());
|
|
|
|
+ taskDTO.setNotPay(Double.valueOf(buyReportDO.getNotMoney()));
|
|
|
|
+ sumNet = sumNet + buyReportDO.getNetWeight();
|
|
|
|
+ taskDTOList.add(taskDTO);
|
|
|
|
+// // 查询任务表
|
|
|
|
+// List<TaskDO> taskDOList = taskMapper.selectList(new EntityWrapper<TaskDO>().eq("report_id", buyReportDO.getId()).eq("task_type", "入库任务").eq("task_status",TaskStatusType.STATUS2.getCode()));
|
|
|
|
+// if (CollectionUtils.isNotEmpty(taskDOList)) {
|
|
|
|
+// for (TaskDO taskDO : taskDOList) {
|
|
|
|
+// TaskDTO taskDTO = new TaskDTO();
|
|
|
|
+// // 结算单价
|
|
|
|
+// Double sumTotalSingal = Double.valueOf(buyReportDO.getMoney()) ;
|
|
|
|
+// sumTotal = sumTotal + sumTotalSingal;
|
|
|
|
+// taskDTO.setSumPrice(sumTotalSingal);
|
|
|
|
+// payMoney = payMoney + (buyReportDO.getMoney() - buyReportDO.getNotMoney());
|
|
|
|
+// taskDTO.setCarNo(taskDO.getCarNo());
|
|
|
|
+// taskDTO.setNetWeight(taskDO.getNetWeight());
|
|
|
|
+// taskDTO.setNotPay(Double.valueOf(buyReportDO.getNotMoney()));
|
|
|
|
+// sumNet = sumNet + taskDO.getNetWeight();
|
|
|
|
+// taskDTOList.add(taskDTO);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
// 平仓
|
|
// 平仓
|
|
TaskDTO taskDTO1 = new TaskDTO();
|
|
TaskDTO taskDTO1 = new TaskDTO();
|
|
taskDTO1.setCloseTon(buyReportDO.getNetWeight());
|
|
taskDTO1.setCloseTon(buyReportDO.getNetWeight());
|
|
- taskDTO1.setSumPriceClose(Double.valueOf(buyReportDO.getUnitPrice1() + buyReportDO.getBasis()) * buyReportDO.getBuy());
|
|
|
|
|
|
+ taskDTO1.setSumPriceClose(Double.valueOf(buyReportDO.getMoney()));
|
|
sumNetClose = sumNetClose + buyReportDO.getNetWeight();
|
|
sumNetClose = sumNetClose + buyReportDO.getNetWeight();
|
|
sumTotalClose = sumTotalClose + taskDTO1.getSumPriceClose();
|
|
sumTotalClose = sumTotalClose + taskDTO1.getSumPriceClose();
|
|
- payMoneyClose = payMoneyClose + taskDTO1.getSumPriceClose();
|
|
|
|
payNotMoneyClose = payNotMoneyClose + (buyReportDO.getMoney() - buyReportDO.getNotMoney());
|
|
payNotMoneyClose = payNotMoneyClose + (buyReportDO.getMoney() - buyReportDO.getNotMoney());
|
|
|
|
+ taskDTO1.setNotPayClose(Double.valueOf(buyReportDO.getNotMoney()));
|
|
taskDTOList1.add(taskDTO1);
|
|
taskDTOList1.add(taskDTO1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -154,29 +166,41 @@ public class ContractAppServiceImpl implements ContractAppService {
|
|
List<SaleReportDO> saleReportDOS = saleReportMapper.selectList(new EntityWrapper<SaleReportDO>().eq("contract_no", contractNo));
|
|
List<SaleReportDO> saleReportDOS = saleReportMapper.selectList(new EntityWrapper<SaleReportDO>().eq("contract_no", contractNo));
|
|
for(SaleReportDO saleReportDO:saleReportDOS){
|
|
for(SaleReportDO saleReportDO:saleReportDOS){
|
|
if(saleReportDO.getBuy() == 0){
|
|
if(saleReportDO.getBuy() == 0){
|
|
- // 查询任务表
|
|
|
|
- List<TaskDO> taskDOList = taskMapper.selectList(new EntityWrapper<TaskDO>().eq("report_id", saleReportDO.getId()).eq("task_type", "出库任务").eq("task_status",TaskStatusType.STATUS2.getCode()));
|
|
|
|
- if (CollectionUtils.isNotEmpty(taskDOList)) {
|
|
|
|
- for (TaskDO taskDO : taskDOList) {
|
|
|
|
- TaskDTO taskDTO = new TaskDTO();
|
|
|
|
- // 结算单价
|
|
|
|
- Double sumTotalSingal = Double.valueOf(saleReportDO.getUnitPrice1()) * taskDO.getNetWeight();
|
|
|
|
- sumTotal = sumTotal + sumTotalSingal;
|
|
|
|
- taskDTO.setSumPrice(sumTotalSingal);
|
|
|
|
- payMoney = payMoney + (saleReportDO.getMoney());
|
|
|
|
- taskDTO.setCarNo(taskDO.getCarNo());
|
|
|
|
- taskDTO.setNetWeight(taskDO.getNetWeight());
|
|
|
|
- sumNet = sumNet + taskDO.getNetWeight();
|
|
|
|
- taskDTOList.add(taskDTO);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ TaskDTO taskDTO = new TaskDTO();
|
|
|
|
+ // 结算单价
|
|
|
|
+ Double sumTotalSingal = Double.valueOf(saleReportDO.getMoney()) ;
|
|
|
|
+ sumTotal = sumTotal + sumTotalSingal;
|
|
|
|
+ taskDTO.setSumPrice(sumTotalSingal);
|
|
|
|
+ payMoney = payMoney + (saleReportDO.getMoney());
|
|
|
|
+ taskDTO.setCarNo(saleReportDO.getCarNo());
|
|
|
|
+ taskDTO.setNetWeight(saleReportDO.getNetWeight());
|
|
|
|
+ taskDTO.setNotPay(0d);
|
|
|
|
+ sumNet = sumNet + saleReportDO.getNetWeight();
|
|
|
|
+ taskDTOList.add(taskDTO);
|
|
|
|
+// // 查询任务表
|
|
|
|
+// List<TaskDO> taskDOList = taskMapper.selectList(new EntityWrapper<TaskDO>().eq("report_id", saleReportDO.getId()).eq("task_type", "出库任务").eq("task_status",TaskStatusType.STATUS2.getCode()));
|
|
|
|
+// if (CollectionUtils.isNotEmpty(taskDOList)) {
|
|
|
|
+// for (TaskDO taskDO : taskDOList) {
|
|
|
|
+// TaskDTO taskDTO = new TaskDTO();
|
|
|
|
+// // 结算单价
|
|
|
|
+// Double sumTotalSingal = Double.valueOf(saleReportDO.getMoney()) ;
|
|
|
|
+// sumTotal = sumTotal + sumTotalSingal;
|
|
|
|
+// taskDTO.setSumPrice(sumTotalSingal);
|
|
|
|
+// payMoney = payMoney + (saleReportDO.getMoney());
|
|
|
|
+// taskDTO.setCarNo(taskDO.getCarNo());
|
|
|
|
+// taskDTO.setNetWeight(taskDO.getNetWeight());
|
|
|
|
+// sumNet = sumNet + taskDO.getNetWeight();
|
|
|
|
+// taskDTOList.add(taskDTO);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
TaskDTO taskDTO1 = new TaskDTO();
|
|
TaskDTO taskDTO1 = new TaskDTO();
|
|
taskDTO1.setCloseTon(saleReportDO.getNetWeight());
|
|
taskDTO1.setCloseTon(saleReportDO.getNetWeight());
|
|
- taskDTO1.setSumPriceClose(Double.valueOf(saleReportDO.getUnitPrice1() + saleReportDO.getBasis()) * saleReportDO.getBuy());
|
|
|
|
|
|
+ taskDTO1.setSumPriceClose(Double.valueOf(saleReportDO.getPayMoney()));
|
|
|
|
+ taskDTO1.setNotPayClose(Double.valueOf(saleReportDO.getNotPayMoney()));
|
|
sumNetClose = sumNetClose + saleReportDO.getNetWeight();
|
|
sumNetClose = sumNetClose + saleReportDO.getNetWeight();
|
|
- payMoneyClose = payMoneyClose + taskDTO1.getSumPriceClose();
|
|
|
|
|
|
+ sumTotalClose = sumTotalClose + taskDTO1.getSumPriceClose();
|
|
payNotMoneyClose = payNotMoneyClose + (saleReportDO.getNotPayMoney());
|
|
payNotMoneyClose = payNotMoneyClose + (saleReportDO.getNotPayMoney());
|
|
taskDTOList1.add(taskDTO1);
|
|
taskDTOList1.add(taskDTO1);
|
|
}
|
|
}
|
|
@@ -191,7 +215,7 @@ public class ContractAppServiceImpl implements ContractAppService {
|
|
|
|
|
|
map.put("sumTotalClose", sumTotalClose);
|
|
map.put("sumTotalClose", sumTotalClose);
|
|
map.put("sumNetClose", sumNetClose);
|
|
map.put("sumNetClose", sumNetClose);
|
|
- map.put("payMoneyClose", payMoneyClose);
|
|
|
|
|
|
+ map.put("payMoneyClose", sumTotalClose - payNotMoneyClose);
|
|
map.put("notPayMoneyClose", payNotMoneyClose);
|
|
map.put("notPayMoneyClose", payNotMoneyClose);
|
|
map.put("taskDTOList1", taskDTOList1);
|
|
map.put("taskDTOList1", taskDTOList1);
|
|
|
|
|