18513069273 4 年之前
父节点
当前提交
73d02e5e21

+ 77 - 54
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/contract/ContractAppServiceImpl.java

@@ -107,81 +107,102 @@ public class ContractAppServiceImpl implements ContractAppService {
             List<TaskDTO> taskDTOList = new ArrayList<>();
             List<TaskDTO> taskDTOList1 = new ArrayList<>();
             Double sumTotal = 0.00;
+            Double sumTotalClose = 0.00;
             Float sumNet = 0f;
             Double payMoney = 0.00;
             Float sumNetClose = 0f;
+            Float payNotMoneyClose = 0f;
             Double payMoneyClose = 0.00;
             // 采购交易
             if (tradeDO.getType() == 1) {
 
                 List<BuyReportDO> buyReportDOS = buyReportMapper.selectList(new EntityWrapper<BuyReportDO>().eq("contract_no", contractNo));
                 for(BuyReportDO buyReportDO : buyReportDOS){
-                    if(buyReportDO.getBuy() > 0){
-                        // 查询任务表
-                        List<TaskDO> taskDOList = taskMapper.selectList(new EntityWrapper<TaskDO>().eq("report_id", buyReportDO.getReportId()));
-                        if (CollectionUtils.isNotEmpty(taskDOList)) {
-                            for (TaskDO taskDO : taskDOList) {
-                                TaskDTO taskDTO = new TaskDTO();
-                                // 查询统计表
-                                BuyReportDO buyReportDO = buyReportMapper.selectById(taskDO.getReportId());
-                                if (buyReportDO != null) {
-                                    // 结算单价
-                                    Double sumTotalSingal = Double.valueOf(buyReportDO.getUnitPrice1() - taskDO.getDeduction()) * taskDO.getNetWeight();
-                                    sumTotal = sumTotal + sumTotalSingal;
-                                    taskDTO.setSumPrice(sumTotalSingal);
-                                    payMoney = payMoney + (buyReportDO.getMoney() - buyReportDO.getNotMoney());
-                                    if (buyReportDO.getBuy() != null && buyReportDO.getBuy() != 0) {
-
-                                    }
-                                }
-
-                                taskDTO.setCarNo(taskDO.getCarNo());
-                                taskDTO.setNetWeight(taskDO.getNetWeight());
-                                sumNet = sumNet + taskDO.getNetWeight();
-                                taskDTOList.add(taskDTO);
-                            }
-                        }
+                    if(buyReportDO.getBuy() == 0){
+                        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{
                         // 平仓
                         TaskDTO taskDTO1 = new TaskDTO();
                         taskDTO1.setCloseTon(buyReportDO.getNetWeight());
-                        taskDTO1.setSumPriceClose(Double.valueOf(buyReportDO.getUnitPrice1() + buyReportDO.getBasis()) * buyReportDO.getBuy());
+                        taskDTO1.setSumPriceClose(Double.valueOf(buyReportDO.getMoney()));
                         sumNetClose = sumNetClose + buyReportDO.getNetWeight();
-                        payMoneyClose = payMoneyClose + taskDTO1.getSumPriceClose();
+                        sumTotalClose = sumTotalClose + taskDTO1.getSumPriceClose();
+                        payNotMoneyClose = payNotMoneyClose + (buyReportDO.getMoney() - buyReportDO.getNotMoney());
+                        taskDTO1.setNotPayClose(Double.valueOf(buyReportDO.getNotMoney()));
                         taskDTOList1.add(taskDTO1);
                     }
                 }
 
             } else {
-                // 查询任务表
-                List<TaskDO> taskDOList = taskMapper.selectList(new EntityWrapper<TaskDO>().eq("order_no", tradeDO.getOrderNo()).eq("task_type", "出库任务").eq("task_status", TaskStatusType.STATUS2.getCode()));
-                if (CollectionUtils.isNotEmpty(taskDOList)) {
-                    for (TaskDO taskDO : taskDOList) {
+
+                List<SaleReportDO> saleReportDOS = saleReportMapper.selectList(new EntityWrapper<SaleReportDO>().eq("contract_no", contractNo));
+                for(SaleReportDO saleReportDO:saleReportDOS){
+                    if(saleReportDO.getBuy() == 0){
                         TaskDTO taskDTO = new TaskDTO();
-                        // 查询统计表
-                        SaleReportDO saleReportDO = saleReportMapper.selectById(taskDO.getReportId());
-                        if (saleReportDO != null) {
-                            // 结算单价
-                            Double sumTotalSingal = Double.valueOf(saleReportDO.getUnitPrice1()) * taskDO.getNetWeight();
-                            sumTotal = sumTotal + sumTotalSingal;
-                            taskDTO.setSumPrice(sumTotalSingal);
-                            payMoney = payMoney + (saleReportDO.getMoney());
-                            // 平仓
-                            if (saleReportDO.getBuy() != null && saleReportDO.getBuy() != 0) {
-                                TaskDTO taskDTO1 = new TaskDTO();
-                                taskDTO1.setCloseTon(saleReportDO.getNetWeight());
-                                taskDTO1.setSumPriceClose(Double.valueOf(saleReportDO.getUnitPrice1() + saleReportDO.getBasis()) * saleReportDO.getBuy());
-                                sumNetClose = sumNetClose + saleReportDO.getNetWeight();
-                                payMoneyClose = payMoneyClose + taskDTO1.getSumPriceClose();
-                                taskDTOList1.add(taskDTO1);
-                            }
-                        }
-
-                        taskDTO.setCarNo(taskDO.getCarNo());
-                        taskDTO.setNetWeight(taskDO.getNetWeight());
-                        sumNet = sumNet + taskDO.getNetWeight();
+                        // 结算单价
+                        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{
+                        TaskDTO taskDTO1 = new TaskDTO();
+                        taskDTO1.setCloseTon(saleReportDO.getNetWeight());
+                        taskDTO1.setSumPriceClose(Double.valueOf(saleReportDO.getPayMoney()));
+                        taskDTO1.setNotPayClose(Double.valueOf(saleReportDO.getNotPayMoney()));
+                        sumNetClose = sumNetClose + saleReportDO.getNetWeight();
+                        sumTotalClose = sumTotalClose + taskDTO1.getSumPriceClose();
+                        payNotMoneyClose = payNotMoneyClose + (saleReportDO.getNotPayMoney());
+                        taskDTOList1.add(taskDTO1);
                     }
                 }
             }
@@ -192,8 +213,10 @@ public class ContractAppServiceImpl implements ContractAppService {
             map.put("sumNet", sumNet);
             map.put("taskDTOList", taskDTOList);
 
+            map.put("sumTotalClose", sumTotalClose);
             map.put("sumNetClose", sumNetClose);
-            map.put("payMoneyClose", payMoneyClose);
+            map.put("payMoneyClose", sumTotalClose - payNotMoneyClose);
+            map.put("notPayMoneyClose", payNotMoneyClose);
             map.put("taskDTOList1", taskDTOList1);
 
 

+ 15 - 6
unimall-app/pageB/contract/look.vue

@@ -21,31 +21,40 @@
 		<view :class="isOpen1 ? 'content-open' : 'content-close'" class='content1'>
 			<view class='flex justify-between padding-xs'>
 				<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>{{item.carNo}}</view>
 				<view>{{item.netWeight}}</view>
 				<view>{{item.sumPrice}}</view>
+				<view>{{item.sumPrice - item.notPay}}</view>
+				<view>{{item.notPay}}</view>
 			</view>
 		</view>
 		<view style='background:#fff;' class='flex justify-between padding-xl' @click='unfold2()'>
 			<view style='width:92%;margin-top: -4px;' class='flex justify-between'>
-				<view>平仓({{contractInfo.payMoneyClose}}吨)</view>
-				<view>结算总价({{contractInfo.sumNetClose}}元)</view>
+				<text>平仓({{contractInfo.sumNetClose}}吨)</text>
+				<text>结算总价({{contractInfo.sumTotalClose}}元)</text>
+				<text>已收({{contractInfo.payMoneyClose}}元)</text>
+				<text>未收({{contractInfo.notPayMoneyClose}}元)</text>
 			</view>
-			
 			<view :class="isOpen2 ? 'cuIcon-unfold' : 'cuIcon-right'" ></view>
 		</view>
 		<view :class="isOpen2 ? 'content-open' : 'content-close'" class='content2'>
 			<view class='flex justify-between padding-xs'>
 				<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>{{item.closeTon}}</view>
 				<view>{{item.sumPriceClose}}</view>
+				<view>{{item.sumPriceClose - item.notPayClose}}</view>
+				<view>{{item.notPayClose}}</view>
 			</view>
 		</view>
 	</view>

+ 0 - 3
unimall-data/src/main/java/com/iotechn/unimall/data/domain/BuyReportDO.java

@@ -109,8 +109,5 @@ public class BuyReportDO  extends SuperDO {
     /* 库点 */
     @TableField(exist = false)
     private String store;
-    /* 报表id */
-    @TableField("report_id")
-    private Long reportId;
 
 }

+ 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 Double sumPriceClose;
+    // 未付款金额
+    private Double notPay;
+    // 平仓未付款金额
+    private Double notPayClose;
 }