Преглед на файлове

凯和启用退租功能

lazhaoqian преди 3 години
родител
ревизия
7c3cfe8dad

+ 8 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/controller/TCntrnoController.java

@@ -307,7 +307,14 @@ public class TCntrnoController extends BaseController
         return getDataTable(list);
     }
 
-
+    @PostMapping("/updateHire")
+    public AjaxResult updateHire(@RequestBody TCntrno tCntrno)
+    {
+        if (CollectionUtils.isEmpty(tCntrno.getCntrnoList())){
+            return AjaxResult.error("请选择后再提交");
+        }
+        return toAjax(tCntrnoService.updateHire(tCntrno));
+    }
 
 }
 

+ 78 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/domain/TCntrno.java

@@ -119,6 +119,15 @@ public class TCntrno extends BaseEntity
     /** 合同协议号 */
     @Excel(name = "合同协议号")
     private String fPactDealHorn;
+    /** 起租时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "起租时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date onHireStart;
+
+    /** 退租时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+   // @Excel(name = "退租时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date onHireEnd;
 
     /** 最新地点 */
     private String fUpdateaddress;
@@ -174,11 +183,78 @@ public class TCntrno extends BaseEntity
      * 是否按日志分组
      */
     private Integer whether = 0;
+    /**
+     * 状态中文名 T正常 F停用
+     */
+    private String fStatusName;
+    /**
+     * 起租日期区间
+     * @return
+     */
+    private List<String> onHireStartList;
+    /**
+     * 退租日期区间
+     * @return
+     */
+    private List<String> onHireEnfList;
+    /**
+     * 要修改的集装箱id数组
+     */
+    private List<Long> cntrnoList;
+
+    public List<Long> getCntrnoList() {
+        return cntrnoList;
+    }
+
+    public void setCntrnoList(List<Long> cntrnoList) {
+        this.cntrnoList = cntrnoList;
+    }
+
+    public String getfStatusName() {
+        return fStatusName;
+    }
+
+    public void setfStatusName(String fStatusName) {
+        this.fStatusName = fStatusName;
+    }
+
+    public List<String> getOnHireStartList() {
+        return onHireStartList;
+    }
+
+    public void setOnHireStartList(List<String> onHireStartList) {
+        this.onHireStartList = onHireStartList;
+    }
+
+    public List<String> getOnHireEnfList() {
+        return onHireEnfList;
+    }
+
+    public void setOnHireEnfList(List<String> onHireEnfList) {
+        this.onHireEnfList = onHireEnfList;
+    }
 
     public Integer getWhether() {
         return whether;
     }
+    public void setOnHireStart(Date onHireStart)
+    {
+        this.onHireStart = onHireStart;
+    }
 
+    public Date getOnHireStart()
+    {
+        return onHireStart;
+    }
+    public void setOnHireEnd(Date onHireEnd)
+    {
+        this.onHireEnd = onHireEnd;
+    }
+
+    public Date getOnHireEnd()
+    {
+        return onHireEnd;
+    }
     public void setWhether(Integer whether) {
         this.whether = whether;
     }
@@ -572,6 +648,8 @@ public class TCntrno extends BaseEntity
             .append("fBoxTurtleMonth", getfBoxTurtleMonth())
             .append("fMblno", getfMblno())
             .append("fBoxWeight", getfBoxWeight())
+            .append("onHireStart", getOnHireStart())
+            .append("onHireEnd", getOnHireEnd())
             .toString();
     }
 }

+ 26 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/excel/TCntrnoExcel.java

@@ -2,6 +2,8 @@ package com.ruoyi.shipping.excel;
 
 import com.ruoyi.common.annotation.Excel;
 
