ccjgmwz 4 vuotta sitten
vanhempi
commit
05d062b576

+ 61 - 37
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/contract/ContractAppServiceImpl.java

@@ -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);
 
 

+ 18 - 7
unimall-app/pageB/contract/look.vue

@@ -2,8 +2,8 @@
 	<view class="container">
 	<view class="container">
 		<view style='background:#fff;' class='flex justify-between padding-xl' @click='unfold1()'>
 		<view style='background:#fff;' class='flex justify-between padding-xl' @click='unfold1()'>
 			<view style='width:80%;margin-top: -4px;' class='flex justify-between'>
 			<view style='width:80%;margin-top: -4px;' class='flex justify-between'>
-				<text>结算总价({{contractInfo.sumTotal}}元)</text>
 				<text>结算吨数({{contractInfo.sumNet}}吨)</text>
 				<text>结算吨数({{contractInfo.sumNet}}吨)</text>
+				<text>结算总价({{contractInfo.sumTotal}}元)</text>
 			</view>
 			</view>
 			<view style='width:80%;margin-top: -4px;' class='flex justify-between'>
 			<view style='width:80%;margin-top: -4px;' class='flex justify-between'>
 				<text>已收({{contractInfo.payMoney}}元)</text>
 				<text>已收({{contractInfo.payMoney}}元)</text>
@@ -14,31 +14,42 @@
 		<view :class="isOpen1 ? 'content-open' : 'content-close'" class='content1'>
 		<view :class="isOpen1 ? 'content-open' : 'content-close'" class='content1'>
 			<view class='flex justify-between padding-xs'>
 			<view class='flex justify-between padding-xs'>
 				<view>车牌号</view>
 				<view>车牌号</view>
-				<view>结算净重(吨)</view>
-				<view>单车结算价(元)</view>
+				<view>净重(吨)</view>
+				<view>应收(元)</view>
+				<view>已收(元)</view>
+				<view>未收(元)</view>
 			</view>
 			</view>
 			<view class='flex justify-between padding-xs' v-for='item in contractInfo.taskDTOList'>
 			<view class='flex justify-between padding-xs' v-for='item in contractInfo.taskDTOList'>
 				<view>{{item.carNo}}</view>
 				<view>{{item.carNo}}</view>
 				<view>{{item.netWeight}}</view>
 				<view>{{item.netWeight}}</view>
 				<view>{{item.sumPrice}}</view>
 				<view>{{item.sumPrice}}</view>
+				<view>{{item.sumPrice - item.notPay}}</view>
+				<view>{{item.notPay}}</view>
 			</view>
 			</view>
 		</view>
 		</view>
 		<view style='background:#fff;' class='flex justify-between padding-xl' @click='unfold2()'>
 		<view style='background:#fff;' class='flex justify-between padding-xl' @click='unfold2()'>
 			<view style='width:80%;margin-top: -4px;' class='flex justify-between'>
 			<view style='width:80%;margin-top: -4px;' class='flex justify-between'>
-				<text>平仓({{contractInfo.payMoneyClose}}吨)</text>
-				<text>结算总价({{contractInfo.sumNetClose}}元)</text>
+				<text>平仓({{contractInfo.sumNetClose}}吨)</text>
+				<text>结算总价({{contractInfo.sumTotalClose}}元)</text>
+			</view>
+			<view style='width:80%;margin-top: -4px;' class='flex justify-between'>
+				<text>已收({{contractInfo.payMoneyClose}}元)</text>
+				<text>未收({{contractInfo.notPayMoneyClose}}元)</text>
 			</view>
 			</view>
-			
 			<view :class="isOpen2 ? 'cuIcon-unfold' : 'cuIcon-right'" ></view>
 			<view :class="isOpen2 ? 'cuIcon-unfold' : 'cuIcon-right'" ></view>
 		</view>
 		</view>
 		<view :class="isOpen2 ? 'content-open' : 'content-close'" class='content2'>
 		<view :class="isOpen2 ? 'content-open' : 'content-close'" class='content2'>
 			<view class='flex justify-between padding-xs'>
 			<view class='flex justify-between padding-xs'>
 				<view>平仓吨数(吨)</view>
 				<view>平仓吨数(吨)</view>
-				<view>结算单价(元)</view>
+				<view>应收(元)</view>
+				<view>已收(元)</view>
+				<view>未收(元)</view>
 			</view>
 			</view>
 			<view class='flex justify-between padding-xs' v-for='item in contractInfo.taskDTOList1'>
 			<view class='flex justify-between padding-xs' v-for='item in contractInfo.taskDTOList1'>
 				<view>{{item.closeTon}}</view>
 				<view>{{item.closeTon}}</view>
 				<view>{{item.sumPriceClose}}</view>
 				<view>{{item.sumPriceClose}}</view>
+				<view>{{item.sumPriceClose - item.notPayClose}}</view>
+				<view>{{item.notPayClose}}</view>
 			</view>
 			</view>
 		</view>
 		</view>
 	</view>
 	</view>

+ 4 - 0
unimall-data/src/main/java/com/iotechn/unimall/data/dto/TaskDTO.java

@@ -109,4 +109,8 @@ public class TaskDTO {
     private Float closeTon;
     private Float closeTon;
     // 平仓结算单价
     // 平仓结算单价
     private Double sumPriceClose;
     private Double sumPriceClose;
+    // 未付款金额
+    private Double notPay;
+    // 平仓未付款金额
+    private Double notPayClose;
 }
 }