Browse Source

[CODE]: 财务模块列表展示

maxianghua 4 years ago
parent
commit
2e0520e96e

+ 16 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/finance/TChargeController.java

@@ -112,5 +112,21 @@ public class TChargeController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     *   确认收费
+     */
+    @PreAuthorize("@ss.hasPermi('finance:charge:add')")
+    @Log(title = "财务数据主", businessType = BusinessType.INSERT)
+    @PostMapping(value = "/confirm")
+    @RepeatSubmit
+    public AjaxResult confirm(@RequestParam("tFee") String tFee,
+                          @RequestParam("tFeeDo") String tFeeDo ) {
+        String billsType = "SF";
+        // 获取当前的用户
+        LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
+        return tFeeService.confirm(tFee,tFeeDo,loginUser,billsType);
+    }
+
+
 
 }

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

@@ -18,6 +18,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 财务对账数据Controller
@@ -39,7 +40,7 @@ public class TContrastController extends BaseController {
     public TableDataInfo list(TFee tFee) {
         tFee.setfBilltype("DZ");
         startPage();
-        List<TFee> list = tFeeService.selectTFeeList(tFee);
+        List<Map<String, Object>> list = tFeeService.selectTFeeList1(tFee);
         return getDataTable(list);
     }
 

+ 2 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/finance/mapper/TFeeMapper.java

@@ -29,6 +29,8 @@ public interface TFeeMapper {
      */
     public List<TFee> selectTFeeList(TFee tFee);
 
+    public List<Map<String, Object>> selectTFeeList1(TFee tFee);
+
     /**
      * 新增财务数据主
      *

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

@@ -31,6 +31,8 @@ public interface ITFeeService {
      */
     public List<TFee> selectTFeeList(TFee tFee);
 
+    public List<Map<String, Object>> selectTFeeList1(TFee tFee);
+
     /**
      * 新增财务数据主
      *
@@ -80,4 +82,13 @@ public interface ITFeeService {
      * @return
      */
     public List<Map<String, Object>> warehouseBillsFeesList(TWareHouseFees tWareHouseFees);
+
+    /**
+     *    财务: 对账、收费、付费   流程确认
+     * @param fid
+     * @param loginUser
+     * @param fBilltype
+     * @return
+     */
+    public AjaxResult confirm(String tfee, String tfeeDo ,LoginUser loginUser,String fBilltype);
 }

+ 65 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/finance/service/impl/TFeeServiceImpl.java

@@ -19,6 +19,7 @@ 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.mapper.TWarehousebillsfeesMapper;
 import com.ruoyi.warehouseBusiness.service.impl.BillnoSerialServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -54,6 +55,9 @@ public class TFeeServiceImpl implements ITFeeService {
     @Autowired
     private TWarehouseBillsMapper tWarehouseBillsMapper;
 
+    @Autowired
+    private TWarehousebillsfeesMapper tWarehousebillsfeesMapper;
+
     /**
      * 查询财务数据主
      *
@@ -145,6 +149,11 @@ public class TFeeServiceImpl implements ITFeeService {
         return tFeeMapper.selectTFeeList(tFee);
     }
 
+    @Override
+    public List<Map<String, Object>> selectTFeeList1(TFee tFee) {
+        return tFeeMapper.selectTFeeList1(tFee);
+    }
+
     /**
      * 新增财务数据主
      *
@@ -251,4 +260,60 @@ public class TFeeServiceImpl implements ITFeeService {
         map.put("tWareHouseFees", tWareHouseFees);
         return tFeeMapper.warehouseBillsFeesList(map);
     }
+
+
+    @Override
+    public AjaxResult confirm(String tfee, String tfeeDo, LoginUser loginUser, String fBilltype) {
+        // 更新 主表、从表
+        TFee tFee = JSONArray.parseObject(tfee, TFee.class);
+        tFee.setUpdateBy(loginUser.getUser().getUserName());
+        tFee.setUpdateTime(new Date());
+        tFeeMapper.updateTFee(tFee);
+        // 删除从表
+        tFeeDoMapper.deleteByFPid(tFee.getfId());
+        //  财务从表
+        if (StringUtils.isNotNull(tfeeDo)) {
+            JSONArray jsonDrArray = JSONArray.parseArray(tfeeDo);
+            List<TFeeDo> tFeeDoList = JSONObject.parseArray(jsonDrArray.toJSONString(), TFeeDo.class);
+            for (TFeeDo tFeeDo : tFeeDoList) {
+                tFeeDo.setfPid(tFee.getfId());
+                tFeeDo.setCreateBy(loginUser.getUser().getUserName());
+                tFeeDo.setCreateTime(new Date());
+                tFeeDoMapper.insertTFeeDo(tFeeDo);
+            }
+        }
+        // 更新费用明细
+        updateBillsFees(tFee.getfId(),fBilltype);
+
+        // 审批流程
+
+
+
+        return null;
+    }
+
+    public  void  updateBillsFees(Long fid,String billsType){
+        // 查询从表数据
+        TFee tFee=tFeeMapper.selectTFeeById(fid);
+        TFeeDo tFeeDo = new TFeeDo();
+        tFeeDo.setfPid(fid);
+        List<TFeeDo> tFeeDoList=  tFeeDoMapper.selectTFeeDoList(tFeeDo);
+        // 更新费用明细
+        for (TFeeDo tFeeDo1 : tFeeDoList ){
+            // 查询仓库费用明细表数据
+            TWarehousebillsfees tWarehousebillsfees=new TWarehousebillsfees();
+            tWarehousebillsfees.setfId(tFeeDo1.getfSrcid());
+            if(billsType.equals("DZ")){
+                tWarehousebillsfees.setfStatementNo(tFee.getfBillno());
+                tWarehousebillsfees.setfAccamountDate(tFee.getfAccbilldate());
+            } else {
+                tWarehousebillsfees.setfStlamountNo(tFee.getfBillno());
+                // tWarehousebillsfees.setfStlamount();
+                tWarehousebillsfees.setfStlamountDate(tFee.getfAccbilldate());
+            }
+        }
+    }
+
+
+
 }

+ 34 - 2
ruoyi-warehouse/src/main/resources/mapper/finance/TFeeMapper.xml

@@ -45,6 +45,38 @@
         </where>
     </select>
 
+    <select id="selectTFeeList1" parameterType="TFee" resultType="Map">
+        SELECT
+        f.f_id AS fId,
+        f.f_billno AS fBillno,
+        f.f_ctrlcorpid AS fCtrlcorpid,
+        f.f_corpid AS fCorpid,
+        c.f_name AS fCorpidName,
+        f.f_accbilldate AS fAccbilldate,
+        f.t_mblno AS tMblno,
+        f.f_amtdr AS fAmtdr,
+        f.f_amtcr AS fAmtcr,
+        f.f_billtype AS fBilltype,
+        f.f_billstatus AS fBillstatus,
+        f.f_remarks AS fRemarks
+        FROM
+        t_fee AS f
+        LEFT JOIN t_corps AS c ON f.f_corpid = c.f_id
+        <where>
+            <if test="fBillno != null  and fBillno != ''">and f.f_billno = #{fBillno}</if>
+            <if test="fCtrlcorpid != null ">and f.f_ctrlcorpid = #{fCtrlcorpid}</if>
+            <if test="fCorpid != null ">and f.f_corpid = #{fCorpid}</if>
+            <if test="tMblno != null  and tMblno != ''">and f.t_mblno = #{tMblno}</if>
+            <if test="fAmtdr != null ">and f.f_amtdr = #{fAmtdr}</if>
+            <if test="fAmtcr != null ">and f.f_amtcr = #{fAmtcr}</if>
+            <if test="fBilltype != null  and fBilltype != ''">and f.f_billtype = #{fBilltype}</if>
+            <if test="fBillstatus != null  and fBillstatus != ''">and f.f_billstatus = #{fBillstatus}</if>
+            <if test="fRemarks != null  and fRemarks != ''">and f.f_remarks = #{fRemarks}</if>
+            <if test="fAccbilldate != null ">and f.f_accbilldate = #{fAccbilldate}</if>
+            <if test="fDeptid != null ">and f.f_deptid = #{fDeptid}</if>
+        </where>
+    </select>
+
     <select id="selectTFeeById" parameterType="Long" resultMap="TFeeResult">
         <include refid="selectTFeeVo"/>
         where f_id = #{fId}
@@ -187,10 +219,10 @@
             <if test="map.tWareHouseFees.fStatementNo != null and map.tWareHouseFees.fStatementNo != ''">and w.f_statement_no  like concat('%', #{map.tWareHouseFees.fStatementNo}, '%') </if>
 
             <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "1" '>
-                and  w.f_accamount_date IS NOT NULL
+                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
+                and w.f_accamount_date IS  NULL
             </if>
 
             <if test='map.tWareHouseFees.fDc != null and map.tWareHouseFees.fDc != "" and map.tWareHouseFees.fDc == "D" '>