+import java.util.Date;
+
 /**
  * @Author ZhaoQian La
  * @Date 2021/5/21 10:04
@@ -41,6 +43,28 @@ public class TCntrnoExcel {
     //箱状态中文
     @Excel(name = "箱状态",readConverterExp = "如好或者坏")
     private String cntrstatusName;
+    /** 合同协议号 */
+    @Excel(name = "合同协议号")
+    private String fPactDealHorn;
+
+    @Excel(name = "起租时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date onHireStart;
+
+    public String getfPactDealHorn() {
+        return fPactDealHorn;
+    }
+
+    public void setfPactDealHorn(String fPactDealHorn) {
+        this.fPactDealHorn = fPactDealHorn;
+    }
+
+    public Date getOnHireStart() {
+        return onHireStart;
+    }
+
+    public void setOnHireStart(Date onHireStart) {
+        this.onHireStart = onHireStart;
+    }
 
     public String getAddressTypeId() {
         return addressTypeId;
@@ -160,6 +184,8 @@ public class TCntrnoExcel {
                 ", addressName='" + addressName + '\'' +
                 ", cntrstatusName='" + cntrstatusName + '\'' +
                 ", addressType='" + addressType + '\'' +
+                ", onHireStart='" + onHireStart + '\'' +
+                ", fPactDealHorn='" + fPactDealHorn + '\'' +
                 '}';
     }
 }

+ 8 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/mapper/TCntrnoMapper.java

@@ -1,5 +1,6 @@
 package com.ruoyi.shipping.mapper;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -160,4 +161,11 @@ public interface TCntrnoMapper
      */
     public List<Map<String,Object>>homeBox();
 
+    /**
+     * 凯和启用和退租功能
+     * @param tCntrno
+     * @return
+     */
+    public int updateHire(TCntrno tCntrno);
+
 }

+ 7 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/ITCntrnoService.java

@@ -169,4 +169,11 @@ public interface ITCntrnoService
      * @return
      */
     public List<Map<String,Object>>homeBox();
+
+    /**
+     * 凯和启用和退租功能
+     * @param tCntrno
+     * @return
+     */
+    public int updateHire(TCntrno tCntrno);
 }

+ 6 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/impl/TCntrnoServiceImpl.java

@@ -841,6 +841,12 @@ public class TCntrnoServiceImpl implements ITCntrnoService {
         return tCntrnoMapper.homeBox();
     }
 
