Browse Source

1.修改账务管理-对账开票-导出-离港时间问题
2.金港 手机APP 审核增加客户基础资料附件显示接口修改
3.金港 增加放货申请接口
2022年7月18日18点29分

纪新园 3 years ago
parent
commit
1330859d2d

+ 13 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/approvalFlow/AuditPathsController.java

@@ -17,6 +17,7 @@ import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.utils.spring.SpringUtils;
 import com.ruoyi.common.utils.spring.SpringUtils;
 import com.ruoyi.framework.web.service.TokenService;
 import com.ruoyi.framework.web.service.TokenService;
+import com.ruoyi.warehouseBusiness.domain.dto.TWarehouseBillsR;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
@@ -229,4 +230,16 @@ public class AuditPathsController extends BaseController {
         return getDataTable(list);
         return getDataTable(list);
     }
     }
 
 
+    /**
+     * 放货申请
+     *
+     * @param
+     * @return
+     */
+    @GetMapping(value = "/releaseGoodsApply")
+    public AjaxResult releaseGoodsApply(@RequestParam("fId") Long fId) {
+        TWarehouseBillsR result = auditPathsService.generatePDF(fId);
+        return AjaxResult.success(result);
+    }
+
 }
 }

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/warehouseBusiness/TWarehouseGoodsTransferController.java

@@ -48,7 +48,7 @@ public class TWarehouseGoodsTransferController extends BaseController {
         tWarehouseBills.setfBilltype("HQZY");
         tWarehouseBills.setfBilltype("HQZY");
         // 获取登录用户数据
         // 获取登录用户数据
         LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
         LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
-        List<Map<String, Object>> list = itWarehouseBillsService.selectWarehouseBusinessListAddUser(tWarehouseBills,loginUser);
+        List<Map<String, Object>> list = itWarehouseBillsService.selectWarehouseBusinessListAddUser(tWarehouseBills, loginUser);
         return getDataTable(list);
         return getDataTable(list);
     }
     }
 
 
@@ -284,5 +284,5 @@ public class TWarehouseGoodsTransferController extends BaseController {
     public AjaxResult appQueryInit(@RequestParam("id") Long id) {
     public AjaxResult appQueryInit(@RequestParam("id") Long id) {
         return itWarehouseBillsService.appQueryInit(id, WarehouseTypeEnum.HQZY.getType());
         return itWarehouseBillsService.appQueryInit(id, WarehouseTypeEnum.HQZY.getType());
     }
     }
-
 }
 }
+

+ 7 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/approvalFlow/service/IAuditPathsService.java

@@ -7,6 +7,7 @@ import com.ruoyi.approvalFlow.domain.dto.AppAuditItemDTO;
 import com.ruoyi.approvalFlow.domain.vo.AppAuditItemVO;
 import com.ruoyi.approvalFlow.domain.vo.AppAuditItemVO;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.warehouseBusiness.domain.dto.TWarehouseBillsR;
 
 
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
@@ -122,4 +123,10 @@ public interface IAuditPathsService {
      */
      */
     List<AppAuditItemVO> selectOrderAuditItems(AppAuditItemDTO auditItems);
     List<AppAuditItemVO> selectOrderAuditItems(AppAuditItemDTO auditItems);
 
 
+    /**
+     * 放货申请
+     * @param fId  仓库主表id
+     * @return  结果
+     */
+    TWarehouseBillsR generatePDF(Long fId);
 }
 }

+ 127 - 39
ruoyi-warehouse/src/main/java/com/ruoyi/approvalFlow/service/impl/AuditPathsServiceImpl.java

@@ -10,11 +10,12 @@ import com.ruoyi.approvalFlow.domain.vo.AppAuditItemVO;
 import com.ruoyi.approvalFlow.mapper.*;
 import com.ruoyi.approvalFlow.mapper.*;
 import com.ruoyi.approvalFlow.service.IAuditPathsService;
 import com.ruoyi.approvalFlow.service.IAuditPathsService;
 import com.ruoyi.basicData.domain.TFees;
 import com.ruoyi.basicData.domain.TFees;
+import com.ruoyi.basicData.mapper.TCorpsMapper;
 import com.ruoyi.basicData.mapper.TFeesMapper;
 import com.ruoyi.basicData.mapper.TFeesMapper;
+import com.ruoyi.basicData.mapper.TWarehouseMapper;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.exception.WarehouseException;
 import com.ruoyi.common.exception.WarehouseException;
-import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.DictUtils;
 import com.ruoyi.common.utils.DictUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.finance.domain.TFee;
 import com.ruoyi.finance.domain.TFee;
@@ -23,26 +24,21 @@ import com.ruoyi.finance.service.impl.TFeeServiceImpl;
 import com.ruoyi.reportManagement.domain.TWhgenleg;
 import com.ruoyi.reportManagement.domain.TWhgenleg;
 import com.ruoyi.reportManagement.mapper.TWhgenlegMapper;
 import com.ruoyi.reportManagement.mapper.TWhgenlegMapper;
 import com.ruoyi.warehouseBusiness.component.CalculationWarehouseService;
 import com.ruoyi.warehouseBusiness.component.CalculationWarehouseService;
-import com.ruoyi.warehouseBusiness.domain.TWarehouseAgreement;
-import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
-import com.ruoyi.warehouseBusiness.domain.TWarehousebillsfees;
-import com.ruoyi.warehouseBusiness.domain.TWarehousebillsitems;
+import com.ruoyi.warehouseBusiness.domain.*;
+import com.ruoyi.warehouseBusiness.domain.dto.TWarehouseBillsR;
 import com.ruoyi.warehouseBusiness.domain.enums.WarehouseActIdEnum;
 import com.ruoyi.warehouseBusiness.domain.enums.WarehouseActIdEnum;
 import com.ruoyi.warehouseBusiness.domain.enums.WarehouseTypeEnum;
 import com.ruoyi.warehouseBusiness.domain.enums.WarehouseTypeEnum;
-import com.ruoyi.warehouseBusiness.mapper.TWarehouseAgreementMapper;
-import com.ruoyi.warehouseBusiness.mapper.TWarehouseBillsMapper;
-import com.ruoyi.warehouseBusiness.mapper.TWarehousebillsfeesMapper;
-import com.ruoyi.warehouseBusiness.mapper.TWarehousebillsitemsMapper;
+import com.ruoyi.warehouseBusiness.mapper.*;
 import com.ruoyi.warehouseBusiness.service.impl.TWarehouseAgreementServiceImpl;
 import com.ruoyi.warehouseBusiness.service.impl.TWarehouseAgreementServiceImpl;
 import com.ruoyi.warehouseBusiness.service.impl.TWarehouseBillsServiceImpl;
 import com.ruoyi.warehouseBusiness.service.impl.TWarehouseBillsServiceImpl;
 import com.ruoyi.warehouseBusiness.service.impl.TWarehousebillsModifyServiceImpl;
 import com.ruoyi.warehouseBusiness.service.impl.TWarehousebillsModifyServiceImpl;
-import com.sun.scenario.effect.impl.sw.java.JSWEffectPeer;
 import org.apache.commons.compress.utils.Lists;
 import org.apache.commons.compress.utils.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 
 
+import java.math.BigDecimal;
 import java.util.*;
 import java.util.*;
 
 
 import static java.util.stream.Collectors.toList;
 import static java.util.stream.Collectors.toList;
@@ -109,6 +105,12 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
 
 
     @Autowired
     @Autowired
     private CalculationWarehouseService calculationWarehouseService;
     private CalculationWarehouseService calculationWarehouseService;
