Browse Source

优化代码提交

mashengyi 3 years ago
parent
commit
eec2e4f14f

+ 34 - 24
src/main/java/com/jkcredit/invoice/credit/custInterface/SelfCarInterServiceImpl.java

@@ -59,7 +59,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
         String plateNum = jsonObject.getString("plateNum");//车牌号 非必输
         Integer plateColor = jsonObject.getInteger("plateColor");//车牌颜色 非必输
         if(StringUtils.isEmpty(data)|| null == jsonObject || StringUtils.isEmpty(companyNum)){
-            result.setData(2);
+            result.setData(3);
             result.setMsg("请输入必输项!");
             return  result;
         }
@@ -70,7 +70,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
         customerRec.setInterType(0);
         CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec);
             if (null == customerRec1){
-                result.setCode(2);
+                result.setCode(200);
                 result.setMsg("该企业编号在平台中不存在,请联系管理员核实!");
                 return result;
             }
@@ -89,10 +89,17 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
         if(null != rs && rs.getCode() == 0){
            result.setData(1);
            result.setCode(200);
+
            result.setMsg(rs.getData().toString());
            return result;
         } else {
-            result.setData(2);
+            if(rs!=null && rs.getCode()==2){
+                result.setData(2);
+                result.setCode(200);
+                result.setMsg("未查得");
+                return result;
+            }
+            result.setData(3);
             result.setCode(200);
             result.setMsg(rs.getMsg());
             return result;
@@ -138,7 +145,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             if(StringUtils.isEmpty(data)|| null == jsonObject || StringUtils.isEmpty(companyNum)
                     || null == vehicleList
                      ){
-                result.setCode(2);
+                result.setCode(200);
                 result.setMsg("必传参数有为空情况,请核实后再试");
                 return  result;
             }
@@ -186,9 +193,12 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
                 result.setMsg(rs.getData().toString());
                 return result;
             } else {
-                result.setData(2);
+                result.setData(3);
                 result.setCode(200);
                 result.setMsg(rs.getMsg());
+                if("未查得".equals(rs.getMsg())){
+                    result.setData(2);
+                }
                 return result;
             }
         } catch (Exception e) {
@@ -234,7 +244,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
                     || null == cardIdList
 
             ){
-                result.setCode(2);
+                result.setCode(200);
                 result.setMsg("必传参数有为空情况,请核实后再试");
                 return  result;
             }
@@ -244,7 +254,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             customerRec.setCompanyNum(companyNum);
             CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec);
             if (null == customerRec1){
-                result.setCode(2);
+                result.setCode(200);
                 result.setMsg("该企业编号在平台中不存在,请联系管理员核实!");
                 return result;
             }
@@ -259,7 +269,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
 
                 if(null == jb || StringUtils.isEmpty(cardId)
                 ){
-                    result.setCode(2);
+                    result.setCode(200);
                     result.setMsg("用户卡为空!");
                     return  result;
                 }
@@ -281,7 +291,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
                 result.setMsg(rs.getData().toString());
                 return result;
             } else {
-                result.setData(2);
+                result.setData(3);
                 result.setCode(200);
                 result.setMsg(rs.getMsg());
                 return result;
@@ -326,7 +336,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
                     || StringUtils.isEmpty(validCode)
 
             ){
-                result.setCode(2);
+                result.setCode(200);
                 result.setMsg("必传参数有为空情况,请核实后再试");
                 return  result;
             }
@@ -336,7 +346,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             customerRec.setCompanyNum(companyNum);
             CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec);
             if (null == customerRec1){
-                result.setCode(2);
+                result.setCode(200);
                 result.setMsg("该企业编号在平台中不存在,请联系管理员核实!");
                 return result;
             }
@@ -358,7 +368,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
                 result.setMsg(rs.getData().toString());
                 return result;
             } else {
-                result.setData(2);
+                result.setData(3);
                 result.setCode(200);
                 result.setMsg(rs.getMsg());
                 return result;
@@ -408,7 +418,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
                     || StringUtils.isEmpty(endExTime)
 
             ){
-                result.setCode(2);
+                result.setCode(200);
                 result.setMsg("必传参数有为空情况,请核实后再试");
                 return  result;
             }
@@ -418,7 +428,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             customerRec.setCompanyNum(companyNum);
             CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec);
             if (null == customerRec1){
-                result.setCode(2);
+                result.setCode(200);
                 result.setMsg("该企业编号在平台中不存在,请联系管理员核实!");
                 return result;
             }
@@ -466,7 +476,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
                 result.setMsg(rs.getData().toString());
                 return result;
             } else {
-                result.setData(2);
+                result.setData(3);
                 result.setCode(200);
                 result.setMsg(rs.getMsg());
                 return result;
@@ -513,7 +523,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
                     || StringUtils.isEmpty(cardId)
                     || null == tradeIdModel
             ){
-                result.setCode(2);
+                result.setCode(200);
                 result.setMsg("必传参数有为空情况,请核实后再试");
                 return  result;
             }
@@ -523,7 +533,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             customerRec.setCompanyNum(companyNum);
             CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec);
             if (null == customerRec1 ){
-                result.setCode(2);
+                result.setCode(200);
                 result.setMsg("该企业编号在平台中不存在,请联系管理员核实!");
                 return result;
             }
@@ -557,7 +567,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
                 result.setMsg(rs.getData().toString());
                 return result;
             } else {
-                result.setData(2);
+                result.setData(3);
                 result.setCode(200);
                 result.setMsg(rs.getMsg());
                 return result;
@@ -604,7 +614,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
                     || StringUtils.isEmpty(endInvoiceMakeTime)
 
             ){
-                result.setCode(2);
+                result.setCode(200);
                 result.setMsg("必传参数有为空情况,请核实后再试");
                 return  result;
             }