+    @Override
+    @Transactional
+    public int updateHire(TCntrno tCntrno) {
+        return tCntrnoMapper.updateHire(tCntrno);
+    }
+
     /**
      * set字段
      *

+ 82 - 9
ruoyi-shipping/src/main/resources/mapper/shipping/TCntrnoMapper.xml

@@ -30,11 +30,13 @@
         <result property="fPactDealHorn"    column="f_pact_deal_horn"    />
         <result property="fMblno"    column="f_mblno"    />
         <result property="fBoxWeight"    column="f_box_weight"    />
+        <result property="onHireStart"    column="on_hire_start"    />
+        <result property="onHireEnd"    column="on_hire_end"    />
     </resultMap>
 
     <sql id="selectTCntrnoVo">
         select f_id, f_no, f_typeid, f_owner, f_source, f_rent, f_updatetime, f_updateaddress, f_updateEF, f_cntrstatus, case when f_status = 'T' then '正常' else '停用' end as f_status,f_opctnstatus,f_sealno,create_by, create_time, update_by, update_time, remark,
-               f_build_box_time,f_box_turtle_year,f_box_turtle_month,f_box_lord,f_pact_deal_horn,f_mblno,f_box_weight from t_cntrno
+               f_build_box_time,f_box_turtle_year,f_box_turtle_month,f_box_lord,f_pact_deal_horn,f_mblno,f_box_weight,on_hire_start,on_hire_end from t_cntrno
     </sql>
 
     <select id="selectTCntrnoList" parameterType="TCntrno" resultMap="TCntrnoResult">
@@ -65,6 +67,8 @@
             <if test="fPactDealHorn != null  and fPactDealHorn != ''"> and f_pact_deal_horn = #{fPactDealHorn}</if>
             <if test="fMblno != null  and fMblno != ''"> and f_mblno = #{fMblno}</if>
             <if test="fBoxWeight != null "> and f_box_weight = #{fBoxWeight}</if>
+            <if test="onHireStart != null "> and on_hire_start = #{onHireStart}</if>
+            <if test="onHireEnd != null "> and on_hire_end = #{onHireEnd}</if>
         </where>
     </select>
     <select id="selectTcntrnoMessage" parameterType="TCntrno" resultMap="TCntrnoResult">
@@ -88,7 +92,8 @@
         sdda.dict_label updateEFName,
         tc.f_cntrstatus,
         pr.dict_label cntrstatusName,
-        case when tc.f_status = 'T' then '正常' else '停用' end as f_status,
+        tc.f_status,
+        case when tc.f_status = 'T' then '启用' else '停用' end as fStatusName,
         prd.dict_label opctnstatusName,
         tc.create_by,
         tc.create_time,
@@ -99,7 +104,10 @@
         tc.f_box_turtle_year,
         tc.f_box_turtle_month,
         tc.f_box_lord,
-        tc.f_pact_deal_horn
+        tc.f_pact_deal_horn,
+        tc.on_hire_start,
+        tc.on_hire_end,
+        tc.f_mblno
         FROM
         t_cntrno tc
         LEFT JOIN sys_dict_data pro ON pro.dict_value = tc.f_owner
@@ -119,7 +127,6 @@
         AND prd.dict_type = 'f_opctnstatus'
         LEFT JOIN t_address address ON address.f_id = tc.f_updateaddress
         <where>
-            tc.f_status = 'T'
             <if test="tc.fNo != null  and tc.fNo != ''">and tc.f_no like concat('%', #{tc.fNo}, '%') </if>
             <if test="tc.fTypeid != null ">and tc.f_typeid = #{tc.fTypeid}</if>
             <if test="tc.fOwner != null  and tc.fOwner != ''">and tc.f_owner = #{tc.fOwner}</if>
@@ -151,6 +158,18 @@
             <if test="tc.fPactDealHorn != null  and tc.fPactDealHorn != ''"> and tc.f_pact_deal_horn = #{tc.fPactDealHorn}</if>
             <if test="tc.fMblno != null  and tc.fMblno != ''"> and tc.f_mblno = #{tc.fMblno}</if>
             <if test="tc.fBoxWeight != null "> and tc.f_box_weight = #{tc.fBoxWeight}</if>
+            <if test='tc.onHireStartList != null and tc.onHireStartList[0] != null and tc.onHireStartList[0]!= ""'>
+                and tc.on_hire_start &gt;= #{tc.onHireStartList[0]}
+            </if>
+            <if test='tc.onHireStartList != null and tc.onHireStartList[1] != null and tc.onHireStartList[1]!= ""'>
+                and tc.on_hire_start &lt;= #{tc.onHireStartList[1]}
+            </if>
+            <if test='tc.onHireEnfList != null and tc.onHireEnfList[0] != null and tc.onHireEnfList[0]!= ""'>
+                and tc.on_hire_end &gt;= #{tc.onHireEnfList[0]}
+            </if>
+            <if test='tc.onHireEnfList != null and tc.onHireEnfList[1] != null and tc.onHireEnfList[1]!= ""'>
+                and tc.on_hire_end &lt;= #{tc.onHireEnfList[1]}
+            </if>
         </where>
         ORDER BY tc.f_no,CONVERT(tc.f_updateaddress USING gbk),CONVERT(t.f_no USING gbk),
         tc.f_updateEF,tc.f_cntrstatus,tc.f_owner
@@ -178,7 +197,8 @@
         sdda.dict_label updateEFName,
         tc.f_cntrstatus,
         pr.dict_label cntrstatusName,
-        case when tc.f_status = 'T' then '正常' else '停用' end as f_status,
+        tc.f_status,
+        case when tc.f_status = 'T' then '启用' else '停用' end as fStatusName,
         tc.f_opctnstatus,
         tc.create_by,
         tc.create_time,
@@ -189,7 +209,9 @@
         tc.f_box_turtle_year,
         tc.f_box_turtle_month,
         tc.f_box_lord,
-        tc.f_pact_deal_horn
+        tc.f_pact_deal_horn,
+        tc.on_hire_start,
+        tc.on_hire_end
         FROM
         t_cntrno tc
         LEFT JOIN sys_dict_data pro ON pro.dict_value = tc.f_owner
@@ -230,7 +252,8 @@
         sdda.dict_label updateEFName,
         tc.f_cntrstatus,
         pr.dict_label cntrstatusName,
-        case when tc.f_status = 'T' then '正常' else '停用' end as f_status,
+        tc.f_status,
+        case when tc.f_status = 'T' then '启用' else '停用' end as fStatusName,
         tc.f_opctnstatus,
         tc.create_by,
         tc.create_time,
@@ -258,7 +281,7 @@
 		LEFT JOIN sys_dict_data prs ON prs.dict_value = t.f_cntrsize
         AND prs.dict_type = 'f_cntrsize'
         LEFT JOIN t_address address ON address.f_id = tc.f_updateaddress
-        where tc.f_no = #{fNo}
+        where tc.f_no = #{fNo} and tc.f_status = 'T'
     </select>
 
     <insert id="insertTCntrno" parameterType="TCntrno">
@@ -287,6 +310,10 @@
             <if test="fBoxTurtleMonth != null">f_box_turtle_month,</if>
             <if test="fBoxLord != null">f_box_lord,</if>
             <if test="fPactDealHorn != null">f_pact_deal_horn,</if>
+            <if test="fMblno != null">f_mblno,</if>
+            <if test="fBoxWeight != null">f_box_weight,</if>
+            <if test="onHireStart != null">on_hire_start,</if>
+            <if test="onHireEnd != null">on_hire_end,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="fId != null">#{fId},</if>
@@ -312,6 +339,10 @@
             <if test="fBoxTurtleMonth != null">#{fBoxTurtleMonth},</if>
             <if test="fBoxLord != null">#{fBoxLord},</if>
             <if test="fPactDealHorn != null">#{fPactDealHorn},</if>
+            <if test="fMblno != null">#{fMblno},</if>
+            <if test="fBoxWeight != null">#{fBoxWeight},</if>
+            <if test="onHireStart != null">#{onHireStart},</if>
+            <if test="onHireEnd != null">#{onHireEnd},</if>
         </trim>
     </insert>
 
@@ -340,6 +371,10 @@
             <if test="fBoxTurtleMonth != null">f_box_turtle_month = #{fBoxTurtleMonth},</if>
             <if test="fBoxLord != null">f_box_lord = #{fBoxLord},</if>
             <if test="fPactDealHorn != null">f_pact_deal_horn = #{fPactDealHorn},</if>
+            <if test="fMblno != null">f_mblno = #{fMblno},</if>
+            <if test="fBoxWeight != null">f_box_weight = #{fBoxWeight},</if>
+            <if test="onHireStart != null">on_hire_start = #{onHireStart},</if>
+            <if test="onHireEnd != null">on_hire_end = #{onHireEnd},</if>
         </trim>
         where f_id = #{fId}
     </update>
@@ -369,6 +404,10 @@
             <if test="fBoxTurtleMonth != null">f_box_turtle_month = #{fBoxTurtleMonth},</if>
             <if test="fBoxLord != null">f_box_lord = #{fBoxLord},</if>
             <if test="fPactDealHorn != null">f_pact_deal_horn = #{fPactDealHorn},</if>
+            <if test="fMblno != null">f_mblno = #{fMblno},</if>
+            <if test="fBoxWeight != null">f_box_weight = #{fBoxWeight},</if>
+            <if test="onHireStart != null">on_hire_start = #{onHireStart},</if>
+            <if test="onHireEnd != null">on_hire_end = #{onHireEnd},</if>
         </trim>
         where f_no = #{fNo}
     </update>
@@ -667,6 +706,40 @@ FROM
 WHERE
 	ta.f_name = '在船'
     </select>
-
+    <update id="updateHire" parameterType="TCntrno">
+        update t_cntrno
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="fNo != null and fNo != ''">f_no = #{fNo},</if>
+            <if test="fTypeid != null">f_typeid = #{fTypeid},</if>
+            <if test="fOwner != null and fOwner != ''">f_owner = #{fOwner},</if>
+            <if test="fSource != null">f_source = #{fSource},</if>
+            <if test="fRent != null">f_rent = #{fRent},</if>
+            <if test="fUpdatetime != null">f_updatetime = #{fUpdatetime},</if>
+            <if test="fUpdateaddress != null and fUpdateaddress != ''">f_updateaddress = #{fUpdateaddress},</if>
+            <if test="fUpdateef != null and fUpdateef != ''">f_updateEF = #{fUpdateef},</if>
+            <if test="fCntrstatus != null and fCntrstatus != ''">f_cntrstatus = #{fCntrstatus},</if>
+            <if test="fStatus != null">f_status = #{fStatus},</if>
+            <if test="fSealno != null">f_sealno = #{fSealno},</if>
+            <if test="fOpctnstatus != null">f_opctnstatus = #{fOpctnstatus},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="fBuildBoxTime != null">f_build_box_time = #{fBuildBoxTime},</if>
+            <if test="fBoxTurtleYear != null">f_box_turtle_year = #{fBoxTurtleYear},</if>
+            <if test="fBoxTurtleMonth != null">f_box_turtle_month = #{fBoxTurtleMonth},</if>
+            <if test="fBoxLord != null">f_box_lord = #{fBoxLord},</if>
+            <if test="fPactDealHorn != null">f_pact_deal_horn = #{fPactDealHorn},</if>
+            <if test="fMblno != null">f_mblno = #{fMblno},</if>
+            <if test="fBoxWeight != null">f_box_weight = #{fBoxWeight},</if>
+            <if test="onHireStart != null">on_hire_start = #{onHireStart},</if>
+            <if test="onHireEnd != null">on_hire_end = #{onHireEnd},</if>
+        </trim>
+        where f_id in
+        <foreach item="fId" collection="cntrnoList" open="(" separator="," close=")">
+            #{fId}
+        </foreach>
+    </update>
 
 </mapper>