diff --git a/erp-hyc-interfaces-api/src/main/java/com/unlcn/erp/hyc/interfaces/api/controller/CallHYCExceptionController.java b/erp-hyc-interfaces-api/src/main/java/com/unlcn/erp/hyc/interfaces/api/controller/CallHYCExceptionController.java index 28b1dde2fa72d2c74d334f8d8ea42713440f56c7..4028c644b2a11d4921057d66ee774837012b1806 100644 --- a/erp-hyc-interfaces-api/src/main/java/com/unlcn/erp/hyc/interfaces/api/controller/CallHYCExceptionController.java +++ b/erp-hyc-interfaces-api/src/main/java/com/unlcn/erp/hyc/interfaces/api/controller/CallHYCExceptionController.java @@ -2,6 +2,7 @@ package com.unlcn.erp.hyc.interfaces.api.controller; import cn.huiyunche.commons.domain.ResultDTO; import cn.huiyunche.commons.exception.BusinessException; +import com.unlcn.erp.hyc.interfaces.backend.enums.CallHYCUrlTypeEnum; import com.unlcn.erp.hyc.interfaces.backend.service.ExecptionDisposeService; import com.unlcn.erp.hyc.interfaces.base.model.bo.HycExceptionMsgBo; import org.slf4j.Logger; @@ -33,6 +34,14 @@ public class CallHYCExceptionController { ResultDTO> result = new ResultDTO<>(true, null, "查询异常成功"); try{ List msgList = execptionDisposeService.getUndisposedExceptionList(); + msgList.forEach(HycExceptionMsgBo -> { + if(HycExceptionMsgBo.getExceptionType() == CallHYCUrlTypeEnum.HYC_ORDERDETAILS.getValue()){ + HycExceptionMsgBo.setExceptionTypeMsg("获取订单明细异常"); + } + if(HycExceptionMsgBo.getExceptionType() == CallHYCUrlTypeEnum.HYC_WAYBILLDETAILS.getValue()){ + HycExceptionMsgBo.setExceptionTypeMsg("获取运单明细异常"); + } + }); result.setData(msgList); }catch (Exception e){ LOGGER.error("TmsPickUpController.getExcepList error: {}", e); diff --git a/erp-hyc-interfaces-api/src/main/java/com/unlcn/erp/hyc/interfaces/api/controller/CallPayCodesController.java b/erp-hyc-interfaces-api/src/main/java/com/unlcn/erp/hyc/interfaces/api/controller/CallPayCodesController.java index 43d797448c0e38d260d58626573f64c29db847c0..2dab039c2247f8a849051766ab4ec1ca11c8a8cd 100644 --- a/erp-hyc-interfaces-api/src/main/java/com/unlcn/erp/hyc/interfaces/api/controller/CallPayCodesController.java +++ b/erp-hyc-interfaces-api/src/main/java/com/unlcn/erp/hyc/interfaces/api/controller/CallPayCodesController.java @@ -51,19 +51,6 @@ public class CallPayCodesController { } } -// @RequestMapping(value = "/checkAccoun" ,method = RequestMethod.GET) -// @ResponseBody -// public void checkAccoun(){ -// LOGGER.info("CallPayCodesController.checkAccoun param:{}."); -// ResultDTO result = new ResultDTO(true, null, "查询成功"); -// try{ -// callPayCodesService.checkAccoun(); -// }catch (Exception e){ -// LOGGER.error("TmsPickUpController.getExcepList error: {}", e); -// throw new BusinessException(e); -// } -// } - @RequestMapping(value = "/markersOfBill" , method = RequestMethod.GET) @ResponseBody public void markersOfBill(){ @@ -77,7 +64,6 @@ public class CallPayCodesController { } } - @RequestMapping(value = "/paymentAmount" , method = RequestMethod.GET) @ResponseBody public void paymentAmount(){ diff --git a/erp-hyc-interfaces-backend/src/main/java/com/unlcn/erp/hyc/interfaces/backend/service/CallPayCodesService.java b/erp-hyc-interfaces-backend/src/main/java/com/unlcn/erp/hyc/interfaces/backend/service/CallPayCodesService.java index 4b2148ae623e2e4d208ee38a3a3ed59a5ee505fd..53f6045fa40af8de444f297b8cbbc98bfddb7544 100644 --- a/erp-hyc-interfaces-backend/src/main/java/com/unlcn/erp/hyc/interfaces/backend/service/CallPayCodesService.java +++ b/erp-hyc-interfaces-backend/src/main/java/com/unlcn/erp/hyc/interfaces/backend/service/CallPayCodesService.java @@ -26,4 +26,6 @@ public interface CallPayCodesService { void markersOfBill() throws Exception; void paymentAmount() throws Exception; + + void paymentAmount(String waybillcode) throws Exception; } diff --git a/erp-hyc-interfaces-backend/src/main/java/com/unlcn/erp/hyc/interfaces/backend/service/CallPayCodesServiceImpl.java b/erp-hyc-interfaces-backend/src/main/java/com/unlcn/erp/hyc/interfaces/backend/service/CallPayCodesServiceImpl.java index 13afd26da1035eff987e630153429418ce82b763..2eec34a33fef22e0cdb51bd085d961dc4e83dce1 100644 --- a/erp-hyc-interfaces-backend/src/main/java/com/unlcn/erp/hyc/interfaces/backend/service/CallPayCodesServiceImpl.java +++ b/erp-hyc-interfaces-backend/src/main/java/com/unlcn/erp/hyc/interfaces/backend/service/CallPayCodesServiceImpl.java @@ -402,4 +402,54 @@ public class CallPayCodesServiceImpl implements CallPayCodesService { } } } + + @Override + public void paymentAmount(String waybillcode) throws Exception { + HycwaybillExample example = new HycwaybillExample(); + example.createCriteria().andWaybillcodeEqualTo(waybillcode); + + List waybillList = hycwaybillMapper.selectByExample(example); + if(CollectionUtils.isNotEmpty(waybillList)) { + Hycwaybill hycwaybill = waybillList.get(0); + try{ + int i = 0; + //找到对应的明细订单 + List waybilldetailList = hycwaybilldetailMapper.getOrderCodeByWaybillCode(hycwaybill.getWaybillcode()); + for (Hycwaybilldetail hycwaybilldetail : waybilldetailList) { + //System.out.println(hycwaybilldetail.getWaybillcode()+"~~~~~"+hycwaybilldetail.getOrdercode()); + Long orderCode = 0L; + //找到对应的订单 + Soorder soorder = soorderMapper.getOrderByOrderNo(hycwaybilldetail.getOrdercode()); + if(soorder != null) { + String startCity = checkIntermediateService.switchCityName(hycwaybill.getDepartcityname()); + String endCity = checkIntermediateService.switchCityName(hycwaybill.getReceiptcityname()); + //2、判断一次调度还是多次调度 + if (1 == hycwaybilldetail.getServicedispatchtimes() && soorder.getVcorderno().indexOf("SO") == 0 && startCity.equals(soorder.getVcstartcity()) && endCity.equals(soorder.getVccityname())) { + //3、一次调度自动将金额写入到soshipline中 + orderCode = soorder.getIlineid(); + //判断该指令是否已被调度 + Long shiplineId= soshiplineMapper.getLineIdByOrderId(orderCode); + if(shiplineId != null && shiplineId != 0 ){ + //将金额修改到运单上 + Soshipline soshipline = new Soshipline(); + soshipline.setIorderid2(orderCode); + soshipline.setDcpaycost(hycwaybilldetail.getUnitcost()); + soshipline.setIpaycosttype(1); + soshiplineMapper.updatePayCostByOrderId(soshipline); + i++; + } + } + } + } + if(waybilldetailList.size() == i && i != 0){ + hycwaybill.setIsamount(1); + hycwaybill.setDtamount(new Date()); + hycwaybillMapper.updateByPrimaryKey(hycwaybill); + } + }catch (Exception e){ + execptionDisposeService.saveExecption(e.toString(),hycwaybill.getWaybillcode(),CallHYCUrlTypeEnum.HYC_PAYMENTAMOUNT.getValue()); + LOGGER.error("检查账单是否到账:"+hycwaybill.getWaybillcode()+"异常信息:"+e.toString()); + } + } + } } diff --git a/erp-hyc-interfaces-base/src/main/java/com/unlcn/erp/hyc/interfaces/base/model/bo/HycExceptionMsgBo.java b/erp-hyc-interfaces-base/src/main/java/com/unlcn/erp/hyc/interfaces/base/model/bo/HycExceptionMsgBo.java index 929f28eed03d856df8b9ca70b496c1f99e7593cb..33fe1945e354bb981e05e76631c141953c49b2ab 100644 --- a/erp-hyc-interfaces-base/src/main/java/com/unlcn/erp/hyc/interfaces/base/model/bo/HycExceptionMsgBo.java +++ b/erp-hyc-interfaces-base/src/main/java/com/unlcn/erp/hyc/interfaces/base/model/bo/HycExceptionMsgBo.java @@ -23,7 +23,7 @@ public class HycExceptionMsgBo implements Serializable { */ private Date dtcreate; - + private String exceptionTypeMsg; /** * This method was generated by MyBatis Generator. * This method returns the value of the database column HYC_EXCEPTION_MSG.EXCEPTION_TYPE @@ -96,6 +96,14 @@ public class HycExceptionMsgBo implements Serializable { this.dtcreate = dtcreate; } + public String getExceptionTypeMsg() { + return exceptionTypeMsg; + } + + public void setExceptionTypeMsg(String exceptionTypeMsg) { + this.exceptionTypeMsg = exceptionTypeMsg; + } + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table HYC_EXCEPTION_MSG