浏览代码

Merge branch 'master' of http://47.100.3.209:3000/gdc/yiliangyiyun

ccj 2 年之前
父节点
当前提交
93d638036c

+ 8 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/TranSettlementReportServiceImpl.java

@@ -9,6 +9,7 @@ import com.winsea.svc.base.base.entity.CommonRoleResource;
 import com.winsea.svc.base.base.entity.CommonStaff;
 import com.winsea.svc.base.base.service.ICommonRoleResourceService;
 import com.winsea.svc.base.base.service.ICommonStaffService;
+import com.winsea.svc.base.base.util.DateUtils;
 import com.winsea.svc.base.security.entity.User;
 import com.winsea.svc.base.security.util.AuthSecurityUtils;
 import com.winsea.svc.base.workflow.entity.Workflow;
@@ -21,6 +22,7 @@ import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
 import com.yh.saas.plugin.yiliangyiyun.mapper.TranSettlementReportMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.*;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import org.apache.commons.httpclient.util.DateUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -286,11 +288,15 @@ public class TranSettlementReportServiceImpl extends ServiceImpl<TranSettlementR
     @Override
     public List<ContractManagementInfo> selectContractNoList(String compId) {
         List<ContractManagementInfo> temp = new ArrayList();
-        //查我方承运的合同
+        Calendar calendar = Calendar.getInstance();
+        calendar.add(Calendar.MONTH, -3);
+        //查不包含采购的我方承运的合同
         List<ContractManagementInfo> contractManagementInfoList = contractManagementInfoService.selectList(new EntityWrapper<ContractManagementInfo>()
                 .eq("comp_id", compId)
                 .eq("deliver_type", "1")
                 .eq("delete_flag", "0")
+                .ne("contract_type","2")
+                .ge("update_date", DateUtil.formatDate(calendar.getTime(), DateUtils.DATE_FMT_YYYY_MM_DD))
                 .orderBy("update_date", false));
         if (!CollectionUtils.isEmpty(contractManagementInfoList)){
             temp.addAll(contractManagementInfoList);
@@ -300,6 +306,7 @@ public class TranSettlementReportServiceImpl extends ServiceImpl<TranSettlementR
                 .eq("delete_flag", "0")
                 .eq("task_type_key", "3")
                 .eq("in_out_flag", "1")
+                .ge("update_date", DateUtil.formatDate(calendar.getTime(), DateUtils.DATE_FMT_YYYY_MM_DD))
                 .orderBy("update_date", false));
         for (InOutWarehouseTask inOutWarehouseTask : inOutWarehouseTaskList) {
             ContractManagementInfo contractManagementInfo = new ContractManagementInfo();

+ 64 - 88
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseInOutInfoServiceImpl.java

@@ -2133,62 +2133,38 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                             warehouseInOutInfo.setTranCarNo(tranCarNo);
                             warehouseInOutInfoService.updateById(warehouseInOutInfo);
                             tranCarInfoService.insert(tranCarInfo);
-                            //生成汽运报表
-                            TranSettlementReport tranSettlementReport = new TranSettlementReport();
-                            tranSettlementReport.setCompId(warehouseBaseInfo.getCompId());
-                            tranSettlementReport.setCarId(warehouseInOutInfo.getCarId());
-                            tranSettlementReport.setId(IdGenerator.generateUUID());
-                            if ("汽运".equals(warehouseInOutInfo.getOutType())) {
-                                tranSettlementReport.setTranType("汽运");
-                                tranSettlementReport.setTranTypeKey("1");
-                            } else if ("火运".equals(warehouseInOutInfo.getOutType())) {
-                                tranSettlementReport.setTranType("火运");
-                                tranSettlementReport.setTranTypeKey("2");
-                            } else {
-                                tranSettlementReport.setTranType("船运");
-                                tranSettlementReport.setTranTypeKey("3");
-                            }
-                            tranSettlementReport.setContractNo(warehouseInOutInfo.getContractNo());
-                            tranSettlementReport.setCarNo(warehouseInOutInfo.getCarNo());
-                            tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
-                            //运输单价不为空
-                            if (warehouseInOutInfo.getFreight()!=null){
-                                //应付
-                                tranSettlementReport.setAmountIngPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
-                                //未付
-                                tranSettlementReport.setAmountNotPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
-                                tranSettlementReport.setTransportPrice(Float.valueOf(warehouseInOutInfo.getFreight()));
-                            }
-                            tranSettlementReport.setLoadingImg(warehouseInOutInfo.getAddressUrl());
-                            tranSettlementReport.setLoadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
-                            tranSettlementReport.setStatusFlag(StatusEnum.PENDING_PAY.getFlag());
-                            tranSettlementReport.setStatus(StatusEnum.PENDING_PAY.getName());
-                            tranSettlementReportService.insert(tranSettlementReport);
-//                            boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(tranSettlementReport.getWorkflowId());
-//                            // 不是退回的单子
-//                            if (isStartWorkflow) {
-//                                Workflow workflow = workflowService
-//                                        .findLatestWorkflowByBusinessCodeByApp(tranSettlementReport.getCompId(), "TRANSPORTATION-SETTLEMENT-REPORT");
-//                                // 没配置审核流程,直接结束并处理信息
-//                                if (workflow == null) {
-//                                    throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
-//                                }
-//                                // 开启审核流
-//                                else {
-//
-//                                    // 设置状态 已提交审核
-//                                    tranSettlementReport.setWorkflowId(workflow.getId());
-//                                    tranSettlementReportService.updateById(tranSettlementReport);
-//                                    workflowService.startInstance(workflow.getId(), tranSettlementReport.getId());
-//                                }
-//                            }
-//                            // 退回的单子 再启用
-//                            else {
-//
-//                                tranSettlementReportService.updateById(tranSettlementReport);
-//                                workflowService.activateInstance(tranSettlementReport.getWorkflowId(), tranSettlementReport.getId());
-//                            }
                         }
+                        //生成汽运报表
+                        TranSettlementReport tranSettlementReport = new TranSettlementReport();
+                        tranSettlementReport.setCompId(warehouseBaseInfo.getCompId());
+                        tranSettlementReport.setCarId(warehouseInOutInfo.getCarId());
+                        tranSettlementReport.setId(IdGenerator.generateUUID());
+                        if ("汽运".equals(warehouseInOutInfo.getOutType())) {
+                            tranSettlementReport.setTranType("汽运");
+                            tranSettlementReport.setTranTypeKey("1");
+                        } else if ("火运".equals(warehouseInOutInfo.getOutType())) {
+                            tranSettlementReport.setTranType("火运");
+                            tranSettlementReport.setTranTypeKey("2");
+                        } else {
+                            tranSettlementReport.setTranType("船运");
+                            tranSettlementReport.setTranTypeKey("3");
+                        }
+                        tranSettlementReport.setContractNo(warehouseInOutInfo.getContractNo());
+                        tranSettlementReport.setCarNo(warehouseInOutInfo.getCarNo());
+                        tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
+                        //运输单价不为空
+                        if (warehouseInOutInfo.getFreight()!=null){
+                            //应付
+                            tranSettlementReport.setAmountIngPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
+                            //未付
+                            tranSettlementReport.setAmountNotPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
+                            tranSettlementReport.setTransportPrice(Float.valueOf(warehouseInOutInfo.getFreight()));
+                        }
+                        tranSettlementReport.setLoadingImg(warehouseInOutInfo.getAddressUrl());
+                        tranSettlementReport.setLoadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
+                        tranSettlementReport.setStatusFlag(StatusEnum.PENDING_PAY.getFlag());
+                        tranSettlementReport.setStatus(StatusEnum.PENDING_PAY.getName());
+                        tranSettlementReportService.insert(tranSettlementReport);
                     }
                     if (warehouseBaseInfo != null) {
                         //出库时打入成本
@@ -4328,38 +4304,39 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                 warehouseInOutInfo.setTranCarNo(tranCarNo);
                                 warehouseInOutInfoService.updateById(warehouseInOutInfo);
                                 tranCarInfoService.insert(tranCarInfo);
-                                //生成汽运报表
-                                TranSettlementReport tranSettlementReport = new TranSettlementReport();
-                                tranSettlementReport.setCompId(warehouseBaseInfo.getCompId());
-                                tranSettlementReport.setCarId(warehouseInOutInfo.getCarId());
-                                tranSettlementReport.setId(IdGenerator.generateUUID());
-                                if ("汽运".equals(warehouseInOutInfo.getOutType())) {
-                                    tranSettlementReport.setTranType("汽运");
-                                    tranSettlementReport.setTranTypeKey("1");
-                                } else if ("火运".equals(warehouseInOutInfo.getOutType())) {
-                                    tranSettlementReport.setTranType("火运");
-                                    tranSettlementReport.setTranTypeKey("2");
-                                } else {
-                                    tranSettlementReport.setTranType("船运");
-                                    tranSettlementReport.setTranTypeKey("3");
-                                }
-                                tranSettlementReport.setContractNo(warehouseInOutInfo.getContractNo());
-                                tranSettlementReport.setCarNo(warehouseInOutInfo.getCarNo());
-                                tranSettlementReport.setStartAddress(warehouseInOutInfo.getWarehouseName());
-                                tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
-                                //运输单价不为空
-                                if (warehouseInOutInfo.getFreight()!=null){
-                                    //应付
-                                    tranSettlementReport.setAmountIngPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
-                                    //未付
-                                    tranSettlementReport.setAmountNotPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
-                                    tranSettlementReport.setTransportPrice(Float.valueOf(warehouseInOutInfo.getFreight()));
-                                }
-                                tranSettlementReport.setLoadingImg(warehouseInOutInfo.getAddressUrl());
-                                tranSettlementReport.setLoadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
-                                tranSettlementReport.setStatusFlag(StatusEnum.PENDING_PAY.getFlag());
-                                tranSettlementReport.setStatus(StatusEnum.PENDING_PAY.getName());
-                                tranSettlementReportService.insert(tranSettlementReport);
+                            }
+                            //生成汽运报表
+                            TranSettlementReport tranSettlementReport = new TranSettlementReport();
+                            tranSettlementReport.setCompId(warehouseBaseInfo.getCompId());
+                            tranSettlementReport.setCarId(warehouseInOutInfo.getCarId());
+                            tranSettlementReport.setId(IdGenerator.generateUUID());
+                            if ("汽运".equals(warehouseInOutInfo.getOutType())) {
+                                tranSettlementReport.setTranType("汽运");
+                                tranSettlementReport.setTranTypeKey("1");
+                            } else if ("火运".equals(warehouseInOutInfo.getOutType())) {
+                                tranSettlementReport.setTranType("火运");
+                                tranSettlementReport.setTranTypeKey("2");
+                            } else {
+                                tranSettlementReport.setTranType("船运");
+                                tranSettlementReport.setTranTypeKey("3");
+                            }
+                            tranSettlementReport.setContractNo(warehouseInOutInfo.getContractNo());
+                            tranSettlementReport.setCarNo(warehouseInOutInfo.getCarNo());
+                            tranSettlementReport.setStartAddress(warehouseInOutInfo.getWarehouseName());
+                            tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
+                            //运输单价不为空
+                            if (warehouseInOutInfo.getFreight()!=null){
+                                //应付
+                                tranSettlementReport.setAmountIngPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
+                                //未付
+                                tranSettlementReport.setAmountNotPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
+                                tranSettlementReport.setTransportPrice(Float.valueOf(warehouseInOutInfo.getFreight()));
+                            }
+                            tranSettlementReport.setLoadingImg(warehouseInOutInfo.getAddressUrl());
+                            tranSettlementReport.setLoadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
+                            tranSettlementReport.setStatusFlag(StatusEnum.PENDING_PAY.getFlag());
+                            tranSettlementReport.setStatus(StatusEnum.PENDING_PAY.getName());
+                            tranSettlementReportService.insert(tranSettlementReport);
 //                                boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(tranSettlementReport.getWorkflowId());
 //                                // 不是退回的单子
 //                                if (isStartWorkflow) {
@@ -4384,7 +4361,6 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
 //                                    tranSettlementReportService.updateById(tranSettlementReport);
 //                                    workflowService.activateInstance(tranSettlementReport.getWorkflowId(), tranSettlementReport.getId());
 //                                }
-                            }
                         }
                     }
                     if (warehouseInOutInfo.getWeighingManagement() != null) {

+ 2 - 4
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/TranSettlementReportMapper.xml

@@ -14,8 +14,7 @@
                 AND status='待请款'  and approve_status is not null
             </if>
             <if test="searchType == 2">
-                AND status='待请款'  and( approve_status= ''
-                or approve_status is null)
+                AND amount_ing_payable-amount_ed_payable>0
             </if>
             <if test="searchType == 3">
                 AND amount_ing_payable-amount_ed_payable=0
@@ -105,8 +104,7 @@
                 AND status='待请款'  and approve_status is not null
             </if>
             <if test="searchType == 2">
-                AND status='待请款'  and( approve_status= ''
-                or approve_status is null)
+                AND amount_ing_payable-amount_ed_payable>0
             </if>
             <if test="searchType == 3">
                 AND amount_ing_payable-amount_ed_payable=0