caifc 3 år sedan
förälder
incheckning
947b123028

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/finance/TInvoiceController.java

@@ -79,7 +79,7 @@ public class TInvoiceController extends BaseController {
     }
 
     /**
-     * 新增财务数据主
+     * 新增财务数据主  
      */
     @PreAuthorize("@ss.hasPermi('finance:charge:add')")
     @Log(title = "财务数据主", businessType = BusinessType.INSERT)

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/reportManagement/TWhgenlegController.java

@@ -241,7 +241,7 @@ public class TWhgenlegController extends BaseController {
      * 网站查询库存总账列表
      */
     @DataScope(deptAlias = "d", userAlias = "u")
-    @GetMapping("/websiteWhGenLegList")
+    @GetMapping("/whgenlegList")
     public TableDataInfo websiteWhGenLegList(TWhgenleg tWhgenleg) {
         startPage();
         List<Map<String, Object>> list = tWhgenlegService.selectInventoryMapList(tWhgenleg);

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

@@ -133,6 +133,16 @@ public class TWareHouseFees extends BaseEntity {
     @TableField(exist = false)
     private Long stlTypeid;
 
+    /**
+     *  是否已审核
+     */
+    @TableField(exist = false)
+    private Long isReviewed;
+
+    public void setIsReviewed(Long isReviewed) {
+        this.isReviewed = isReviewed;
+    }
+
     public Long getfSalesmanId() {
         return fSalesmanId;
     }

+ 5 - 1
ruoyi-warehouse/src/main/java/com/ruoyi/finance/domain/dto/FeeDTO.java

@@ -2,7 +2,6 @@ package com.ruoyi.finance.domain.dto;
 
 import lombok.Data;
 
-import java.io.Serializable;
 import java.util.List;
 
 /**
@@ -31,6 +30,11 @@ public class FeeDTO {
     // 费用状态
     private Long fBillstatus;
 
+    /**
+     * 是否已审核
+     */
+    private Long isReviewed;
+
     // 审核时间集合
     private List<String> fAuditList;
 

+ 28 - 26
ruoyi-warehouse/src/main/java/com/ruoyi/finance/service/impl/TFeeServiceImpl.java

@@ -709,32 +709,34 @@ public class TFeeServiceImpl implements ITFeeService {
         boolean isApprove = false;
         Map<String, Object> messageMap = new HashMap<>();
         long actId = 0L;
-        if ("DZ".equals(fBilltype)) {
-            actId = 210L;
-            key = "warehouse.contrast.ApprovalFlow";
-        } else if ("SF".equals(fBilltype)) {
-            actId = 220L;
-            key = "warehouse.charge.ApprovalFlow";
-        } else if ("FF".equals(fBilltype)) {
-            actId = 230L;
-            key = "warehouse.payment.ApprovalFlow";
-        } else if ("KHDZ".equals(fBilltype)) {
-            actId = 430L;
-            key = "warehouse.kaiHeContrast.ApprovalFlow";
-        } else if ("KHSF".equals(fBilltype)) {
-            actId = 440L;
-            key = "warehouse.kaiHeCharge.ApprovalFlow";
-        } else if ("KHFF".equals(fBilltype)) {
-            actId = 450L;
-            key = "warehouse.kaiHePayment.ApprovalFlow";
-        }
-        SysConfig sysConfig = sysConfigMapper.checkConfigKeyUnique(key);
-        if (StringUtils.isNull(sysConfig) && !fBilltype.equals(FeesTypeEnum.INVOICE.getType())) {
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-            return AjaxResult.error("系统参数异常,未找到开启审批流参数");
-        }
-        if ("0".equals(sysConfig.getConfigValue()) && !fBilltype.equals(FeesTypeEnum.INVOICE.getType())) {
-            isApprove = true;
+        if (!fBilltype.equals(FeesTypeEnum.INVOICE.getType())) {
+            if ("DZ".equals(fBilltype)) {
+                actId = 210L;
+                key = "warehouse.contrast.ApprovalFlow";
+            } else if ("SF".equals(fBilltype)) {
+                actId = 220L;
+                key = "warehouse.charge.ApprovalFlow";
+            } else if ("FF".equals(fBilltype)) {
+                actId = 230L;
+                key = "warehouse.payment.ApprovalFlow";
+            } else if ("KHDZ".equals(fBilltype)) {
+                actId = 430L;
+                key = "warehouse.kaiHeContrast.ApprovalFlow";
+            } else if ("KHSF".equals(fBilltype)) {
+                actId = 440L;
+                key = "warehouse.kaiHeCharge.ApprovalFlow";
+            } else if ("KHFF".equals(fBilltype)) {
+                actId = 450L;
+                key = "warehouse.kaiHePayment.ApprovalFlow";
+            }
+            SysConfig sysConfig = sysConfigMapper.checkConfigKeyUnique(key);
+            if (StringUtils.isNull(sysConfig)) {
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return AjaxResult.error("系统参数异常,未找到开启审批流参数");
+            }
+            if ("0".equals(sysConfig.getConfigValue())) {
+                isApprove = true;
+            }
         }
         TFee tFee = JSONArray.parseObject(tfee, TFee.class);
         String billstatus = "";

+ 17 - 26
ruoyi-warehouse/src/main/resources/mapper/finance/TFeeMapper.xml

@@ -2423,8 +2423,8 @@
             WHEN w.f_dc = 'C' THEN
             '付'
             END AS fSrcdcName,
-            ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmtdr,
-            ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmt,
+            ifnull( w.f_amount, 0 ) - ifnull( w.f_invamount, 0 ) AS fAmtdr,
+            ifnull( w.f_amount, 0 ) - ifnull( w.f_invamount, 0 ) AS fAmt,
             dict.dict_label AS fFeeunitid,
             w.f_qty AS fQty,
             w.f_unitprice AS fUnitprice,
@@ -2538,7 +2538,7 @@
 
     <select id="selectFinancialLedgerList" resultMap="feeVOResult">
         SELECT
-            c.f_name AS f_fees_name, w.f_corpid, w.f_mblno, w.f_billstatus,
+            c.f_name AS f_fees_name, w.f_corpid, w.f_mblno, w.f_billstatus, w.f_review_date,
             SUM( w.f_amount ) AS f_amount, SUM( w.f_stlamount ) AS f_stlamount,
             ifnull( SUM( w.f_amount ), 0 ) - ifnull( SUM( w.f_stlamount ), 0 ) AS nnfinished
         FROM
@@ -2549,6 +2549,7 @@
             LEFT JOIN t_corps c ON c.f_id = w.f_corpid
             LEFT JOIN t_fees f ON w.f_feeid = f.f_id
         <where>
+            w.f_dc = #{fDc}
             <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="fMblno != null  and fMblno != ''">and w.f_mblno like concat('%', #{fMblno}, '%')</if>
@@ -2556,28 +2557,18 @@
             <if test="fProductName != null and fProductName != ''">and w.f_product_name like concat('%',
                 #{fProductName}, '%')
             </if>
-            <if test='fBillstatus != null and fBillstatus != "" and fBillstatus == "0" '>
+            <if test="isReviewed != null and isReviewed == 0">
                 and w.f_billstatus != 6
             </if>
-            <if test='fBillstatus != null and fBillstatus != "" and fBillstatus == "1" '>
+            <if test="isReviewed != null and isReviewed == 1">
                 and w.f_billstatus = 6
             </if>
-            <if test='fDc != null and fDc != "" and fDc == "D" '>
-                and w.f_dc = #{fDc}
-            </if>
-            <if test='fDc != null and fDc != "" and fDc == "C" '>
-                and w.f_dc = #{fDc}
-            </if>
-            <if test='timeExamine != null and timeExamine[0] != null and timeExamine[0]!= ""'>
-                and t.f_review_date &gt;= #{timeExamine[0]}
-            </if>
-            <if test='timeExamine != null and timeExamine[1] != null and timeExamine[1]!= ""'>
-                and t.f_review_date &lt;= #{timeExamine[1]}
-            </if>
-            <if test='fReconciliation!= null and fReconciliation != "" and fReconciliation == "0" '>
+            <if test="fReconciliation!= null and fReconciliation != '' and fReconciliation == '0'">
                 and ifnull(w.f_amount, 0) - ifnull(w.f_stlamount, 0) != 0
             </if>
-            and w.f_review_date IS NOT NULL
+            <if test="timeExamine != null and timeExamine[0] != null and timeExamine[0]!= ''">
+                and w.f_review_date between #{timeExamine[0]} and #{timeExamine[1]}
+            </if>
             ${params.dataScope}
         </where>
         GROUP BY
@@ -2588,7 +2579,7 @@
     <select id="selectFinancialLedgerDetails" resultMap="feeVOResult">
         SELECT t.f_id AS f_srcpid, c.f_name AS f_fees_name, w.f_mblno AS f_mblno,
             w.f_product_name, w.f_marks, t.f_billtype,
-            t.f_review_date,
+            w.f_review_date,
             IF ( w.f_feeid = #{feesId}, w.f_amount, 0.00 ) storage_fee,
             IF ( w.f_feeid != #{feesId}, w.f_amount, 0.00 ) other_fee,
             w.f_amount, w.f_stlamount AS fStlamount,
@@ -2601,16 +2592,16 @@
             LEFT JOIN t_fees f ON w.f_feeid = f.f_id
         where
             w.f_dc = #{fDc}
-            <if test="fCorpId != null and fCorpId != ''">and t.f_corpid = #{fCorpId}</if>
-            <if test='fAuditList != null and fAuditList[0] != null'>
-                and t.f_review_date BETWEEN #{fAuditList[0]} and #{fAuditList[1]}
-            </if>
-            <if test='fBillstatus != null and fBillstatus != "" and fBillstatus == "0" '>
+            <if test="fCorpId != null and fCorpId != ''">and w.f_corpid = #{fCorpId}</if>
+            <if test='isReviewed != null and isReviewed == 0 '>
                 and w.f_billstatus != 6
             </if>
-            <if test='fBillstatus != null and fBillstatus != "" and fBillstatus == "1" '>
+            <if test='isReviewed != null and isReviewed == 1 '>
                 and w.f_billstatus = 6
             </if>
+            <if test='fAuditList != null and fAuditList[0] != null'>
+                and w.f_review_date BETWEEN #{fAuditList[0]} and #{fAuditList[1]}
+            </if>
         GROUP BY
         w.f_id
     </select>

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

@@ -533,12 +533,12 @@
             /*判断确认仓库发票*/
             <if test="map.billType == 'FP'">
                 f_invnos = #{map.tFee.fBillno},
-                f_invamount = f_invamount + #{map.tFeeDo.fAmt},
+                f_invamount = f_invamount + #{map.tFeeDo.fAmt}
             </if>
             /*判断撤销仓库发票*/
             <if test="map.billType == 'FPRevoke'">
                 f_invnos = #{map.tFee.fBillno},
-                f_invamount = f_invamount - #{map.tFeeDo.fAmt},
+                f_invamount = f_invamount - #{map.tFeeDo.fAmt}
             </if>
         </trim>
         where f_id = #{map.tFeeDo.fSrcid}