+    @Autowired
+    private TWarehouseMapper tWarehouseMapper;
+    @Autowired
+    private TCorpsMapper tCorpsMapper;
+    @Autowired
+    private TEnclosureMapper tEnclosureMapper;
 
 
     /**
     /**
      * 查询审批流配置主
      * 查询审批流配置主
@@ -287,17 +289,17 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
      */
      */
     @Override
     @Override
     public List<Map<String, Object>> selectAllAuditItems(AuditItems auditItems) {
     public List<Map<String, Object>> selectAllAuditItems(AuditItems auditItems) {
-        List<Map<String,Object>> list = auditItemsMapper.selectAuditItems(auditItems);
-        for (Map<String,Object> map : list) {
+        List<Map<String, Object>> list = auditItemsMapper.selectAuditItems(auditItems);
+        for (Map<String, Object> map : list) {
             // 根据审批明细详情主表 id 获取审批明细从表数据
             // 根据审批明细详情主表 id 获取审批明细从表数据
-            List<Map<String,Object>> auditItemsDoList = auditItemsDoMapper.selectByFPid(Long.valueOf(map.get("id").toString()));
+            List<Map<String, Object>> auditItemsDoList = auditItemsDoMapper.selectByFPid(Long.valueOf(map.get("id").toString()));
             StringBuilder stringBuilder = new StringBuilder();
             StringBuilder stringBuilder = new StringBuilder();
-            for (Map<String,Object> auditItemsDo : auditItemsDoList) {
+            for (Map<String, Object> auditItemsDo : auditItemsDoList) {
                 if (StringUtils.isNotNull(auditItemsDo)) { // 有数据
                 if (StringUtils.isNotNull(auditItemsDo)) { // 有数据
                     stringBuilder.append(auditItemsDo.get("fBsno")).append(",");
                     stringBuilder.append(auditItemsDo.get("fBsno")).append(",");
                 }
                 }
             }
             }
-            map.put("fBsno",StringUtils.removeTheLastComma(stringBuilder));
+            map.put("fBsno", StringUtils.removeTheLastComma(stringBuilder));
         }
         }
         return list;
         return list;
     }
     }
@@ -376,7 +378,7 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
                         } else {
                         } else {
                             tWarehouseBillsMapper.warehouseFollowUpdate(auditItems.getBillId(), fettle, at.getAuditItem());
                             tWarehouseBillsMapper.warehouseFollowUpdate(auditItems.getBillId(), fettle, at.getAuditItem());
                         }
                         }
