Sfoglia il codice sorgente

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

Administrator 3 anni fa
parent
commit
de55d0ff22

+ 1 - 1
src/main/java/com/jkcredit/invoice/mapper/Binvoce/SelfCarInvoiceMapper.java

@@ -21,6 +21,6 @@ public interface SelfCarInvoiceMapper extends BaseMapper<SelfCarInvoice> {
     List<SelfCarInvoice> selectByCardId(String cardId);
 
     List<SelfCarInvoice> selectByTradeAndInvoiceMakeTime(SelfCarInvoice record);
-    SelfCarInvoice selectByCodeAndNum(SelfCarInvoice record);
+    List<SelfCarInvoice> selectByCodeAndNum(SelfCarInvoice record);
     int upDateCompany(CompanyVo companyVo);
 }

+ 1 - 0
src/main/java/com/jkcredit/invoice/mapper/customer/CustomerCarRecMapper.java

@@ -21,6 +21,7 @@ public interface CustomerCarRecMapper extends BaseMapper<CustomerCarRec> {
     List<CustomerCarRec>  selectByCustName(String customerName);
 
     CustomerCarRec selectByETC(String etcNum);
+    CustomerCarRec selectByETCForLock(String etcNum);
     List<CustomerCarRec> selectByCarNum(String carNum);
     List<CustomerCarRec> selectBySelfCarNum(String carNum);
     List<CustomerCarRec> selectAllEtcBySelfCarNum(String carNum);

+ 3 - 1
src/main/java/com/jkcredit/invoice/service/lowerService/impl/SelfCarServiceLImpl.java

@@ -59,6 +59,7 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
     @Autowired
     CustomerService customerService;
     @Override
+    @Transactional
     public RespR<List<CardTradeModel>> getTradeList(TradeRequestVo tradeRequestVo) {
         log.info("获取交易开始SelfCarServiceLImpl.getTradeList{}",tradeRequestVo);
         Customer customer = customerMapper.selectByCustomerName(tradeRequestVo.getCustomerName());
@@ -97,6 +98,7 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
             List<CardTradeModel> result  = cardTradeResponse.getResult();
             //对不存在的tradeId入表
             if(result!=null && result.size()>0){
+                customerCarRecMapper.selectByETCForLock(tradeRequestVo.getEtcId());
                 for(CardTradeModel cardTradeModel:result){
                     SelfCarTrade selfCarTrade =  sellCarTradeMapper.selectByTradeId(cardTradeModel.getTradeId());
                     if(selfCarTrade == null){
@@ -341,7 +343,7 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
                     selfCarInvoice.setCompanyNum(customerRec.getCompanyNum());
                     selfCarInvoice.setEnStation(b2BInvoiceListModel.getEnStationName());
                     selfCarInvoice.setExStation(b2BInvoiceListModel.getExStationName());
-                    SelfCarInvoice selfCarInvoice1 = selfCarInvoiceMapper.selectByCodeAndNum(selfCarInvoice);
+                    List<SelfCarInvoice> selfCarInvoice1 = selfCarInvoiceMapper.selectByCodeAndNum(selfCarInvoice);
                     if(selfCarInvoice1==null){
                         selfCarInvoiceMapper.insert(selfCarInvoice);
                     }

+ 6 - 0
src/main/resources/mapper/customer/CustomerCarRecMapper.xml

@@ -90,6 +90,12 @@
     from t_customer_carRec
     where  etc_num = BINARY #{etcNum,jdbcType=VARCHAR} AND bussiness_type=0
   </select>
+  <select id="selectByETCForLock" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from t_customer_carRec
+    where  etc_num = BINARY #{etcNum,jdbcType=VARCHAR} AND bussiness_type=0 FOR UPDATE
+  </select>
   <update id="updateWaitETCStatus" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerCarRec">
     update t_customer_carRec set rec_status = #{recStatus,jdbcType=INTEGER} ,succ_time = #{succTime,jdbcType=VARCHAR}, fail_time = #{failTime,jdbcType=VARCHAR}
     , fail_reason = #{failReason,jdbcType=VARCHAR}, inter_type = #{interType,jdbcType=VARCHAR}