Forráskód Böngészése

新增其他账务菜单、细节优化

Sun 3 éve
szülő
commit
8555a099fd
15 módosított fájl, 442 hozzáadás és 50 törlés
  1. 3 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
  2. 2 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/reportManagement/TWarehousebillsitemsSummaryController.java
  3. 138 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/warehouseBusiness/TOtherFeesController.java
  4. 18 1
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/TWarehouse.java
  5. 3 0
      ruoyi-warehouse/src/main/java/com/ruoyi/approvalFlow/domain/dto/AppAuditItemDTO.java
  6. 4 2
      ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/mapper/TWhgenlegMapper.java
  7. 1 1
      ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/ITWhgenlegService.java
  8. 3 4
      ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/impl/TWhgenlegServiceImpl.java
  9. 35 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITWarehouseBillsService.java
  10. 169 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java
  11. 30 27
      ruoyi-warehouse/src/main/resources/mapper/approvalFlow/AuditItemsMapper.xml
  12. 6 5
      ruoyi-warehouse/src/main/resources/mapper/basicData/TFeesMapper.xml
  13. 9 2
      ruoyi-warehouse/src/main/resources/mapper/basicData/TWarehouseMapper.xml
  14. 19 4
      ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml
  15. 2 1
      ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml

+ 3 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java

@@ -164,7 +164,9 @@ public class SysUserController extends BaseController {
 //            return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
 //        }
         // 更新密码
-        user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
+        if(StringUtils.isNotEmpty(user.getPassword())) {
+            user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
+        }
         user.setUpdateBy(SecurityUtils.getUsername());
         return toAjax(userService.updateUser(user));
     }

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/reportManagement/TWarehousebillsitemsSummaryController.java

