Quellcode durchsuchen

[CODE]: 财务收费

maxianghua vor 4 Jahren
Ursprung
Commit
dc8d353855

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/fleet/finance/FTmsaccbillsController.java

@@ -42,7 +42,7 @@ public class FTmsaccbillsController extends BaseController {
     {
         fTmsaccbills.setfBilltype("SFDZ");
         startPage();
-        List<FTmsaccbills> list = fTmsaccbillsService.selectFTmsaccbillsList(fTmsaccbills);
+        List<Map<String, Object>> list = fTmsaccbillsService.selectFTmsaccbillsMapList(fTmsaccbills);
         return getDataTable(list);
     }
 

+ 104 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/fleet/finance/TChargesController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.web.controller.fleet.finance;
+
+import com.ruoyi.common.annotation.Log;
+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.domain.model.LoginUser;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.ServletUtils;
+import com.ruoyi.common.utils.spring.SpringUtils;
+import com.ruoyi.framework.web.service.TokenService;
+import com.ruoyi.orderManagement.finance.domain.FTmsaccbills;
+import com.ruoyi.orderManagement.finance.domain.FTmsaccbillsFees;
+import com.ruoyi.orderManagement.finance.service.IFTmsaccbillsService;
+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
+ *
+ * @author ruoyi
+ * @date 2021-01-18
+ */
+@RestController
+@RequestMapping("/finances/charge")
+public class TChargesController extends BaseController {
+
+    @Autowired
+    private IFTmsaccbillsService fTmsaccbillsService;
+
+
+    /**
+     * 查询财务主列表
+     */
+    @PreAuthorize("@ss.hasPermi('finances:contrast:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FTmsaccbills fTmsaccbills)
+    {
+        fTmsaccbills.setfBilltype("JSSF");
+        startPage();
+        List<Map<String, Object>> list = fTmsaccbillsService.selectFTmsaccbillsMapList(fTmsaccbills);
+        return getDataTable(list);
+    }
+
+    /**
+     *  收费查询
+     */
+    @GetMapping("/chargeList")
+    public TableDataInfo chargeList(FTmsaccbillsFees fTmsaccbillsFees) {
+        fTmsaccbillsFees.setfDc("D");
+        startPage();
+        String billsType = "SF";
+        List<Map<String, Object>> list = fTmsaccbillsService.fTmsaccbillsList(fTmsaccbillsFees,billsType);
+        return getDataTable(list);
+    }
+
+    /**
+     * 新增财务数据主
+     */
+    @PreAuthorize("@ss.hasPermi('finances:charge:add')")
+    @Log(title = "财务数据主", businessType = BusinessType.INSERT)
+    @PostMapping(value = "/add")
+    @RepeatSubmit
+    public AjaxResult add(@RequestParam("tFee") String tFee,
+                          @RequestParam("tFeeDo") String tFeeDo ) {
+        String billsType = "JSSF";
+        // 获取当前的用户
+        LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
+        return fTmsaccbillsService.insertTFeeTFeeDo(tFee,tFeeDo,loginUser,billsType);
+    }
+
+    /**
+     *  查询详情
+     */
+    @PreAuthorize("@ss.hasPermi('finances:charge:query')")
+    @GetMapping(value = "/{fId}")
+    public AjaxResult getInfo(@PathVariable("fId") Long fId) {
+        return AjaxResult.success(fTmsaccbillsService.selectFTmsaccbillsAndItemsById(fId));
+    }
+
+    /**
+     * 删除财务数据主
+     */
+    @PreAuthorize("@ss.hasPermi('finances:charge:remove')")
+    @Log(title = "财务数据主", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{fIds}")
+    public AjaxResult remove(@PathVariable Long[] fIds) {
+        return toAjax(fTmsaccbillsService.deleteFTmsaccbillsByIds(fIds));
+    }
+
+    @PreAuthorize("@ss.hasPermi('finances:charge:remove')")
+    @Log(title = "财务数据主", businessType = BusinessType.DELETE)
+    @DeleteMapping("/queryRemove/{fId}")
+    public AjaxResult queryRemove(@PathVariable("fId") Long fId) {
+        return fTmsaccbillsService.queryRemove(fId);
+    }
+
+
+}

+ 84 - 4
ruoyi-fleet/src/main/java/com/ruoyi/orderManagement/finance/domain/FTmsaccbills.java

@@ -1,12 +1,14 @@
 package com.ruoyi.orderManagement.finance.domain;
 
-import java.math.BigDecimal;
-import java.util.Date;
 import com.fasterxml.jackson.annotation.JsonFormat;
-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;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
 
 /**
  * 财务主对象 F_TMSACCBILLS
@@ -119,6 +121,84 @@ public class FTmsaccbills extends BaseEntity
     @Excel(name = "业务编号(唯一格式+YYYY+YY+NNN,编号不能断号,要连续、如果删除该编号,下次新建单据,优先使用删除单据号,每月从001开始。) 对账 DZ 收费 SF 付费 FF 发票 FP")
     private String fBillno;
 
+    /**
+     * 收费方式
+     */
+    @Excel(name = "收费方式")
+    private String chargingMethod;
+    /**
+     * 发票号
+     */
+    @Excel(name = "发票号")
+    private String invoiceNo;
+    /**
+     * 银行
+     */
+    @Excel(name = "银行")
+    private String bank;
+    /**
+     * 水单号
+     */
+    @Excel(name = "水单号")
+    private String waterBillNo;
+
+    /**
+     * 结算单位(下拉模糊搜索)
+     */
+    @Excel(name = "结算单位(下拉模糊搜索)")
+    private Long fCorpid;
+
+    public Long getfCorpid() {
+        return fCorpid;
+    }
+
+    public void setfCorpid(Long fCorpid) {
+        this.fCorpid = fCorpid;
+    }
+
+    public String getChargingMethod() {
+        return chargingMethod;
+    }
+
+    public void setChargingMethod(String chargingMethod) {
+        this.chargingMethod = chargingMethod;
+    }
+
+    public String getInvoiceNo() {
+        return invoiceNo;
+    }
+
+    public void setInvoiceNo(String invoiceNo) {
+        this.invoiceNo = invoiceNo;
+    }
+
+    public String getBank() {
+        return bank;
+    }
+
+    public void setBank(String bank) {
+        this.bank = bank;
+    }
+
+    public String getWaterBillNo() {
+        return waterBillNo;
+    }
+
+    public void setWaterBillNo(String waterBillNo) {
+        this.waterBillNo = waterBillNo;
+    }
+
+    /**
+     * 查询时间区间
+     */
+    private List<String> timeInterval;
+    public void settimeInterval(List<String> timeInterval) {
+        this.timeInterval = timeInterval;
+    }
+    public List<String> gettimeInterval() {
+        return timeInterval;
+    }
+
     public void setId(Long id) 
     {
         this.id = id;

+ 86 - 102
ruoyi-fleet/src/main/resources/mapper/finance/FTmsaccbillsMapper.xml

@@ -29,11 +29,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="fBilltype"    column="f_billtype"    />
         <result property="fAccbilldate"    column="f_accbilldate"    />
         <result property="fBillno"    column="f_billno"    />
+        <result property="chargingMethod" column="charging_method"/>
+        <result property="invoiceNo" column="invoice_no"/>
+        <result property="bank" column="bank"/>
+        <result property="waterBillNo" column="water_bill_no"/>
+        <result property="fCorpid" column="f_corpid"/>
     </resultMap>
 
     <sql id="selectFTmsaccbillsVo">
         select id, acc_year, acc_month, act_id, bill_no, corp_id, transact_id, from_date, to_date, amt, ref_no, post_date, bill_status, del_flag, create_by, create_time, update_by, update_time, remarks ,
-               f_ctrlcorpid ,t_mblno ,f_billtype,f_accbilldate,f_billno   from F_TMSACCBILLS
+               f_ctrlcorpid ,t_mblno ,f_billtype,f_accbilldate,f_billno,charging_method ,invoice_no ,  bank , water_bill_no ,f_corpid   from F_TMSACCBILLS
     </sql>
 
     <select id="selectFTmsaccbillsList" parameterType="FTmsaccbills" resultMap="FTmsaccbillsResult">
@@ -52,6 +57,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="postDate != null "> and post_date = #{postDate}</if>
             <if test="billStatus != null "> and bill_status = #{billStatus}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
+            <if test="chargingMethod != null ">and charging_method = #{chargingMethod}</if>
+            <if test="invoiceNo != null ">and invoice_no = #{invoiceNo}</if>
+            <if test="bank != null ">and bank = #{bank}</if>
+            <if test="waterBillNo != null ">and water_bill_no = #{waterBillNo}</if>
+            <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
+            <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
+                and f_accbilldate &gt;= #{timeInterval[0]}
+            </if>
+            <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
+                and f_accbilldate &lt;= #{timeInterval[1]}
+            </if>
         </where>
     </select>
     
@@ -87,6 +103,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="fBilltype != null">f_billtype,</if>
             <if test="fAccbilldate != null">f_accbilldate,</if>
             <if test="fBillno != null">f_billno,</if>
+            <if test="chargingMethod != null">charging_method,</if>
+            <if test="invoiceNo != null">invoice_no,</if>
+            <if test="bank != null">bank,</if>
+            <if test="waterBillNo != null">water_bill_no,</if>
+            <if test="fCorpid != null">f_corpid,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="accYear != null">#{accYear},</if>
@@ -112,6 +133,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="fBilltype != null">#{fBilltype},</if>
             <if test="fAccbilldate != null">#{fAccbilldate},</if>
             <if test="fBillno != null">#{fBillno},</if>
+            <if test="chargingMethod != null">#{chargingMethod},</if>
+            <if test="invoiceNo != null">#{invoiceNo},</if>
+            <if test="bank != null">#{bank},</if>
+            <if test="waterBillNo != null">#{waterBillNo},</if>
+            <if test="fCorpid != null">#{fCorpid},</if>
          </trim>
     </insert>
 
@@ -136,6 +162,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="remarks != null">remarks = #{remarks},</if>
+            <if test="chargingMethod != null">charging_method = #{chargingMethod},</if>
+            <if test="invoiceNo != null">invoice_no = #{invoiceNo},</if>
+            <if test="bank != null">bank = #{bank},</if>
+            <if test="waterBillNo != null">water_bill_no = #{waterBillNo},</if>
+            <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
         </trim>
         where id = #{id}
     </update>
@@ -237,95 +268,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="fTmsaccbillsList" resultType="java.util.Map">
         SELECT
-        w.f_id AS fSrcid,
-        t.id AS fSrcpid,
-        t.corp_id AS fCorpid,
-        c.f_name AS fName,
-        w.fName AS fFeesName,
-        w.f_mblno AS fMblno,
-        w.f_product_name AS fProductName,
-        w.f_bsdate AS fBsdate,
-        t.bill_type AS fBilltype,
-        w.f_review_date AS fReviewDate,
-        w.f_marks AS fMarks,
-        w.f_feeid AS fFeeid,
-        w.f_billtype AS fBilltype,
-        w.f_chargedate AS fChargedate,
-        w.f_originalbilldate AS fOriginalbilldate,
-        w.f_billing_deadline AS fBillingDeadline,
-        f.f_name AS fFeeName,
-        w.f_dc AS fSrcdc,
-        ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmtdr,
-        ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmt,
-        w.f_qty AS fQty,
-        w.f_unitprice AS fUnitprice
-        FROM
-        f_tmsorderbills t
-        LEFT JOIN t_corps c ON c.f_id = t.corp_id
-        LEFT JOIN f_tmsorderbillscars car ON car.p_id = t.id
-        LEFT JOIN (
-        SELECT
-        f.f_id,
-        f.f_pid,
-        f.act_id,
-        f.org_id,
-        f.f_lineno,
-        f.f_corpid,
-        f.f_feeid,
-        f.f_feeUnitid,
-        f.f_qty,
-        f.f_unitprice,
-        f.f_amount,
-        f.f_currency,
-        f.f_exrate,
-        f.f_taxrate,
-        f.f_dc,
-        f.f_review_date,
-        f.f_billstatus,
-        f.f_statement_no,
-        f.f_accamount,
-        f.f_accamount_date,
-        f.f_stlamount_no,
-        f.f_stlamount,
-        f.f_stlamount_date,
-        f.f_invnos,
-        f.f_invamount,
-        f.f_askamount,
-        f.f_status,
-        f.del_flag,
-        f.create_by,
-        f.update_by,
-        f.create_time,
-        f.update_time,
-        f.remark,
-        f.src_id,
-        f.src_bill_no,
-        f.f_mblno,
-        f.f_product_name,
-        f.f_marks,
-        f.f_chargedate,
-        f.f_billing_deadline,
-        f.f_inventory_days,
-        f.f_amt,
-        f.f_billing_days,
-        f.f_billing_qty,
-        f.f_billtype,
-        f.f_billingway,
-        f.f_bsdate,
-        f.f_originalbilldate,
-        f.f_stltypeid,
-        f.remarks,
-        c.f_id AS fId,
-        c.f_name AS fName
+            w.f_id AS fSrcid,
+            t.id AS fSrcpid ,
+            t.corp_id AS fCorpid,
+            c1.f_name AS fName,
+            c.f_id AS fId,
+            c.f_name AS fFeesName,
+            w.f_mblno AS fMblno,
+            w.f_product_name AS fProductName,
+            w.create_time AS fBsdate,
+            w.act_id AS fBilltype,
+            dict.dict_label  AS billType,
+            w.f_feeid AS fFeeid,
+            w.src_bill_no AS srcBillNo,
+            f.f_name AS fFeeName,
+            w.f_dc AS fSrcdc,
+            ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmtdr,
+            ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmt
         FROM
-        f_tmsorderbillsfees AS f
-        LEFT JOIN t_corps AS c ON f.f_corpid = c.f_id
-        ) w ON w.f_pid = car.id
-        LEFT JOIN t_fees f ON w.f_feeid = f.f_id
-        LEFT JOIN sys_dict_data dict ON dict.dict_value = w.f_feeUnitid
+            f_tmsorderbillsfees w
+            LEFT JOIN t_fees f ON w.f_feeid = f.f_id
+            LEFT JOIN t_corps AS c ON w.f_corpid = c.f_id
+            LEFT JOIN f_tmsorderbills AS t ON w.org_id = t.id
+            LEFT JOIN t_corps AS c1 ON t.corp_id = c1.f_id
+            LEFT JOIN sys_dict_data dict ON dict.dict_value = t.bill_type
         <where>
             dict.status = '0'
-            AND dict.dict_type = 'data_unitfees'
+            AND dict.dict_type = 'data_billType'
             <if test=" fCorpid != null  and  fCorpid != ''">and t.corp_id = #{ 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>
@@ -368,27 +337,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test=' timeReconci != null and  timeReconci[1] != null and  timeReconci[1]!= ""'>
                 and w.f_stlamount_date &lt;= #{ timeReconci[1]}
             </if>
-            and  w.f_review_date IS NOT NULL
             and  ifnull(w.f_amount, 0) - ifnull(w.f_stlamount, 0) != 0
             GROUP BY  w.f_id
         </where>
     </select>
     <select id="selectFTmsaccbillsMapList" resultType="java.util.Map">
-
+        SELECT
+            f.id AS fId,
+            f.bill_no AS fBillno,
+            f.f_ctrlcorpid AS fCtrlcorpid,
+            f.corp_id AS fCorpid,
+            c.f_name AS fCorpidName,
+            f.f_accbilldate AS fAccbilldate,
+            f.t_mblno AS tMblno,
+            f.amt AS fAmtdr,
+            f.f_billtype AS fBilltype,
+            f.bill_status AS fBillstatus,
+            f.remarks AS fRemarks,
+            f.create_by AS createBy
+        FROM
+            f_tmsaccbills f
+            LEFT JOIN t_corps AS c ON f.corp_id = c.f_id
         <where>
-            <if test="accYear != null "> and acc_year = #{accYear}</if>
-            <if test="accMonth != null "> and acc_month = #{accMonth}</if>
-            <if test="actId != null "> and act_id = #{actId}</if>
-            <if test="billNo != null  and billNo != ''"> and bill_no = #{billNo}</if>
-            <if test="corpId != null "> and corp_id = #{corpId}</if>
-            <if test="transactId != null "> and transact_id = #{transactId}</if>
-            <if test="fromDate != null "> and from_date = #{fromDate}</if>
-            <if test="toDate != null "> and to_date = #{toDate}</if>
-            <if test="amt != null "> and amt = #{amt}</if>
-            <if test="refNo != null  and refNo != ''"> and ref_no = #{refNo}</if>
-            <if test="postDate != null "> and post_date = #{postDate}</if>
-            <if test="billStatus != null "> and bill_status = #{billStatus}</if>
-            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
+            <if test="accYear != null "> and f.acc_year = #{accYear}</if>
+            <if test="accMonth != null "> and f.acc_month = #{accMonth}</if>
+            <if test="actId != null "> and f.act_id = #{actId}</if>
+            <if test="billNo != null  and billNo != ''"> and f.bill_no = #{billNo}</if>
+            <if test="corpId != null "> and f.corp_id = #{corpId}</if>
+            <if test="transactId != null "> and f.transact_id = #{transactId}</if>
+            <if test="fromDate != null "> and f.from_date = #{fromDate}</if>
+            <if test="toDate != null "> and f.to_date = #{toDate}</if>
+            <if test="amt != null "> and f.amt = #{amt}</if>
+            <if test="refNo != null  and refNo != ''"> and f.ref_no = #{refNo}</if>
+            <if test="postDate != null "> and f.post_date = #{postDate}</if>
+            <if test="billStatus != null "> and f.bill_status = #{billStatus}</if>
+            <if test="remarks != null  and remarks != ''"> and f.remarks = #{remarks}</if>
+            <if test="fBilltype != null  and fBilltype != ''">and f.f_billtype = #{fBilltype}</if>
         </where>
     </select>
 </mapper>

+ 1 - 1
ruoyi-fleet/src/main/resources/mapper/statusTracking/ftmsorderbillsfeesMapper.xml

@@ -309,7 +309,7 @@
         </foreach>
     </delete>
     <delete id="deleteFTmsorderbillsfeesByPIdAndActId" parameterType="Long">
-        delete from F_TMSORDERBILLSFEES where f_pid = #{fId} and act_id = 1080
+        delete from F_TMSORDERBILLSFEES where f_pid = #{fId} and act_id = 1090
     </delete>
 
 </mapper>

+ 4 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/BillnoSerialServiceImpl.java

@@ -89,6 +89,10 @@ public class BillnoSerialServiceImpl implements IBillnoSerialService {
             billNo = "FF" + billNo;
         } else if ("SFDZ".equals(billType)) {
             billNo = "SFDZ" + billNo;
+        } else if ("JSSF".equals(billType)) {
+            billNo = "JSSF" + billNo;
+        }  else if ("JSFF".equals(billType)) {
+            billNo = "JSFF" + billNo;
         }
         return billNo;
     }