-                        getfBillStatus(auditItems,at,fettle);
+                        getfBillStatus(auditItems, at, fettle);
                         if (Objects.equals(fettle, 6L)) {
                         if (Objects.equals(fettle, 6L)) {
                             if (Objects.equals(auditItems.getActId(), 120L)) {
                             if (Objects.equals(auditItems.getActId(), 120L)) {
                                 List<TWarehousebillsfees> feesList = tWarehousebillsfeesMapper.selectWarehousebillsfeesByPId(auditItems.getBillId());
                                 List<TWarehousebillsfees> feesList = tWarehousebillsfeesMapper.selectWarehousebillsfeesByPId(auditItems.getBillId());
@@ -670,7 +672,7 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
                         tWarehouseBills.setfId(auditItems.getBillId());
                         tWarehouseBills.setfId(auditItems.getBillId());
                         tWarehouseBills.setfBillstatus(fettle);
                         tWarehouseBills.setfBillstatus(fettle);
                         tWarehouseBillsMapper.updateKaHeOrder(tWarehouseBills);
                         tWarehouseBillsMapper.updateKaHeOrder(tWarehouseBills);
-                        getfBillStatus(auditItems,at,fettle);
+                        getfBillStatus(auditItems, at, fettle);
                     } else if (Objects.equals(auditItems.getActId(), WarehouseActIdEnum.FEE_CHANGES.getActId().longValue())) {
                     } else if (Objects.equals(auditItems.getActId(), WarehouseActIdEnum.FEE_CHANGES.getActId().longValue())) {
                         // 费用变更审核通过处理
                         // 费用变更审核通过处理
                         if ("T".equals(at.getIffinalItem())) {
                         if ("T".equals(at.getIffinalItem())) {
@@ -708,10 +710,11 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
 
 
     /**
     /**
      * 获取费用明细数据,并保持费用明细请核状态不改动
      * 获取费用明细数据,并保持费用明细请核状态不改动
+     *
      * @param auditItems 审批流
      * @param auditItems 审批流
-     * @param at 审批流
+     * @param at         审批流
      */
      */
-    public void getfBillStatus(AuditItems auditItems,AuditItems at,Long fettle) {
+    public void getfBillStatus(AuditItems auditItems, AuditItems at, Long fettle) {
         List<TWarehousebillsfees> tWarehousebillsfees = tWarehousebillsfeesMapper.selectWarehousebillsfeesByPId(auditItems.getBillId());
         List<TWarehousebillsfees> tWarehousebillsfees = tWarehousebillsfeesMapper.selectWarehousebillsfeesByPId(auditItems.getBillId());
         for (TWarehousebillsfees result : tWarehousebillsfees) {
         for (TWarehousebillsfees result : tWarehousebillsfees) {
             if (result.getfBillstatus() != 6L) { // 判断状态
             if (result.getfBillstatus() != 6L) { // 判断状态
@@ -748,7 +751,7 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
             } else {
             } else {
                 tWarehouseBillsMapper.warehouseApprovalUpdate(auditItems, fettle);
                 tWarehouseBillsMapper.warehouseApprovalUpdate(auditItems, fettle);
             }
             }
-            getfBillStatus(auditItems,auditItems,null);
+            getfBillStatus(auditItems, auditItems, null);
             if (Objects.equals(auditItems.getActId(), 150L)) {
             if (Objects.equals(auditItems.getActId(), 150L)) {
                 List<TWarehousebillsfees> feesList = tWarehousebillsfeesMapper.selectWarehousebillsfeesByPId(auditItems.getBillId());
                 List<TWarehousebillsfees> feesList = tWarehousebillsfeesMapper.selectWarehousebillsfeesByPId(auditItems.getBillId());
                 for (TWarehousebillsfees wareItem : feesList) {
                 for (TWarehousebillsfees wareItem : feesList) {
@@ -791,7 +794,7 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
                 return ajaxResult;
                 return ajaxResult;
             }
             }
             // 更新费用明细
             // 更新费用明细
-            AjaxResult result = tFeeServiceImpl.updateDSFMoney(auditItems.getBillId(),fBillType);
+            AjaxResult result = tFeeServiceImpl.updateDSFMoney(auditItems.getBillId(), fBillType);
             String message = result.get("code").toString();
             String message = result.get("code").toString();
             if ("500".equals(message)) {
             if ("500".equals(message)) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -825,14 +828,14 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
         } else if (auditItems.getActId() >= 430 && auditItems.getActId() <= 450) {
         } else if (auditItems.getActId() >= 430 && auditItems.getActId() <= 450) {
             fettle = 3L;
             fettle = 3L;
             String fBillType = null;
             String fBillType = null;
-            if (auditItems.getActId() == 450 || auditItems.getActId() == 440){
+            if (auditItems.getActId() == 450 || auditItems.getActId() == 440) {
                 fBillType = "DCRevoke";
                 fBillType = "DCRevoke";
-            }else if (auditItems.getActId() == 430){
+            } else if (auditItems.getActId() == 430) {
                 fBillType = "KHDZRevoke";
                 fBillType = "KHDZRevoke";
             }
             }
             // 查询财务状态
             // 查询财务状态
             TFee tFee = tFeeMapper.selectTFeeById(auditItems.getBillId());
             TFee tFee = tFeeMapper.selectTFeeById(auditItems.getBillId());
-            if (!"4".equals(tFee.getfBillstatus())  && !"5".equals(tFee.getfBillstatus())) {
+            if (!"4".equals(tFee.getfBillstatus()) && !"5".equals(tFee.getfBillstatus())) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return AjaxResult.error("审批驳回失败: 数据已操作");
                 return AjaxResult.error("审批驳回失败: 数据已操作");
             }
             }
@@ -844,7 +847,7 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
                 return ajaxResult;
                 return ajaxResult;
             }
             }
             // 更新费用明细
             // 更新费用明细
-            AjaxResult result = tFeeServiceImpl.updateMoney(auditItems.getBillId(),fBillType);
+            AjaxResult result = tFeeServiceImpl.updateMoney(auditItems.getBillId(), fBillType);
             String message = result.get("code").toString();
             String message = result.get("code").toString();
             if ("500".equals(message)) {
             if ("500".equals(message)) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -934,7 +937,7 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
             tWarehouseBills.setfId(auditItems.getBillId());
             tWarehouseBills.setfId(auditItems.getBillId());
             tWarehouseBills.setfBillstatus(fettle);
             tWarehouseBills.setfBillstatus(fettle);
             tWarehouseBillsMapper.updateKaHeOrder(tWarehouseBills);
             tWarehouseBillsMapper.updateKaHeOrder(tWarehouseBills);
-            getfBillStatus(auditItems,auditItems,null);
+            getfBillStatus(auditItems, auditItems, null);
         } else if (Objects.equals(auditItems.getActId(), WarehouseActIdEnum.FEE_CHANGES.getActId().longValue())) {
         } else if (Objects.equals(auditItems.getActId(), WarehouseActIdEnum.FEE_CHANGES.getActId().longValue())) {
             warehousebillsModifyService.additionalFeeInformation(auditItems.getBillId(), WarehouseTypeEnum.DISMISS);
             warehousebillsModifyService.additionalFeeInformation(auditItems.getBillId(), WarehouseTypeEnum.DISMISS);
         }
         }
@@ -1020,9 +1023,9 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
                 }
                 }
             }
             }
             tWarehouseBillsMapper.warehouseApprovalUpdate(auditItems, fettle);
             tWarehouseBillsMapper.warehouseApprovalUpdate(auditItems, fettle);
-            getfBillStatus(auditItems,auditItems,null);
+            getfBillStatus(auditItems, auditItems, null);
             // 撤销审批时删除审批流任务明细从表对应数据
             // 撤销审批时删除审批流任务明细从表对应数据
-            AuditItemsAbout.revokeDeleteAID(auditItems.getActId(),auditItems.getBillId());
+            AuditItemsAbout.revokeDeleteAID(auditItems.getActId(), auditItems.getBillId());
         } else if (auditItems.getActId() >= 210 && auditItems.getActId() <= 230) {
         } else if (auditItems.getActId() >= 210 && auditItems.getActId() <= 230) {
             fettle = 2L;
             fettle = 2L;
             String fBillType = null;
             String fBillType = null;
@@ -1045,14 +1048,14 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
                 return AjaxResult.error("审批撤销失败: 更新审批状态失败");
                 return AjaxResult.error("审批撤销失败: 更新审批状态失败");
             }
             }
             // 更新费用明细
             // 更新费用明细
-            AjaxResult result = tFeeServiceImpl.updateDSFMoney(auditItems.getBillId(),fBillType);
+            AjaxResult result = tFeeServiceImpl.updateDSFMoney(auditItems.getBillId(), fBillType);
             String message = result.get("code").toString();
             String message = result.get("code").toString();
             if ("500".equals(message)) {
             if ("500".equals(message)) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return result;
                 return result;
             }
             }
             // 撤销审批时删除审批流任务明细从表对应数据
             // 撤销审批时删除审批流任务明细从表对应数据
-            AuditItemsAbout.revokeDeleteAID(auditItems.getActId(),auditItems.getBillId());
+            AuditItemsAbout.revokeDeleteAID(auditItems.getActId(), auditItems.getBillId());
         } else if (auditItems.getActId() >= 310 && auditItems.getActId() <= 320) {
         } else if (auditItems.getActId() >= 310 && auditItems.getActId() <= 320) {
             fettle = 2L;
             fettle = 2L;
             // 查询协议状态
             // 查询协议状态
@@ -1070,7 +1073,7 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
             }
             }
             if (auditItems.getActId() == 310) { // 如果是仓储费审批流
             if (auditItems.getActId() == 310) { // 如果是仓储费审批流
                 // 删去审批流业务编号
                 // 删去审批流业务编号
-                AuditItemsAbout.revokeDeleteAID(auditItems.getActId(),auditItems.getBillId());
+                AuditItemsAbout.revokeDeleteAID(auditItems.getActId(), auditItems.getBillId());
             }
             }
         } else if (auditItems.getActId() == 410) {
         } else if (auditItems.getActId() == 410) {
             fettle = 2L;
             fettle = 2L;
@@ -1101,9 +1104,9 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
         } else if (auditItems.getActId() >= 430 && auditItems.getActId() <= 450) {
         } else if (auditItems.getActId() >= 430 && auditItems.getActId() <= 450) {
             fettle = 2L;
             fettle = 2L;
             String fBillType = null;
             String fBillType = null;
-            if (auditItems.getActId() == 450 || auditItems.getActId() == 440){
+            if (auditItems.getActId() == 450 || auditItems.getActId() == 440) {
                 fBillType = "DCRevoke";
                 fBillType = "DCRevoke";
-            }else if (auditItems.getActId() == 430){
+            } else if (auditItems.getActId() == 430) {
                 fBillType = "KHDZRevoke";
                 fBillType = "KHDZRevoke";
             }
             }
             // 查询财务状态
             // 查询财务状态
@@ -1120,7 +1123,7 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
                 return AjaxResult.error("审批撤销失败: 更新审批状态失败");
                 return AjaxResult.error("审批撤销失败: 更新审批状态失败");
             }
             }
             // 更新费用明细
             // 更新费用明细
-            AjaxResult result = tFeeServiceImpl.updateMoney(auditItems.getBillId(),fBillType);
+            AjaxResult result = tFeeServiceImpl.updateMoney(auditItems.getBillId(), fBillType);
             String message = result.get("code").toString();
             String message = result.get("code").toString();
             if ("500".equals(message)) {
             if ("500".equals(message)) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -1175,7 +1178,7 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return AjaxResult.error("审核失败,更新费用状态失败");
                 return AjaxResult.error("审核失败,更新费用状态失败");
             }
             }
-            AuditItemsAbout.revokeDeleteAID(auditItems.getActId(),auditItems.getBillId());
+            AuditItemsAbout.revokeDeleteAID(auditItems.getActId(), auditItems.getBillId());
         } else if (auditItems.getActId() == 180) { // 出库明细撤销
         } else if (auditItems.getActId() == 180) { // 出库明细撤销
             //入库明细审核
             //入库明细审核
             fettle = 2L;
             fettle = 2L;
@@ -1186,14 +1189,14 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
             tWarehouseBills.setfItemstatus(fettle);
             tWarehouseBills.setfItemstatus(fettle);
             i = tWarehouseBillsMapper.updateTWarehousebills(tWarehouseBills);
             i = tWarehouseBillsMapper.updateTWarehousebills(tWarehouseBills);
             int size = tWarehousebillsitemsMapper.selectWarehouseItemsByfPid(auditItems.getBillId()).size();
             int size = tWarehousebillsitemsMapper.selectWarehouseItemsByfPid(auditItems.getBillId()).size();
-            if (size!=0) {
+            if (size != 0) {
                 i = tWarehousebillsitemsMapper.warehouseItemfItemstatus(auditItems.getBillId(), fettle);
                 i = tWarehousebillsitemsMapper.warehouseItemfItemstatus(auditItems.getBillId(), fettle);
             }
             }
             if (i <= 0) {
             if (i <= 0) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return AjaxResult.error("审核失败,更新费用状态失败");
                 return AjaxResult.error("审核失败,更新费用状态失败");
             }
             }
