소스 검색

凯和运价加限制

lazhaoqian 4 년 전
부모
커밋
eaab4508e2

+ 10 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/domain/TCtnpriceItems.java

@@ -46,10 +46,20 @@ public class TCtnpriceItems extends BaseEntity
     private Long fPortofloadid;
     //目的港
     private Long fDistinationid;
+    //中转港
+    private Long fPortoftransshipment;
     /** 预计开船日期 */
     @JsonFormat(pattern = "yyyy-MM-dd")
     private Date fEtd;
 
+    public Long getfPortoftransshipment() {
+        return fPortoftransshipment;
+    }
+
+    public void setfPortoftransshipment(Long fPortoftransshipment) {
+        this.fPortoftransshipment = fPortoftransshipment;
+    }
+
     public Date getfEtd() {
         return fEtd;
     }

+ 9 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/mapper/TCtnpriceItemsMapper.java

@@ -101,4 +101,13 @@ public interface TCtnpriceItemsMapper
      * @return
      */
     public List<Long> containerPrice(TCtnpriceItems tCtnpriceItems);
+    /**
+     * 查询同一条件下集装箱运价是否存在
+     *
+     * @param fPid 主表id
+     * @param fCntrid 集装箱id
+     * @return 海运运价从集合
+     */
+    public List<TCtnpriceItems> selectItemMeaasge(@Param("fPid") Long fPid,
+            @Param("fCntrid") Long fCntrid);
 }

+ 7 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/mapper/TCtnpriceMapper.java

@@ -58,4 +58,11 @@ public interface TCtnpriceMapper
      * @return 结果
      */
     public int deleteTCtnpriceByIds(Long[] fIds);
+    /**
+     * 查询海运运价表是否存在有效期重复的运价信息
+     *
+     * @param tCtnprice 海运运价
+     * @return 海运运价集合
+     */
+    public List<TCtnprice> selectMessage(TCtnprice tCtnprice);
 }

+ 10 - 1
ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/impl/TCtnpriceServiceImpl.java

