Parcourir la source

客户下游接口开发_20210925_2

MSY il y a 3 ans
Parent
commit
b2651ae85a

+ 18 - 14
src/main/java/com/jkcredit/invoice/credit/custInterface/NoCarInterServiceImpl.java

@@ -13,10 +13,12 @@ import com.jkcredit.invoice.model.entity.customer.Customer;
 import com.jkcredit.invoice.model.entity.customer.CustomerCarRec;
 import com.jkcredit.invoice.model.entity.customer.CustomerRec;
 import com.jkcredit.invoice.model.entity.invoice.BillInvoice;
+import com.jkcredit.invoice.model.entity.manager.Param;
 import com.jkcredit.invoice.model.entity.waybill.NoCarWayBill;
 import com.jkcredit.invoice.service.lowerService.NoCarService;
 import com.jkcredit.invoice.service.lowerService.SelfCarServiceL;
 import com.jkcredit.invoice.service.lowerService.vo.*;
+import com.jkcredit.invoice.service.manager.ParamService;
 import com.jkcredit.invoice.util.RespR;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -50,6 +52,8 @@ public class NoCarInterServiceImpl implements NoCarInterService {
     @Autowired
     CustomerMapper customerMapper;
 
+    @Autowired
+    ParamService paramService;
 
     /**
      * 无车 车辆备案接口
@@ -73,35 +77,35 @@ public class NoCarInterServiceImpl implements NoCarInterService {
         try {
             log.info("[-NoCarInterServiceImpl.customerCarRec-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data);
             JSONObject jsonObject = JSONObject.parseObject(data);
-            String companyName =  jsonObject.getString("companyName");//企业名称 
+            String companyName =  jsonObject.getString("companyName");//企业名称 
             String plateNumber =  jsonObject.getString("plateNumber");//plateNumber 必输
             String plateColor =  jsonObject.getString("plateColor");//plateColor 必输
             if(StringUtils.isEmpty(data)|| null == jsonObject || StringUtils.isEmpty(plateNumber)
-                    || StringUtils.isEmpty(plateColor)
+                    || StringUtils.isEmpty(plateColor) || StringUtils.isEmpty(companyName)
 
             ){
                 return  result;
             }
 
-            CustomerCarRec customerCarRec1 = customerCarRecMapper.selectByCarNum(plateNumber);
+          /*  CustomerCarRec customerCarRec1 = customerCarRecMapper.selectByCarNum(plateNumber);
 
             if (null == customerCarRec1){
                 return result;
-            }
+            }*/
 
             List<CustomerCarRec> customerCarRecList = new ArrayList<CustomerCarRec>();
             CustomerCarRec customerCarRec = new CustomerCarRec();
             customerCarRec.setCustomerName(appKey);
-            if(StringUtils.isEmpty(companyName)){
+            /*if(StringUtils.isEmpty(companyName)){
                 customerCarRec.setCompanyName(customerCarRec1.getCompanyName());
-            }else {
+            }else {*/
                 customerCarRec.setCompanyName(companyName);
-            }
+           // }
 
-            customerCarRec.setBusinessType(customerCarRec1.getBusinessType());
+            customerCarRec.setBusinessType("2");//无车
             customerCarRec.setCarColor(plateColor);
             customerCarRec.setCarNum(plateNumber);
-            customerCarRec.setServiceOperation(customerCarRec1.getServiceOperation());
+          //  customerCarRec.setServiceOperation(customerCarRec1.getServiceOperation());
 
             customerCarRecList.add(customerCarRec);
 
@@ -162,18 +166,18 @@ public class NoCarInterServiceImpl implements NoCarInterService {
                 return  result;
             }
 
-            CustomerCarRec customerCarRec1 = customerCarRecMapper.selectByCarNum(plateNumber);
+           /* CustomerCarRec customerCarRec1 = customerCarRecMapper.selectByCarNum(plateNumber);
             if (null == customerCarRec1){
                 return result;
-            }
+            }*/
 
             CustomerCarRec customerCarRec = new CustomerCarRec();
-
-            customerCarRec.setCompanyNum(customerCarRec1.getCompanyNum());
+            Param param = paramService.getParamsByParamName("REQUEST_COMPANY_NUM");
+            customerCarRec.setCompanyNum(param.getParamValue());//无车,车辆备案,运单上传,运单查询都是统一用交科的企业编号;自有车用客户的企业编号
             customerCarRec.setCarColor(plateColor);
             customerCarRec.setCarNum(plateNumber);
             customerCarRec.setCustomerName(appKey);
-            customerCarRec.setCompanyName(customerCarRec1.getCompanyName());
+            //customerCarRec.setCompanyName(customerCarRec1.getCompanyName());
 
             RespR rs = noCarService.customerCarRecQueryUpper(customerCarRec);
             long costtimeend = System.currentTimeMillis();

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

@@ -160,14 +160,14 @@ public class NoCarServiceImpl implements NoCarService{
             res.append("#客户:"+customer.getCustomerName()+"不存在或状态异常");
             return new RespR(false,res.toString());
         }
-        CustomerRec customerRecP = new CustomerRec();
+     /*   CustomerRec customerRecP = new CustomerRec();
         customerRecP.setCustomerName(customerCarRec.getCustomerName());
         customerRecP.setCompanyName(customerCarRec.getCompanyName());
         CustomerRec customerRec = customerRecMapper.selectByCustomerNameAndCompany(customerRecP);
         if(customerRec == null){
             res.append("#客户:"+customerCarRec.getCustomerName()+"企业:"+customerCarRec.getCompanyName()+"备案信息不存在");
             return new RespR(false,res.toString());
-        }
+        }*/
 
         VehicleQueryRequest vehicleQueryRequest = new VehicleQueryRequest();
         vehicleQueryRequest.setCompanyNum(customerCarRec.getCompanyNum());