@@ -614,7 +624,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             customerRec.setCompanyNum(companyNum);
             CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec);
             if (null == customerRec1){
-                result.setCode(2);
+                result.setCode(200);
                 result.setMsg("该企业编号在平台中不存在,请联系管理员核实!");
                 return result;
             }
@@ -636,7 +646,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
                 result.setMsg(rs.getMsg());
                 return result;
             } else {
-                result.setData(2);
+                result.setData(3);
                 result.setCode(200);
                 result.setMsg(rs.getMsg());
                 return result;
@@ -680,7 +690,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
                     || StringUtils.isEmpty(makeMonth)
 
             ){
-                result.setCode(2);
+                result.setCode(200);
                 result.setMsg("必传参数有为空情况,请核实后再试");
                 return  result;
             }
@@ -690,7 +700,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
             customerRec.setCompanyNum(companyNum);
             CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec);
             if (null == customerRec1){
-                result.setCode(2);
+                result.setCode(200);
                 result.setMsg("该企业编号在平台中不存在,请联系管理员核实!");
                 return result;
             }
@@ -710,7 +720,7 @@ public class SelfCarInterServiceImpl implements SelfCarInterService {
                 result.setMsg(rs.getData().toString());
                 return result;
             } else {
-                result.setData(2);
+                result.setData(3);
                 result.setCode(200);
                 result.setMsg(rs.getMsg());
                 return result;

+ 11 - 7
src/main/java/com/jkcredit/invoice/service/lowerService/impl/SelfCarServiceLImpl.java

@@ -82,8 +82,8 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
         }
         CustomerCarRec customerCarRec = customerCarRecMapper.selectByETC(tradeRequestVo.getEtcId());
         if(customerCarRec == null || customerCarRec.getRecStatus() != 1){
-            MIX_LOG.info("获取交易失败SelfCarServiceLImpl.getTradeList{},msg{}",tradeRequestVo,"该etc卡未绑定或绑定类型错误");
-            return new RespR(false,"该etc卡未绑定或绑定类型错误");
+            MIX_LOG.info("获取交易失败SelfCarServiceLImpl.getTradeList{},msg{}",tradeRequestVo,"业务校验错误:该卡号不在该企业下绑定!\\n:803");
+            return new RespR(false,"业务校验错误:该卡号不在该企业下绑定!\\n:803");
         }
         CardTradeRequest cardTradeRequest = new CardTradeRequest();
         cardTradeRequest.setCardId(tradeRequestVo.getEtcId());
@@ -152,8 +152,8 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
         }
         CustomerCarRec customerCarRec = customerCarRecMapper.selectByETC(invoiceApplVo.getCardId());
         if(customerCarRec == null || customerCarRec.getRecStatus() != 1){
-            MIX_LOG.info("申请开票失败SelfCarServiceLImpl.applInvoice{},msg{}",invoiceApplVo,"该etc卡未绑定或绑定类型错误");
-            return new RespR(false,"该etc卡未绑定或绑定类型错误");
+            MIX_LOG.info("申请开票失败SelfCarServiceLImpl.applInvoice{},msg{}",invoiceApplVo,"业务校验错误:该卡号不在该企业下绑定!\\n:803");
+            return new RespR(false,"业务校验错误:该卡号不在该企业下绑定!\\n:803");
         }
         B2BInvoiceApplyRequest b2BInvoiceApplyRequest = new B2BInvoiceApplyRequest();
         b2BInvoiceApplyRequest.setCardId(invoiceApplVo.getCardId());
@@ -329,7 +329,7 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
         }
         CustomerCarRec customerCarRec = customerCarRecMapper.selectByETC(selfCarDueQueryVo.getCardId());
         if(customerCarRec == null  || customerCarRec.getRecStatus() != 1){
-            return new RespR(false,"该etc卡未绑定或绑定类型错误");
+            return new RespR(false,"业务校验错误:该卡号不在该企业下绑定!\\n:803");
         }
         B2BInvoiceQueryRequest b2BInvoiceQueryRequest = new B2BInvoiceQueryRequest();
         b2BInvoiceQueryRequest.setCompanyNum(customerRec.getCompanyNum());
@@ -416,7 +416,11 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
         cardQueryCardToBRequest.setPlateNum(etcQueryVo.getPlateNum());//车牌号,非必输
         cardQueryCardToBRequest.setPalteColor(etcQueryVo.getPlateColor());//车牌颜色.非必输
         RespR<CardBindQueryListToBResponse> respR = selfCarInterface.cardBindQueryListToB(cardQueryCardToBRequest);
+
         if(customerRec.getInterType() == 0){
+            if(respR.getCode() == 0 && (respR.getData().getResult()==null||respR.getData().getResult().size()==0)){
+                respR.setCode(2);
+            }
             return respR;
         }
         if(respR.getCode() == 1){
@@ -459,9 +463,9 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
             MIX_LOG.info("获取etc信息失败:SelfCarServiceLImpl.queryEtcInfo{},msg{}",etcBindVo,respR.getMsg());
             return new RespR(false,respR.getMsg());
         }
-        if(respR.getData().getResult() == null){
+        if(respR.getData().getResult() == null || respR.getData().getResult().size()<=0){
             MIX_LOG.info("获取etc信息失败:SelfCarServiceLImpl.queryEtcInfo{},msg{}",etcBindVo,"没有etc卡");
-            return new RespR(false,"未查");
+            return new RespR(false,"未查");
         }
         return new RespR(respR.getData().getResult());