@@ -19,6 +19,7 @@ import com.ruoyi.shipping.mapper.TCtnpriceMapper;
 import com.ruoyi.shipping.domain.TCtnprice;
 import com.ruoyi.shipping.service.ITCtnpriceService;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
 
 /**
  * 海运运价Service业务层处理
@@ -106,7 +107,10 @@ public class TCtnpriceServiceImpl implements ITCtnpriceService
         if (ctnprice.getfBegindate() == null){
             return AjaxResult.error("有效期止不能为空");
         }
-
+        List<TCtnprice> tCtnpriceList = tCtnpriceMapper.selectMessage(ctnprice);
+        if (CollectionUtils.isNotEmpty(tCtnpriceList)){
+            return AjaxResult.error("当前起始港口的有效期内的运价条目重复,请确认");
+        }
         List<TCtnpriceItems> ctnpriceItems = new ArrayList<>();
         if (ctnprice.getfId() == null){
             ctnprice.setCreateTime(DateUtils.getNowDate());
@@ -120,6 +124,11 @@ public class TCtnpriceServiceImpl implements ITCtnpriceService
             ctnpriceItems = JSONObject.parseArray(warehouseJSON.toJSONString(), TCtnpriceItems.class);
             if (CollectionUtils.isNotEmpty(ctnpriceItems)){
                 for (TCtnpriceItems ctnpriceItem : ctnpriceItems) {
+                    List<TCtnpriceItems> ctnpriceItemsList = tCtnpriceItemsMapper.selectItemMeaasge(ctnprice.getfId(), ctnpriceItem.getfCntrid());
+                    if (CollectionUtils.isNotEmpty(ctnpriceItemsList)){
+                        TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                        return AjaxResult.error("运价中集装箱编号重复,请确认");
+                    }
                     ctnpriceItem.setfPid(ctnprice.getfId());
                     ctnpriceItem.setCreateTime(DateUtils.getNowDate());
                     ctnpriceItem.setCreateBy(SecurityUtils.getUsername());

+ 86 - 57
ruoyi-shipping/src/main/resources/mapper/shipping/TCtnpriceItemsMapper.xml

@@ -1,24 +1,34 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.shipping.mapper.TCtnpriceItemsMapper">
-    
+
     <resultMap type="TCtnpriceItems" id="TCtnpriceItemsResult">
-        <result property="fId"    column="f_id"    />
-        <result property="fPid"    column="f_pid"    />
-        <result property="fCntrid"    column="f_cntrid"    />
-        <result property="fPrice"    column="f_price"    />
-        <result property="fStatus"    column="f_status"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="remark"    column="remark"    />
+        <result property="fId" column="f_id"/>
+        <result property="fPid" column="f_pid"/>
+        <result property="fCntrid" column="f_cntrid"/>
+        <result property="fPrice" column="f_price"/>
+        <result property="fStatus" column="f_status"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
     </resultMap>
 
     <sql id="selectTCtnpriceItemsVo">
-        select f_id, f_pid, f_cntrid, f_price, f_status, create_by, create_time, update_by, update_time, remark from t_ctnprice_items
+        select f_id,
+               f_pid,
+               f_cntrid,
+               f_price,
+               f_status,
+               create_by,
+               create_time,
+               update_by,
+               update_time,
+               remark
+        from t_ctnprice_items
     </sql>
 
     <select id="selectTCtnpriceItemsList" parameterType="TCtnpriceItems" resultMap="TCtnpriceItemsResult">
@@ -40,11 +50,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         FROM
         t_ctnprice_items ti
         LEFT JOIN t_cntr tc ON ti.f_cntrid = tc.f_id
-        <where>  
-            <if test="fPid != null "> and ti.f_pid = #{fPid}</if>
-            <if test="fCntrid != null "> and ti.f_cntrid = #{fCntrid}</if>
-            <if test="fPrice != null "> and ti.f_price = #{fPrice}</if>
-            <if test="fStatus != null  and fStatus != ''"> and ti.f_status = #{fStatus}</if>
+        <where>
+            <if test="fPid != null ">and ti.f_pid = #{fPid}</if>
+            <if test="fCntrid != null ">and ti.f_cntrid = #{fCntrid}</if>
+            <if test="fPrice != null ">and ti.f_price = #{fPrice}</if>
+            <if test="fStatus != null  and fStatus != ''">and ti.f_status = #{fStatus}</if>
             <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
                 and ti.create_time &gt;= #{cLoadDate[0]}
             </if>
@@ -53,12 +63,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             </if>
         </where>
     </select>
-    
+
     <select id="selectTCtnpriceItemsById" parameterType="Long" resultMap="TCtnpriceItemsResult">
         <include refid="selectTCtnpriceItemsVo"/>
         where f_id = #{fId}
     </select>
-        
+
     <insert id="insertTCtnpriceItems" parameterType="TCtnpriceItems" useGeneratedKeys="true" keyProperty="fId">
         insert into t_ctnprice_items
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -71,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateBy != null">update_by,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="remark != null">remark,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="fPid != null">#{fPid},</if>
             <if test="fCntrid != null">#{fCntrid},</if>
@@ -82,7 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="remark != null">#{remark},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateTCtnpriceItems" parameterType="TCtnpriceItems">
@@ -102,17 +112,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <delete id="deleteTCtnpriceItemsById" parameterType="Long">
-        delete from t_ctnprice_items where f_id = #{fId}
+        delete
+        from t_ctnprice_items
+        where f_id = #{fId}
     </delete>
 
     <delete id="deleteTCtnpriceItemsByIds" parameterType="String">
-        delete from t_ctnprice_items where f_id in 
+        delete from t_ctnprice_items where f_id in
         <foreach item="fId" collection="array" open="(" separator="," close=")">
             #{fId}
         </foreach>
     </delete>
     <delete id="deleteTCtnpriceItemsByfPid" parameterType="Long">
-        delete from t_ctnprice_items where f_pid = #{fPid}
+        delete
+        from t_ctnprice_items
+        where f_pid = #{fPid}
     </delete>
     <delete id="deleteTCtnpriceItemsByfPids" parameterType="Long">
         delete from t_ctnprice_items where f_pid in
@@ -121,44 +135,59 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
     </delete>
     <select id="selectMoney" resultType="string">
-        SELECT
-            IFNULL(min(ti.f_price),0) price
-        FROM
-	        t_ctnprice_items ti
-	    LEFT JOIN t_ctnprice tc ON ti.f_pid = tc.f_id
-	    LEFT JOIN t_cntr tr ON ti.f_cntrid = tr.f_id
-        WHERE
-	        tc.f_portofloadid = #{fPortofloadid}
-	        AND tc.f_distinationid = #{fDistinationid}
-	        AND tr.f_no = #{fNo}
+        SELECT IFNULL(min(ti.f_price), 0) price
+        FROM t_ctnprice_items ti
+                 LEFT JOIN t_ctnprice tc ON ti.f_pid = tc.f_id
+                 LEFT JOIN t_cntr tr ON ti.f_cntrid = tr.f_id
+        WHERE tc.f_portofloadid = #{fPortofloadid}
+          AND tc.f_distinationid = #{fDistinationid}
+          AND tr.f_no = #{fNo}
+          AND tc.f_status = 'T'
+          AND ti.f_status = 'T'
     </select>
     <select id="selectPriceMoney" resultType="string">
-        SELECT
-        CASE
-	    WHEN
-		    ti.f_price IS NULL THEN
-			0 ELSE ti.f_price END AS pric
-		FROM
-			t_ctnprice_items ti
-			LEFT JOIN t_ctnprice tc ON ti.f_pid = tc.f_id
-			LEFT JOIN t_cntr tr ON ti.f_cntrid = tr.f_id
-        WHERE
-	        tc.f_portofloadid = #{fPortofloadid}
-	        AND tc.f_distinationid = #{fDistinationid}
-	        AND tr.f_no = #{fNo}
+        SELECT CASE
+                   WHEN
+                       ti.f_price IS NULL THEN
+                       0
+                   ELSE ti.f_price END AS pric
+        FROM t_ctnprice_items ti
+                 LEFT JOIN t_ctnprice tc ON ti.f_pid = tc.f_id
+                 LEFT JOIN t_cntr tr ON ti.f_cntrid = tr.f_id
+        WHERE tc.f_portofloadid = #{fPortofloadid}
+          AND tc.f_distinationid = #{fDistinationid}
+          AND tr.f_no = #{fNo}
+          AND tc.f_status = 'T'
+          AND ti.f_status = 'T'
     </select>
     <select id="containerPrice" parameterType="object" resultType="long">
-        SELECT
-            ti.f_price
-        FROM
-            t_ctnprice_items ti
-                LEFT JOIN t_cntr tc
-                          ON ti.f_cntrid = tc.f_id
-                LEFT JOIN t_ctnprice tp ON ti.f_pid = tp.f_id
+        SELECT ti.f_price
+        FROM t_ctnprice_items ti
+                 LEFT JOIN t_cntr tc
+                           ON ti.f_cntrid = tc.f_id
+                 LEFT JOIN t_ctnprice tp ON ti.f_pid = tp.f_id
         WHERE tc.f_no = #{cntridName}
           AND tp.f_portofloadid = #{fPortofloadid}
           AND tp.f_distinationid = #{fDistinationid}
           AND #{fEtd} BETWEEN tp.f_begindate AND tp.f_end
+          AND tc.f_status = 'T'
+          AND tp.f_status = 'T'
+        <if test="fPortoftransshipment != null">AND tp.f_portoftransshipment = #{fPortoftransshipment}</if>
+    </select>
+    <select id="selectItemMeaasge" parameterType="TCtnpriceItems" resultMap="TCtnpriceItemsResult">
+        select f_id,
+               f_pid,
+               f_cntrid,
+               f_price,
+               f_status,
+               create_by,
+               create_time,
+               update_by,
+               update_time,
+               remark
+        from t_ctnprice_items
+        where f_pid = #{fPid}
+          AND f_cntrid = #{fCntrid}
     </select>
-    
+
 </mapper>

+ 72 - 40
ruoyi-shipping/src/main/resources/mapper/shipping/TCtnpriceMapper.xml

@@ -1,31 +1,48 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.shipping.mapper.TCtnpriceMapper">
-    
+
     <resultMap type="TCtnprice" id="TCtnpriceResult">
-        <result property="fId"    column="f_id"    />
-        <result property="fPortofloadid"    column="f_portofloadid"    />
-        <result property="fDistinationid"    column="f_distinationid"    />
-        <result property="fPortoftransshipment"    column="f_portoftransshipment"    />
-        <result property="fEtd"    column="f_ETD"    />
-        <result property="fEta"    column="f_ETA"    />
-        <result property="fDays"    column="f_days"    />
-        <result property="fBegindate"    column="f_begindate"    />
-        <result property="fEnd"    column="f_end"    />
-        <result property="fTeu"    column="f_teu"    />
-        <result property="fDates"    column="f_dates"    />
-        <result property="fStatus"    column="f_status"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="remark"    column="remark"    />
+        <result property="fId" column="f_id"/>
+        <result property="fPortofloadid" column="f_portofloadid"/>
+        <result property="fDistinationid" column="f_distinationid"/>
+        <result property="fPortoftransshipment" column="f_portoftransshipment"/>
+        <result property="fEtd" column="f_ETD"/>
+        <result property="fEta" column="f_ETA"/>
+        <result property="fDays" column="f_days"/>
+        <result property="fBegindate" column="f_begindate"/>
+        <result property="fEnd" column="f_end"/>
+        <result property="fTeu" column="f_teu"/>
+        <result property="fDates" column="f_dates"/>
+        <result property="fStatus" column="f_status"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
     </resultMap>
 
     <sql id="selectTCtnpriceVo">
-        select f_id, f_portofloadid, f_distinationid, f_portoftransshipment, f_ETD, f_ETA, f_days, f_begindate, f_end, f_teu, f_dates, f_status, create_by, create_time, update_by, update_time, remark from t_ctnprice
+        select f_id,
+               f_portofloadid,
+               f_distinationid,
+               f_portoftransshipment,
+               f_ETD,
+               f_ETA,
+               f_days,
+               f_begindate,
+               f_end,
+               f_teu,
+               f_dates,
+               f_status,
+               create_by,
+               create_time,
+               update_by,
+               update_time,
+               remark
+        from t_ctnprice
     </sql>
 
     <select id="selectTCtnpriceList" parameterType="TCtnprice" resultMap="TCtnpriceResult">
@@ -58,18 +75,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN t_address ta ON tc.f_portofloadid = ta.f_id
         LEFT JOIN t_address tr ON tc.f_distinationid = tr.f_id
         LEFT JOIN t_address ts ON tc.f_portoftransshipment = ts.f_id
-        <where>  
-            <if test="fPortofloadid != null "> and tc.f_portofloadid = #{fPortofloadid}</if>
-            <if test="fDistinationid != null "> and tc.f_distinationid = #{fDistinationid}</if>
-            <if test="fPortoftransshipment != null "> and tc.f_portoftransshipment = #{fPortoftransshipment}</if>
-            <if test="fEtd != null "> and tc.f_ETD = #{fEtd}</if>
-            <if test="fEta != null "> and tc.f_ETA = #{fEta}</if>
-            <if test="fDays != null "> and tc.f_days = #{fDays}</if>
-            <if test="fBegindate != null "> and tc.f_begindate = #{fBegindate}</if>
-            <if test="fEnd != null "> and tc.f_end = #{fEnd}</if>
-            <if test="fTeu != null  and fTeu != ''"> and tc.f_teu = #{fTeu}</if>
-            <if test="fDates != null  and fDates != ''"> and tc.f_dates = #{fDates}</if>
-            <if test="fStatus != null  and fStatus != ''"> and tc.f_status = #{fStatus}</if>
+        <where>
+            <if test="fPortofloadid != null ">and tc.f_portofloadid = #{fPortofloadid}</if>
+            <if test="fDistinationid != null ">and tc.f_distinationid = #{fDistinationid}</if>
+            <if test="fPortoftransshipment != null ">and tc.f_portoftransshipment = #{fPortoftransshipment}</if>
+            <if test="fEtd != null ">and tc.f_ETD = #{fEtd}</if>
+            <if test="fEta != null ">and tc.f_ETA = #{fEta}</if>
+            <if test="fDays != null ">and tc.f_days = #{fDays}</if>
+            <if test="fBegindate != null ">and tc.f_begindate = #{fBegindate}</if>
+            <if test="fEnd != null ">and tc.f_end = #{fEnd}</if>
+            <if test="fTeu != null  and fTeu != ''">and tc.f_teu = #{fTeu}</if>
+            <if test="fDates != null  and fDates != ''">and tc.f_dates = #{fDates}</if>
+            <if test="fStatus != null  and fStatus != ''">and tc.f_status = #{fStatus}</if>
             <if test="createBy != null  and createBy != ''">and tc.create_by like concat('%', #{createBy}, '%')</if>
             <if test="remark != null  and remark != ''">and tc.remark like concat('%', #{remark}, '%')</if>
             <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
@@ -80,12 +97,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             </if>
         </where>
     </select>
-    
+
     <select id="selectTCtnpriceById" parameterType="Long" resultMap="TCtnpriceResult">
         <include refid="selectTCtnpriceVo"/>
         where f_id = #{fId}
     </select>
-        
+
     <insert id="insertTCtnprice" parameterType="TCtnprice" useGeneratedKeys="true" keyProperty="fId">
         insert into t_ctnprice
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -105,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateBy != null">update_by,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="remark != null">remark,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="fPortofloadid != null">#{fPortofloadid},</if>
             <if test="fDistinationid != null">#{fDistinationid},</if>
@@ -123,7 +140,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="remark != null">#{remark},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateTCtnprice" parameterType="TCtnprice">
@@ -151,14 +168,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <delete id="deleteTCtnpriceById" parameterType="Long">
-        delete from t_ctnprice where f_id = #{fId}
+        delete
+        from t_ctnprice
+        where f_id = #{fId}
     </delete>
 
     <delete id="deleteTCtnpriceByIds" parameterType="String">
-        delete from t_ctnprice where f_id in 
+        delete from t_ctnprice where f_id in
         <foreach item="fId" collection="array" open="(" separator="," close=")">
             #{fId}
         </foreach>
     </delete>
-    
+    <select id="selectMessage" parameterType="TCtnprice" resultMap="TCtnpriceResult">
+        SELECT
+        t.f_id, t.f_portofloadid, t.f_distinationid, t.f_portoftransshipment, t.f_begindate, t.f_end
+        FROM
+        t_ctnprice t
+        WHERE
+        t.f_portofloadid = #{fPortofloadid}
+        AND t.f_distinationid = #{fDistinationid}
+        AND t.f_status = 'T'
+        AND #{fBegindate} BETWEEN t.f_begindate AND t.f_end
+        <if test="fPortoftransshipment != null">AND f_portoftransshipment = #{fPortoftransshipment}</if>
+        <if test="fPortoftransshipment == null">AND f_portoftransshipment IS NULL</if>
+    </select>
+
 </mapper>

+ 1 - 0
ruoyi-shipping/src/main/resources/mapper/shipping/TVoyageMapper.xml

@@ -79,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN t_address ts ON tv.f_portoftransshipment = ts.f_id
         LEFT JOIN sys_user  su ON tv.f_manageid = su.user_id
         <where>
+            tv.f_status = ‘T’
             <if test="fPid != null "> and tv.f_pid = #{fPid}</if>
             <if test="fNo != null  and fNo != ''"> and tv.f_no = #{fNo}</if>
             <if test="fPortofloadid != null "> and tv.f_portofloadid = #{fPortofloadid}</if>

+ 7 - 2
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -633,6 +633,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             TWarehouseBills tWarehouseBills = tWarehouseBillsMapper.selectTWarehousebillsById(warehouseBills.getfId());
             if (!"2".equals(tWarehouseBills.getfBillstatus())
                     || !"3".equals(tWarehouseBills.getfBillstatus())){
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return AjaxResult.error("当前数据不允许暂存");
             }
             warehouseBills.setUpdateTime(DateUtils.getNowDate());
@@ -715,8 +716,10 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             fPid = warehouseBills.getfId();
         } else {
             TWarehouseBills tWarehouseBills = tWarehouseBillsMapper.selectTWarehousebillsById(warehouseBills.getfId());
-            if (!"2".equals(tWarehouseBills.getfBillstatus())
-                    || !"3".equals(tWarehouseBills.getfBillstatus())){
+            if (tWarehouseBills.getfBillstatus() == 2L
+                    || tWarehouseBills.getfBillstatus() == 3L){
+            }else {
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return AjaxResult.error("当前数据不允许提交");
             }
             fPid = warehouseBills.getfId();
@@ -791,6 +794,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         TWarehouseBills tWarehouseBills = tWarehouseBillsMapper.selectTWarehousebillsById(warehouseBills.getfId());
         if (!"7".equals(tWarehouseBills.getfBillstatus())
                 || !"8".equals(tWarehouseBills.getfBillstatus())){
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
             return AjaxResult.error("当前数据不允许暂存");
         }
         warehouseBills.setfBillstatus(7L);
@@ -853,6 +857,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 || tWarehouseBills.getfBillstatus() == 7L
                 || tWarehouseBills.getfBillstatus() == 8L){
         }else {
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
             return AjaxResult.error("当前数据不允许提交");
         }
         tWarehouseBillsMapper.updateTWarehousebills(warehouseBills);