@@ -137,8 +137,8 @@ public class TWarehousebillsitemsSummaryController extends BaseController {
      * bi大屏客户概况
      */
     @GetMapping("/biCustomerInfo")
-    public AjaxResult biCustomerInfo(Long warehouseId, Long customerId) {
-        return AjaxResult.success(itWhgenlegService.biCustomerInfo(warehouseId, customerId));
+    public AjaxResult biCustomerInfo(Long warehouseId, Long customerId, String mode) {
+        return AjaxResult.success(itWhgenlegService.biCustomerInfo(warehouseId, customerId, mode));
     }
 
     /**

+ 138 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/warehouseBusiness/TOtherFeesController.java

@@ -0,0 +1,138 @@
+package com.ruoyi.web.controller.warehouse.warehouseBusiness;
+
+import com.ruoyi.common.annotation.DataScope;
+import com.ruoyi.common.annotation.RepeatSubmit;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
+import com.ruoyi.warehouseBusiness.service.ITWarehouseBillsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 其他账务Controller
+ */
+@RestController
+@RequestMapping("/warehouseBusiness/otherFees")
+public class TOtherFeesController extends BaseController {
+
+    @Autowired
+    private ITWarehouseBillsService itWarehouseBillsService;
+
+    /**
+     * 查询其他账务
+     *
+     * @param tWarehouseBills
+     * @return
+     */
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:otherFees:list')")
+    @DataScope(deptAlias = "d", userAlias = "u")
+    @GetMapping("/list")
+    public TableDataInfo list(TWarehouseBills tWarehouseBills) {
+        startPage();
+        // 仓库其他账务
+        tWarehouseBills.setfBilltype("QTZW");
+        List<Map<String, Object>> list = itWarehouseBillsService.getWarehouseBusinessList(tWarehouseBills);
+        list.forEach(map -> map.put("fBilltype", "其他账务"));
+        return getDataTable(list);
+    }
+
+    /**
+     * 查看其他账务详情
+     *
+     * @param fId 其他账务id
+     * @return
+     */
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:otherFees:edit')")
+    @GetMapping("/{fId}")
+    @RepeatSubmit
+    public AjaxResult getInfo(@PathVariable("fId") Long fId) {
+        if (StringUtils.isNull(fId)) {
+            return AjaxResult.error("未找到查询id,请确认");
+        }
+        return itWarehouseBillsService.selectOtherFees(fId);
+    }
+
+    /**
+     * 其他账务保存接口
+     *
+     * @param tWarehouseBills 主表业务
+     * @param feesCr          收费
+     * @param feesDr          付费
+     * @return
+     */
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:otherFees:add')")
+    @PostMapping("/save")
+    @RepeatSubmit
+    public AjaxResult save(@RequestParam("warehouseBills") String tWarehouseBills,
+                           @RequestParam("feesCr") String feesCr,
+                           @RequestParam("feesDr") String feesDr) {
+        if (StringUtils.isEmpty(tWarehouseBills)) {
+            return AjaxResult.error("未找到主表保存信息,请确认");
+        }
+        String type = "save";
+        return itWarehouseBillsService.saveOtherFees(tWarehouseBills, feesCr, feesDr, type);
+    }
+
+    /**
+     * 其他账务撤销接口
+     *
+     * @param fId 主表业务
+     * @return
+     */
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:otherFees:add')")
+    @GetMapping("/revoke/{fId}")
+    @RepeatSubmit
+    public AjaxResult revoke(@PathVariable("fId") Long fId) {
+        if (StringUtils.isNull(fId)) {
+            return AjaxResult.error("未找到主表保存信息,请确认");
+        }
+        String type = "revoke";
+        return itWarehouseBillsService.revokeOtherFees(fId, type);
+    }
+
+    /**
+     * 其他账务删除接口
+     *
+     * @param fId 主表业务
+     * @return
+     */
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:containerPort:remove')")
+    @GetMapping("/remove/{fId}")
+    @RepeatSubmit
+    public AjaxResult removeContainerPort(@PathVariable("fId") Long fId) {
+        if (StringUtils.isNull(fId)) {
+            return AjaxResult.error("未找到主表保存信息,请确认");
+        }
+        String type = "remove";
+        return itWarehouseBillsService.revokeOtherFees(fId, type);
+    }
+
+    /**
+     * 其他账务提交接口
+     *
+     * @param tWarehouseBills 主表业务
+     * @param feesCr          收费
+     * @param feesDr          付费
+     * @return
+     */
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:containerPort:add')")
+    @PostMapping("/add")
+    @RepeatSubmit
+    public AjaxResult add(@RequestParam("warehouseBills") String tWarehouseBills,
+                          @RequestParam("feesCr") String feesCr,
+                          @RequestParam("feesDr") String feesDr) {
+        if (StringUtils.isEmpty(tWarehouseBills)) {
+            return AjaxResult.error("未找到主表保存信息,请确认");
+        }
+        String type = "add";
+        return itWarehouseBillsService.saveOtherFees(tWarehouseBills, feesCr, feesDr, type);
+    }
+
+}

+ 18 - 1
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/TWarehouse.java

@@ -49,6 +49,10 @@ public class TWarehouse extends BaseEntity
     @Excel(name = "名称")
     private String fName;
 
+    /** 简称 */
+    @Excel(name = "简称")
+    private String fCname;
+
     /** 是否保税 */
     @Excel(name = "是否保税")
     private String fIsBonded;
@@ -150,6 +154,7 @@ public class TWarehouse extends BaseEntity
     {
         return fId;
     }
+
     public void setfNo(String fNo)
     {
         this.fNo = fNo;
@@ -159,6 +164,7 @@ public class TWarehouse extends BaseEntity
     {
         return fNo;
     }
+
     public void setfName(String fName)
     {
         this.fName = fName;
@@ -168,6 +174,17 @@ public class TWarehouse extends BaseEntity
     {
         return fName;
     }
+
+    public void setfCname(String fCname)
+    {
+        this.fCname = fCname;
+    }
+
+    public String getfCname()
+    {
+        return fCname;
+    }
+
     public void setfAddr(String fAddr)
     {
         this.fAddr = fAddr;
@@ -273,4 +290,4 @@ public class TWarehouse extends BaseEntity
                 .append("remark", getRemark())
                 .toString();
     }
-}
+}

+ 3 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/approvalFlow/domain/dto/AppAuditItemDTO.java

@@ -21,6 +21,9 @@ public class AppAuditItemDTO extends AuditItems {
     // 提单号
     private String fMblno;
 
+    // 发货方
+    private String fShipper;
+
     // 状态
     private String auditStatus;
 

+ 4 - 2
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/mapper/TWhgenlegMapper.java

@@ -205,7 +205,8 @@ public interface TWhgenlegMapper {
      */
     public List<Map<String, Object>> biCustomerInfo(@Param("external") String external,
                                                     @Param("warehouseId") Long warehouseId,
-                                                    @Param("customerId") Long customerId);
+                                                    @Param("customerId") Long customerId,
+                                                    @Param("mode") String mode);
 
     /**
      * bi大屏仓库概况
@@ -213,5 +214,6 @@ public interface TWhgenlegMapper {
      * @return
      */
     public List<Map<String, Object>> biWarehouseInfo(@Param("external") String external,
-                                                    @Param("customerId") Long customerId);
+                                                     @Param("customerId") Long customerId,
+                                                     @Param("mode") String mode);
 }

+ 1 - 1
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/ITWhgenlegService.java

@@ -178,7 +178,7 @@ public interface ITWhgenlegService {
      *
      * @return
      */
-    public List<Map<String, Object>> biCustomerInfo(Long warehouseId, Long customerId);
+    public List<Map<String, Object>> biCustomerInfo(Long warehouseId, Long customerId, String mode);
 
     /**
      * bi库存数量

+ 3 - 4
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/impl/TWhgenlegServiceImpl.java

@@ -651,7 +651,7 @@ public class TWhgenlegServiceImpl implements ITWhgenlegService {
      * @return
      */
     @Override
-    public List<Map<String, Object>> biCustomerInfo(Long warehouseId, Long customerId) {
+    public List<Map<String, Object>> biCustomerInfo(Long warehouseId, Long customerId, String mode) {
         String external = null;
         SysUser user = SecurityUtils.getLoginUser().getUser();
         if ("外部用户".equals(user.getDept().getDeptName())) {
@@ -659,10 +659,9 @@ public class TWhgenlegServiceImpl implements ITWhgenlegService {
         }
 
         if (warehouseId == null && customerId != null) {
-
+            return tWhgenlegMapper.biWarehouseInfo(external, customerId, mode);
         }
-
-        return tWhgenlegMapper.biCustomerInfo(external, warehouseId, customerId);
+        return tWhgenlegMapper.biCustomerInfo(external, warehouseId, customerId, mode);
     }
 
     /**

+ 35 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITWarehouseBillsService.java

@@ -57,6 +57,14 @@ public interface ITWarehouseBillsService {
     public List<Map<String, Object>> selectWarehouseBusinessList(TWarehouseBills tWarehousebills);
 
     /**
+     * 查询详情主表列表
+     *
+     * @param tWarehousebills 详情主表
+     * @return 详情主表集合
+     */
+    public List<Map<String, Object>> getWarehouseBusinessList(TWarehouseBills tWarehousebills);
+
+    /**
      * 新增详情主表
      *
      * @param tWarehouseBills       仓库主表
@@ -501,6 +509,33 @@ public interface ITWarehouseBillsService {
     public AjaxResult revokeContainerPort(Long fId, String type);
 
     /**
+     * 查看其他账务
+     *
+     * @param fId 其他账务id
+     * @return
+     */
+    public AjaxResult selectOtherFees(Long fId);
+
+    /**
+     * 其他账务保存、提交接口
+     *
+     * @param tWarehouseBills 主表业务
+     * @param feesCr          收费
+     * @param feesDr          付费
+     * @return
+     */
+    public AjaxResult saveOtherFees(String tWarehouseBills, String feesCr, String feesDr, String type);
+
+    /**
+     * 其他账务撤销
+     *
+     * @param fId  主表id
+     * @param type
+     * @return
+     */
+    public AjaxResult revokeOtherFees(Long fId, String type);
+
+    /**
      * 导入Excel生成箱信息
      *
      * @param file excel

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

@@ -474,6 +474,17 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
     }
 
     /**
+     * 查询详情主表列表
+     *
+     * @param tWarehousebills 详情主表
+     * @return 详情主表
+     */
+    @Override
+    public List<Map<String, Object>> getWarehouseBusinessList(TWarehouseBills tWarehousebills) {
+        return tWarehouseBillsMapper.selectWarehouseBusinessList(tWarehousebills);
+    }
+
+    /**
      * 查询导出所需主表列表
      *
      * @param tWarehousebills 详情主表
@@ -1975,6 +1986,164 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         return AjaxResult.success();
     }
 
+    /**
+     * 查看其他账务
+     *
+     * @param fId 其他账务id
+     * @return
+     */
+    @Override
+    public AjaxResult selectOtherFees(Long fId) {
+        TWarehouseBills warehouseBills = tWarehouseBillsMapper.selectTWarehousebillsById(fId);
+        if (StringUtils.isNull(warehouseBills)) {
+            return AjaxResult.error("未找到主表信息,请确认该信息是否存在");
+        }
+
+        TWarehousebillsfees fee1 = new TWarehousebillsfees();
+        fee1.setfPid(fId);
+        fee1.setfDc("D");
+        TWarehousebillsfees fee2 = new TWarehousebillsfees();
+        fee2.setfPid(fId);
+        fee2.setfDc("C");
+
+        return AjaxResult.success(new HashMap<String, Object>() {{
+            this.put("warehouseBills", warehouseBills);
+            this.put("feesDrList", tWarehousebillsfeesMapper.selectTWarehousebillsfeesList(fee1));
+            this.put("feesCrList", tWarehousebillsfeesMapper.selectTWarehousebillsfeesList(fee2));
+        }});
+    }
+
+    /**
+     * 其他账务保存、提交接口
+     *
+     * @param tWarehouseBills 主表业务
+     * @param feesCr          收费
+     * @param feesDr          付费
+     * @return
+     */
+    @Override
+    @Transactional
+    public AjaxResult saveOtherFees(String tWarehouseBills, String feesCr, String feesDr, String type) {
+        TWarehouseBills warehouseBills = JSONArray.parseObject(tWarehouseBills, TWarehouseBills.class);
+        warehouseBills.setfBilltype("QTZW");
+        // 判断提单号是否存在
+        if (StringUtils.isNull(warehouseBills.getfId()) && tWarehouseBillsMapper.selectContainMblno(warehouseBills) > 0) {
+            return AjaxResult.error("该参看编号已存在");
+        }
+        Long billStatus = 2L;
+        if ("add".equals(type)) {
+            billStatus = 6L;
+            warehouseBills.setfReviewDate(warehouseBills.getfBsdate());
+            warehouseBills.setfBillstatus(billStatus);
+        } else {
+            if (StringUtils.isNull(warehouseBills.getfBillstatus())) {
+                warehouseBills.setfBillstatus(billStatus);
+            }
+        }
+        if (StringUtils.isNull(warehouseBills.getfId())) {
+            warehouseBills.setCreateTime(new Date());
+            warehouseBills.setCreateBy(SecurityUtils.getUsername());
+            warehouseBills.setfDeptid(SecurityUtils.getLoginUser().getUser().getDeptId());
+            warehouseBills.setfBsdeptid(SecurityUtils.getLoginUser().getUser().getDeptId());
+            tWarehouseBillsMapper.insertTWarehousebills(warehouseBills);
+        } else {
+            warehouseBills.setUpdateTime(new Date());
+            warehouseBills.setUpdateBy(SecurityUtils.getUsername());
+            tWarehouseBillsMapper.updateTWarehousebills(warehouseBills);
+        }
+
+        tWarehousebillsfeesMapper.deleteByFPid(warehouseBills.getfId());
+        if (StringUtils.isNotEmpty(feesCr) && !"[]".equals(feesCr)) {
+            JSONArray jsonDrArray = JSONArray.parseArray(feesCr);
+            List<TWarehousebillsfees> crs = JSONObject.parseArray(jsonDrArray.toJSONString(), TWarehousebillsfees.class);
+            int line = 1;
+            for (TWarehousebillsfees cr : crs) {
+                if (StringUtils.isNull(cr.getfCorpid()) || StringUtils.isNull(cr.getfFeeunitid())) {
+                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                    return AjaxResult.error("付款费用第" + line + "行,缺少必填信息");
+                }
+                cr.setfDc("C");
+                cr.setfBillstatus(billStatus);
+                cr.setCreateTime(new Date());
+                cr.setfPid(warehouseBills.getfId());
+                cr.setCreateBy(SecurityUtils.getUsername());
+                tWarehousebillsfeesMapper.insertTWarehousebillsfees(cr);
+                line++;
+            }
+        }
+        if (StringUtils.isNotEmpty(feesDr) && !"[]".equals(feesDr)) {
+            JSONArray jsonDrArray = JSONArray.parseArray(feesDr);
+            List<TWarehousebillsfees> crs = JSONObject.parseArray(jsonDrArray.toJSONString(), TWarehousebillsfees.class);
+            int line = 1;
+            for (TWarehousebillsfees dr : crs) {
+                if (StringUtils.isNull(dr.getfCorpid()) || StringUtils.isNull(dr.getfFeeunitid())) {
+                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                    return AjaxResult.error("收款费用第" + line + "行,缺少必填信息");
+                }
+                dr.setfDc("D");
+                dr.setfBillstatus(billStatus);
+                dr.setCreateTime(new Date());
+                dr.setfPid(warehouseBills.getfId());
+                dr.setCreateBy(SecurityUtils.getUsername());
+                tWarehousebillsfeesMapper.insertTWarehousebillsfees(dr);
+                line++;
+            }
+        }
+        return AjaxResult.success();
+    }
+
+    /**
+     * 其他账务撤销
+     *
+     * @param fId  主表id
+     * @param type 类型
+     * @return
+     */
+    @Override
+    @Transactional
+    public AjaxResult revokeOtherFees(Long fId, String type) {
+        TWarehouseBills warehouseBills = tWarehouseBillsMapper.selectTWarehousebillsById(fId);
+        if (StringUtils.isNull(warehouseBills)) {
+            return AjaxResult.error("未找到主表信息,请确认是否存在");
+        }
+        TWarehousebillsfees fees = new TWarehousebillsfees();
+        fees.setfPid(fId);
+        List<TWarehousebillsfees> feesList = tWarehousebillsfeesMapper.selectTWarehousebillsfeesList(fees);
+        if (StringUtils.isEmpty(feesList)) {
+            return AjaxResult.error("未找到费用信息,请确认是否存在");
+        }
+        for (TWarehousebillsfees fee : feesList) {
+            if (StringUtils.isNotEmpty(fee.getfStatementNo()) || StringUtils.isNotEmpty(fee.getfStlamountNo())) {
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return AjaxResult.error("费用信息存在已对账或已收费付费操作,无法撤销");
+            }
+            if ("remove".equals(type)) {
+                tWarehousebillsfeesMapper.deleteTWarehousebillsfeesById(fee.getfId());
+            } else {
+                fee.setfStatus("2");
+                fee.setUpdateTime(new Date());
+                fee.setUpdateBy(SecurityUtils.getUsername());
+                tWarehousebillsfeesMapper.updateTWarehousebillsfees(fee);
+            }
+        }
+        if ("remove".equals(type)) {
+            if (warehouseBills.getfBillstatus() != 2L) {
+                return AjaxResult.error("主表状态有误,请确认状态是否为暂存状态");
+            }
+            tWarehouseBillsMapper.deleteTWarehousebillsById(fId);
+            return AjaxResult.success();
+        } else {
+            if (warehouseBills.getfBillstatus() != 6L) {
+                return AjaxResult.error("主表状态有误,请确认状态是否已提交");
+            }
+        }
+        warehouseBills.setfBillstatus(2L);
+        warehouseBills.setUpdateTime(new Date());
+        warehouseBills.setUpdateBy(SecurityUtils.getUsername());
+        tWarehouseBillsMapper.updateTWarehousebills(warehouseBills);
+        return AjaxResult.success();
+    }
+
     @Override
     public AjaxResult importCreateCompanyMsg(MultipartFile file) throws Exception {
         List<TWarehousebillsCntritemsExcel> fleetCompanyMsgs = new ArrayList<>();

+ 30 - 27
ruoyi-warehouse/src/main/resources/mapper/approvalFlow/AuditItemsMapper.xml

@@ -248,33 +248,33 @@
             LEFT JOIN t_corps corp ON corp.f_id = item.refno1
             LEFT JOIN audit_items_users us ON us.pid = item.id
             LEFT JOIN sys_user usr ON usr.user_id = item.audit_user_id
-        where
-        1=1
-        <if test="billNo != null  and billNo != ''"> and item.bill_no = #{billNo}</if>
-        <if test="actId != null  and actId != ''"> and item.act_id = #{actId}</if>
-        <if test="refno2 != null  and refno2 != ''"> and item.refno2 = #{refno2}</if>
-        <if test="refno3 != null  and refno3 != ''">
-            and item.refno3 like concat('%', #{refno3}, '%') or item.bill_no like concat('%', #{refno3}, '%')
-        </if>
-        <if test="billId != null  and billId != ''"> and item.bill_id like concat('%', #{billId}, '%')</if>
-        <if test="refno1 != null  and refno1 != ''"> and corp.f_name like concat('%', #{refno1}, '%')</if>
-        <if test="sendUserId != null  and sendUserId != ''"> and item.send_user_id like concat('%', #{sendUserId}, '%')</if>
-        <if test="billTime != null  and billTime != ''"> and item.bill_time = #{billTime}</if>
-        <if test="fidStatus != null  and fidStatus != ''"> AND item.fid_status = #{fidStatus}</if>
-        <if test="auditStatus != null  and auditStatus != ''"> AND item.audit_status = #{auditStatus} and us.audit_status =  #{auditStatus}</if>
-        <if test="auditUserId != null  and auditUserId != ''"> AND us.user_id = #{auditUserId}</if>
-        <if test='sendTime != null and sendTime[0] != null and sendTime[0]!= ""'>
-            and item.send_time &gt;= #{sendTime[0]}
-        </if>
-        <if test='sendTime != null and sendTime[1] != null and sendTime[1]!= ""'>
-            and item.send_time &lt;= #{sendTime[1]}
-        </if>
-        <if test='auditOpTime != null and auditOpTime[0] != null and auditOpTime[0]!= ""'>
-            and item.audit_op_time &gt;= #{auditOpTime[0]}
-        </if>
-        <if test='auditOpTime != null and auditOpTime[1] != null and auditOpTime[1]!= ""'>
-            and item.audit_op_time &lt;= #{auditOpTime[1]}
-        </if>
+        <where>
+            <if test="billNo != null  and billNo != ''"> and item.bill_no = #{billNo}</if>
+            <if test="actId != null  and actId != ''"> and item.act_id = #{actId}</if>
+            <if test="refno2 != null  and refno2 != ''"> and item.refno2 = #{refno2}</if>
+            <if test="refno3 != null  and refno3 != ''">
+                and (item.refno3 like concat('%', #{refno3}, '%') or item.bill_no like concat('%', #{refno3}, '%'))
+            </if>
+            <if test="billId != null  and billId != ''"> and item.bill_id like concat('%', #{billId}, '%')</if>
+            <if test="refno1 != null  and refno1 != ''"> and corp.f_name like concat('%', #{refno1}, '%')</if>
+            <if test="sendUserId != null  and sendUserId != ''"> and item.send_user_id like concat('%', #{sendUserId}, '%')</if>
+            <if test="billTime != null  and billTime != ''"> and item.bill_time = #{billTime}</if>
+            <if test="fidStatus != null  and fidStatus != ''"> AND item.fid_status = #{fidStatus}</if>
+            <if test="auditStatus != null  and auditStatus != ''"> AND item.audit_status = #{auditStatus} and us.audit_status =  #{auditStatus}</if>
+            <if test="auditUserId != null  and auditUserId != ''"> AND us.user_id = #{auditUserId}</if>
+            <if test='sendTime != null and sendTime[0] != null and sendTime[0]!= ""'>
+                and item.send_time &gt;= #{sendTime[0]}
+            </if>
+            <if test='sendTime != null and sendTime[1] != null and sendTime[1]!= ""'>
+                and item.send_time &lt;= #{sendTime[1]}
+            </if>
+            <if test='auditOpTime != null and auditOpTime[0] != null and auditOpTime[0]!= ""'>
+                and item.audit_op_time &gt;= #{auditOpTime[0]}
+            </if>
+            <if test='auditOpTime != null and auditOpTime[1] != null and auditOpTime[1]!= ""'>
+                and item.audit_op_time &lt;= #{auditOpTime[1]}
+            </if>
+        </where>
         ORDER BY
             item.send_time DESC
     </select>
@@ -401,6 +401,9 @@
             <if test='audit.corpId != null and audit.corpId!= ""'>
                 and w.f_corpid = #{audit.corpId}
             </if>
+            <if test='audit.fShipper != null and audit.fShipper!= ""'>
+                and w.f_shipper like concat('%', #{audit.fShipper}, '%')
+            </if>
             <if test='audit.sendList != null and audit.sendList[1]!= ""'>
                 and a.send_time BETWEEN #{audit.sendList[0]} AND #{audit.sendList[1]}
             </if>

+ 6 - 5
ruoyi-warehouse/src/main/resources/mapper/basicData/TFeesMapper.xml

@@ -140,9 +140,9 @@
 
     <select id="getFeeStatistics" resultType="map">
         select
-            ifnull(round(sum(if(f_dc = 'D', f_amount, 0)) / 10000, 2), 0) as receivable,
-            ifnull(round(sum(if(f_dc = 'D', f_stlamount, 0)) / 10000, 2), 0) as received,
-            ifnull(round((sum(if(f_dc = 'D', f_amount, 0)) - sum(if(f_dc = 'C', f_amount, 0))) / 10000, 2), 0) as profit
+            ifnull(round(sum(if(wf.f_dc = 'D', wf.f_amount, 0)) / 10000, 2), 0) as receivable,
+            ifnull(round(sum(if(wf.f_dc = 'D', wf.f_stlamount, 0)) / 10000, 2), 0) as received,
+            ifnull(round((sum(if(wf.f_dc = 'D', wf.f_amount, 0)) - sum(if(wf.f_dc = 'C', wf.f_amount, 0))) / 10000, 2), 0) as profit
         from t_warehousebillsfees wf
             left join t_warehousebills tw on wf.f_pid = tw.f_id
             left join sys_user u on tw.create_by = u.user_name
@@ -154,13 +154,14 @@
     <select id="getArrearsStatistics" resultType="map">
         select
             ifnull(tc.f_cname, tc.f_name) as name,
-            ifnull(round(sum(f_amount) / 10000, 2), 0) as receivable
+            ifnull(round(sum(wf.f_amount) / 10000, 2), 0) as receivable
         from t_warehousebillsfees wf
             left join t_warehousebills tw on wf.f_pid = tw.f_id
             left join sys_user u on tw.create_by = u.user_name
             left join sys_dept d on tw.f_bsdeptid = d.dept_id
             left join t_corps tc on wf.f_corpid = tc.f_id
-        where f_dc = 'D'
+        where wf.f_dc = 'D'
+            and wf.f_review_date is not null
             ${params.dataScope}
         group by wf.f_corpid
         order by receivable desc

+ 9 - 2
ruoyi-warehouse/src/main/resources/mapper/basicData/TWarehouseMapper.xml

@@ -12,6 +12,7 @@
         <result property="fNo" column="f_no"/>
         <result property="fIsBonded" column="f_is_bonded"/>
         <result property="fName" column="f_name"/>
+        <result property="fCname" column="f_cname"/>
         <result property="fAddr" column="f_addr"/>
         <result property="fTotalgross" column="f_totalgross"/>
         <result property="fContacts" column="f_contacts"/>
@@ -37,6 +38,7 @@
                f_no,
                f_is_bonded,
                f_name,
+               f_cname,
                f_addr,
                f_totalgross,
                f_contacts,
@@ -62,6 +64,7 @@
             <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>
+            <if test="fCname != null  and fCname != ''">and f_cname like concat('%', #{fCname}, '%')</if>
             <if test="fAddr != null  and fAddr != ''">and f_addr like concat('%', #{fAddr}, '%')</if>
             <if test="fTotalgross != null ">and f_totalgross like concat('%', #{fTotalgross}, '%')</if>
             <if test="fContacts != null  and fContacts != ''">and f_contacts = #{fContacts}</if>
@@ -76,8 +79,8 @@
 
     <select id="lazyList" parameterType="TWarehouse" resultMap="TWarehouseResult">
         select
-            ware.f_id, ware.parent_id, ware.ancestors, ware.order_num,ware.f_no, ware.f_name,ware.f_totalgross, ware.f_location,
-               ware.f_addr,ware.f_contacts,ware.f_tel,ware.f_charg,ware.f_is_bonded,ware.remark,ware.f_status,
+            ware.f_id, ware.parent_id, ware.ancestors, ware.order_num, ware.f_no, ware.f_name, ware.f_cname, ware.f_totalgross, ware.f_location,
+               ware.f_addr, ware.f_contacts, ware.f_tel, ware.f_charg, ware.f_is_bonded, ware.remark, ware.f_status,
             (
             SELECT
                 CASE WHEN count( 1 ) > 0 THEN 1 ELSE 0 END
@@ -91,6 +94,7 @@
             <if test="parentId != null">and ware.parent_id = #{parentId}</if>
             <if test="fNo != null  and fNo != ''">and ware.f_no like concat('%', #{fNo}, '%')</if>
             <if test="fName != null  and fName != ''">and ware.f_name like concat('%', #{fName}, '%')</if>
+            <if test="fCname != null  and fCname != ''">and ware.f_cname like concat('%', #{fCname}, '%')</if>
             <if test="fStatus != null  and fStatus != ''">and ware.f_status = #{fStatus}</if>
         </where>
         <!-- 数据范围过滤 -->
@@ -131,6 +135,7 @@
             <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="fCname != null and fCname != ''">f_cname,</if>
             <if test="fAddr != null and fAddr != ''">f_addr,</if>
             <if test="fTotalgross != null">f_totalgross,</if>
             <if test="fContacts != null">f_contacts,</if>
@@ -153,6 +158,7 @@
             <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="fCname != null and fCname != ''">#{fCname},</if>
             <if test="fAddr != null and fAddr != ''">#{fAddr},</if>
             <if test="fTotalgross != null">#{fTotalgross},</if>
             <if test="fContacts != null">#{fContacts},</if>
@@ -179,6 +185,7 @@
             <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="fCname != null and fCname != ''">f_cname = #{fCname},</if>
             <if test="fAddr != null and fAddr != ''">f_addr = #{fAddr},</if>
             <if test="fTotalgross != null">f_totalgross = #{fTotalgross},</if>
             <if test="fContacts != null">f_contacts = #{fContacts},</if>

+ 19 - 4
ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml

@@ -1203,7 +1203,9 @@
                 end as quantity
             </if>
         from t_whgenleg
-        <where>
+        where
+            f_qtyD != 0
+            and f_qtyblc != 0
             <if test="beginDate != null and beginDate != ''">and f_bsdate &gt;= #{beginDate}</if>
             <if test="endDate != null and endDate != ''">and f_bsdate &lt;= #{endDate}</if>
             <if test="external != null and external != ''">
@@ -1211,7 +1213,6 @@
             </if>
             <if test="warehouseId != null"> and f_warehouseid = #{warehouseId}</if>
             <if test="customerId != null"> and f_corpid = #{customerId}</if>
-        </where>
     </select>
 
     <select id="stockDays" resultType="map">
@@ -1250,7 +1251,14 @@
     <select id="biCustomerInfo" resultType="map">
         select
             ifnull(tw.f_shipper, tc.f_cname) as customerName,
-            round(ifnull(sum(tw.f_grossweightblc), 0) / 1000) as quantity
+            <if test="mode == null or mode == ''">round(ifnull(sum(tw.f_grossweightblc), 0) / 1000) as quantity</if>
+            <if test="mode != null and mode != ''">
+                case #{mode}
+                when '3' then round(ifnull(sum(tw.f_volumnblc), 0))
+                when '2' then round(ifnull(sum(tw.f_grossweightblc) / 1000, 0))
+                else ifnull(sum(tw.f_qtyblc), 0)
+                end as quantity
+            </if>
         from t_whgenleg tw left join t_corps tc on tw.f_corpid = tc.f_id
         where
             tw.f_qtyD != 0
@@ -1267,7 +1275,14 @@
     <select id="biWarehouseInfo" resultType="map">
         select
             t.f_name as customerName,
-            round(ifnull(sum(tw.f_grossweightblc), 0) / 1000) as quantity
+            <if test="mode == null or mode == ''">round(ifnull(sum(tw.f_grossweightblc), 0) / 1000) as quantity</if>
+            <if test="mode != null and mode != ''">
+                case #{mode}
+                when '3' then round(ifnull(sum(tw.f_volumnblc), 0))
+                when '2' then round(ifnull(sum(tw.f_grossweightblc) / 1000, 0))
+                else ifnull(sum(tw.f_qtyblc), 0)
+                end as quantity
+            </if>
         from t_whgenleg tw left join t_warehouse t on tw.f_warehouseid = t.f_id
         where
             tw.f_qtyD != 0

+ 2 - 1
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml

@@ -635,7 +635,7 @@
             t_warehousebills w
                 LEFT JOIN t_warehousebillsfees wi ON w.f_id = wi.f_pid
                 LEFT JOIN t_warehouse ware ON ware.f_id = wi.f_warehouseid
-                LEFT JOIN sys_dict_data dict ON dict.dict_value = wi.f_feeUnitid,
+                LEFT JOIN sys_dict_data dict ON dict.dict_value = wi.f_billingway,
             ( SELECT @ii := 0 ) AS ii
         WHERE w.f_id = #{fId}
           AND w.f_typeid IS NULL
@@ -2623,6 +2623,7 @@
         <if test="fItemsStatus == null and timeInterval == null and fMblno == null">
             and IF( w.f_planqty IS NOT NULL, w.f_planqty != w.f_qty, w.f_id != '')
         </if>
+        <if test="fCorpid != null and fCorpid != ''">and w.f_corpid = #{fCorpid}</if>
         <if test="fShipper != null and fShipper != ''">and w.f_shipper like concat('%', #{fShipper}, '%')</if>
         <if test="fMblno != null ">and w.f_mblno like concat('%', #{fMblno}, '%')</if>
         <if test="fItemsStatus != null ">and w.f_items_status = #{fItemsStatus}</if>