-            AuditItemsAbout.revokeDeleteAID(auditItems.getActId(),auditItems.getBillId());
+            AuditItemsAbout.revokeDeleteAID(auditItems.getActId(), auditItems.getBillId());
         } else if (auditItems.getActId() == 471) {
         } else if (auditItems.getActId() == 471) {
             fettle = 2L;
             fettle = 2L;
             // 变更凯和申请修改订单状态
             // 变更凯和申请修改订单状态
@@ -1231,9 +1234,9 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
             tWarehouseBills.setfId(auditItems.getBillId());
             tWarehouseBills.setfId(auditItems.getBillId());
             tWarehouseBills.setfBillstatus(fettle);
             tWarehouseBills.setfBillstatus(fettle);
             tWarehouseBillsMapper.updateKaHeOrder(tWarehouseBills);
             tWarehouseBillsMapper.updateKaHeOrder(tWarehouseBills);
-            getfBillStatus(auditItems,auditItems,null);
+            getfBillStatus(auditItems, auditItems, null);
             // 撤销审批时删除审批流任务明细从表对应数据
             // 撤销审批时删除审批流任务明细从表对应数据
-            AuditItemsAbout.revokeDeleteAID(auditItems.getActId(),auditItems.getBillId());
+            AuditItemsAbout.revokeDeleteAID(auditItems.getActId(), auditItems.getBillId());
         } else if (Objects.equals(auditItems.getActId(), WarehouseActIdEnum.FEE_CHANGES.getActId().longValue())) {
         } else if (Objects.equals(auditItems.getActId(), WarehouseActIdEnum.FEE_CHANGES.getActId().longValue())) {
             warehousebillsModifyService.withdrawalApprovalById(auditItems.getBillId());
             warehousebillsModifyService.withdrawalApprovalById(auditItems.getBillId());
         }
         }
@@ -1293,4 +1296,89 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
         return appAuditItemVOList;
         return appAuditItemVOList;
     }
     }
 
 
+
+    /**
+     * 放货申请
+     *
+     * @param fId 仓库主表id
+     * @return 结果
+     */
+    @Override
+    public TWarehouseBillsR generatePDF(Long fId) {
+
+        // 查询仓库主表数据
+        TWarehouseBills tWarehousebills = tWarehouseBillsMapper.selectTWarehousebillsById(fId);
+
+        TWarehouseBillsR tWarehouseBillsR = new TWarehouseBillsR();
+        tWarehouseBillsR.setfBillno(tWarehousebills.getfBillno());
+        tWarehouseBillsR.setfMblno(tWarehousebills.getfMblno());
+        tWarehouseBillsR.setfCustomno(tWarehousebills.getfCustomno());
+        tWarehouseBillsR.setfWarehouseName(tWarehouseMapper.selectTWarehouseById(tWarehousebills.getfWarehouseid()) == null ? "无" : tWarehouseMapper.selectTWarehouseById(tWarehousebills.getfWarehouseid()).getfName());
+        tWarehouseBillsR.setfBsdate(tWarehousebills.getfBsdate());
+        tWarehouseBillsR.setCreateTime(tWarehousebills.getCreateTime());
+        tWarehouseBillsR.setfCorpName(tCorpsMapper.selectTCorpsById(tWarehousebills.getfCorpid()) == null ? "" : tCorpsMapper.selectTCorpsById(tWarehousebills.getfCorpid()).getfName());
+
+        // 查询仓库明细从表数据
+        TWarehousebillsitems tWarehousebillsitems = new TWarehousebillsitems();
+        tWarehousebillsitems.setfPid(fId);
+        List<Map<String, Object>> mapList = tWarehousebillsitemsMapper.selectGoodsTransferitemsList(tWarehousebillsitems);
+
+        //总件数
+        Long fQty = 0l;
+
+        //总毛重
+        BigDecimal fGrossweight = new BigDecimal(0);
+
+        //总净重
+        BigDecimal fNetweight = new BigDecimal(0);
+
+        //客户出库集合
+        List<Map<String, Object>> customerList = new ArrayList<>();
+        //客户结余集合
+        List<Map<String, Object>> balanceList = new ArrayList<>();
+
+        for (Map<String, Object> map : mapList) {
+            //计算出库总件数
+            fQty = (long) map.get("fPlanqty") + fQty;
+            //计算出库总毛重
+            fGrossweight = fGrossweight.add((BigDecimal) map.get("fPlangrossweight"));
+            //计算出库总净重
+            fNetweight = fNetweight.add((BigDecimal) map.get("fPlannetweight"));
+
+            //出库数据
+            Map<String, Object> customer = new HashMap<>();
+            customer.put("fGoodsids", map.get("fGoodsids"));
+            customer.put("fBoxno", map.get("fBoxno"));
+            customer.put("fPlanqty", map.get("fPlanqty"));
+            customer.put("fPlangrossweight", map.get("fPlangrossweight"));
+            customer.put("fPlannetweight", map.get("fPlannetweight"));
+            customerList.add(customer);
+            //结余数据
+            Map<String, Object> balance = new HashMap<>();
+            balance.put("fGoodsids", map.get("fGoodsids"));
+            balance.put("fQty", map.get("fQty"));
+            balance.put("fGrossweight", map.get("fGrossweight"));
+            balance.put("fNetweight", map.get("fNetweight"));
+            balanceList.add(balance);
+
+        }
+
+        tWarehouseBillsR.setfQty(fQty);
+        tWarehouseBillsR.setfGrossweight(fGrossweight);
+        tWarehouseBillsR.setfNetweight(fNetweight);
+
+        // 查询订单附件
+        List<TEnclosure> tEnclosureList = tEnclosureMapper.selectTEnclosureByPId(tWarehousebills.getfId());
+        if (CollectionUtils.isNotEmpty(tEnclosureList)) {
+            tWarehouseBillsR.setEnclosureList(tEnclosureList);
+        }
+        //查询客户资料附件
+        List<TEnclosure> customerInformationList = tEnclosureMapper.selectTEnclosureByPId(tWarehousebills.getfCorpid());
+        if (CollectionUtils.isNotEmpty(customerInformationList)) {
+            tWarehouseBillsR.setCustomerInformationList(customerInformationList);
+        }
+
+        return tWarehouseBillsR;
+    }
+
 }
 }

+ 46 - 39
ruoyi-warehouse/src/main/java/com/ruoyi/finance/service/impl/TFeeServiceImpl.java

@@ -4,8 +4,6 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.ruoyi.approvalFlow.domain.AuditItems;
 import com.ruoyi.approvalFlow.domain.AuditItems;
-import com.ruoyi.approvalFlow.mapper.AuditItemsDoMapper;
-import com.ruoyi.approvalFlow.mapper.AuditItemsMapper;
 import com.ruoyi.approvalFlow.service.impl.AuditItemsAbout;
 import com.ruoyi.approvalFlow.service.impl.AuditItemsAbout;
 import com.ruoyi.approvalFlow.service.impl.AuditItemsServiceImpl;
 import com.ruoyi.approvalFlow.service.impl.AuditItemsServiceImpl;
 import com.ruoyi.basicData.domain.TCorps;
 import com.ruoyi.basicData.domain.TCorps;
