Browse Source

自有车添加本地计费时间,无车添加拆分运单号字段

Administrator 1 year ago
parent
commit
d9594eca36

+ 11 - 2
src/main/java/com/jkcredit/invoice/controller/business/SelfCarController.java

@@ -32,6 +32,7 @@ import com.jkcredit.invoice.service.selfcar.SelfCarInvoiceService;
 import com.jkcredit.invoice.service.selfcar.SelfCarTradeService;
 import com.jkcredit.invoice.util.DateUtil;
 import com.jkcredit.invoice.util.RespR;
+import com.jkcredit.invoice.util.StringUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
@@ -205,7 +206,7 @@ public class SelfCarController {
     @PostMapping("/updateTrades")
     @ApiOperation(value = "更新交易id状态", notes = "更新交易id状态")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_SELFCAR)
-    public void updateTrades(@NotNull(message = "更新交易id状态,不能为空") String selfCarTradesStr, @NotNull(message = "更新交易id状态,不能为空") String companyName, User user) {
+    public RespR updateTrades(@NotNull(message = "更新交易id状态,不能为空") String selfCarTradesStr, @NotNull(message = "更新交易id状态,不能为空") String companyName, User user) {
         try {
             checkHasAuthRole.checkCompanyRole(user, companyName);
             List<SelfCarTrade> selfCarTrades = JSON.parseArray(selfCarTradesStr, SelfCarTrade.class);
@@ -214,8 +215,10 @@ public class SelfCarController {
 
             }
             selfCarTradeService.updateTrades(selfCarTrades);
+            return new RespR(true);
         } catch (Exception e) {
             e.printStackTrace();
+            return new RespR(false,e.getMessage());
         }
     }
 
@@ -512,6 +515,7 @@ public class SelfCarController {
                 return new RespR(false, "客户未备案");
             }
             List<B2BInvoiceListModel> allSelfInvocies = new ArrayList<>();
+            StringBuilder resp = new StringBuilder("");
             customerCarRecs.forEach(customerCarRec -> {
                 SelfCarDueQueryVo selfCarDueQueryVo = new SelfCarDueQueryVo();
                 selfCarDueQueryVo.setCustomername(selfcarInvoiceByTimeVo.getCustomerName());
@@ -523,9 +527,14 @@ public class SelfCarController {
                 if (respR.getCode() == 0) {
                     allSelfInvocies.addAll(respR.getData());
                 }else{
-                    throw new RuntimeException(respR.getMsg());
+                    if(!"未查得".equals(respR.getMsg())){
+                        resp.append(customerCarRec.getEtcNum()).append(":").append(respR.getMsg()).append("#");
+                    }
                 }
             });
+            if(!StringUtil.isEmpty(resp.toString())){
+                return new RespR(false,resp.toString());
+            }
             return new RespR(allSelfInvocies);
         } catch (Exception e) {
             e.printStackTrace();

+ 2 - 0
src/main/java/com/jkcredit/invoice/service/lowerservice/impl/NoCarServiceImpl.java

@@ -910,6 +910,7 @@ public class NoCarServiceImpl implements NoCarService {
         Param param = paramService.getParamsByParamName("CUST_NOCAR_FEE");
         Double fee = Double.parseDouble(param.getParamValue());
         Customer customer = customerMapper.selectByCustomerNameForLock(noCarWayBill.getCustomerName());
+        log.info("recode customerBlance before:[{}],[{}],[{}]",customer.getCustomerName(),customer.getAccountBalance(),carCalculateInfors.size());
         customer.setInvoiceTime(DateUtil.getCurrentDateStr());
         carCalculateInfors.stream().forEach(calculateInfor -> {
             try {
@@ -924,6 +925,7 @@ public class NoCarServiceImpl implements NoCarService {
 
         });
         if (isKf == 1) {
+            log.info("recode customerBlance after:[{}],[{}]",customer.getCustomerName(),customer.getAccountBalance());
             customerMapper.updateByPrimaryKeySelective(customer);
         }
         return false;

+ 1 - 1
src/main/java/com/jkcredit/invoice/service/lowerservice/impl/SelfCarCustServiceImpl.java

@@ -103,7 +103,7 @@ public class SelfCarCustServiceImpl implements SelfCarCustService {
                 if(tradeRequestVo.getTradeStatus() == 1 && resp.getMsg().contains("该卡号不在该企业下绑定")){
                     int i = sellCarTradeMapper.deletebyEtcAndTime(tradeRequestVo);
                     log.info("本次删除条数{},etcId{},reultNum",i,tradeRequestVo.getEtcId(),0);
-                }else{
+                }else if(tradeRequestVo.getTradeStatus() == 2 && resp.getMsg().contains("该卡号不在该企业下绑定")){
                     sellCarTradeMapper.updatebindStatus(2,tradeRequestVo.getEtcId(),customerRec.getCompanyNum());
                     log.info("{}更新成功bindstatus",tradeRequestVo.getEtcId());
                 }

+ 6 - 0
src/main/java/com/jkcredit/invoice/task/ScheduledBillTask.java

@@ -171,6 +171,12 @@ public class ScheduledBillTask {
     }
     @Autowired
     SelfCarInterface selfCarInterface;
+
+
+    @Scheduled(cron = "0 20 30 4 * ?", zone = "Asia/Shanghai")
+    public void  test()throws Exception{
+        getSefCarInvoice();
+    }
     /**
      * @Scheduled(cron = "0 0 23 * * ?", zone = "Asia/Shanghai")
      * @throws Exception