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

[CODE]: 财务货权方更换数据类型、回显展示

maxianghua 4 éve
szülő
commit
799b8a0617

+ 3 - 3
ruoyi-warehouse/src/main/java/com/ruoyi/finance/domain/TFee.java

@@ -41,7 +41,7 @@ public class TFee extends BaseEntity {
      * 货权方
      */
     @Excel(name = "货权方")
-    private Long fCtrlcorpid;
+    private String  fCtrlcorpid;
 
     /**
      * 结算单位(下拉模糊搜索)
@@ -119,11 +119,11 @@ public class TFee extends BaseEntity {
         return fBillno;
     }
 
-    public void setfCtrlcorpid(Long fCtrlcorpid) {
+    public void setfCtrlcorpid(String fCtrlcorpid) {
         this.fCtrlcorpid = fCtrlcorpid;
     }
 
-    public Long getfCtrlcorpid() {
+    public String getfCtrlcorpid() {
         return fCtrlcorpid;
     }
 

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

@@ -78,6 +78,20 @@ public class TWareHouseFees {
         this.timeExamine = timeExamine;
     }
 
+
+    /**
+     * 查询时间区间 对账日期
+     */
+    private List<String> timeReconci;
+
+    public List<String> getTimeReconci() {
+        return timeReconci;
+    }
+
+    public void setTimeReconci(List<String> timeReconci) {
+        this.timeReconci = timeReconci;
+    }
+
     /**
      * 查询时间区间 入(出)库日期
      */

+ 1 - 1
ruoyi-warehouse/src/main/java/com/ruoyi/finance/service/ITFeeService.java

@@ -21,7 +21,7 @@ public interface ITFeeService {
      * @param fId 财务数据主ID
      * @return 财务数据主
      */
-    public TFee selectTFeeById(Long fId);
+    public Map<String, Object> selectTFeeById(Long fId);
 
     /**
      * 查询财务数据主列表

+ 82 - 2
ruoyi-warehouse/src/main/java/com/ruoyi/finance/service/impl/TFeeServiceImpl.java

@@ -2,6 +2,10 @@ package com.ruoyi.finance.service.impl;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+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.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.utils.DateUtils;
@@ -14,6 +18,7 @@ import com.ruoyi.finance.mapper.TFeeMapper;
 import com.ruoyi.finance.service.ITFeeService;
 import com.ruoyi.warehouseBusiness.domain.*;
 import com.ruoyi.warehouseBusiness.mapper.BillnoDelMapper;
+import com.ruoyi.warehouseBusiness.mapper.TWarehouseBillsMapper;
 import com.ruoyi.warehouseBusiness.service.impl.BillnoSerialServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -40,6 +45,15 @@ public class TFeeServiceImpl implements ITFeeService {
     @Autowired
     private BillnoDelMapper billnoDelMapper;
 
+    @Autowired
+    private TCorpsMapper tCorpsMapper;
+
+    @Autowired
+    private TFeesMapper tFeesMapper;
+
+    @Autowired
+    private TWarehouseBillsMapper tWarehouseBillsMapper;
+
     /**
      * 查询财务数据主
      *
@@ -47,8 +61,74 @@ public class TFeeServiceImpl implements ITFeeService {
      * @return 财务数据主
      */
     @Override
-    public TFee selectTFeeById(Long fId) {
-        return tFeeMapper.selectTFeeById(fId);
+    public Map<String, Object> selectTFeeById(Long fId) {
+        Map<String, Object> map = new HashMap<>();
+        // 客户表
+        List<Long> corpsId = new ArrayList<>();
+        // 费用
+        List<Long> feesId = new ArrayList<>();
+
+        TFee tFee=tFeeMapper.selectTFeeById(fId);
+        if (StringUtils.isNotNull(tFee.getfCorpid())) {
+            corpsId.add(tFee.getfCorpid());
+        }
+        corpsId.add(tFee.getfCorpid());
+
+        // 查询从表数据
+        TFeeDo tFeeDo = new TFeeDo();
+        tFeeDo.setfPid(fId);
+        List<TFeeDo> tFeeDoList=  tFeeDoMapper.selectTFeeDoList(tFeeDo);
+        List<Map<String, Object>> feeDoList=new ArrayList<>();
+        if (StringUtils.isNotEmpty(tFeeDoList)) {
+            for (TFeeDo fees : tFeeDoList) {
+                Map<String, Object> map1 = new HashMap<>();
+                feesId.add(fees.getfFeeid());
+                // 查询主表
+                TWarehouseBills tWarehousebills = tWarehouseBillsMapper.selectTWarehousebillsById(fees.getfSrcpid());
+                map1.put("fId",fees.getfId());
+                map1.put("fSrcid",fees.getfSrcid());
+                map1.put("fSrcpid",fees.getfSrcpid());
+                map1.put("fMblno",tWarehousebills.getfMblno());
+                map1.put("fBscorpno",tWarehousebills.getfBscorpno());
+                map1.put("fProductName",tWarehousebills.getfProductName());
+                map1.put("fBsdate",tWarehousebills.getfBsdate());
+                map1.put("fFeeid",fees.getfFeeid());
+                map1.put("fSrcdc",fees.getfSrcdc());
+                map1.put("fAmt",fees.getfAmt());
+                if(tWarehousebills.getfBilltype().equals("SJRK")){
+                    map1.put("fBilltype","入库");
+                } else if(tWarehousebills.getfBilltype().equals("SJCK")){
+                    map1.put("fBilltype","出库");
+                } else if(tWarehousebills.getfBilltype().equals("CKDB")){
+                    map1.put("fBilltype","调拨");
+                } else if(tWarehousebills.getfBilltype().equals("HQZY")){
+                    map1.put("fBilltype","货权转移");
+                }
+                feeDoList.add(map1);
+            }
+        }
+
+        List<TCorps> corpsList = new ArrayList<>();
+        List<Long> corpsIdList = StringUtils.integerDeduplication(corpsId);
+        for (Long corpId : corpsIdList) {
+            TCorps corps = tCorpsMapper.selectTCorpsById(corpId);
+            if (StringUtils.isNotNull(corps)) {
+                corpsList.add(corps);
+            }
+        }
+        List<TFees> feesList = new ArrayList<>();
+        List<Long> longList = StringUtils.integerDeduplication(feesId);
+        for (Long fees : longList) {
+            TFees tFees = tFeesMapper.selectTFeesById(fees);
+            if (StringUtils.isNotNull(tFees)) {
+                feesList.add(tFees);
+            }
+        }
+        map.put("tFee",tFee);
+        map.put("corps",corpsList);
+        map.put("feesList", feesList);
+        map.put("feeDoList",feeDoList);
+        return map;
     }
 
     /**

+ 1 - 3
ruoyi-warehouse/src/main/resources/mapper/finance/TFeeDoMapper.xml

@@ -48,10 +48,9 @@
         where f_id = #{fId}
     </select>
 
-    <insert id="insertTFeeDo" parameterType="TFeeDo">
+    <insert id="insertTFeeDo" parameterType="TFeeDo" useGeneratedKeys="true" keyProperty="fId">
         insert into t_fee_do
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="fId != null">f_id,</if>
             <if test="fPid != null">f_pid,</if>
             <if test="fLineno != null">f_lineno,</if>
             <if test="fSrcid != null">f_srcid,</if>
@@ -69,7 +68,6 @@
             <if test="updateTime != null">update_time,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="fId != null">#{fId},</if>
             <if test="fPid != null">#{fPid},</if>
             <if test="fLineno != null">#{fLineno},</if>
             <if test="fSrcid != null">#{fSrcid},</if>

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

@@ -185,22 +185,20 @@
             <if test="map.tWareHouseFees.fToCorpid != null  and map.tWareHouseFees.fToCorpid != ''">and w.f_corpid = #{map.tWareHouseFees.fToCorpid} </if>
             <if test="map.tWareHouseFees.fMblno != null  and map.tWareHouseFees.fMblno != ''">and t.f_mblno  like concat('%', #{map.tWareHouseFees.fMblno}, '%') </if>
             <if test="map.tWareHouseFees.fStatementNo != null and map.tWareHouseFees.fStatementNo != ''">and w.f_statement_no  like concat('%', #{map.tWareHouseFees.fStatementNo}, '%') </if>
-            <choose>
-                <when test="map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != '' and map.tWareHouseFees.fReconciliation == '1' ">
-                    and  w.f_accamount_date IS NOT NULL
-                </when>
-                <otherwise>
-                    and  w.f_accamount_date IS  NULL
-                </otherwise>
-            </choose>
-            <!--<choose>
-                <when test="map.tWareHouseFees.fDc != null and map.tWareHouseFees.fDc != '' and map.tWareHouseFees.fDc == 'D' ">
-                    and  w.f_dc = #{map.tWareHouseFees.fDc}
-                </when>
-                <otherwise>
-                    and  w.f_dc = #{map.tWareHouseFees.fDc}
-                </otherwise>
-            </choose>-->
+
+            <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "1" '>
+                and  w.f_accamount_date IS NOT NULL
+            </if>
+            <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "0" '>
+                and  w.f_accamount_date IS  NULL
+            </if>
+
+            <if test='map.tWareHouseFees.fDc != null and map.tWareHouseFees.fDc != "" and map.tWareHouseFees.fDc == "D" '>
+                    and w.f_dc = #{map.tWareHouseFees.fDc}
+            </if>
+            <if test='map.tWareHouseFees.fDc != null and map.tWareHouseFees.fDc != "" and map.tWareHouseFees.fDc == "C" '>
+                    and w.f_dc = #{map.tWareHouseFees.fDc}
+            </if>
             <if test="map.tWareHouseFees.fFeeid != null  and  map.tWareHouseFees.fFeeid != '' ">
                 and  w.f_feeid in
                 <foreach collection="map.tWareHouseFees.fFeeid" item="id" index="index" open="(" close=")" separator=",">
@@ -219,6 +217,13 @@
             <if test='map.tWareHouseFees.timeInterval != null and map.tWareHouseFees.timeInterval[1] != null and map.tWareHouseFees.timeInterval[1]!= ""'>
                 and t.f_bsdate &lt;= #{map.tWareHouseFees.timeInterval[1]}
             </if>
+            <if test='map.tWareHouseFees.timeReconci != null and map.tWareHouseFees.timeReconci[0] != null and map.tWareHouseFees.timeReconci[0]!= ""'>
+                and w.f_accamount_date &gt;= #{map.tWareHouseFees.timeReconci[0]}
+            </if>
+            <if test='map.tWareHouseFees.timeReconci != null and map.tWareHouseFees.timeReconci[1] != null and map.tWareHouseFees.timeReconci[1]!= ""'>
+                and w.f_accamount_date &lt;= #{map.tWareHouseFees.timeReconci[1]}
+            </if>
+
             and  t.f_review_date IS NOT NULL
         </where>
     </select>