Browse Source

Merge remote-tracking branch 'origin/dev' into dev

lazhaoqian 3 years ago
parent
commit
91d134cb69
24 changed files with 925 additions and 137 deletions
  1. 12 8
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/agreement/TWarehouseAgreementStorageController.java
  2. 11 8
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/agreement/TWarehouseAgreementTaskController.java
  3. 10 15
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/basicData/TWarehouseController.java
  4. 0 3
      ruoyi-admin/src/main/resources/application-druid.yml
  5. 11 0
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/TWarehouse.java
  6. 2 1
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/enums/WarehouseEnum.java
  7. 15 2
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/ITWarehouseService.java
  8. 138 52
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/impl/TWarehouseServiceImpl.java
  9. 10 0
      ruoyi-warehouse/src/main/java/com/ruoyi/finance/domain/TWareHouseFees.java
  10. 160 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TAnnex.java
  11. 14 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TWarehousebillsitems.java
  12. 22 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/dto/WarehouseSubmitDTO.java
  13. 36 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/enums/AnnexActEnum.java
  14. 3 3
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/enums/WarehouseTypeEnum.java
  15. 22 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/vo/WarehouseInfoVO.java
  16. 70 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TAnnexMapper.java
  17. 62 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITAnnexService.java
  18. 2 2
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITWarehouseAgreementService.java
  19. 90 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TAnnexServiceImpl.java
  20. 85 22
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseAgreementServiceImpl.java
  21. 6 0
      ruoyi-warehouse/src/main/resources/mapper/basicData/TWarehouseMapper.xml
  22. 21 20
      ruoyi-warehouse/src/main/resources/mapper/finance/TFeeMapper.xml
  23. 116 0
      ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TAnnexMapper.xml
  24. 7 1
      ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsitemsMapper.xml

+ 12 - 8
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/agreement/TWarehouseAgreementStorageController.java

@@ -73,11 +73,13 @@ public class TWarehouseAgreementStorageController extends BaseController {
     @PostMapping
     @RepeatSubmit
     public AjaxResult add(@RequestParam("agreement") String agreement,
-                          @RequestParam("agreementitems") String agreementitems) {
+                          @RequestParam("agreementitems") String agreementitems,
+                          @RequestParam(value = "attachments", required = false) String attachments
+    ) {
         int fFeetypeid = 0;
         // 获取当前的用户
         LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
-        return tWarehouseAgreementService.insertTWarehouseAgreement(agreement,agreementitems,loginUser,fFeetypeid);
+        return tWarehouseAgreementService.insertTWarehouseAgreement(agreement, agreementitems, attachments, loginUser, fFeetypeid);
     }
 
     /**
@@ -108,32 +110,34 @@ public class TWarehouseAgreementStorageController extends BaseController {
     }
 
     /**
-     *  仓储费请核
+     * 仓储费请核
      */
     @PreAuthorize("@ss.hasPermi('agreement:agreementStorage:add')")
     @Log(title = "仓储费", businessType = BusinessType.INSERT)
     @PostMapping(value = "/agreementStorageSubmission")
     @RepeatSubmit
     public AjaxResult agreementStorageSubmission(@RequestParam("agreement") String agreement,
-                          @RequestParam("agreementitems") String agreementitems) {
+                                                 @RequestParam("agreementitems") String agreementitems,
+                                                 @RequestParam(value = "attachments", required = false) String attachments
+    ) {
         int fFeetypeid = 0;
         // 获取当前的用户
         LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
-        return tWarehouseAgreementService.tWarehouseAgreementSubmit(agreement,agreementitems,loginUser,fFeetypeid);
+        return tWarehouseAgreementService.tWarehouseAgreementSubmit(agreement, agreementitems, attachments, loginUser, fFeetypeid);
     }
 
     /**
-     *   撤销对账
+     * 撤销对账
      */
     @PreAuthorize("@ss.hasPermi('agreement:agreementStorage:add')")
     @Log(title = "仓储费", businessType = BusinessType.INSERT)
     @PostMapping(value = "/revoke")
     @RepeatSubmit
     public AjaxResult revoke(@RequestParam("agreement") String agreement,
-                                                 @RequestParam("agreementitems") String agreementitems) {
+                             @RequestParam("agreementitems") String agreementitems) {
         int fFeetypeid = 0;
         // 获取当前的用户
         LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
-        return tWarehouseAgreementService.revoke(agreement,agreementitems,loginUser,fFeetypeid);
+        return tWarehouseAgreementService.revoke(agreement, agreementitems, loginUser, fFeetypeid);
     }
 }

+ 11 - 8
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/agreement/TWarehouseAgreementTaskController.java

@@ -21,7 +21,7 @@ import java.util.List;
 import java.util.Map;
 
 /**
- * 仓储费Controller
+ * 作业费Controller
  *
  * @author ruoyi
  * @date 2020-12-11
@@ -73,11 +73,13 @@ public class TWarehouseAgreementTaskController extends BaseController {
     @PostMapping
     @RepeatSubmit
     public AjaxResult add(@RequestParam("agreement") String agreement,
-                          @RequestParam("agreementitems") String agreementitems) {
+                          @RequestParam("agreementitems") String agreementitems,
+                          @RequestParam(value = "attachments", required = false) String attachments
+    ) {
         int fFeetypeid = 1;
         // 获取当前的用户
         LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
-        return tWarehouseAgreementService.insertTWarehouseAgreement(agreement,agreementitems,loginUser,fFeetypeid);
+        return tWarehouseAgreementService.insertTWarehouseAgreement(agreement, agreementitems, attachments, loginUser, fFeetypeid);
     }
 
     /**
@@ -109,22 +111,23 @@ public class TWarehouseAgreementTaskController extends BaseController {
 
 
     /**
-     *  仓储费请核
+     * 仓储费请核
      */
     @PreAuthorize("@ss.hasPermi('agreement:agreementTask:add')")
     @Log(title = "仓储费", businessType = BusinessType.INSERT)
     @PostMapping(value = "/agreementTaskSubmission")
     @RepeatSubmit
     public AjaxResult agreementTaskSubmission(@RequestParam("agreement") String agreement,
-                                                 @RequestParam("agreementitems") String agreementitems) {
+                                              @RequestParam("agreementitems") String agreementitems,
+                                              @RequestParam(value = "attachments", required = false) String attachments) {
         int fFeetypeid = 1;
         // 获取当前的用户
         LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
-        return tWarehouseAgreementService.tWarehouseAgreementSubmit(agreement,agreementitems,loginUser,fFeetypeid);
+        return tWarehouseAgreementService.tWarehouseAgreementSubmit(agreement, agreementitems, attachments, loginUser, fFeetypeid);
     }
 
     /**
-     *   撤销对账
+     * 撤销对账
      */
     @PreAuthorize("@ss.hasPermi('agreement:agreementTask:add')")
     @Log(title = "仓储费", businessType = BusinessType.INSERT)
@@ -135,6 +138,6 @@ public class TWarehouseAgreementTaskController extends BaseController {
         int fFeetypeid = 1;
         // 获取当前的用户
         LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
-        return tWarehouseAgreementService.revoke(agreement,agreementitems,loginUser,fFeetypeid);
+        return tWarehouseAgreementService.revoke(agreement, agreementitems, loginUser, fFeetypeid);
     }
 }

+ 10 - 15
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/basicData/TWarehouseController.java

@@ -1,25 +1,24 @@
 package com.ruoyi.web.controller.warehouse.basicData;
 
 
-import com.ruoyi.common.core.domain.entity.TWarehouse;
 import com.ruoyi.basicData.service.ITWarehouseService;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.annotation.RepeatSubmit;
 import com.ruoyi.common.constant.UserConstants;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.TWarehouse;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
-import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.warehouseBusiness.domain.dto.WarehouseSubmitDTO;
 import org.apache.commons.lang3.ArrayUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
-
 import java.util.Iterator;
 import java.util.List;
 