@@ -240,9 +238,9 @@ public class TFeeServiceImpl implements ITFeeService {
                 map1.put("fFeeunitid", sysDictDataList.get(0).getDictLabel());
                 map1.put("fFeeunitid", sysDictDataList.get(0).getDictLabel());
                 map1.put("fQty", tWarehousebillsfees.getfQty());
                 map1.put("fQty", tWarehousebillsfees.getfQty());
                 map1.put("fUnitprice", tWarehousebillsfees.getfUnitprice());
                 map1.put("fUnitprice", tWarehousebillsfees.getfUnitprice());
-                map1.put("fBillno",fees.getfSrcBillno());// 业务编号(单据编号)
-                map1.put("invoiceNo",fees.getfInvoiceNo());// 发票号
-                map1.put("fTaxrate",tWarehousebillsfees.getfTaxrateStr());// 税率--传递字符串数据
+                map1.put("fBillno", fees.getfSrcBillno());// 业务编号(单据编号)
+                map1.put("invoiceNo", fees.getfInvoiceNo());// 发票号
+                map1.put("fTaxrate", tWarehousebillsfees.getfTaxrateStr());// 税率--传递字符串数据
                 if (StringUtils.isNotEmpty(tWarehousebillsfees.getfBilltype()) && tWarehousebillsfees.getfBilltype().equals("KHDD")) {
                 if (StringUtils.isNotEmpty(tWarehousebillsfees.getfBilltype()) && tWarehousebillsfees.getfBilltype().equals("KHDD")) {
                     map1.put("fBusinessType", "船运订单");
                     map1.put("fBusinessType", "船运订单");
                 } else if (CollectionUtils.isNotEmpty(sysDictDataListIn)) {
                 } else if (CollectionUtils.isNotEmpty(sysDictDataListIn)) {
@@ -326,17 +324,17 @@ public class TFeeServiceImpl implements ITFeeService {
 
 
     @Override
     @Override
     public List<Map<String, Object>> selectTFeeList1(TFee tFee) {
     public List<Map<String, Object>> selectTFeeList1(TFee tFee) {
-        List<Map<String,Object>> list = tFeeMapper.selectTFeeList1(tFee);
-        for (Map<String,Object> map : list) {
+        List<Map<String, Object>> list = tFeeMapper.selectTFeeList1(tFee);
+        for (Map<String, Object> map : list) {
             List<TFeeDo> tfd = tFeeDoMapper.selectTFeeDoByfPid(Long.valueOf(map.get("fId").toString()));
             List<TFeeDo> tfd = tFeeDoMapper.selectTFeeDoByfPid(Long.valueOf(map.get("fId").toString()));
-            if (tfd.size()!=0) {
+            if (tfd.size() != 0) {
                 StringBuilder stringBuilder = new StringBuilder();
                 StringBuilder stringBuilder = new StringBuilder();
                 for (TFeeDo tFeeDo : tfd) {
                 for (TFeeDo tFeeDo : tfd) {
                     if (StringUtils.isNotNull(tFeeDo.getfSrcBillno())) {
                     if (StringUtils.isNotNull(tFeeDo.getfSrcBillno())) {
                         stringBuilder.append(tFeeDo.getfSrcBillno()).append(",");
                         stringBuilder.append(tFeeDo.getfSrcBillno()).append(",");
                     }
                     }
                 }
                 }
-                map.put("fSrcBillno",StringUtils.removeTheLastComma(stringBuilder));
+                map.put("fSrcBillno", StringUtils.removeTheLastComma(stringBuilder));
             }
             }
         }
         }
         return list;
         return list;
@@ -846,16 +844,16 @@ public class TFeeServiceImpl implements ITFeeService {
             }
             }
         }
         }
         //凯和收费提交审核时去掉钱
         //凯和收费提交审核时去掉钱
-        if (actId >= 430 && actId <= 450){
+        if (actId >= 430 && actId <= 450) {
             //判断明细客户是否为同一个
             //判断明细客户是否为同一个
             List<TFeeDo> list = tFeeDoMapper.selectTFeeDoByfPid(tFee.getfId());
             List<TFeeDo> list = tFeeDoMapper.selectTFeeDoByfPid(tFee.getfId());
-            if (CollectionUtils.isNotEmpty(list)){
+            if (CollectionUtils.isNotEmpty(list)) {
                 List<Long> collect = list.stream().filter(e -> e.getfSrcid() != null).map(TFeeDo::getfSrcid).collect(toList());
                 List<Long> collect = list.stream().filter(e -> e.getfSrcid() != null).map(TFeeDo::getfSrcid).collect(toList());
-                if (CollectionUtils.isNotEmpty(collect)){
+                if (CollectionUtils.isNotEmpty(collect)) {
                     List<Long> corpid = tWarehousebillsfeesMapper.getCorpid(collect);
                     List<Long> corpid = tWarehousebillsfeesMapper.getCorpid(collect);
-                    if (CollectionUtils.isNotEmpty(corpid)){
+                    if (CollectionUtils.isNotEmpty(corpid)) {
                         List<Long> longs = corpid.stream().distinct().collect(toList());
                         List<Long> longs = corpid.stream().distinct().collect(toList());
-                        if (CollectionUtils.isNotEmpty(longs) && longs.size() >1){
+                        if (CollectionUtils.isNotEmpty(longs) && longs.size() > 1) {
                             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                             return AjaxResult.error("费用明细的客户非同一个客户");
                             return AjaxResult.error("费用明细的客户非同一个客户");
                         }
                         }
@@ -873,7 +871,7 @@ public class TFeeServiceImpl implements ITFeeService {
         BigDecimal amount = BigDecimal.ZERO;//财务对账金额
         BigDecimal amount = BigDecimal.ZERO;//财务对账金额
         //获取账单明细
         //获取账单明细
         List<TFeeDo> list = tFeeDoMapper.selectTFeeDoByfPid(tFee.getfId());
         List<TFeeDo> list = tFeeDoMapper.selectTFeeDoByfPid(tFee.getfId());
-        if (CollectionUtils.isNotEmpty(list)){
+        if (CollectionUtils.isNotEmpty(list)) {
             amount = list.stream().filter(e -> e.getfAmt() != null).map(TFeeDo::getfAmt).reduce(BigDecimal.ZERO, BigDecimal::add);
             amount = list.stream().filter(e -> e.getfAmt() != null).map(TFeeDo::getfAmt).reduce(BigDecimal.ZERO, BigDecimal::add);
         }
         }
         if (isApprove) {
         if (isApprove) {
@@ -924,7 +922,7 @@ public class TFeeServiceImpl implements ITFeeService {
                 return AjaxResult.error("发票申请提交审核失败,请找管理员");
                 return AjaxResult.error("发票申请提交审核失败,请找管理员");
             }
             }
             //凯和系统 修改订单的实收实付费用
             //凯和系统 修改订单的实收实付费用
-            if ("KHSF".equals(fBilltype) || "KHFF".equals(fBilltype)){
+            if ("KHSF".equals(fBilltype) || "KHFF".equals(fBilltype)) {
                 this.updateMessage(tFee.getfId());
                 this.updateMessage(tFee.getfId());
             }
             }
         }
         }
@@ -1252,12 +1250,13 @@ public class TFeeServiceImpl implements ITFeeService {
 
 
     /**
     /**
      * 账单管理撤销对账、收费、付费
      * 账单管理撤销对账、收费、付费
+     *
      * @param fPid
      * @param fPid
      * @param fBillType
      * @param fBillType
      * @return
      * @return
      */
      */
     @Transactional
     @Transactional
-    public AjaxResult updateDSFMoney(Long fPid,String fBillType){
+    public AjaxResult updateDSFMoney(Long fPid, String fBillType) {
         if (StringUtils.isNull(fPid)) {
         if (StringUtils.isNull(fPid)) {
             return AjaxResult.error("费用明细更新状态未找到主表信息,请与管理员联系");
             return AjaxResult.error("费用明细更新状态未找到主表信息,请与管理员联系");
         }
         }
@@ -1277,12 +1276,13 @@ public class TFeeServiceImpl implements ITFeeService {
 
 
     /**
     /**
      * 凯和撤销收费 付费 对账
      * 凯和撤销收费 付费 对账
+     *
      * @param fPid
      * @param fPid
      * @param fBillType
      * @param fBillType
      * @return
      * @return
      */
      */
     @Transactional
     @Transactional
-    public  AjaxResult updateMoney(Long fPid,String fBillType) {
+    public AjaxResult updateMoney(Long fPid, String fBillType) {
         if (StringUtils.isNull(fPid)) {
         if (StringUtils.isNull(fPid)) {
             return AjaxResult.error("费用明细更新状态未找到主表信息,请与管理员联系");
             return AjaxResult.error("费用明细更新状态未找到主表信息,请与管理员联系");
         }
         }
@@ -1359,11 +1359,12 @@ public class TFeeServiceImpl implements ITFeeService {
         AuditItemsAbout.deleteAuditItemsData(tFee.getfId());
         AuditItemsAbout.deleteAuditItemsData(tFee.getfId());
         return AjaxResult.success();
         return AjaxResult.success();
     }
     }
+
     public void updateMessage(Long fid) {
     public void updateMessage(Long fid) {
         List<TFeeDo> list = tFeeDoMapper.selectTFeeDoByfPid(fid);
         List<TFeeDo> list = tFeeDoMapper.selectTFeeDoByfPid(fid);
-        if (CollectionUtils.isNotEmpty(list)){
+        if (CollectionUtils.isNotEmpty(list)) {
             List<Long> collect = list.stream().map(TFeeDo::getfSrcpid).collect(toList());
             List<Long> collect = list.stream().map(TFeeDo::getfSrcpid).collect(toList());
-            collect.stream().forEach(item ->{
+            collect.stream().forEach(item -> {
                 TWarehouseBills warehouseBills = tWarehouseBillsMapper.selectTWarehousebillsById(item);
                 TWarehouseBills warehouseBills = tWarehouseBillsMapper.selectTWarehousebillsById(item);
                 //获取订舱单位
                 //获取订舱单位
                 TCorps tCorps = tCorpsMapper.selectTCorpsById(warehouseBills.getfCorpid());
                 TCorps tCorps = tCorpsMapper.selectTCorpsById(warehouseBills.getfCorpid());
@@ -1373,22 +1374,23 @@ public class TFeeServiceImpl implements ITFeeService {
                 List<TWarehousebillsfees> tWarehousebillsfees = tWarehousebillsfeesMapper.selectFeesByPId(item, "C");
                 List<TWarehousebillsfees> tWarehousebillsfees = tWarehousebillsfeesMapper.selectFeesByPId(item, "C");
                 TWarehouseBills tWarehouseBills = new TWarehouseBills();
                 TWarehouseBills tWarehouseBills = new TWarehouseBills();
                 tWarehouseBills.setfId(item);
                 tWarehouseBills.setfId(item);
-                tWarehouseBills.setfRecycle(warehousebillsfees.stream().filter(ei->ei.getfStlamount()!=null && ei.getfBillstatus().longValue() == 6L).map(TWarehousebillsfees::getfStlamount).reduce(BigDecimal.ZERO,BigDecimal::add));
-                tWarehouseBills.setfPay(tWarehousebillsfees.stream().filter(ei->ei.getfStlamount()!=null && ei.getfBillstatus().longValue() == 6L).map(TWarehousebillsfees::getfStlamount).reduce(BigDecimal.ZERO,BigDecimal::add));
+                tWarehouseBills.setfRecycle(warehousebillsfees.stream().filter(ei -> ei.getfStlamount() != null && ei.getfBillstatus().longValue() == 6L).map(TWarehousebillsfees::getfStlamount).reduce(BigDecimal.ZERO, BigDecimal::add));
+                tWarehouseBills.setfPay(tWarehousebillsfees.stream().filter(ei -> ei.getfStlamount() != null && ei.getfBillstatus().longValue() == 6L).map(TWarehousebillsfees::getfStlamount).reduce(BigDecimal.ZERO, BigDecimal::add));
                 //如果订舱单位是凯和 应收尾0 也是放货状态
                 //如果订舱单位是凯和 应收尾0 也是放货状态
                 //1:  未放货   应收>0  应收>实收
                 //1:  未放货   应收>0  应收>实收
                 //2:放货      应收>0  应收=实收
                 //2:放货      应收>0  应收=实收
-                if ((tCorps == null || tCorps.getfCname().equals("青岛凯和志诚物流有限公司")) && !warehouseBills.getfCaregoStatus().equals("3") ){
+                if ((tCorps == null || tCorps.getfCname().equals("青岛凯和志诚物流有限公司")) && !warehouseBills.getfCaregoStatus().equals("3")) {
                     tWarehouseBills.setfCaregoStatus("2");
                     tWarehouseBills.setfCaregoStatus("2");
-                }else if (warehouseBills.getfReceivable().compareTo(BigDecimal.ZERO) > 0 && warehouseBills.getfReceivable().compareTo(tWarehouseBills.getfRecycle()) > 0){
+                } else if (warehouseBills.getfReceivable().compareTo(BigDecimal.ZERO) > 0 && warehouseBills.getfReceivable().compareTo(tWarehouseBills.getfRecycle()) > 0) {
                     tWarehouseBills.setfCaregoStatus("1");
                     tWarehouseBills.setfCaregoStatus("1");
-                }else if (warehouseBills.getfReceivable().compareTo(BigDecimal.ZERO) > 0 && warehouseBills.getfReceivable().compareTo(tWarehouseBills.getfRecycle()) <= 0){
+                } else if (warehouseBills.getfReceivable().compareTo(BigDecimal.ZERO) > 0 && warehouseBills.getfReceivable().compareTo(tWarehouseBills.getfRecycle()) <= 0) {
                     tWarehouseBills.setfCaregoStatus("2");
                     tWarehouseBills.setfCaregoStatus("2");
                 }
                 }
                 tWarehouseBillsMapper.updateTWarehousebills(tWarehouseBills);
                 tWarehouseBillsMapper.updateTWarehousebills(tWarehouseBills);
             });
             });
         }
         }
     }
     }
+
     @Override
     @Override
     public AjaxResult queryRemove(Long fId) {
     public AjaxResult queryRemove(Long fId) {
         TFee tFee = tFeeMapper.selectTFeeById(fId);
         TFee tFee = tFeeMapper.selectTFeeById(fId);
@@ -1508,16 +1510,16 @@ public class TFeeServiceImpl implements ITFeeService {
     @Override
     @Override
     public List<Contrast> contrastExport(TFee tFee) throws Exception {
     public List<Contrast> contrastExport(TFee tFee) throws Exception {
         List<Map<String, Object>> list = tFeeMapper.selectTFeeList1(tFee);
         List<Map<String, Object>> list = tFeeMapper.selectTFeeList1(tFee);
-        for (Map<String,Object> map : list) {
+        for (Map<String, Object> map : list) {
             List<TFeeDo> tfd = tFeeDoMapper.selectTFeeDoByfPid(Long.valueOf(map.get("fId").toString()));
             List<TFeeDo> tfd = tFeeDoMapper.selectTFeeDoByfPid(Long.valueOf(map.get("fId").toString()));
-            if (tfd.size()!=0) {
+            if (tfd.size() != 0) {
                 StringBuilder stringBuilder = new StringBuilder();
                 StringBuilder stringBuilder = new StringBuilder();
                 for (TFeeDo tFeeDo : tfd) {
                 for (TFeeDo tFeeDo : tfd) {
                     if (StringUtils.isNotNull(tFeeDo.getfSrcBillno())) {
                     if (StringUtils.isNotNull(tFeeDo.getfSrcBillno())) {
                         stringBuilder.append(tFeeDo.getfSrcBillno()).append(",");
                         stringBuilder.append(tFeeDo.getfSrcBillno()).append(",");
                     }
                     }
                 }
                 }
-                map.put("fSrcBillno",StringUtils.removeTheLastComma(stringBuilder));
+                map.put("fSrcBillno", StringUtils.removeTheLastComma(stringBuilder));
             }
             }
         }
         }
         return ListMapToBeanUtils.castMapToBean(list, Contrast.class);
         return ListMapToBeanUtils.castMapToBean(list, Contrast.class);
@@ -1862,41 +1864,41 @@ public class TFeeServiceImpl implements ITFeeService {
         BigDecimal stlamount = warehousebillsfees.getfStlamount();//结算金额
         BigDecimal stlamount = warehousebillsfees.getfStlamount();//结算金额
         BigDecimal invamount = warehousebillsfees.getfInvamount();//开票金额a
         BigDecimal invamount = warehousebillsfees.getfInvamount();//开票金额a
         BigDecimal askamount = warehousebillsfees.getfAskamount();//申请金额
         BigDecimal askamount = warehousebillsfees.getfAskamount();//申请金额
-        if (bills == null){
+        if (bills == null) {
             flag = false;
             flag = false;
             map.put("message", "费用明细数据有误,请找管理员");
             map.put("message", "费用明细数据有误,请找管理员");
-        }else if (warehousebillsfees == null) {
+        } else if (warehousebillsfees == null) {
             flag = false;
             flag = false;
             map.put("message", "费用明细数据有误,请找管理员");
             map.put("message", "费用明细数据有误,请找管理员");
         } else if ("DZ".equals(type) || "KHDZ".equals(type)) {
         } else if ("DZ".equals(type) || "KHDZ".equals(type)) {
             BigDecimal subtract = amount.subtract(accamount);
             BigDecimal subtract = amount.subtract(accamount);
             if (subtract.compareTo(money) < 0) {
             if (subtract.compareTo(money) < 0) {
                 flag = false;
                 flag = false;
-                map.put("message", "提单号"+bills.getfMblno()+"的"+tFees.getfName() + "对账金额超过可对账金额,当前可对账金额为" + subtract + "元");
+                map.put("message", "提单号" + bills.getfMblno() + "的" + tFees.getfName() + "对账金额超过可对账金额,当前可对账金额为" + subtract + "元");
             }
             }
         } else if ("SF".equals(type) || "KHSF".equals(type)) {
         } else if ("SF".equals(type) || "KHSF".equals(type)) {
             BigDecimal subtract = amount.subtract(stlamount);
             BigDecimal subtract = amount.subtract(stlamount);
             if (subtract.compareTo(money) < 0) {
             if (subtract.compareTo(money) < 0) {
                 flag = false;
                 flag = false;
-                map.put("message", "提单号"+bills.getfMblno()+"的"+tFees.getfName() + "收费金额超过可收费金额,当前可对账金额为" + subtract + "元");
+                map.put("message", "提单号" + bills.getfMblno() + "的" + tFees.getfName() + "收费金额超过可收费金额,当前可对账金额为" + subtract + "元");
             }
             }
         } else if ("FF".equals(type) || "KHFF".equals(type)) {
         } else if ("FF".equals(type) || "KHFF".equals(type)) {
             BigDecimal subtract = amount.subtract(stlamount);
             BigDecimal subtract = amount.subtract(stlamount);
             if (subtract.compareTo(money) < 0) {
             if (subtract.compareTo(money) < 0) {
                 flag = false;
                 flag = false;
-                map.put("message", "提单号"+bills.getfMblno()+"的"+tFees.getfName() + "付费金额超过可付费金额,当前可对账金额为" + subtract + "元");
+                map.put("message", "提单号" + bills.getfMblno() + "的" + tFees.getfName() + "付费金额超过可付费金额,当前可对账金额为" + subtract + "元");
             }
             }
         } else if ("ApplyFP".equals(type)) {
         } else if ("ApplyFP".equals(type)) {
             BigDecimal subtract = amount.subtract(askamount);
             BigDecimal subtract = amount.subtract(askamount);
             if (subtract.compareTo(money) < 0) {
             if (subtract.compareTo(money) < 0) {
                 flag = false;
                 flag = false;
-                map.put("message", "提单号"+bills.getfMblno()+"的"+tFees.getfName() + "开票金额超过可开票金额,当前可对账金额为" + subtract + "元");
+                map.put("message", "提单号" + bills.getfMblno() + "的" + tFees.getfName() + "开票金额超过可开票金额,当前可对账金额为" + subtract + "元");
             }
             }
         } else if ("invoiceFP".equals(type)) {
         } else if ("invoiceFP".equals(type)) {
             BigDecimal subtract = amount.subtract(invamount);
             BigDecimal subtract = amount.subtract(invamount);
             if (subtract.compareTo(money) < 0) {
             if (subtract.compareTo(money) < 0) {
                 flag = false;
                 flag = false;
-                map.put("message", "提单号"+bills.getfMblno()+"的"+tFees.getfName() + "开票金额超过可开票金额,当前可对账金额为" + subtract + "元");
+                map.put("message", "提单号" + bills.getfMblno() + "的" + tFees.getfName() + "开票金额超过可开票金额,当前可对账金额为" + subtract + "元");
             }
             }
         }
         }
         map.put("flag", flag);
         map.put("flag", flag);
@@ -1977,9 +1979,9 @@ public class TFeeServiceImpl implements ITFeeService {
         TFee fee = tFeeMapper.selectTFeeById(fId);
         TFee fee = tFeeMapper.selectTFeeById(fId);
         if (fee != null) {
         if (fee != null) {
             corpName = fee.getfCtrlcorpid();
             corpName = fee.getfCtrlcorpid();
-            if (fee.getfFromDate() != null) {
+           /* if (fee.getfFromDate() != null) {
                 fFromDate = simpleDateFormat.format(fee.getfFromDate());
                 fFromDate = simpleDateFormat.format(fee.getfFromDate());
-            }
+            }*/
             if (fee.getfToDate() != null) {
             if (fee.getfToDate() != null) {
                 fToDate = simpleDateFormat.format(fee.getfToDate());
                 fToDate = simpleDateFormat.format(fee.getfToDate());
             }
             }
@@ -2096,7 +2098,7 @@ public class TFeeServiceImpl implements ITFeeService {
         c052.setCellStyle(contentStyle);
         c052.setCellStyle(contentStyle);
         String message = "";
         String message = "";
         HSSFCell c053 = row3.createCell(5);
         HSSFCell c053 = row3.createCell(5);
-        if (StringUtils.isNotEmpty(fFromDate)) {
+       /* if (StringUtils.isNotEmpty(fFromDate)) {
             if (StringUtils.isNotEmpty(fFromDate)) {
             if (StringUtils.isNotEmpty(fFromDate)) {
                 message = fFromDate + "-" + fToDate;
                 message = fFromDate + "-" + fToDate;
             } else {
             } else {
@@ -2104,6 +2106,11 @@ public class TFeeServiceImpl implements ITFeeService {
             }
             }
         } else if (StringUtils.isNotEmpty(fToDate)) {
         } else if (StringUtils.isNotEmpty(fToDate)) {
             message = fToDate;
             message = fToDate;
+        }*/
+        if (StringUtils.isNotEmpty(fToDate)) {
+            message = fToDate;
+        } else {
+            message = "无";
         }
         }
         c053.setCellValue(message);
         c053.setCellValue(message);
         c053.setCellStyle(contentStyle);
         c053.setCellStyle(contentStyle);
@@ -2153,7 +2160,7 @@ public class TFeeServiceImpl implements ITFeeService {
                         cellValue = list.get(i).getDestinationPort();
                         cellValue = list.get(i).getDestinationPort();
                     } else if (j == 4) {
                     } else if (j == 4) {
                         //运输条款
                         //运输条款
-                        cellValue = list.get(i).getfServiceitems()+"-"+list.get(i).getfServiceitemsNew();
+                        cellValue = list.get(i).getfServiceitems() + "-" + list.get(i).getfServiceitemsNew();
                     } else if (j == 5) {
                     } else if (j == 5) {
                         //货名
                         //货名
                         cellValue = list.get(i).getGoodName();
                         cellValue = list.get(i).getGoodName();

+ 231 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/dto/TWarehouseBillsR.java

@@ -0,0 +1,231 @@
+package com.ruoyi.warehouseBusiness.domain.dto;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+import com.ruoyi.shipping.domain.TVoyage;
+import com.ruoyi.shipping.domain.TWarehousebillsCntr;
+import com.ruoyi.shipping.domain.TWarehousebillsCntritems;
+import com.ruoyi.warehouseBusiness.domain.TEnclosure;
+import com.ruoyi.warehouseBusiness.domain.TWarehousebillsfees;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 详情主表对象 t_warehouse_details
+ *
+ * @author ruoyi
+ * @date 2020-12-11
+ */
+public class TWarehouseBillsR extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * $column.columnComment
+     */
+    private Long fId;
+
+    /**
+     * 业务编号,格式RK+YYYY+YY+NNN,编号不能断号,要连续、如果删除该编号,下次新建单据,优先使用删除单据号,每月从001开始。
+     * RK CK DB HZ
+     */
+    @Excel(name = "业务编号")
+    private String fBillno;
+
+    /**
+     * 客户名称,t_corps 中的no或 name,模糊查找选择后,存储id,显示name
+     */
+    @Excel(name = "客户名称,t_corps 中的no或 name,模糊查找选择后,存储id,显示name")
+    private String fCorpName;
+
+    /**
+     * 货转客户名称,t_corps 中的no或 name,模糊查找选择后,存储id,显示name,自有在货权转移是该字段有效
+     */
+    @Excel(name = "货转客户名称,t_corps 中的no或 name,模糊查找选择后,存储id,显示name,自有在货权转移是该字段有效")
+    private Long fTocorpid;
+
+    /**
+     * 仓库
+     */
+    @Excel(name = "存放仓库")
+    private String fWarehouseName;
+
+    /**
+     * 入(出)库日期
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "入", readConverterExp = "出=")
+    private Date fBsdate;
+
+    /**
+     * 件数,由明细表自动合计生成
+     */
+    @Excel(name = "件数,由明细表自动合计生成")
+    private Long fQty;
+
+    /**
+     * 毛重,由明细表自动合计生成
+     */
+    @Excel(name = "毛重,由明细表自动合计生成")
+    private BigDecimal fGrossweight;
+
+    /**
+     * 净重,由明细表自动合计生成
+     */
+    @Excel(name = "净重,由明细表自动合计生成")
+    private BigDecimal fNetweight;
+
+    /**
+     * 提单号
+     */
+    @Excel(name = "提单号")
+    private String fMblno;
+
+    /**
+     * 报关单号
+     */
+    @Excel(name = "报关单号")
+    private String fCustomno;
+
+    /**
+     * 客户出货数据
+     */
+    private List<Map<String,Object>> customerList;
+
+    /**
+     * 客户结余数据
+     */
+    private List<Map<String,Object>> balanceList;
+
+    // 附件结合
+    private List<TEnclosure> enclosureList;
+
+    // 客户基础资料附件
+    private List<TEnclosure> customerInformationList;
+
+    public List<TEnclosure> getEnclosureList() {
+        return enclosureList;
+    }
+
+    public void setEnclosureList(List<TEnclosure> enclosureList) {
+        this.enclosureList = enclosureList;
+    }
+
+    public List<TEnclosure> getCustomerInformationList() {
+        return customerInformationList;
+    }
+
+    public void setCustomerInformationList(List<TEnclosure> customerInformationList) {
+        this.customerInformationList = customerInformationList;
+    }
+
+    public List<Map<String, Object>> getCustomerList() {
+        return customerList;
+    }
+
+    public void setCustomerList(List<Map<String, Object>> customerList) {
+        this.customerList = customerList;
+    }
+
+    public List<Map<String, Object>> getBalanceList() {
+        return balanceList;
+    }
+
+    public void setBalanceList(List<Map<String, Object>> balanceList) {
+        this.balanceList = balanceList;
+    }
+
+    public Long getfId() {
+        return fId;
+    }
+
+    public void setfId(Long fId) {
+        this.fId = fId;
+    }
+
+    public String getfBillno() {
+        return fBillno;
+    }
+
+    public void setfBillno(String fBillno) {
+        this.fBillno = fBillno;
+    }
+
+    public String getfCorpName() {
+        return fCorpName;
+    }
+
+    public void setfCorpName(String fCorpName) {
+        this.fCorpName = fCorpName;
+    }
+
+    public Long getfTocorpid() {
+        return fTocorpid;
+    }
+
+    public void setfTocorpid(Long fTocorpid) {
+        this.fTocorpid = fTocorpid;
+    }
+
+    public String getfWarehouseName() {
+        return fWarehouseName;
+    }
+
+    public void setfWarehouseName(String fWarehouseName) {
+        this.fWarehouseName = fWarehouseName;
+    }
+
+    public Date getfBsdate() {
+        return fBsdate;
+    }
+
+    public void setfBsdate(Date fBsdate) {
+        this.fBsdate = fBsdate;
+    }
+
+    public Long getfQty() {
+        return fQty;
+    }
+
+    public void setfQty(Long fQty) {
+        this.fQty = fQty;
+    }
+
+    public BigDecimal getfGrossweight() {
+        return fGrossweight;
+    }
+
+    public void setfGrossweight(BigDecimal fGrossweight) {
+        this.fGrossweight = fGrossweight;
+    }
+
+    public BigDecimal getfNetweight() {
+        return fNetweight;
+    }
+
+    public void setfNetweight(BigDecimal fNetweight) {
+        this.fNetweight = fNetweight;
+    }
+
+    public String getfMblno() {
+        return fMblno;
+    }
+
+    public void setfMblno(String fMblno) {
+        this.fMblno = fMblno;
+    }
+
+    public String getfCustomno() {
+        return fCustomno;
+    }
+
+    public void setfCustomno(String fCustomno) {
+        this.fCustomno = fCustomno;
+    }
+}

+ 3 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/vo/AppWarehouseInfoVO.java

@@ -47,4 +47,7 @@ public class AppWarehouseInfoVO extends TWarehouseBills {
     // 附件结合
     // 附件结合
     private List<TEnclosure> enclosureList;
     private List<TEnclosure> enclosureList;
 
 
+    // 客户基础资料附件
+    private List<TEnclosure> customerInformationList;
+
 }
 }

+ 5 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -8235,6 +8235,11 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         if (CollectionUtils.isNotEmpty(tEnclosureList)) {
         if (CollectionUtils.isNotEmpty(tEnclosureList)) {
             infoVO.setEnclosureList(tEnclosureList);
             infoVO.setEnclosureList(tEnclosureList);
         }
         }
+        //查询用户资料附件
+        List<TEnclosure> customerInformationList = tEnclosureMapper.selectTEnclosureByPId(infoVO.getfCorpid());
+        if (CollectionUtils.isNotEmpty(customerInformationList)) {
+            infoVO.setCustomerInformationList(customerInformationList);
+        }
         return AjaxResult.success(infoVO);
         return AjaxResult.success(infoVO);
     }
     }