|
@@ -16,7 +16,7 @@ import com.jkcredit.invoice.model.entity.manager.Param;
|
|
|
import com.jkcredit.invoice.model.entity.waybill.NoCarWayBill;
|
|
|
import com.jkcredit.invoice.service.customer.CustomerRecService;
|
|
|
import com.jkcredit.invoice.service.lowerservice.NoCarService;
|
|
|
-import com.jkcredit.invoice.service.lowerservice.vo.HCInvoiceQueryVo;
|
|
|
+import com.jkcredit.invoice.service.lowerservice.vo.HcInvoiceQueryVo;
|
|
|
import com.jkcredit.invoice.service.manager.ParamService;
|
|
|
import com.jkcredit.invoice.service.nocar.NoCarBillWayImportService;
|
|
|
import com.jkcredit.invoice.util.DateUtil;
|
|
@@ -81,7 +81,8 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
// 差集 (list1 - list2)
|
|
|
List<String> reduce1 = list1.stream().filter(item -> !list2.contains(item)).collect(toList());
|
|
|
System.out.println("---差集 reduce1 (list1 - list2)---");
|
|
|
- reduce1.parallelStream().forEach(System.out::println); // 并集
|
|
|
+ // 并集
|
|
|
+ reduce1.parallelStream().forEach(System.out::println);
|
|
|
List<String> listAll = list1.parallelStream().collect(toList());
|
|
|
List<String> listAll2 = list2.parallelStream().collect(toList());
|
|
|
listAll.addAll(listAll2);
|
|
@@ -123,9 +124,12 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
try {
|
|
|
log.info("[-NoCarInterServiceImpl.customerCarRec-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
|
|
|
JSONObject jsonObject = JSONObject.parseObject(data);
|
|
|
- String companyName = jsonObject.getString("companyName");//企业名称 选输
|
|
|
- String plateNumber = jsonObject.getString("plateNumber");//plateNumber 必输
|
|
|
- String plateColor = jsonObject.getString("plateColor");//plateColor 必输
|
|
|
+ //企业名称 选输
|
|
|
+ String companyName = jsonObject.getString("companyName");
|
|
|
+ //plateNumber 必输
|
|
|
+ String plateNumber = jsonObject.getString("plateNumber");
|
|
|
+ //plateColor 必输
|
|
|
+ String plateColor = jsonObject.getString("plateColor");
|
|
|
if (StringUtils.isEmpty(data) || null == jsonObject || StringUtils.isEmpty(plateNumber)
|
|
|
|| StringUtils.isEmpty(plateColor)
|
|
|
|
|
@@ -150,12 +154,14 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
}
|
|
|
customerCarRec.setCompanyName(customerRec1.getCompanyName());
|
|
|
customerCarRec.setCustomerName(customerRec1.getCustomerName());
|
|
|
- customerCarRec.setBusinessType("2");//无车
|
|
|
+ //无车
|
|
|
+ customerCarRec.setBusinessType("2");
|
|
|
customerCarRec.setCarColor(plateColor);
|
|
|
customerCarRec.setCarNum(plateNumber);
|
|
|
customerCarRec.setInterType(0);
|
|
|
if (SELF_CAR.equals(customerCarRec.getCarColor())) {
|
|
|
- customerCarRec.setServiceOperation(1);//默认运营车辆
|
|
|
+ //默认运营车辆
|
|
|
+ customerCarRec.setServiceOperation(1);
|
|
|
}
|
|
|
|
|
|
customerCarRecList.add(customerCarRec);
|
|
@@ -206,9 +212,12 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
try {
|
|
|
log.info("[-NoCarInterServiceImpl.customeRecUpperQuery-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
|
|
|
JSONObject jsonObject = JSONObject.parseObject(data);
|
|
|
- String waybillSource = jsonObject.getString("waybillSource");//备案来源 选输
|
|
|
- String plateNumber = jsonObject.getString("plateNumber");//plateNumber 必输
|
|
|
- String plateColor = jsonObject.getString("plateColor");//plateColor 必输
|
|
|
+ //备案来源 选输
|
|
|
+ String waybillSource = jsonObject.getString("waybillSource");
|
|
|
+ //plateNumber 必输
|
|
|
+ String plateNumber = jsonObject.getString("plateNumber");
|
|
|
+ //plateColor 必输
|
|
|
+ String plateColor = jsonObject.getString("plateColor");
|
|
|
if (StringUtils.isEmpty(data) || null == jsonObject || StringUtils.isEmpty(plateNumber)
|
|
|
|| StringUtils.isEmpty(plateColor)
|
|
|
|
|
@@ -220,12 +229,15 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
|
|
|
CustomerCarRec customerCarRec = new CustomerCarRec();
|
|
|
Param param = paramService.getParamsByParamName("REQUEST_COMPANY_NUM");
|
|
|
- customerCarRec.setCompanyNum(param.getParamValue());//无车,车辆备案,运单上传,运单查询都是统一用交科的企业编号;自有车用客户的企业编号
|
|
|
+ //无车,车辆备案,运单上传,运单查询都是统一用交科的企业编号;自有车用客户的企业编号
|
|
|
+ customerCarRec.setCompanyNum(param.getParamValue());
|
|
|
customerCarRec.setCarColor(plateColor);
|
|
|
customerCarRec.setCarNum(plateNumber);
|
|
|
customerCarRec.setCustomerName(appKey);
|
|
|
- customerCarRec.setBusinessType("2");//无车
|
|
|
- customerCarRec.setInterType(8);//此处代表仅查询上游接口,无任何处理逻辑
|
|
|
+ //无车
|
|
|
+ customerCarRec.setBusinessType("2");
|
|
|
+ //此处代表仅查询上游接口,无任何处理逻辑
|
|
|
+ customerCarRec.setInterType(8);
|
|
|
|
|
|
RespR rs = noCarService.customerCarRecQueryUpper(customerCarRec);
|
|
|
long costtimeend = System.currentTimeMillis();
|
|
@@ -276,16 +288,26 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
try {
|
|
|
log.info("[-NoCarInterServiceImpl.noCarBillStart-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
|
|
|
JSONObject jsonObject = JSONObject.parseObject(data);
|
|
|
- String num = jsonObject.getString("num");//运单编号 必选
|
|
|
- String plateNumber = jsonObject.getString("plateNumber");//车牌号 必选
|
|
|
- String plateColor = jsonObject.getString("plateColor");//车牌颜色 必选
|
|
|
- String startTime = jsonObject.getString("startTime");//运单开始时间 必选
|
|
|
- String sourceAddr = jsonObject.getString("sourceAddr");//运单开始地址 必选
|
|
|
- String destAddr = jsonObject.getString("destAddr");//运单目的地址 必选
|
|
|
- String predictEndTime = jsonObject.getString("predictEndTime");//运单预计完成时间 必选
|
|
|
- Integer fee = jsonObject.getInteger("fee");//运单费用 必选
|
|
|
- Integer titleType = jsonObject.getInteger("titleType");//发票抬头类型 必选
|
|
|
- String taxplayerCode = jsonObject.getString("taxplayerCode");//税号 必选
|
|
|
+ //运单编号 必选
|
|
|
+ String num = jsonObject.getString("num");
|
|
|
+ //车牌号 必选
|
|
|
+ String plateNumber = jsonObject.getString("plateNumber");
|
|
|
+ //车牌颜色 必选
|
|
|
+ String plateColor = jsonObject.getString("plateColor");
|
|
|
+ //运单开始时间 必选
|
|
|
+ String startTime = jsonObject.getString("startTime");
|
|
|
+ //运单开始地址 必选
|
|
|
+ String sourceAddr = jsonObject.getString("sourceAddr");
|
|
|
+ //运单目的地址 必选
|
|
|
+ String destAddr = jsonObject.getString("destAddr");
|
|
|
+ //运单预计完成时间 必选
|
|
|
+ String predictEndTime = jsonObject.getString("predictEndTime");
|
|
|
+ //运单费用 必选
|
|
|
+ Integer fee = jsonObject.getInteger("fee");
|
|
|
+ //发票抬头类型 必选
|
|
|
+ Integer titleType = jsonObject.getInteger("titleType");
|
|
|
+ //税号 必选
|
|
|
+ String taxplayerCode = jsonObject.getString("taxplayerCode");
|
|
|
if (StringUtils.isEmpty(data) || null == jsonObject
|
|
|
|| StringUtils.isEmpty(num)
|
|
|
|| StringUtils.isEmpty(plateNumber)
|
|
@@ -339,12 +361,15 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
customerCarRec.setCarNum(noCarWayBill.getPlateNum());
|
|
|
customerCarRec.setCarColor(noCarWayBill.getPlateColor());
|
|
|
customerCarRec.setCustomerName(appKey);
|
|
|
- customerCarRec.setInterType(0);//接口
|
|
|
+ //接口
|
|
|
+ customerCarRec.setInterType(0);
|
|
|
customerCarRec.setCompanyNum(customerRec.getCompanyNum());
|
|
|
customerCarRec.setBusinessType("2");
|
|
|
- customerCarRec.setServiceOperation(1);//默认运营车辆
|
|
|
+ //默认运营车辆
|
|
|
+ customerCarRec.setServiceOperation(1);
|
|
|
noCarWayBill.setTitleType(2);
|
|
|
- noCarWayBill.setInterType(0);//接口
|
|
|
+ //接口
|
|
|
+ noCarWayBill.setInterType(0);
|
|
|
return getDataResult(data, costtimestart, result, noCarWayBill, customerCarRecs, customerCarRec);
|
|
|
} catch (Exception e) {
|
|
|
log.error("[-NoCarInterServiceImpl.noCarBillStart-] get httpclient exception is "
|
|
@@ -408,9 +433,12 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
try {
|
|
|
log.info("[-NoCarInterServiceImpl.noCarBillEnd-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
|
|
|
JSONObject jsonObject = JSONObject.parseObject(data);
|
|
|
- String num = jsonObject.getString("num");//运单号 必输
|
|
|
- String realDestAddr = jsonObject.getString("realDestAddr");//运单实际目的地址 必输
|
|
|
- String endTime = jsonObject.getString("endTime");//运单实际结束时间 必输
|
|
|
+ //运单号 必输
|
|
|
+ String num = jsonObject.getString("num");
|
|
|
+ //运单实际目的地址 必输
|
|
|
+ String realDestAddr = jsonObject.getString("realDestAddr");
|
|
|
+ //运单实际结束时间 必输
|
|
|
+ String endTime = jsonObject.getString("endTime");
|
|
|
if (StringUtils.isEmpty(data) || null == jsonObject || StringUtils.isEmpty(num)
|
|
|
|| StringUtils.isEmpty(realDestAddr)
|
|
|
|| StringUtils.isEmpty(endTime)
|
|
@@ -432,7 +460,8 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
noCarWayBill.setDestAddr(realDestAddr);
|
|
|
noCarWayBill.setPredictEndTime(DateUtil.getDistanceHoursFormat(endTime));
|
|
|
noCarWayBill.setHisFlag(0);
|
|
|
- noCarWayBill.setInterType(0);//接口
|
|
|
+ //接口
|
|
|
+ noCarWayBill.setInterType(0);
|
|
|
RespR rs = noCarService.noCarWaybillEnd(noCarWayBill);
|
|
|
long costtimeend = System.currentTimeMillis();
|
|
|
log.info("[-NoCarInterServiceImpl.noCarBillEnd-] result is "
|
|
@@ -475,16 +504,26 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
try {
|
|
|
log.info("[-NoCarInterServiceImpl.noCarHisWaybillStart-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
|
|
|
JSONObject jsonObject = JSONObject.parseObject(data);
|
|
|
- String num = jsonObject.getString("num");//运单编号 必选
|
|
|
- String plateNumber = jsonObject.getString("plateNumber");//车牌号 必选
|
|
|
- String plateColor = jsonObject.getString("plateColor");//车牌颜色 必选
|
|
|
- String startTime = jsonObject.getString("startTime");//运单开始时间 必选
|
|
|
- String sourceAddr = jsonObject.getString("sourceAddr");//运单开始地址 必选
|
|
|
- String destAddr = jsonObject.getString("destAddr");//运单目的地址 必选
|
|
|
- String predictEndTime = jsonObject.getString("predictEndTime");//运单预计完成时间 必选
|
|
|
- Integer fee = jsonObject.getInteger("fee");//运单费用 必选
|
|
|
- Integer titleType = jsonObject.getInteger("titleType");//发票抬头类型 必选
|
|
|
- String taxplayerCode = jsonObject.getString("taxplayerCode");//税号 必选
|
|
|
+ //运单编号 必选
|
|
|
+ String num = jsonObject.getString("num");
|
|
|
+ //车牌号 必选
|
|
|
+ String plateNumber = jsonObject.getString("plateNumber");
|
|
|
+ //车牌颜色 必选
|
|
|
+ String plateColor = jsonObject.getString("plateColor");
|
|
|
+ //运单开始时间 必选
|
|
|
+ String startTime = jsonObject.getString("startTime");
|
|
|
+ //运单开始地址 必选
|
|
|
+ String sourceAddr = jsonObject.getString("sourceAddr");
|
|
|
+ //运单目的地址 必选
|
|
|
+ String destAddr = jsonObject.getString("destAddr");
|
|
|
+ //运单预计完成时间 必选
|
|
|
+ String predictEndTime = jsonObject.getString("predictEndTime");
|
|
|
+ //运单费用 必选
|
|
|
+ Integer fee = jsonObject.getInteger("fee");
|
|
|
+ //发票抬头类型 必选
|
|
|
+ Integer titleType = jsonObject.getInteger("titleType");
|
|
|
+ //税号 必选
|
|
|
+ String taxplayerCode = jsonObject.getString("taxplayerCode");
|
|
|
if (StringUtils.isEmpty(data) || null == jsonObject
|
|
|
|| StringUtils.isEmpty(num)
|
|
|
|| StringUtils.isEmpty(plateNumber)
|
|
@@ -532,7 +571,8 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
noCarWayBill.setHisFlag(1);
|
|
|
noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
|
|
|
noCarWayBill.setIntfaceStartTime(DateUtil.getCurrentDateStr());
|
|
|
- noCarWayBill.setInterType(0);//接口
|
|
|
+ //接口
|
|
|
+ noCarWayBill.setInterType(0);
|
|
|
List<CustomerCarRec> customerCarRecs = new ArrayList<>();
|
|
|
CustomerCarRec customerCarRec = new CustomerCarRec();
|
|
|
customerCarRec.setCompanyName(noCarWayBill.getCompanyName());
|
|
@@ -542,7 +582,8 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
customerCarRec.setInterType(0);
|
|
|
customerCarRec.setCompanyNum(customerRec.getCompanyNum());
|
|
|
customerCarRec.setBusinessType("2");
|
|
|
- customerCarRec.setServiceOperation(1);//默认运营车辆
|
|
|
+ //默认运营车辆
|
|
|
+ customerCarRec.setServiceOperation(1);
|
|
|
noCarWayBill.setTitleType(2);
|
|
|
//先查询上游是否已经备案
|
|
|
RespR<VehicleQueryResponse> respRquery = noCarService.customerCarRecQueryUpper(customerCarRec);
|
|
@@ -580,7 +621,10 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- //插入或者更新运单
|
|
|
+ /**
|
|
|
+ * 插入或者更新运单
|
|
|
+ * @param noCarWayBill
|
|
|
+ */
|
|
|
public void insertOrUpdateBillStart(NoCarWayBill noCarWayBill) {
|
|
|
noCarWayBill.setIntfaceStartTime(DateUtil.getCurrentDateStr());
|
|
|
noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
|
|
@@ -617,9 +661,12 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
try {
|
|
|
log.info("[-NoCarInterServiceImpl.noCarHisWaybillEnd-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
|
|
|
JSONObject jsonObject = JSONObject.parseObject(data);
|
|
|
- String num = jsonObject.getString("num");//运单号 必输
|
|
|
- String realDestAddr = jsonObject.getString("realDestAddr");//运单实际目的地址 必输
|
|
|
- String endTime = jsonObject.getString("endTime");//运单实际结束时间 必输
|
|
|
+ //运单号 必输
|
|
|
+ String num = jsonObject.getString("num");
|
|
|
+ //运单实际目的地址 必输
|
|
|
+ String realDestAddr = jsonObject.getString("realDestAddr");
|
|
|
+ //运单实际结束时间 必输
|
|
|
+ String endTime = jsonObject.getString("endTime");
|
|
|
if (StringUtils.isEmpty(data) || null == jsonObject || StringUtils.isEmpty(num)
|
|
|
|| StringUtils.isEmpty(realDestAddr)
|
|
|
|| StringUtils.isEmpty(endTime)
|
|
@@ -642,7 +689,8 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
noCarWayBill.setPredictEndTime(DateUtil.getDistanceHoursFormat(endTime));
|
|
|
noCarWayBill.setHisFlag(1);
|
|
|
noCarWayBill.setCustomerName(appKey);
|
|
|
- noCarWayBill.setInterType(0);//接口
|
|
|
+ //接口
|
|
|
+ noCarWayBill.setInterType(0);
|
|
|
RespR rs = noCarService.noCarHisWaybillEnd(noCarWayBill);
|
|
|
long costtimeend = System.currentTimeMillis();
|
|
|
log.info("[-NoCarInterServiceImpl.noCarHisWaybillEnd-] result is "
|
|
@@ -689,7 +737,8 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
try {
|
|
|
log.info("[-NoCarInterServiceImpl.noCarVoiceQuery-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
|
|
|
JSONObject jsonObject = JSONObject.parseObject(data);
|
|
|
- String num = jsonObject.getString("num");//运单号 必输
|
|
|
+ //运单号 必输
|
|
|
+ String num = jsonObject.getString("num");
|
|
|
if (StringUtils.isEmpty(data) || null == jsonObject || StringUtils.isEmpty(num)
|
|
|
|
|
|
) {
|
|
@@ -887,10 +936,14 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
try {
|
|
|
log.info("[-NoCarInterServiceImpl.redInkInvoiceQuery-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
|
|
|
JSONObject jsonObject = JSONObject.parseObject(data);
|
|
|
- String taxplayerCode = jsonObject.getString("taxplayerCode");//企业税号 必输
|
|
|
- String month = jsonObject.getString("month");//开票月份 样例:yyyy-MM 必输
|
|
|
- Long pageNo = jsonObject.getLong("pageNo");//查询第几页 示例1,2,3,4…
|
|
|
- Long pageSize = jsonObject.getLong("pageSize");//查询第几页 示例1,2,3,4… 没有就默认1000
|
|
|
+ //企业税号 必输
|
|
|
+ String taxplayerCode = jsonObject.getString("taxplayerCode");
|
|
|
+ //开票月份 样例:yyyy-MM 必输
|
|
|
+ String month = jsonObject.getString("month");
|
|
|
+ //查询第几页 示例1,2,3,4…
|
|
|
+ Long pageNo = jsonObject.getLong("pageNo");
|
|
|
+ //查询第几页 示例1,2,3,4… 没有就默认1000
|
|
|
+ Long pageSize = jsonObject.getLong("pageSize");
|
|
|
|
|
|
if (StringUtils.isEmpty(data) || null == jsonObject) {
|
|
|
return result;
|
|
@@ -904,7 +957,7 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
result.setMsg("日期格式不正确!");
|
|
|
return result;
|
|
|
}
|
|
|
- HCInvoiceQueryVo hcInvoiceQueryVo = new HCInvoiceQueryVo();
|
|
|
+ HcInvoiceQueryVo hcInvoiceQueryVo = new HcInvoiceQueryVo();
|
|
|
hcInvoiceQueryVo.setBuyerTaxpayerCode(taxplayerCode);
|
|
|
hcInvoiceQueryVo.setMonth(month);
|
|
|
hcInvoiceQueryVo.setPageSize(pageSize);
|
|
@@ -956,7 +1009,8 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
try {
|
|
|
log.info("[-NoCarInterServiceImpl.noCarVoiceOwnerQuery-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
|
|
|
JSONObject jsonObject = JSONObject.parseObject(data);
|
|
|
- String num = jsonObject.getString("num");//运单号 必输
|
|
|
+ //运单号 必输
|
|
|
+ String num = jsonObject.getString("num");
|
|
|
if (StringUtils.isEmpty(data) || null == jsonObject || StringUtils.isEmpty(num)
|
|
|
|
|
|
) {
|