소스 검색

无车优化,自有车接口返回

Administrator 2 년 전
부모
커밋
b8906e2e94

+ 2 - 0
src/main/java/com/jkcredit/invoice/mapper/waybill/NoCarWaybillMapper.java

@@ -25,7 +25,9 @@ public interface NoCarWaybillMapper extends BaseMapper<NoCarWayBill>{
     int updateByBillNum(NoCarWayBill record);
     int updateByBillNumTimeRes(NoCarWayBill record);
     NoCarWayBill selectByBillNum(String wayBillNum);
+    List<NoCarWayBill> selectByBillNumForRe(String wayBillNum);
     NoCarWayBill selectByBillNumforLock(String wayBillNum);
+    void deleteNotRightWayBill(String wayBillNum);
     List<NoCarWayBill> selectByHisFlagAndBillStatus(NoCarWayBill noCarWayBill);
 
     int upDateCompany(CompanyVo companyVo);

+ 24 - 4
src/main/java/com/jkcredit/invoice/service/lowerservice/impl/NoCarServiceImpl.java

@@ -220,7 +220,12 @@ public class NoCarServiceImpl implements NoCarService{
         try {
             noCarWayBillDb = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
         }catch (Exception e){
-            return new RespR(false,"有重复运单,请联系管理员删除");
+            noCarWaybillMapper.deleteNotRightWayBill(noCarWayBill.getBillNum());
+            try {
+                noCarWayBillDb = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
+            }catch (Exception e1){
+                return new RespR(false,"运单异常,请联系管理员处理");
+            }
         }
         if(noCarWayBillDb!=null && noCarWayBillDb.getBillwayStatus()>0){
             return new   RespR(false,"开始指令已经上传成功");
@@ -324,7 +329,12 @@ public class NoCarServiceImpl implements NoCarService{
         try {
             noCarWayBillDb = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
         }catch (Exception e){
-            return new RespR(false,"有重复运单,请联系管理员删除");
+            noCarWaybillMapper.deleteNotRightWayBill(noCarWayBill.getBillNum());
+            try {
+                noCarWayBillDb = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
+            }catch (Exception e1){
+                return new RespR(false,"运单异常,请联系管理员处理");
+            }
         }
         if(noCarWayBillDb == null){
             try{
@@ -405,7 +415,12 @@ public class NoCarServiceImpl implements NoCarService{
         try {
             noCarWayBillDb = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
         }catch (Exception e){
-            return new RespR(false,"有重复运单,请联系管理员删除");
+            noCarWaybillMapper.deleteNotRightWayBill(noCarWayBill.getBillNum());
+            try {
+                noCarWayBillDb = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
+            }catch (Exception e1){
+                return new RespR(false,"运单异常,请联系管理员处理");
+            }
         }
         if(noCarWayBillDb!=null && noCarWayBillDb.getBillwayStatus()>0){
             return new   RespR(false,"开始指令已经上传成功,请勿重复上传");
@@ -471,7 +486,12 @@ public class NoCarServiceImpl implements NoCarService{
         try {
             noCarWayBillDb = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
         }catch (Exception e){
-            return new RespR(false,"有重复运单,请联系管理员删除");
+            noCarWaybillMapper.deleteNotRightWayBill(noCarWayBill.getBillNum());
+            try {
+                noCarWayBillDb = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
+            }catch (Exception e1){
+                return new RespR(false,"运单异常,请联系管理员处理");
+            }
         }
         if(noCarWayBillDb == null){
             try{

+ 10 - 1
src/main/resources/mapper/waybill/NoCarWaybillMapper.xml

@@ -229,6 +229,12 @@
         from t_waybill_no
         where  billNum = BINARY #{billNum,jdbcType=VARCHAR}
     </select>
+    <select id="selectByBillNumForRe" resultMap="BaseResultMap" parameterType="java.lang.String" >
+        select
+        <include refid="baseSql" />
+        from t_waybill_no
+        where  billNum = BINARY #{billNum,jdbcType=VARCHAR}
+    </select>
     <select id="selectByBillNumforLock" resultMap="BaseResultMap" parameterType="java.lang.String" >
         select
         <include refid="baseSql" />
@@ -254,5 +260,8 @@
    <update id="upDateCompany" parameterType="com.jkcredit.invoice.model.vo.CompanyVo">
        UPDATE t_waybill_no set companyName = #{newCompanyName} where companyName = #{oldCompanyName}
    </update>
-
+   <delete id="deleteNotRightWayBill" parameterType="java.lang.String">
+        delete from t_waybill_no
+        where  billNum = BINARY #{billNum,jdbcType=VARCHAR} and billwayStatus &lt; 1
+   </delete>
 </mapper>