@@ -43,7 +42,7 @@ public class TWarehouseController extends BaseController {
     public AjaxResult list(TWarehouse tWarehouse) {
         // startPage();
         List<TWarehouse> list = tWarehouseService.selectTWarehouseList(tWarehouse);
-        return  AjaxResult.success(list); // getDataTable(list);
+        return AjaxResult.success(list); // getDataTable(list);
     }
 
     /**
@@ -53,7 +52,7 @@ public class TWarehouseController extends BaseController {
     public TableDataInfo lists(TWarehouse tWarehouse) {
         startPage();
         List<TWarehouse> list = tWarehouseService.selectTWarehouseLists(tWarehouse);
-        return  getDataTable(list);
+        return getDataTable(list);
     }
 
     /**
@@ -133,12 +132,11 @@ public class TWarehouseController extends BaseController {
     @Log(title = "仓库", businessType = BusinessType.INSERT)
     @PostMapping
     @RepeatSubmit
-    public AjaxResult add(@Validated @RequestBody TWarehouse tWarehouse) {
+    public AjaxResult add(@Validated @RequestBody WarehouseSubmitDTO tWarehouse) {
         if (UserConstants.NOT_UNIQUE.equals(tWarehouseService.checkNameUnique(tWarehouse))) {
             return AjaxResult.error("新增仓库'" + tWarehouse.getfNo() + "'失败,仓库已存在");
         }
-        tWarehouse.setCreateBy(SecurityUtils.getUsername());
-        return toAjax(tWarehouseService.insertTWarehouse(tWarehouse));
+        return tWarehouseService.warehouseSubmit(tWarehouse);
     }
 
     /**
@@ -150,16 +148,14 @@ public class TWarehouseController extends BaseController {
     public AjaxResult edit(@RequestBody TWarehouse tWarehouse) {
         return tWarehouseService.updateTWarehouse(tWarehouse);
     }*/
-
     @PreAuthorize("@ss.hasPermi('basicdata:warehouse:edit')")
     @PutMapping
     @RepeatSubmit
-    public AjaxResult edit(@Validated @RequestBody TWarehouse tWarehouse) {
+    public AjaxResult edit(@Validated @RequestBody WarehouseSubmitDTO tWarehouse) {
         if (UserConstants.NOT_UNIQUE.equals(tWarehouseService.checkNameUnique(tWarehouse))) {
             return AjaxResult.error("修改仓库'" + tWarehouse.getfNo() + "'失败,仓库已存在");
         }
-        tWarehouse.setUpdateBy(SecurityUtils.getUsername());
-        return toAjax(tWarehouseService.updateTWarehouses(tWarehouse));
+        return tWarehouseService.edit(tWarehouse);
     }
 
 
@@ -187,11 +183,11 @@ public class TWarehouseController extends BaseController {
         }
         // 获取仓库信息
         TWarehouse tWarehouse = tWarehouseService.selectTWarehouseById(fId);
-        if(tWarehouse.getfLocation()==1){ // 库位
+        if (tWarehouse.getfLocation() == 1) { // 库位
             if (tWarehouseService.checkDeptExistWarehouseItems(fId)) {
                 return AjaxResult.error("库位存在货物,不允许删除");
             }
-        } else if (tWarehouse.getParentId() == 100){ //  仓库
+        } else if (tWarehouse.getParentId() == 100) { //  仓库
             if (tWarehouseService.checkDeptExistWarehouse(fId)) {
                 return AjaxResult.error("仓库存在货物,不允许删除");
             }
@@ -210,5 +206,4 @@ public class TWarehouseController extends BaseController {
     }
 
 
-
 }

+ 0 - 3
ruoyi-admin/src/main/resources/application-druid.yml

@@ -6,9 +6,6 @@ spring:
     druid:
       # 主库数据源
       master:
-#        url: jdbc:mysql://localhost:3306/ruoyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
- #       url: jdbc:mysql://115.29.151.39:3306/sys?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
-#        url: jdbc:mysql://124.70.179.5:3306/Test?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
         url: jdbc:mysql://124.70.179.5:3306/LinuxServer?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
         username: root
         password: daasan7ujm^YHN

+ 11 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/TWarehouse.java

@@ -48,6 +48,10 @@ public class TWarehouse extends BaseEntity
     @Excel(name = "名称")
     private String fName;
 
+    /** 是否保税 */
+    @Excel(name = "是否保税")
+    private String fIsBonded;
+
     /** 地址 */
     @Excel(name = "地址")
     private String fAddr;
@@ -120,6 +124,13 @@ public class TWarehouse extends BaseEntity
         this.orderNum = orderNum;
     }
 
+    public String getfIsBonded() {
+        return fIsBonded;
+    }
+
+    public void setfIsBonded(String fIsBonded) {
+        this.fIsBonded = fIsBonded;
+    }
 
     public Long getfId()
     {

+ 2 - 1
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/enums/WarehouseEnum.java

@@ -19,7 +19,8 @@ public enum WarehouseEnum {
     BY_MONTH("month", "按照月"),
     BY_WEEK("week", "按照周"),
 
-
+    BONDED("0", "保税"),
+    NOT_BONDED("1", "非保税"),
     ;
 
     private final String type;

+ 15 - 2
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/ITWarehouseService.java

@@ -4,9 +4,10 @@ package com.ruoyi.basicData.service;
 import com.ruoyi.basicData.domain.TWarehouseArea;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.TreeSelect;
-import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.core.domain.entity.TWarehouse;
 import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.warehouseBusiness.domain.dto.WarehouseSubmitDTO;
+import com.ruoyi.warehouseBusiness.domain.vo.WarehouseInfoVO;
 
 import java.util.List;
 import java.util.Map;
@@ -24,7 +25,7 @@ public interface ITWarehouseService {
      * @param fId 仓库ID
      * @return 仓库
      */
-    public TWarehouse selectTWarehouseById(Long fId);
+    public WarehouseInfoVO selectTWarehouseById(Long fId);
     public Map<String, Object> selectTWarehouseById1(Long fId);
 
     /**
@@ -149,5 +150,17 @@ public interface ITWarehouseService {
     public boolean checkDeptExistWarehouse(Long deptId);
     public boolean checkDeptExistWarehouseItems(Long deptId);
 
+    /**
+     *  新增仓库
+     * @param tWarehouse
+     * @return
+     */
+    AjaxResult warehouseSubmit(WarehouseSubmitDTO tWarehouse);
 
+    /**
+     *  修改仓库
+     * @param tWarehouse
+     * @return
+     */
+    AjaxResult edit(WarehouseSubmitDTO tWarehouse);
 }

+ 138 - 52
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/impl/TWarehouseServiceImpl.java

@@ -2,8 +2,7 @@ package com.ruoyi.basicData.service.impl;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.ruoyi.common.core.domain.entity.SysDept;
-import com.ruoyi.common.core.domain.entity.TWarehouse;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.ruoyi.basicData.domain.TWarehouseArea;
 import com.ruoyi.basicData.mapper.TWarehouseAreaMapper;
 import com.ruoyi.basicData.mapper.TWarehouseMapper;
@@ -11,12 +10,20 @@ import com.ruoyi.basicData.service.ITWarehouseService;
 import com.ruoyi.common.constant.UserConstants;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.TreeSelect;
+import com.ruoyi.common.core.domain.entity.TWarehouse;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.exception.CustomException;
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.warehouseBusiness.domain.TAnnex;
 import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
+import com.ruoyi.warehouseBusiness.domain.dto.WarehouseSubmitDTO;
+import com.ruoyi.warehouseBusiness.domain.enums.AnnexActEnum;
+import com.ruoyi.warehouseBusiness.domain.vo.WarehouseInfoVO;
+import com.ruoyi.warehouseBusiness.mapper.TAnnexMapper;
 import com.ruoyi.warehouseBusiness.mapper.TWarehouseBillsMapper;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -35,6 +42,9 @@ import java.util.stream.Collectors;
 @Service
 public class TWarehouseServiceImpl implements ITWarehouseService {
     @Autowired
+    private TAnnexMapper annexMapper;
+
+    @Autowired
     private TWarehouseMapper tWarehouseMapper;
 
     @Autowired
@@ -51,8 +61,18 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
      * @return 仓库
      */
     @Override
-    public TWarehouse selectTWarehouseById(Long fId) {
-        return tWarehouseMapper.selectTWarehouseById(fId);
+    public WarehouseInfoVO selectTWarehouseById(Long fId) {
+        WarehouseInfoVO warehouseInfoVO = new WarehouseInfoVO();
+        TWarehouse tWarehouse = tWarehouseMapper.selectTWarehouseById(fId);
+        if (Objects.nonNull(tWarehouse)) {
+            BeanUtils.copyProperties(tWarehouse, warehouseInfoVO);
+            TAnnex annex = new TAnnex();
+            annex.setfPid(tWarehouse.getfId());
+            annex.setfActid(AnnexActEnum.WAREHOUSE.getType());
+            List<TAnnex> annexList = annexMapper.selectTAnnexList(annex);
+            warehouseInfoVO.setAnnexList(annexList);
+        }
+        return warehouseInfoVO;
     }
 
     @Override
@@ -62,9 +82,9 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
         if (StringUtils.isNotNull(tWarehouse)) {
             map.put("tWarehouse", tWarehouse);
         }
-        TWarehouseArea tWarehouseArea=  new TWarehouseArea();
+        TWarehouseArea tWarehouseArea = new TWarehouseArea();
         tWarehouseArea.setfWarehouseid(fId);
-        List<TWarehouseArea> tWarehouseAreaList =tWarehouseAreaMapper.selectTWarehouseAreaList(tWarehouseArea);
+        List<TWarehouseArea> tWarehouseAreaList = tWarehouseAreaMapper.selectTWarehouseAreaList(tWarehouseArea);
         if (StringUtils.isNotEmpty(tWarehouseAreaList)) {
             map.put("tWarehouseArea", tWarehouseAreaList);
         }
@@ -104,11 +124,11 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
         }
         tWarehouse.setAncestors(info.getAncestors() + "," + tWarehouse.getParentId());
         // 所有节点转换成中文拼接
-        String  fWarehouseInformation = warehouseName(info.getAncestors() + "," + tWarehouse.getParentId(),tWarehouse.getfName());
+        String fWarehouseInformation = warehouseName(info.getAncestors() + "," + tWarehouse.getParentId(), tWarehouse.getfName());
         tWarehouse.setfWarehouseInformation(fWarehouseInformation);
         tWarehouseMapper.insertTWarehouse(tWarehouse);
         // 更新库容
-        if (tWarehouse.getfLocation()==1){
+        if (tWarehouse.getfLocation() == 1) {
             int i = updateWarehousefTotalgross(tWarehouse.getAncestors());
             if (i <= 0) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -125,7 +145,7 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
         if (StringUtils.isEmpty(tWarehouse)) {
             return AjaxResult.error("提交失败:仓库信息为空");
         }
-        if ( StringUtils.isEmpty(tWarehouseArea) && !"[{}]".equals(tWarehouseArea) ) {
+        if (StringUtils.isEmpty(tWarehouseArea) && !"[{}]".equals(tWarehouseArea)) {
             return AjaxResult.error("提交失败:库区为空");
         }
         Long fPid = null;
@@ -137,16 +157,16 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
             tWarehouses.setCreateTime(new Date());
             tWarehouses.setfStatus("0");
             tWarehouseMapper.insertTWarehouse(tWarehouses);
-            fPid=tWarehouses.getfId();
+            fPid = tWarehouses.getfId();
         } else {
-            fPid=tWarehouses.getfId();
+            fPid = tWarehouses.getfId();
             tWarehouses.setUpdateBy(loginUser.getUser().getUserName());
             tWarehouses.setUpdateTime(new Date());
-            if(tWarehouses.getfStatus()!=null && tWarehouses.getfStatus().equals("1") ){
-                TWarehouseBills   tWarehouseBill =new TWarehouseBills();
+            if (tWarehouses.getfStatus() != null && tWarehouses.getfStatus().equals("1")) {
+                TWarehouseBills tWarehouseBill = new TWarehouseBills();
                 tWarehouseBill.setfWarehouseid(tWarehouses.getfId());
-                List<TWarehouseBills>   tWarehouseBillList=tWarehouseBillsMapper.selectTWarehousebillsList(tWarehouseBill);
-                if(tWarehouseBillList!=null && !tWarehouseBillList.isEmpty()){
+                List<TWarehouseBills> tWarehouseBillList = tWarehouseBillsMapper.selectTWarehousebillsList(tWarehouseBill);
+                if (tWarehouseBillList != null && !tWarehouseBillList.isEmpty()) {
                     return AjaxResult.error("仓库在库存总账有记录不可变更状态");
                 }
             }
@@ -154,13 +174,13 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
             // tWarehouseAreaMapper.deleteTWarehouseAreaByTWarehoused(fPid);
         }
         for (TWarehouseArea cc : tWarehouseAreaList) {
-            if( StringUtils.isNull(cc.getfNo())  ||
-                StringUtils.isNull(cc.getfName()) ||
-                StringUtils.isNull(cc.getfAddr()) ){
+            if (StringUtils.isNull(cc.getfNo()) ||
+                    StringUtils.isNull(cc.getfName()) ||
+                    StringUtils.isNull(cc.getfAddr())) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return AjaxResult.error("请完善库区明细信息");
             }
-            if(cc.getfId()!=null){
+            if (cc.getfId() != null) {
                 cc.setUpdateBy(loginUser.getUser().getUserName());
                 cc.setUpdateTime(new Date());
                 tWarehouseAreaMapper.updateTWarehouseArea(cc);
@@ -185,11 +205,11 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
     @Override
     @Transactional
     public AjaxResult updateTWarehouse(TWarehouse tWarehouse) {
-        if(tWarehouse.getfStatus()!=null && tWarehouse.getfStatus().equals("1") ){
-            TWarehouseBills   tWarehouseBill =new TWarehouseBills();
+        if (tWarehouse.getfStatus() != null && tWarehouse.getfStatus().equals("1")) {
+            TWarehouseBills tWarehouseBill = new TWarehouseBills();
             tWarehouseBill.setfWarehouseid(tWarehouse.getfId());
-            List<TWarehouseBills>   tWarehouseBillList=tWarehouseBillsMapper.selectTWarehousebillsList(tWarehouseBill);
-            if(tWarehouseBillList!=null && !tWarehouseBillList.isEmpty()){
+            List<TWarehouseBills> tWarehouseBillList = tWarehouseBillsMapper.selectTWarehousebillsList(tWarehouseBill);
+            if (tWarehouseBillList != null && !tWarehouseBillList.isEmpty()) {
                 return AjaxResult.error("仓库在库存总账有记录不可变更状态");
             }
         }
@@ -208,7 +228,7 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
             tWarehouse.setAncestors(newAncestors);
             updateDeptChildren(tWarehouse.getfId(), newAncestors, oldAncestors);
             // 修改仓库信息
-            String  fWarehouseInformation = warehouseName(newAncestors,tWarehouse.getfName());
+            String fWarehouseInformation = warehouseName(newAncestors, tWarehouse.getfName());
             tWarehouse.setfWarehouseInformation(fWarehouseInformation);
         }
         int result = tWarehouseMapper.updateTWarehouse(tWarehouse);
@@ -217,7 +237,7 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
             updateParentDeptStatus(tWarehouse);
         }
         // 更新库容
-        if (tWarehouse.getfLocation()==1){
+        if (tWarehouse.getfLocation() == 1) {
             int i = updateWarehousefTotalgross(tWarehouse.getAncestors());
             if (i <= 0) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -267,11 +287,11 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
     public AjaxResult deleteTWarehouseByIds(Long[] fIds) {
         // 查询仓库主表 是否有仓库在使用
         int i = 1;
-        for(Long id:fIds){
-            TWarehouseBills   tWarehouseBill =new TWarehouseBills();
+        for (Long id : fIds) {
+            TWarehouseBills tWarehouseBill = new TWarehouseBills();
             tWarehouseBill.setfWarehouseid(id);
-            List<TWarehouseBills>   tWarehouseBillList=tWarehouseBillsMapper.selectTWarehousebillsList(tWarehouseBill);
-            if(tWarehouseBillList!=null && !tWarehouseBillList.isEmpty()){
+            List<TWarehouseBills> tWarehouseBillList = tWarehouseBillsMapper.selectTWarehousebillsList(tWarehouseBill);
+            if (tWarehouseBillList != null && !tWarehouseBillList.isEmpty()) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return AjaxResult.error("仓库第" + i + "行仓库有货物不可删除");
             }
@@ -291,7 +311,9 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
     @Override
     @Transactional
     public int deleteTWarehouseById(Long fId) {
-        return tWarehouseMapper.deleteTWarehouseById(fId);
+        tWarehouseMapper.deleteTWarehouseById(fId);
+        annexMapper.deleteByPid(fId, AnnexActEnum.WAREHOUSE.getType());
+        return 1;
     }
 
     @Override
@@ -322,10 +344,73 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
         return result > 0 ? true : false;
     }
 
+    /**
+     * 新增仓库
+     *
+     * @param tWarehouse
+     * @return
+     */
+    @Override
+    public AjaxResult warehouseSubmit(WarehouseSubmitDTO tWarehouse) {
+        // 登录用户
+        String username = SecurityUtils.getUsername();
+        tWarehouse.setCreateTime(new Date());
+        tWarehouse.setCreateBy(username);
+        tWarehouseMapper.insertTWarehouse(tWarehouse);
+
+        if (CollectionUtils.isNotEmpty(tWarehouse.getAnnexList())) {
+            tWarehouse.getAnnexList().forEach(li -> {
+                li.setfPid(tWarehouse.getfId());
+                li.setfActid(AnnexActEnum.WAREHOUSE.getType());
+                if (Objects.nonNull(li.getfId())) {
+                    li.setCreateTime(new Date());
+                    li.setCreateBy(username);
+                } else {
+                    li.setUpdateTime(new Date());
+                    li.setUpdateBy(username);
+                }
+                annexMapper.insertTAnnex(li);
+            });
+        }
+        return AjaxResult.success();
+    }
+
+    /**
+     * 修改仓库
+     *
+     * @param tWarehouse
+     * @return
+     */
+    @Override
+    @Transactional
+    public AjaxResult edit(WarehouseSubmitDTO tWarehouse) {
+        // 登录用户
+        String username = SecurityUtils.getUsername();
+
+        tWarehouse.setUpdateBy(username);
+        tWarehouseMapper.updateTWarehouse(tWarehouse);
+        annexMapper.deleteByPid(tWarehouse.getfId(), AnnexActEnum.WAREHOUSE.getType());
+        if (CollectionUtils.isNotEmpty(tWarehouse.getAnnexList())) {
+            tWarehouse.getAnnexList().forEach(li -> {
+                li.setfPid(tWarehouse.getfId());
+                li.setfActid(AnnexActEnum.WAREHOUSE.getType());
+                if (Objects.nonNull(li.getfId())) {
+                    li.setCreateTime(new Date());
+                    li.setCreateBy(username);
+                } else {
+                    li.setUpdateTime(new Date());
+                    li.setUpdateBy(username);
+                }
+                annexMapper.insertTAnnex(li);
+            });
+        }
+        return AjaxResult.success();
+    }
+
     @Override
     public String checkUFNoUnique(TWarehouse tWarehouse) {
         TWarehouse tWarehouse1 = tWarehouseMapper.checkFNoUnique(tWarehouse.getfNo());
-        if (StringUtils.isNotNull(tWarehouse1) && tWarehouse1.getfId()!=tWarehouse.getfId()) {
+        if (StringUtils.isNotNull(tWarehouse1) && tWarehouse1.getfId() != tWarehouse.getfId()) {
             return UserConstants.NOT_UNIQUE;
         }
         return UserConstants.UNIQUE;
@@ -334,7 +419,7 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
     @Override
     public String checkUFNnameUnique(TWarehouse tWarehouse) {
         TWarehouse tWarehouse1 = tWarehouseMapper.checkUFNnameUnique(tWarehouse.getfName());
-        if (StringUtils.isNotNull(tWarehouse1) && tWarehouse1.getfId()!=tWarehouse.getfId()) {
+        if (StringUtils.isNotNull(tWarehouse1) && tWarehouse1.getfId() != tWarehouse.getfId()) {
             return UserConstants.NOT_UNIQUE;
         }
         return UserConstants.UNIQUE;
@@ -343,7 +428,7 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
     @Override
     public String checkUFAaddrUnique(TWarehouse tWarehouse) {
         TWarehouse tWarehouse1 = tWarehouseMapper.checkUFAaddrUnique(tWarehouse.getfAddr());
-        if (StringUtils.isNotNull(tWarehouse1) && tWarehouse1.getfId()!=tWarehouse.getfId()) {
+        if (StringUtils.isNotNull(tWarehouse1) && tWarehouse1.getfId() != tWarehouse.getfId()) {
             return UserConstants.NOT_UNIQUE;
         }
         return UserConstants.UNIQUE;
@@ -351,8 +436,8 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
 
     @Override
     public String checkUFTWarehouseAreaNoUnique(TWarehouseArea tWarehouseAreas) {
-        TWarehouseArea tWarehouseAreas1 = tWarehouseAreaMapper.checkFNoUnique(tWarehouseAreas.getfNo(),tWarehouseAreas.getfWarehouseid());
-        if (StringUtils.isNotNull(tWarehouseAreas1) && tWarehouseAreas1.getfId()!=tWarehouseAreas.getfId()) {
+        TWarehouseArea tWarehouseAreas1 = tWarehouseAreaMapper.checkFNoUnique(tWarehouseAreas.getfNo(), tWarehouseAreas.getfWarehouseid());
+        if (StringUtils.isNotNull(tWarehouseAreas1) && tWarehouseAreas1.getfId() != tWarehouseAreas.getfId()) {
             return UserConstants.NOT_UNIQUE;
         }
         return UserConstants.UNIQUE;
@@ -360,8 +445,8 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
 
     @Override
     public String checkUTWarehouseAreaFNnameUnique(TWarehouseArea tWarehouseAreas) {
-        TWarehouseArea tWarehouseAreas1 = tWarehouseAreaMapper.checkUFNnameUnique(tWarehouseAreas.getfName(),tWarehouseAreas.getfWarehouseid());
-        if (StringUtils.isNotNull(tWarehouseAreas1) && tWarehouseAreas1.getfId()!=tWarehouseAreas.getfId()) {
+        TWarehouseArea tWarehouseAreas1 = tWarehouseAreaMapper.checkUFNnameUnique(tWarehouseAreas.getfName(), tWarehouseAreas.getfWarehouseid());
+        if (StringUtils.isNotNull(tWarehouseAreas1) && tWarehouseAreas1.getfId() != tWarehouseAreas.getfId()) {
             return UserConstants.NOT_UNIQUE;
         }
         return UserConstants.UNIQUE;
@@ -408,7 +493,7 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
     @Override
     public String checkUFAreUnique(TWarehouse tWarehouse) {
         TWarehouseArea tWarehouseArea = tWarehouseAreaMapper.selectTWarehouseAreaByWarehouseId(tWarehouse.getParentId());
-        if (StringUtils.isNotNull(tWarehouseArea) ) {
+        if (StringUtils.isNotNull(tWarehouseArea)) {
             return UserConstants.NOT_UNIQUE;
         }
         return UserConstants.UNIQUE;
@@ -450,46 +535,47 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
         return getChildList(list, t).size() > 0 ? true : false;
     }
 
-    public  String warehouseName(String ancestors,String oldName){
+    public String warehouseName(String ancestors, String oldName) {
         String str[] = ancestors.split(",");
         String fWarehouseInformation = "";
-        for (String id: str){
-            if(!(id.equals("0")) && !(id.equals("100"))){
+        for (String id : str) {
+            if (!(id.equals("0")) && !(id.equals("100"))) {
                 // 查询仓库名称
-                TWarehouse tWarehouse=tWarehouseMapper.selectTWarehouseById(Long.valueOf(id));
+                TWarehouse tWarehouse = tWarehouseMapper.selectTWarehouseById(Long.valueOf(id));
                 fWarehouseInformation += tWarehouse.getfName() + "/";
             }
         }
-        if(StringUtils.isNull(fWarehouseInformation) && !fWarehouseInformation.equals("") ){
+        if (StringUtils.isNull(fWarehouseInformation) && !fWarehouseInformation.equals("")) {
             fWarehouseInformation = oldName;
         } else {
-            fWarehouseInformation +=  oldName;
+            fWarehouseInformation += oldName;
         }
         return fWarehouseInformation;
     }
 
     /**
-     *  修改仓库库容
+     * 修改仓库库容
+     *
      * @param ancestors
      * @return
      */
-    public  int updateWarehousefTotalgross(String  ancestors){
+    public int updateWarehousefTotalgross(String ancestors) {
         String str[] = ancestors.split(",");
-        Long warehouseId =0L;
-        for (String id: str){
-            if(!(id.equals("0")) && !(id.equals("100"))){
+        Long warehouseId = 0L;
+        for (String id : str) {
+            if (!(id.equals("0")) && !(id.equals("100"))) {
                 warehouseId = Long.valueOf(id);
                 break;
             }
         }
-        if(warehouseId!=0){
+        if (warehouseId != 0) {
             // 所有库容
             BigDecimal fTotalgross = tWarehouseMapper.selectTWarehouseFTotalgross(warehouseId);
             TWarehouse tWarehouseNew = new TWarehouse();
             tWarehouseNew.setfId(warehouseId);
             tWarehouseNew.setfTotalgross(fTotalgross);
-            return  tWarehouseMapper.updatefTotalgross(tWarehouseNew);
-        }else {
+            return tWarehouseMapper.updatefTotalgross(tWarehouseNew);
+        } else {
             return 0;
         }
     }

+ 10 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/finance/domain/TWareHouseFees.java

@@ -114,6 +114,8 @@ public class TWareHouseFees extends BaseEntity {
     private Long fLoadportid;
     /** 目的港 */
     private Long fDestportid;
+    /** 业务员id */
+    private Long fSalesmanId;
 
     /**
      * 检索区间始
@@ -131,6 +133,14 @@ public class TWareHouseFees extends BaseEntity {
     @TableField(exist = false)
     private Long stlTypeid;
 
+    public Long getfSalesmanId() {
+        return fSalesmanId;
+    }
+
+    public void setfSalesmanId(Long fSalesmanId) {
+        this.fSalesmanId = fSalesmanId;
+    }
+
     public Long getStlTypeid() {
         return stlTypeid;
     }

+ 160 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TAnnex.java

@@ -0,0 +1,160 @@
+package com.ruoyi.warehouseBusiness.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 业务附件对象 t_annex
+ *
+ * @author ruoyi
+ * @date 2021-11-19
+ */
+public class TAnnex extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * $column.columnComment
+     */
+    private Long fId;
+
+    /**
+     * 主表id
+     */
+    @Excel(name = "主表id")
+    private Long fPid;
+
+    /**
+     * 业务活动号
+     */
+    @Excel(name = "业务活动号")
+    private Long fActid;
+
+    /**
+     * 行号
+     */
+    @Excel(name = "行号")
+    private String fLineno;
+
+    /**
+     * 附件名称
+     */
+    @Excel(name = "附件名称")
+    private String fName;
+
+    /**
+     * 附件描述
+     */
+    @Excel(name = "附件描述")
+    private String fDesc;
+
+    /**
+     * 附件地址
+     */
+    @Excel(name = "附件地址")
+    private String fUrl;
+
+    /**
+     * 状态,默认 T ,正常T 停用F 下拉选择
+     */
+    @Excel(name = "状态,默认 T ,正常T 停用F 下拉选择")
+    private String fStatus;
+
+    /**
+     * 删除状态
+     */
+    private String delFlag;
+
+    public void setfId(Long fId) {
+        this.fId = fId;
+    }
+
+    public Long getfId() {
+        return fId;
+    }
+
+    public void setfPid(Long fPid) {
+        this.fPid = fPid;
+    }
+
+    public Long getfPid() {
+        return fPid;
+    }
+
+    public void setfActid(Long fActid) {
+        this.fActid = fActid;
+    }
+
+    public Long getfActid() {
+        return fActid;
+    }
+
+    public void setfLineno(String fLineno) {
+        this.fLineno = fLineno;
+    }
+
+    public String getfLineno() {
+        return fLineno;
+    }
+
+    public void setfName(String fName) {
+        this.fName = fName;
+    }
+
+    public String getfName() {
+        return fName;
+    }
+
+    public void setfDesc(String fDesc) {
+        this.fDesc = fDesc;
+    }
+
+    public String getfDesc() {
+        return fDesc;
+    }
+
+    public void setfUrl(String fUrl) {
+        this.fUrl = fUrl;
+    }
+
+    public String getfUrl() {
+        return fUrl;
+    }
+
+    public void setfStatus(String fStatus) {
+        this.fStatus = fStatus;
+    }
+
+    public String getfStatus() {
+        return fStatus;
+    }
+
+    public void setDelFlag(String delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() {
+        return delFlag;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("fId", getfId())
+                .append("fPid", getfPid())
+                .append("fActid", getfActid())
+                .append("fLineno", getfLineno())
+                .append("fName", getfName())
+                .append("fDesc", getfDesc())
+                .append("fUrl", getfUrl())
+                .append("fStatus", getfStatus())
+                .append("delFlag", getDelFlag())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("remark", getRemark())
+                .toString();
+    }
+}

+ 14 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TWarehousebillsitems.java

@@ -211,6 +211,12 @@ public class TWarehousebillsitems extends BaseEntity {
     private String fMarks;
 
     /**
+     * 溢短重
+     */
+    @Excel(name = "溢短重")
+    private BigDecimal  fActualWeight = BigDecimal.ZERO;
+
+    /**
      * 库存天数(出库日期-仓储费计费日期)
      */
     @Excel(name = "库存天数(出库日期-仓储费计费日期)")
@@ -394,6 +400,14 @@ public class TWarehousebillsitems extends BaseEntity {
      */
     private String fDc;
 
+    public BigDecimal getfActualWeight() {
+        return fActualWeight;
+    }
+
+    public void setfActualWeight(BigDecimal fActualWeight) {
+        this.fActualWeight = fActualWeight;
+    }
+
     public String getfDc() {
         return fDc;
     }

+ 22 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/dto/WarehouseSubmitDTO.java

@@ -0,0 +1,22 @@
+package com.ruoyi.warehouseBusiness.domain.dto;
+
+import com.ruoyi.common.core.domain.entity.TWarehouse;
+import com.ruoyi.warehouseBusiness.domain.TAnnex;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author caifc
+ * @date 2021-11-12 11:12
+ */
+@Data
+public class WarehouseSubmitDTO extends TWarehouse {
+    private static final long serialVersionUID = 1L;
+
+
+    // 附件信息
+    private List<TAnnex> annexList = new ArrayList<>();
+
+}

+ 36 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/enums/AnnexActEnum.java

@@ -0,0 +1,36 @@
+package com.ruoyi.warehouseBusiness.domain.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.Objects;
+
+/**
+ * @author caifc
+ * @date 2021-10-22 17:19
+ */
+@Getter
+@AllArgsConstructor
+public enum AnnexActEnum {
+
+    // 活动号
+    STORAGE_FEE(1L, "仓储费协议"),
+    HOMEWORK_FEE(10L, "作业费协议"),
+    WAREHOUSE(30L, "仓库"),
+
+
+    ;
+
+    private final Long type;
+    private final String name;
+
+    public static AnnexActEnum fromType(Long tp) {
+        for (AnnexActEnum type : AnnexActEnum.values()) {
+            if (Objects.equals(type.getType(), tp)) {
+                return type;
+            }
+        }
+        throw new IllegalArgumentException("fees type not exist");
+    }
+
+}

+ 3 - 3
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/enums/WarehouseTypeEnum.java

@@ -68,9 +68,9 @@ public enum WarehouseTypeEnum {
 
     // 编号生成简写
 
-    SJRK_NO("RK", "费用变更"),
-    SJCK_NO("CK", "库"),
-    CKDB_NO("DB", "出库"),
+    SJRK_NO("RK", "入库"),
+    SJCK_NO("CK", "库"),
+    CKDB_NO("DB", "调拨"),
     HQZY_NO("HZ", "货转"),
 
     FYBG_NO("FYBG", "费用变更"),

+ 22 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/vo/WarehouseInfoVO.java

@@ -0,0 +1,22 @@
+package com.ruoyi.warehouseBusiness.domain.vo;
+
+import com.ruoyi.common.core.domain.entity.TWarehouse;
+import com.ruoyi.warehouseBusiness.domain.TAnnex;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author caifc
+ * @date 2021-11-12 11:12
+ */
+@Data
+public class WarehouseInfoVO extends TWarehouse {
+    private static final long serialVersionUID = 1L;
+
+
+    // 附件信息
+    private List<TAnnex> annexList = new ArrayList<>();
+
+}

+ 70 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TAnnexMapper.java

@@ -0,0 +1,70 @@
+package com.ruoyi.warehouseBusiness.mapper;
+
+
+import com.ruoyi.warehouseBusiness.domain.TAnnex;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 业务附件Mapper接口
+ *
+ * @author ruoyi
+ * @date 2021-11-19
+ */
+public interface TAnnexMapper {
+    /**
+     * 查询业务附件
+     *
+     * @param fId 业务附件ID
+     * @return 业务附件
+     */
+    public TAnnex selectTAnnexById(Long fId);
+
+    /**
+     * 查询业务附件列表
+     *
+     * @param tAnnex 业务附件
+     * @return 业务附件集合
+     */
+    public List<TAnnex> selectTAnnexList(TAnnex tAnnex);
+
+    /**
+     * 新增业务附件
+     *
+     * @param tAnnex 业务附件
+     * @return 结果
+     */
+    public int insertTAnnex(TAnnex tAnnex);
+
+    /**
+     * 修改业务附件
+     *
+     * @param tAnnex 业务附件
+     * @return 结果
+     */
+    public int updateTAnnex(TAnnex tAnnex);
+
+    /**
+     * 删除业务附件
+     *
+     * @param fId 业务附件ID
+     * @return 结果
+     */
+    public int deleteTAnnexById(Long fId);
+
+    /**
+     * 批量删除业务附件
+     *
+     * @param fIds 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteTAnnexByIds(Long[] fIds);
+
+    /**
+     *  删除来源id
+     * @param fPid
+     * @return
+     */
+    int deleteByPid(@Param("pid") Long fPid, @Param("actId") Long actId);
+}

+ 62 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITAnnexService.java

@@ -0,0 +1,62 @@
+package com.ruoyi.warehouseBusiness.service;
+
+
+import com.ruoyi.warehouseBusiness.domain.TAnnex;
+
+import java.util.List;
+
+/**
+ * 业务附件Service接口
+ *
+ * @author ruoyi
+ * @date 2021-11-19
+ */
+public interface ITAnnexService {
+    /**
+     * 查询业务附件
+     *
+     * @param fId 业务附件ID
+     * @return 业务附件
+     */
+    public TAnnex selectTAnnexById(Long fId);
+
+    /**
+     * 查询业务附件列表
+     *
+     * @param tAnnex 业务附件
+     * @return 业务附件集合
+     */
+    public List<TAnnex> selectTAnnexList(TAnnex tAnnex);
+
+    /**
+     * 新增业务附件
+     *
+     * @param tAnnex 业务附件
+     * @return 结果
+     */
+    public int insertTAnnex(TAnnex tAnnex);
+
+    /**
+     * 修改业务附件
+     *
+     * @param tAnnex 业务附件
+     * @return 结果
+     */
+    public int updateTAnnex(TAnnex tAnnex);
+
+    /**
+     * 批量删除业务附件
+     *
+     * @param fIds 需要删除的业务附件ID
+     * @return 结果
+     */
+    public int deleteTAnnexByIds(Long[] fIds);
+
+    /**
+     * 删除业务附件信息
+     *
+     * @param fId 业务附件ID
+     * @return 结果
+     */
+    public int deleteTAnnexById(Long fId);
+}

+ 2 - 2
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITWarehouseAgreementService.java

@@ -41,9 +41,9 @@ public interface ITWarehouseAgreementService {
      * @param loginUser
      * @return
      */
-    public AjaxResult insertTWarehouseAgreement(String agreement, String agreementitems, LoginUser loginUser,int fFeetypeid);
+    public AjaxResult insertTWarehouseAgreement(String agreement, String agreementitems, String attachments, LoginUser loginUser,int fFeetypeid);
 
-    public AjaxResult tWarehouseAgreementSubmit(String agreement, String agreementitems, LoginUser loginUser,int fFeetypeid);
+    public AjaxResult tWarehouseAgreementSubmit(String agreement, String agreementitems, String attachments, LoginUser loginUser,int fFeetypeid);
 
     public AjaxResult revoke(String agreement, String agreementitems, LoginUser loginUser,int fFeetypeid);
     /**

+ 90 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TAnnexServiceImpl.java

@@ -0,0 +1,90 @@
+package com.ruoyi.warehouseBusiness.service.impl;
+
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.warehouseBusiness.domain.TAnnex;
+import com.ruoyi.warehouseBusiness.mapper.TAnnexMapper;
+import com.ruoyi.warehouseBusiness.service.ITAnnexService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 业务附件Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2021-11-19
+ */
+@Service
+public class TAnnexServiceImpl implements ITAnnexService {
+    @Autowired
+    private TAnnexMapper tAnnexMapper;
+
+    /**
+     * 查询业务附件
+     *
+     * @param fId 业务附件ID
+     * @return 业务附件
+     */
+    @Override
+    public TAnnex selectTAnnexById(Long fId) {
+        return tAnnexMapper.selectTAnnexById(fId);
+    }
+
+    /**
+     * 查询业务附件列表
+     *
+     * @param tAnnex 业务附件
+     * @return 业务附件
+     */
+    @Override
+    public List<TAnnex> selectTAnnexList(TAnnex tAnnex) {
+        return tAnnexMapper.selectTAnnexList(tAnnex);
+    }
+
+    /**
+     * 新增业务附件
+     *
+     * @param tAnnex 业务附件
+     * @return 结果
+     */
+    @Override
+    public int insertTAnnex(TAnnex tAnnex) {
+        tAnnex.setCreateTime(DateUtils.getNowDate());
+        return tAnnexMapper.insertTAnnex(tAnnex);
+    }
+
+    /**
+     * 修改业务附件
+     *
+     * @param tAnnex 业务附件
+     * @return 结果
+     */
+    @Override
+    public int updateTAnnex(TAnnex tAnnex) {
+        tAnnex.setUpdateTime(DateUtils.getNowDate());
+        return tAnnexMapper.updateTAnnex(tAnnex);
+    }
+
+    /**
+     * 批量删除业务附件
+     *
+     * @param fIds 需要删除的业务附件ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTAnnexByIds(Long[] fIds) {
+        return tAnnexMapper.deleteTAnnexByIds(fIds);
+    }
+
+    /**
+     * 删除业务附件信息
+     *
+     * @param fId 业务附件ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTAnnexById(Long fId) {
+        return tAnnexMapper.deleteTAnnexById(fId);
+    }
+}

+ 85 - 22
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseAgreementServiceImpl.java

@@ -10,9 +10,7 @@ import com.ruoyi.basicData.domain.TCorps;
 import com.ruoyi.basicData.domain.TFees;
 import com.ruoyi.basicData.mapper.TCorpsMapper;
 import com.ruoyi.basicData.mapper.TFeesMapper;
-import com.ruoyi.basicData.mapper.TGoodsMapper;
 import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.exception.WarehouseException;
 import com.ruoyi.common.utils.DateUtils;
@@ -21,13 +19,16 @@ import com.ruoyi.system.domain.SysConfig;
 import com.ruoyi.system.mapper.SysConfigMapper;
 import com.ruoyi.system.mapper.SysDeptMapper;
 import com.ruoyi.warehouseBusiness.domain.BillnoDel;
+import com.ruoyi.warehouseBusiness.domain.TAnnex;
 import com.ruoyi.warehouseBusiness.domain.TWarehouseAgreement;
 import com.ruoyi.warehouseBusiness.domain.TWarehouseAgreementitems;
 import com.ruoyi.warehouseBusiness.domain.dto.CalculateStorageFeesDTO;
 import com.ruoyi.warehouseBusiness.domain.dto.StorageFeeRangeDTO;
+import com.ruoyi.warehouseBusiness.domain.enums.AnnexActEnum;
 import com.ruoyi.warehouseBusiness.domain.enums.WarehouseTypeEnum;
 import com.ruoyi.warehouseBusiness.domain.vo.StorageFeeCalculationResultVO;
 import com.ruoyi.warehouseBusiness.mapper.BillnoDelMapper;
+import com.ruoyi.warehouseBusiness.mapper.TAnnexMapper;
 import com.ruoyi.warehouseBusiness.mapper.TWarehouseAgreementMapper;
 import com.ruoyi.warehouseBusiness.mapper.TWarehouseAgreementitemsMapper;
 import com.ruoyi.warehouseBusiness.service.ITWarehouseAgreementService;
@@ -64,7 +65,7 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
     private TCorpsMapper tCorpsMapper;
 
     @Autowired
-    private TGoodsMapper tGoodsMapper;
+    private TAnnexMapper annexMapper;
 
     @Autowired
     private TFeesMapper tFeesMapper;
@@ -97,15 +98,10 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
         TWarehouseAgreement tWarehouseAgreement = tWarehouseAgreementMapper.selectTWarehouseAgreementById(fId);
         // 客户表
         List<Long> corpsId = new ArrayList<>();
-        // 用户表
-        List<SysUser> sysUserList = new ArrayList<>();
-        // 商品
-        //List<String> goodsId = new ArrayList<>();
         // 费用
         List<Long> feesId = new ArrayList<>();
         if (!StringUtils.isNull(tWarehouseAgreement)) {
             corpsId.add(tWarehouseAgreement.getfCorpid());
-            //goodsId.add(tWarehouseAgreement.getfGoodsid());
             map.put("tWarehouseAgreement", tWarehouseAgreement);
         }
         // 协议从表
@@ -117,6 +113,20 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
                 feesId.add(fees.getfFeeid());
             }
         }
+        // 附件
+        Long type;
+        if (tWarehouseAgreement.getfFeetypeid() < 1) {
+            type = AnnexActEnum.STORAGE_FEE.getType();
+        } else {
+            type = AnnexActEnum.HOMEWORK_FEE.getType();
+        }
+        TAnnex annex = new TAnnex();
+        annex.setfPid(fId);
+        annex.setfActid(type);
+        List<TAnnex> annexList = annexMapper.selectTAnnexList(annex);
+        if (StringUtils.isNotEmpty(annexList)) {
+            map.put("attachList", annexList);
+        }
         List<TCorps> corpsList = new ArrayList<>();
         List<Long> corpsIdList = StringUtils.integerDeduplication(corpsId);
         for (Long corpId : corpsIdList) {
@@ -125,14 +135,6 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
                 corpsList.add(corps);
             }
         }
-        /*List<TGoods> goodsList = new ArrayList<>();
-        List<String> goodsIdList = goodsId.stream().distinct().collect(Collectors.toList());
-        for (String goods : goodsIdList) {
-            TGoods tGoods = tGoodsMapper.selectTGoodsById(Long.valueOf(goods));
-            if (StringUtils.isNotNull(tGoods)) {
-                goodsList.add(tGoods);
-            }
-        }*/
         List<TFees> feesList = new ArrayList<>();
         List<Long> longList = StringUtils.integerDeduplication(feesId);
         for (Long fees : longList) {
@@ -142,7 +144,6 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
             }
         }
         map.put("corps", corpsList);
-        // map.put("goodsList", goodsList);
         map.put("feesList", feesList);
         map.put("tWarehouseAgreementitems", tWarehouseAgreementitemss);
         map.put("dept", sysDeptMapper.selectDeptById(tWarehouseAgreement.getfDeptid()));
@@ -183,9 +184,15 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
      */
     @Override
     @Transactional
-    public AjaxResult insertTWarehouseAgreement(String agreement, String agreementitems, LoginUser loginUser, int fFeetypeid) {
-        Long fPid = null;
+    public AjaxResult insertTWarehouseAgreement(String agreement, String agreementitems, String attachments, LoginUser loginUser, int fFeetypeid) {
+        Long fPid;
+        Long type;
         Map<String, Object> map = new HashMap<>();
+        if (fFeetypeid < 1) {
+            type = AnnexActEnum.STORAGE_FEE.getType();
+        } else {
+            type = AnnexActEnum.HOMEWORK_FEE.getType();
+        }
         TWarehouseAgreement tWarehouseAgreement = JSONArray.parseObject(agreement, TWarehouseAgreement.class);
         if (StringUtils.isNull(tWarehouseAgreement.getfId())) {
             // 如果是新数据
@@ -207,6 +214,7 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
             tWarehouseAgreement.setUpdateTime(new Date());
             tWarehouseAgreementMapper.updateTWarehouseAgreement(tWarehouseAgreement);
             tWarehouseAgreementitemsMapper.deleteByFPid(fPid);
+            annexMapper.deleteByPid(fPid, type);
         }
         //  从表添加
         if (StringUtils.isNotNull(agreementitems) && !"[]".equals(agreementitems)) {
@@ -219,6 +227,24 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
                 tWarehouseAgreementitemsMapper.insertTWarehouseAgreementitems(tWarehouseAgreementitems);
             }
         }
+        //  附件添加
+        if (StringUtils.isNotNull(attachments) && !"[]".equals(attachments)) {
+            JSONArray jsonDrArray = JSONArray.parseArray(attachments);
+            List<TAnnex> annexList = JSONObject.parseArray(jsonDrArray.toJSONString(), TAnnex.class);
+            annexList.forEach(li -> {
+                li.setfPid(fPid);
+                li.setfActid(type);
+                if (Objects.nonNull(li.getfId())) {
+                    li.setCreateTime(new Date());
+                    li.setCreateBy(loginUser.getUsername());
+                } else {
+                    li.setUpdateTime(new Date());
+                    li.setUpdateBy(loginUser.getUsername());
+                }
+                annexMapper.insertTAnnex(li);
+            });
+            map.put("attachList", annexList);
+        }
         TWarehouseAgreementitems tWarehouseAgreementitems = new TWarehouseAgreementitems();
         tWarehouseAgreementitems.setfPid(fPid);
         map.put("tWarehouseAgreement", tWarehouseAgreement);
@@ -237,8 +263,15 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
      */
     @Override
     @Transactional
-    public AjaxResult tWarehouseAgreementSubmit(String agreement, String agreementitems, LoginUser loginUser, int fFeetypeid) {
-        Long fPid = null;
+    public AjaxResult tWarehouseAgreementSubmit(String agreement, String agreementitems, String attachments, LoginUser loginUser, int fFeetypeid) {
+        Long fPid;
+        Long type;
+        Map<String, Object> map = new HashMap<>();
+        if (fFeetypeid < 1) {
+            type = AnnexActEnum.STORAGE_FEE.getType();
+        } else {
+            type = AnnexActEnum.HOMEWORK_FEE.getType();
+        }
         TWarehouseAgreement tWarehouseAgreement = JSONArray.parseObject(agreement, TWarehouseAgreement.class);
         if (StringUtils.isNull(tWarehouseAgreement.getfId())) {
             // 如果是新数据
@@ -260,6 +293,7 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
             tWarehouseAgreement.setUpdateTime(new Date());
             tWarehouseAgreementMapper.updateTWarehouseAgreement(tWarehouseAgreement);
             tWarehouseAgreementitemsMapper.deleteByFPid(fPid);
+            annexMapper.deleteByPid(fPid, type);
         }
         //  从表添加
         if (StringUtils.isNotNull(agreementitems) && !"[]".equals(agreementitems)) {
@@ -272,6 +306,24 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
                 tWarehouseAgreementitemsMapper.insertTWarehouseAgreementitems(tWarehouseAgreementitems);
             }
         }
+        //  附件添加
+        if (StringUtils.isNotNull(attachments) && !"[]".equals(attachments)) {
+            JSONArray jsonDrArray = JSONArray.parseArray(attachments);
+            List<TAnnex> annexList = JSONObject.parseArray(jsonDrArray.toJSONString(), TAnnex.class);
+            annexList.forEach(li -> {
+                li.setfPid(fPid);
+                li.setfActid(type);
+                if (Objects.nonNull(li.getfId())) {
+                    li.setCreateTime(new Date());
+                    li.setCreateBy(loginUser.getUsername());
+                } else {
+                    li.setUpdateTime(new Date());
+                    li.setUpdateBy(loginUser.getUsername());
+                }
+                annexMapper.insertTAnnex(li);
+            });
+            map.put("attachList", annexList);
+        }
         // 这里加个判断取系统参数来确定是否需要启用审批流
         String key = "";
         boolean isApprove = false;
@@ -393,6 +445,7 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
      * @return 结果
      */
     @Override
+    @Transactional
     public int deleteTWarehouseAgreementByIds(Long[] fIds) {
         // 取出业务编号、 放入 billno_del
         for (Long id : fIds) {
@@ -402,9 +455,19 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
             BillnoDel billnoDel = new BillnoDel();
             billnoDel.setBillType("WA");
             billnoDel.setBillNo(tWarehouseAgreement.getfBillno());
+
+            Long type;
+            if (tWarehouseAgreement.getfFeetypeid() < 1) {
+                type = AnnexActEnum.STORAGE_FEE.getType();
+            } else {
+                type = AnnexActEnum.HOMEWORK_FEE.getType();
+            }
             billnoDelMapper.insertBillnoDel(billnoDel);
+            tWarehouseAgreementitemsMapper.deleteByFPid(id);
+            annexMapper.deleteByPid(id, type);
         }
-        return tWarehouseAgreementMapper.deleteTWarehouseAgreementByIds(fIds);
+        tWarehouseAgreementMapper.deleteTWarehouseAgreementByIds(fIds);
+        return 1;
     }
 
     /**

+ 6 - 0
ruoyi-warehouse/src/main/resources/mapper/basicData/TWarehouseMapper.xml

@@ -10,6 +10,7 @@
         <result property="ancestors" column="ancestors"/>
         <result property="orderNum" column="order_num"/>
         <result property="fNo" column="f_no"/>
+        <result property="fIsBonded" column="f_is_bonded"/>
         <result property="fName" column="f_name"/>
         <result property="fAddr" column="f_addr"/>
         <result property="fTotalgross" column="f_totalgross"/>
@@ -33,6 +34,7 @@
                ancestors,
                order_num,
                f_no,
+               f_is_bonded,
                f_name,
                f_addr,
                f_totalgross,
@@ -55,6 +57,7 @@
         <include refid="selectTWarehouseVo"/>
         <where>
             <if test="parentId != null  and parentId != ''">and parent_id = #{parentId}</if>
+            <if test="fIsBonded != null  and fIsBonded != ''">and f_is_bonded = #{fIsBonded}</if>
             <if test="ancestors != null  and ancestors != ''">and ancestors like concat('%', #{ancestors}, '%')</if>
             <if test="fNo != null  and fNo != ''">and f_no like concat('%', #{fNo}, '%')</if>
             <if test="fName != null  and fName != ''">and f_name like concat('%', #{fName}, '%')</if>
@@ -89,6 +92,7 @@
             <if test="ancestors != null and ancestors != ''">ancestors,</if>
             <if test="orderNum != null and orderNum != ''">order_num,</if>
             <if test="fNo != null and fNo != ''">f_no,</if>
+            <if test="fIsBonded != null and fIsBonded != ''">f_is_bonded,</if>
             <if test="fName != null and fName != ''">f_name,</if>
             <if test="fAddr != null and fAddr != ''">f_addr,</if>
             <if test="fTotalgross != null">f_totalgross,</if>
@@ -110,6 +114,7 @@
             <if test="ancestors != null and ancestors != ''">#{ancestors},</if>
             <if test="orderNum != null and orderNum != ''">#{orderNum},</if>
             <if test="fNo != null and fNo != ''">#{fNo},</if>
+            <if test="fIsBonded != null and fIsBonded != ''">#{fIsBonded},</if>
             <if test="fName != null and fName != ''">#{fName},</if>
             <if test="fAddr != null and fAddr != ''">#{fAddr},</if>
             <if test="fTotalgross != null">#{fTotalgross},</if>
@@ -135,6 +140,7 @@
             <if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
             <if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
             <if test="fNo != null and fNo != ''">f_no = #{fNo},</if>
+            <if test="fIsBonded != null and fIsBonded != ''">f_is_bonded = #{fIsBonded},</if>
             <if test="fName != null and fName != ''">f_name = #{fName},</if>
             <if test="fAddr != null and fAddr != ''">f_addr = #{fAddr},</if>
             <if test="fTotalgross != null">f_totalgross = #{fTotalgross},</if>

+ 21 - 20
ruoyi-warehouse/src/main/resources/mapper/finance/TFeeMapper.xml

@@ -1794,28 +1794,29 @@
 
     <select id="warehouseBillsFeesProfitList" resultType="java.util.Map">
         SELECT
-        t.f_id AS fSrcpid,
-        c.f_name AS fName,
-        c1.f_name AS fFeesName,
-        w.f_mblno AS fMblno,
-        w.f_product_name AS fProductName,
-        w.f_marks AS fMarks,
-        t.f_billtype AS fBilltype,
-        w.f_review_date AS fReviewDate,
-        sum( CASE f_dc WHEN 'D' THEN f_amount ELSE 0 END ) fAmount,
-        sum( CASE f_dc WHEN 'C' THEN f_amount ELSE 0 END ) fStlamount,
-        sum( CASE f_dc WHEN 'D' THEN f_amount ELSE 0 END ) - sum( CASE f_dc WHEN 'C' THEN f_amount ELSE 0 END )
-        nnfinished
+            t.f_id AS fSrcpid,
+            c.f_name AS fName,
+            c1.f_name AS fFeesName,
+            w.f_mblno AS fMblno,
+            w.f_product_name AS fProductName,
+            w.f_marks AS fMarks,
+            t.f_billtype AS fBilltype,
+            w.f_review_date AS fReviewDate,
+            sum( CASE f_dc WHEN 'D' THEN f_amount ELSE 0 END ) fAmount,
+            sum( CASE f_dc WHEN 'C' THEN f_amount ELSE 0 END ) fStlamount,
+            sum( CASE f_dc WHEN 'D' THEN f_amount ELSE 0 END ) - sum( CASE f_dc WHEN 'C' THEN f_amount ELSE 0 END )
+            nnfinished
         FROM
-        t_warehousebillsfees w
-        LEFT JOIN t_warehousebills t ON t.f_id = w.f_pid
-        left join sys_user u on t.create_by = u.user_name
-        left join sys_dept d on t.f_bsdeptid = d.dept_id
-        LEFT JOIN t_corps c ON c.f_id = t.f_corpid
-        LEFT JOIN t_corps c1 ON c1.f_id = w.f_corpid
+            t_warehousebillsfees w
+            LEFT JOIN t_warehousebills t ON t.f_id = w.f_pid
+            left join sys_user u on t.create_by = u.user_name
+            left join sys_dept d on t.f_bsdeptid = d.dept_id
+            LEFT JOIN t_corps c ON c.f_id = t.f_corpid
+            LEFT JOIN t_corps c1 ON c1.f_id = w.f_corpid
         <where>
-            <if test="fCorpid != null  and fCorpid != ''">and t.f_corpid = #{fCorpid}</if>
-            <if test="fToCorpid != null  and fToCorpid != ''">and w.f_corpid = #{fToCorpid}</if>
+            <if test="fCorpid != null and fCorpid != ''">and t.f_corpid = #{fCorpid}</if>
+            <if test="fToCorpid != null and fToCorpid != ''">and w.f_corpid = #{fToCorpid}</if>
+            <if test="fSalesmanId != null and fSalesmanId != ''">and t.f_salesman_id = #{fSalesmanId}</if>
             <if test="fMblno != null  and fMblno != ''">and w.f_mblno like concat('%', #{fMblno}, '%')</if>
             <if test="fMarks != null and fMarks != ''">and w.f_marks like concat('%', #{fMarks}, '%')</if>
             <if test="fProductName != null and fProductName != ''">and w.f_product_name like concat('%',

+ 116 - 0
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TAnnexMapper.xml

@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.warehouseBusiness.mapper.TAnnexMapper">
+    
+    <resultMap type="TAnnex" id="TAnnexResult">
+        <result property="fId"    column="f_id"    />
+        <result property="fPid"    column="f_pid"    />
+        <result property="fActid"    column="f_actid"    />
+        <result property="fLineno"    column="f_lineno"    />
+        <result property="fName"    column="f_name"    />
+        <result property="fDesc"    column="f_desc"    />
+        <result property="fUrl"    column="f_url"    />
+        <result property="fStatus"    column="f_status"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectTAnnexVo">
+        select f_id, f_pid, f_actid, f_lineno, f_name, f_desc, f_url, f_status, del_flag, create_by, create_time, update_by, update_time, remark from t_annex
+    </sql>
+
+    <select id="selectTAnnexList" parameterType="TAnnex" resultMap="TAnnexResult">
+        <include refid="selectTAnnexVo"/>
+        <where>  
+            <if test="fPid != null "> and f_pid = #{fPid}</if>
+            <if test="fActid != null "> and f_actid = #{fActid}</if>
+            <if test="fLineno != null  and fLineno != ''"> and f_lineno = #{fLineno}</if>
+            <if test="fName != null  and fName != ''"> and f_name like concat('%', #{fName}, '%')</if>
+            <if test="fDesc != null  and fDesc != ''"> and f_desc = #{fDesc}</if>
+            <if test="fUrl != null  and fUrl != ''"> and f_url = #{fUrl}</if>
+            <if test="fStatus != null  and fStatus != ''"> and f_status = #{fStatus}</if>
+        </where>
+    </select>
+    
+    <select id="selectTAnnexById" parameterType="Long" resultMap="TAnnexResult">
+        <include refid="selectTAnnexVo"/>
+        where f_id = #{fId}
+    </select>
+        
+    <insert id="insertTAnnex" parameterType="TAnnex" useGeneratedKeys="true" keyProperty="fId">
+        insert into t_annex
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="fId != null">f_id,</if>
+            <if test="fPid != null">f_pid,</if>
+            <if test="fActid != null">f_actid,</if>
+            <if test="fLineno != null">f_lineno,</if>
+            <if test="fName != null">f_name,</if>
+            <if test="fDesc != null">f_desc,</if>
+            <if test="fUrl != null">f_url,</if>
+            <if test="fStatus != null">f_status,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="fId != null">#{fId},</if>
+            <if test="fPid != null">#{fPid},</if>
+            <if test="fActid != null">#{fActid},</if>
+            <if test="fLineno != null">#{fLineno},</if>
+            <if test="fName != null">#{fName},</if>
+            <if test="fDesc != null">#{fDesc},</if>
+            <if test="fUrl != null">#{fUrl},</if>
+            <if test="fStatus != null">#{fStatus},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTAnnex" parameterType="TAnnex">
+        update t_annex
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="fPid != null">f_pid = #{fPid},</if>
+            <if test="fActid != null">f_actid = #{fActid},</if>
+            <if test="fLineno != null">f_lineno = #{fLineno},</if>
+            <if test="fName != null">f_name = #{fName},</if>
+            <if test="fDesc != null">f_desc = #{fDesc},</if>
+            <if test="fUrl != null">f_url = #{fUrl},</if>
+            <if test="fStatus != null">f_status = #{fStatus},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where f_id = #{fId}
+    </update>
+
+    <delete id="deleteTAnnexById" parameterType="Long">
+        delete from t_annex where f_id = #{fId}
+    </delete>
+
+    <delete id="deleteTAnnexByIds" parameterType="String">
+        delete from t_annex where f_id in 
+        <foreach item="fId" collection="array" open="(" separator="," close=")">
+            #{fId}
+        </foreach>
+    </delete>
+    <delete id="deleteByPid">
+        DELETE FROM t_annex WHERE f_pid = #{pid} and f_actid = #{actId}
+    </delete>
+
+</mapper>

+ 7 - 1
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsitemsMapper.xml

@@ -36,6 +36,7 @@
         <result property="fCntrno" column="f_cntrno"/>
         <result property="fTruckno" column="f_truckno"/>
         <result property="fMarks" column="f_marks"/>
+        <result property="fActualWeight" column="f_actual_weight"/>
         <result property="fBillstatus" column="f_billstatus"/>
         <result property="delFlag" column="del_flag"/>
         <result property="createBy" column="create_by"/>
@@ -107,7 +108,7 @@
     <sql id="selectTWarehousebillsitemsVo">
         select f_id, f_pid, f_srcid, f_lineno, f_billno, f_goodsid, f_mblno, f_src_bsdate, f_originalbillno, f_transfer_warehouselocid, f_warehouselocid,
          f_originalbilldate, f_bsdate, f_billingway, f_chargedate, f_boxno, f_goodsval, f_cntqty, f_packagespecs, f_cntrtype, f_planvolumn,
-          f_planqty, f_plangrossweight, f_plannetweight, f_volumn, f_qty, f_grossweight, f_netweight, f_cntrno, f_truckno, f_marks, f_billstatus,
+          f_planqty, f_plangrossweight, f_plannetweight, f_volumn, f_qty, f_grossweight, f_netweight, f_cntrno, f_truckno, f_marks, f_actual_weight, f_billstatus,
            del_flag, create_by, create_time, update_by, update_time, remark, f_inventory_days, f_storage_fee_deadline, f_amt, f_billing_days,
             f_driver_name, f_driver_tel, f_driver_id_car, f_serial_number, f_is_pass, f_billtype, f_billing_qty, f_billing_deadline, f_business_type,
              f_is_inventory, f_warehouse_information, f_orgwarehouse_information, f_labour, f_fleet, f_stevedore, f_lntype, f_forkliftman,
@@ -155,6 +156,7 @@
             <if test="fTruckno != null  and fTruckno != ''">and f_truckno = #{fTruckno}</if>
             <if test="fBillstatus != null  and fBillstatus != ''">and f_billstatus = #{fBillstatus}</if>
             <if test="fMarks != null  and fMarks != ''">and f_marks = #{fMarks}</if>
+            <if test="fActualWeight != null  and fActualWeight != ''">and f_actual_weight = #{fActualWeight}</if>
             <if test="fInventoryDays != null ">and f_inventory_days = #{fInventoryDays}</if>
             <if test="fAmt != null ">and f_amt = #{fAmt}</if>
             <if test="fBillingDays != null ">and f_billing_days = #{fBillingDays}</if>
@@ -208,6 +210,7 @@
             item.f_driver_id_car AS fDriverIdCar,
             item.f_serial_number AS fSerialNumber,
             item.f_marks AS fMarks,
+            item.f_actual_weight AS fActualWeight,
             item.f_grossweight AS fGrossweight,
             item.f_is_inventory AS fIsInventory,
             item.f_business_type AS fBusinessType,
@@ -285,6 +288,7 @@
             <if test="fCntrno != null">f_cntrno,</if>
             <if test="fTruckno != null">f_truckno,</if>
             <if test="fMarks != null">f_marks,</if>
+            <if test="fActualWeight != null">f_actual_weight,</if>
             <if test="fBillstatus != null">f_billstatus,</if>
             <if test="delFlag != null">del_flag,</if>
             <if test="createBy != null">create_by,</if>
@@ -353,6 +357,7 @@
             <if test="fCntrno != null">#{fCntrno},</if>
             <if test="fTruckno != null">#{fTruckno},</if>
             <if test="fMarks != null">#{fMarks},</if>
+            <if test="fActualWeight != null">#{fActualWeight},</if>
             <if test="fBillstatus != null">#{fBillstatus},</if>
             <if test="delFlag != null">#{delFlag},</if>
             <if test="createBy != null">#{createBy},</if>
@@ -424,6 +429,7 @@
             <if test="fCntrno != null">f_cntrno = #{fCntrno},</if>
             <if test="fTruckno != null">f_truckno = #{fTruckno},</if>
             <if test="fMarks != null">f_marks = #{fMarks},</if>
+            <if test="fActualWeight != null">f_actual_weight = #{fActualWeight},</if>
             <if test="fBillstatus != null and fBillstatus != ''">f_billstatus = #{fBillstatus},</if>
             <if test="delFlag != null">del_flag = #{delFlag},</if>
             <if test="createBy != null">create_by = #{createBy},</if>