diff --git a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisCommonController.java b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisCommonController.java index e292cbeb8..55b0102a3 100644 --- a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisCommonController.java +++ b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisCommonController.java @@ -1,12 +1,12 @@ -/** - * @Project: emis - * @Title: EmisBrandController.java - * @author linfso - * @date 2023-12-14 13:02:48 - * @Copyright: ShangHai Duta 2022 All rights reserved. - * @version v1.0 - * @Description:

品牌 控制器

+/** + * @Project: emis + * @Title: EmisBrandController.java + * @author linfso + * @date 2023-12-14 13:02:48 + * @Copyright: ShangHai Duta 2022 All rights reserved. + * @version v1.0 + * @Description:

品牌 控制器

*/ package com.xdadan.erp.web.emis; @@ -52,14 +52,15 @@ import java.util.*; /** * EMIS 公共 Controller - * + * * @author linfso * @date 2023-12-14 13:02:48 */ @Slf4j @RestController @RequestMapping("/emis/common") -public class EmisCommonController extends EmisBaseController { +public class EmisCommonController extends EmisBaseController +{ @Autowired private IEmisWaybillService emisWaybillService; @@ -79,6 +80,7 @@ public class EmisCommonController extends EmisBaseController { @Autowired private RL7moorService rl7moorService; + @Autowired private ISysConfigService configService; @@ -126,7 +128,6 @@ public class EmisCommonController extends EmisBaseController { /** * 在线支付回调 - * * @param method * @param data * @param sign_type @@ -134,46 +135,49 @@ public class EmisCommonController extends EmisBaseController { * @return */ @PostMapping("/payNotifyCallback") - public String payNotifyCallback(String method, String data, String sign_type, String sign) { + public String payNotifyCallback(String method,String data,String sign_type,String sign){ log.info("payNotifyCallback start"); - if (StringUtils.isAnyEmpty(method, data, sign)) { + if(StringUtils.isAnyEmpty(method,data,sign)){ return "param error"; } /* - * order_no String 订单号 - * mer_id String 进件返回的商户ID - * amount Integer 支付金额(分) - * fee Integer 手续费(分为单位)。 - * 到账金额为:amount-fee - * time_created String 订单创建时间,yyyy-MM-dd HH:mm:ss - * time_expire String 订单超时时间,yyyy-MM-dd HH:mm:ss - * transaction_no String 支付渠道流水号 - * channel String 支付渠道 - * channel_type String 通道类型,请联系业务配置 例如 klt01 - * trans_no String 平台交易流水号 - * status Integer 交易状态 - * 0 订单创建 - * 10 未支付(待支付) - * 11 用户支付中 - * 20 支付成功 - * 30 已关闭 - * 31 已撤销(刷卡支付) - * 40 支付失败 - * 50 转入退款 - * - * err_msg String 错误消息 + order_no String 订单号 + mer_id String 进件返回的商户ID + amount Integer 支付金额(分) + fee Integer 手续费(分为单位)。 + 到账金额为:amount-fee + time_created String 订单创建时间,yyyy-MM-dd HH:mm:ss + time_expire String 订单超时时间,yyyy-MM-dd HH:mm:ss + transaction_no String 支付渠道流水号 + channel String 支付渠道 + channel_type String 通道类型,请联系业务配置 例如 klt01 + trans_no String 平台交易流水号 + status Integer 交易状态 + 0 订单创建 + 10 未支付(待支付) + 11 用户支付中 + 20 支付成功 + 30 已关闭 + 31 已撤销(刷卡支付) + 40 支付失败 + 50 转入退款 + + err_msg String 错误消息 */ + + + JSONObject jobjRst = JSONObject.parseObject(data); String payId = jobjRst.getString("order_no"); - if (StringUtils.isEmpty(payId)) { + if(StringUtils.isEmpty(payId)){ return "payId error"; } - String lockKey = "payNotifyCallback_" + payId; - redissonService.lock(lockKey, 300); + String lockKey="payNotifyCallback_"+payId; + redissonService.lock(lockKey,300); try { log.info("payNotifyCallback start"); emisSettleBillPayLogService.checkPayStatus(payId); @@ -189,31 +193,32 @@ public class EmisCommonController extends EmisBaseController { /** * 获取中心可用简单数 - * * @param prefix * @return */ @RequestMapping(value = "/getCenterTotalAvailablePag") - public AjaxResult getCenterTotalAvailablePag(String prefix) { - return AjaxResult.success("获取成功", emisElectronicPagService.getCenterTotalAvailablePag("T7080")); + public AjaxResult getCenterTotalAvailablePag(String prefix) + { + return AjaxResult.success("获取成功",emisElectronicPagService.getCenterTotalAvailablePag("T7080")); } /** * 获取网点总可用面单数 */ @RequestMapping(value = "/getTotalAvailablePag") - public AjaxResult getTotalAvailablePag(String useSiteCode, String prefix) { + public AjaxResult getTotalAvailablePag(String useSiteCode,String prefix) + { try { - if (StringUtils.isEmpty(useSiteCode)) { + if(StringUtils.isEmpty(useSiteCode)){ try { - useSiteCode = SecurityUtils.getLoginUser().getUser().getOwnerSiteCode(); - } catch (Exception ex) { + useSiteCode= SecurityUtils.getLoginUser().getUser().getOwnerSiteCode(); + }catch (Exception ex){ ex.printStackTrace(); } } - Map dataMap = emisElectronicSitePagService.getTotalAvailablePag(useSiteCode, "T7080"); - return AjaxResult.success("获取成功", dataMap); - } catch (Exception ex) { + Map dataMap = emisElectronicSitePagService.getTotalAvailablePag(useSiteCode,"T7080"); + return AjaxResult.success("获取成功",dataMap); + }catch (Exception ex){ ex.printStackTrace(); return AjaxResult.error(ex.getMessage()); } @@ -221,48 +226,52 @@ public class EmisCommonController extends EmisBaseController { /** * 获取APP版本 - * { - * version: '1.0.1', - * versionCode: 101, - * apkUrl: 'http://192.168.1.7:5173/static/t.apk', - * // apkUrl: 'http://oss-emis.tanex56.com/sapp/sdg/hdbg.png', - * wgtUrl: 'http://192.168.1.7:5173/static/t.wgt?t.wgt', - * // whiteDeviceIds: ['F9E778C90D0E9A8DA9D95AA97B00A3FB'], - * } - * + { + version: '1.0.1', + versionCode: 101, + apkUrl: 'http://192.168.1.7:5173/static/t.apk', + // apkUrl: 'http://oss-emis.tanex56.com/sapp/sdg/hdbg.png', + wgtUrl: 'http://192.168.1.7:5173/static/t.wgt?t.wgt', + // whiteDeviceIds: ['F9E778C90D0E9A8DA9D95AA97B00A3FB'], + } + * @return */ @RequestMapping(value = "/getLastAppVersion") - public AjaxResult getLastAppVersion() { + public AjaxResult getLastAppVersion() + { try { String lastAppVersionStr = configService.selectConfigByKey("sys.app.version"); - JSONObject obj = JSONObject.parseObject(lastAppVersionStr); + JSONObject obj=JSONObject.parseObject(lastAppVersionStr); - return AjaxResult.success("获取成功", obj); + return AjaxResult.success("获取成功",obj); - } catch (Exception ex) { + }catch (Exception ex){ ex.printStackTrace(); return AjaxResult.error(ex.getMessage()); } } + + /** * 获取电子面单单号 */ @RequestMapping(value = "/realMatchWaybill") - public AjaxResult realMatchWaybill(String useSiteCode, String prefix) { + public AjaxResult realMatchWaybill(String useSiteCode,String prefix) + { try { - if (StringUtils.isEmpty(useSiteCode)) { + if(StringUtils.isEmpty(useSiteCode)){ try { - useSiteCode = SecurityUtils.getLoginUser().getUser().getOwnerSiteCode(); - } catch (Exception ex) { + useSiteCode= SecurityUtils.getLoginUser().getUser().getOwnerSiteCode(); + }catch (Exception ex){ ex.printStackTrace(); } } - String waybillNo = emisElectronicSitePagService.realMatchWaybill(useSiteCode, "T7080"); - return AjaxResult.success("处理成功", waybillNo); - } catch (Exception ex) { + String waybillNo = emisElectronicSitePagService.realMatchWaybill(useSiteCode,"T7080"); + return AjaxResult.success("处理成功",waybillNo); + }catch (Exception ex){ ex.printStackTrace(); return AjaxResult.error(ex.getMessage()); } @@ -272,27 +281,28 @@ public class EmisCommonController extends EmisBaseController { * 获取合包单号 */ @RequestMapping(value = "/getPackNo") - public AjaxResult getPackNo() { + public AjaxResult getPackNo() + { try { String yyMMdd = "yyMMdd"; // 站点三字码 - String siteThreeCode = "--"; - try { - EmisSite site = emisBaseService.getSiteByCode(getLoginUser().getUser().getOwnerSiteCode()); - if (!StringUtils.isEmpty(site.getSizeCode3())) { + String siteThreeCode="--"; + try{ + EmisSite site=emisBaseService.getSiteByCode(getLoginUser().getUser().getOwnerSiteCode()); + if(!StringUtils.isEmpty(site.getSizeCode3())) { siteThreeCode = site.getSizeCode3(); } - } catch (Exception ex) { + }catch (Exception ex){ ex.printStackTrace(); } - // HNJ24061901 - String hbKey = "H" + siteThreeCode + DateUtils.parseDateToStr(yyMMdd, new Date()); - Long lockNo = redissonService.addAndGetLong(hbKey, 1L); - String packNo = hbKey + StringUtils.leftPad(String.valueOf(lockNo), 2, "0"); - return AjaxResult.success("获取成功", packNo); - } catch (Exception ex) { +// HNJ24061901 + String hbKey= "H"+siteThreeCode+DateUtils.parseDateToStr(yyMMdd,new Date()); + Long lockNo = redissonService.addAndGetLong(hbKey,1L); + String packNo =hbKey+StringUtils.leftPad(String.valueOf(lockNo),2,"0"); + return AjaxResult.success("获取成功",packNo); + }catch (Exception ex){ ex.printStackTrace(); return AjaxResult.error(ex.getMessage()); } @@ -302,25 +312,26 @@ public class EmisCommonController extends EmisBaseController { * 获取批次号 */ @RequestMapping(value = "/getTmsGroupBatchNo") - public AjaxResult getTmsGroupBatchNo() { + public AjaxResult getTmsGroupBatchNo() + { try { String yyMMdd = "yyMMdd"; // 站点三字码 - String siteThreeCode = "--"; - try { - EmisSite site = emisBaseService.getSiteByCode(getLoginUser().getUser().getOwnerSiteCode()); - if (!StringUtils.isEmpty(site.getSizeCode3())) { + String siteThreeCode="--"; + try{ + EmisSite site=emisBaseService.getSiteByCode(getLoginUser().getUser().getOwnerSiteCode()); + if(!StringUtils.isEmpty(site.getSizeCode3())) { siteThreeCode = site.getSizeCode3(); } - } catch (Exception ex) { + }catch (Exception ex){ ex.printStackTrace(); } - String batchKey = "B" + siteThreeCode + DateUtils.parseDateToStr(yyMMdd, new Date()); - Long lockNo = redissonService.addAndGetLong(batchKey, 1L); - String batchNo = batchKey + StringUtils.leftPad(String.valueOf(lockNo), 2, "0"); - return AjaxResult.success("获取成功", batchNo); - } catch (Exception ex) { + String batchKey= "B"+siteThreeCode+DateUtils.parseDateToStr(yyMMdd,new Date()); + Long lockNo = redissonService.addAndGetLong(batchKey,1L); + String batchNo =batchKey +StringUtils.leftPad(String.valueOf(lockNo),2,"0"); + return AjaxResult.success("获取成功",batchNo); + }catch (Exception ex){ ex.printStackTrace(); return AjaxResult.error(ex.getMessage()); } @@ -330,36 +341,39 @@ public class EmisCommonController extends EmisBaseController { * 获取进仓单号 */ @RequestMapping(value = "/getWareHouseInNo") - public AjaxResult getWareHouseInNo(String simpleName) { + public AjaxResult getWareHouseInNo(String simpleName) + { try { - if (StringUtils.isEmpty(simpleName)) { - simpleName = "TL"; + if(StringUtils.isEmpty(simpleName)){ + simpleName="TL"; } String YYMMDD = "yyMMdd"; - // TAN-7080-SMD-240603-01 - String hbKey = "TAN-7080-" + "-" + simpleName + DateUtils.parseDateToStr(YYMMDD, new Date()); - Long lockNo = redissonService.addAndGetLong(hbKey, 1L); - String packNo = hbKey + "-" + StringUtils.leftPad(String.valueOf(lockNo), 2, "0"); - return AjaxResult.success("获取成功", packNo); - } catch (Exception ex) { +// TAN-7080-SMD-240603-01 + String hbKey= "TAN-7080-"+"-"+simpleName+DateUtils.parseDateToStr(YYMMDD,new Date()); + Long lockNo = redissonService.addAndGetLong(hbKey,1L); + String packNo =hbKey+"-" +StringUtils.leftPad(String.valueOf(lockNo),2,"0"); + return AjaxResult.success("获取成功",packNo); + }catch (Exception ex){ ex.printStackTrace(); return AjaxResult.error(ex.getMessage()); } } + /** * 获取解析地址 */ @RequestMapping(value = "/parseAddress") - public AjaxResult parseAddress(String content) { + public AjaxResult parseAddress(String content) + { try { AddressParseResult addressParseResult = emisRegionService.parseAddress(content); - return AjaxResult.success("解析成功", addressParseResult); - } catch (Exception ex) { + return AjaxResult.success("解析成功",addressParseResult); + }catch (Exception ex){ ex.printStackTrace(); // 返回子定义异常 - if (ex instanceof EmisBizError) { - return AjaxResult.error(ex.getMessage(), ((EmisBizError) ex).getErrorCode()); + if(ex instanceof EmisBizError){ + return AjaxResult.error(ex.getMessage(),((EmisBizError)ex).getErrorCode()); } return AjaxResult.error("服务器异常,联系客服"); @@ -370,17 +384,17 @@ public class EmisCommonController extends EmisBaseController { * 获取解析地址 */ @RequestMapping(value = "/getEmpSpecialService") - public AjaxResult getEmpSpecialService(String empCode) { + public AjaxResult getEmpSpecialService(String empCode) + { try { - // #小程序://探路速运/Nt29PF2JBvBkf2w - // AddressParseResult addressParseResult = - // emisRegionService.parseAddress(content); +// #小程序://探路速运/Nt29PF2JBvBkf2w +// AddressParseResult addressParseResult = emisRegionService.parseAddress(content); return AjaxResult.success("解析成功"); - } catch (Exception ex) { + }catch (Exception ex){ ex.printStackTrace(); // 返回子定义异常 - if (ex instanceof EmisBizError) { - return AjaxResult.error(ex.getMessage(), ((EmisBizError) ex).getErrorCode()); + if(ex instanceof EmisBizError){ + return AjaxResult.error(ex.getMessage(),((EmisBizError)ex).getErrorCode()); } return AjaxResult.error("服务器异常,联系客服"); @@ -391,54 +405,54 @@ public class EmisCommonController extends EmisBaseController { * 获取解析地址 */ @RequestMapping(value = "/testGenCustomer") - public AjaxResult testGenCustomer() { + public AjaxResult testGenCustomer() + { try { - // AddressParseResult addressParseResult = - // emisRegionService.parseAddress(content); +// AddressParseResult addressParseResult = emisRegionService.parseAddress(content); emisBaseService.batchGenCustomerCode(); return AjaxResult.success("解析成功"); - } catch (Exception ex) { + }catch (Exception ex){ ex.printStackTrace(); // 返回子定义异常 - if (ex instanceof EmisBizError) { - return AjaxResult.error(ex.getMessage(), ((EmisBizError) ex).getErrorCode()); + if(ex instanceof EmisBizError){ + return AjaxResult.error(ex.getMessage(),((EmisBizError)ex).getErrorCode()); } return AjaxResult.error("服务器异常,联系客服"); } } - @RequestMapping("/getPrintDataByPrinter") - public AjaxResult getPrintDataByPrinter(HttpServletRequest request, HttpServletResponse response, String billCode, - String billCodeRange, String tplCode, String lang, String printType, String printManCode) { - if (StringUtils.isEmpty(billCode)) { + @RequestMapping("/getPrintDataByPrinter") + public AjaxResult getPrintDataByPrinter(HttpServletRequest request, HttpServletResponse response, String billCode, String billCodeRange,String tplCode, String lang, String printType,String printManCode) + { + + if(StringUtils.isEmpty(billCode)){ return AjaxResult.error("参数错误"); } - if (!StringUtils.isEmpty(billCode)) { + if(!StringUtils.isEmpty(billCode)){ try { - Map order = emisBaseService.getWaybillPrintOrder(billCode, billCodeRange, tplCode, lang, - printType, printManCode); + Map order = emisBaseService.getWaybillPrintOrder(billCode, billCodeRange, tplCode,lang, printType,printManCode); JSONObject printItem = new JSONObject(); - printItem.put("billCode", billCode); + printItem.put("billCode",billCode); - if (order != null) { + if(order!=null) { String billDetail = WaybillHelper.cvtBillToJsonString(order); - printItem.put("billDetail", - Base64.getEncoder().encodeToString(billDetail.getBytes(Charset.forName("UTF-8")))); - printItem.put("isEncrpt", false); - printItem.put("printCount", 1); - printItem.put("printDate", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date())); - printItem.put("result", "success"); - printItem.put("message", "success"); - return AjaxResult.success("获取成功", printItem); - } else { - return AjaxResult.error("单号不存在:" + billCode); + printItem.put("billDetail", Base64.getEncoder().encodeToString(billDetail.getBytes(Charset.forName("UTF-8")))); + printItem.put("isEncrpt",false); + printItem.put("printCount",1); + printItem.put("printDate", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,new Date())); + printItem.put("result","success"); + printItem.put("message","success"); + return AjaxResult.success("获取成功",printItem); + }else{ + return AjaxResult.error("单号不存在:"+billCode); } - } catch (Exception ex) { + + }catch (Exception ex){ ex.printStackTrace(); return AjaxResult.error("获取失败"); } @@ -452,66 +466,68 @@ public class EmisCommonController extends EmisBaseController { * 预览电子面单打印 */ @RequestMapping(value = "/previewBillPrintImage") - public AjaxResult previewBillPrintImage(String uuid) { + public AjaxResult previewBillPrintImage(String uuid) + { try { return AjaxResult.success("解析成功"); - } catch (Exception ex) { + }catch (Exception ex){ ex.printStackTrace(); // 返回子定义异常 - if (ex instanceof EmisBizError) { - return AjaxResult.error(ex.getMessage(), ((EmisBizError) ex).getErrorCode()); + if(ex instanceof EmisBizError){ + return AjaxResult.error(ex.getMessage(),((EmisBizError)ex).getErrorCode()); } return AjaxResult.error("服务器异常,联系客服"); } } + @GetMapping("/getBillPng/{uuid}") - public void getBillPng(HttpServletRequest request, HttpServletResponse response, - @PathVariable("uuid") String uuid) { - // "https://api-emis.tanex56.com/api/bizsvr/emis/common/getBillPng/123123212.png" - if (StringUtils.isEmpty(uuid)) { + public void getBillPng(HttpServletRequest request, HttpServletResponse response,@PathVariable("uuid")String uuid ) + { +// "https://api-emis.tanex56.com/api/bizsvr/emis/common/getBillPng/123123212.png" + if(StringUtils.isEmpty(uuid)){ log.debug("参数错误"); return; } - // redissonService.setStr("PRINT-IMG-"+uuid,"",300); + // redissonService.setStr("PRINT-IMG-"+uuid,"",300); /* - * { - * "billCode":"", - * "tplCode":"", - * "printManCode":"" - * } - */ - String PRINT_KEY = "PRINT-IMG-" + uuid.trim(); - String printParamStr = redissonService.getStr(PRINT_KEY); - if (StringUtils.isEmpty(printParamStr)) { + { + "billCode":"", + "tplCode":"", + "printManCode":"" + } + */ + String PRINT_KEY="PRINT-IMG-"+uuid.trim(); + String printParamStr=redissonService.getStr(PRINT_KEY); + if(StringUtils.isEmpty(printParamStr)){ log.debug("图片已过期"); return; } JSONObject jObj = JSONObject.parseObject(printParamStr); - String billCode = jObj.getString("billCode"); - String tplCode = jObj.getString("tplCode"); - String printManCode = jObj.getString("printManCode"); + String billCode=jObj.getString("billCode"); + String tplCode=jObj.getString("tplCode"); + String printManCode=jObj.getString("printManCode"); try { response.setCharacterEncoding("UTF-8"); response.setContentType(MediaType.IMAGE_PNG_VALUE); - response.setHeader("Content-Disposition", "filename=" + uuid + ".png"); - OutputStream os = response.getOutputStream(); + response.setHeader("Content-Disposition", "filename=" + uuid+".png"); + OutputStream os=response.getOutputStream(); - Map order = emisBaseService.getWaybillPrintOrder(billCode, "1,1", tplCode, "zh", tplCode, - printManCode); - if (order != null) { + Map order = emisBaseService.getWaybillPrintOrder(billCode, "1,1",tplCode, "zh", tplCode,printManCode); + if(order!=null) { IXddTplPrint tplPrint = new TanexPdfPrinter(); - tplPrint.genPNG(order, tplCode, "", os); + tplPrint.genPNG(order,tplCode,"", os); - } else { + }else{ log.debug("获取运单信息失败"); return; } - } catch (Exception ex) { + + }catch (Exception ex){ ex.printStackTrace(); log.debug("系统异常"); return; @@ -523,56 +539,59 @@ public class EmisCommonController extends EmisBaseController { * 获取打印模版 */ @RequestMapping(value = "/getTnPrinterLocalPrintTpl") - public AjaxResult getTnPrinterLocalPrintTpl(String key, String siteCode, String appCode) { + public AjaxResult getTnPrinterLocalPrintTpl(String key,String siteCode,String appCode) + { try { - if (!"1070ff852af893f45fb3f8275a5bfb23".equals(key)) { + if(!"1070ff852af893f45fb3f8275a5bfb23".equals(key)){ return AjaxResult.error("非法请求!"); } EmisPrintTpl queryEmisPrintTpl = new EmisPrintTpl(); queryEmisPrintTpl.setStatus(1); - JSONArray tplList = new JSONArray(); - List list = emisPrintTplService.selectPrintTplListByPrinter(queryEmisPrintTpl); - for (EmisPrintTpl tpl : list) { + JSONArray tplList = new JSONArray(); + List list=emisPrintTplService.selectPrintTplListByPrinter(queryEmisPrintTpl); + for (EmisPrintTpl tpl:list) { JSONObject jobjTpl = new JSONObject(); - jobjTpl.put("code", tpl.getCode()); - jobjTpl.put("name", tpl.getName()); - jobjTpl.put("expressType", tpl.getExpressType()); - jobjTpl.put("tplEncData", tpl.getTplEncData()); + jobjTpl.put("code",tpl.getCode()); + jobjTpl.put("name",tpl.getName()); + jobjTpl.put("expressType",tpl.getExpressType()); + jobjTpl.put("tplEncData",tpl.getTplEncData()); tplList.add(jobjTpl); } - return AjaxResult.success("获取成功", tplList); - } catch (Exception ex) { + + return AjaxResult.success("获取成功",tplList); + }catch (Exception ex){ ex.printStackTrace(); // 返回子定义异常 - if (ex instanceof EmisBizError) { - return AjaxResult.error(ex.getMessage(), ((EmisBizError) ex).getErrorCode()); + if(ex instanceof EmisBizError){ + return AjaxResult.error(ex.getMessage(),((EmisBizError)ex).getErrorCode()); } return AjaxResult.error("服务器异常,联系客服"); } } @GetMapping(value = "/reCalcEmpProfitSumMoney") - public AjaxResult reCalcEmpProfitSumMoney(String empName, String billMonth) { + public AjaxResult reCalcEmpProfitSumMoney(String empName,String billMonth) + { try { emisCommissionProfitService.reCalcEmpProfitSumMoney(empName, billMonth); return AjaxResult.success("计算成功"); - } catch (Exception ex) { + } + catch(Exception ex){ ex.printStackTrace(); - return AjaxResult.error("计算异常:" + ex.getMessage()); + return AjaxResult.error("计算异常:"+ex.getMessage()); } } /** * 对外物流轨迹信息 - * * @param appId * @param mainNo * @param lang @@ -580,23 +599,27 @@ public class EmisCommonController extends EmisBaseController { * @return */ @RequestMapping("/queryTraceInfo") - public AjaxResult queryTraceInfo(String appId, String mainNo, String lang, String orderBy, String sign) { - if (StringUtils.isAnyEmpty(mainNo, appId, sign)) { + public AjaxResult queryTraceInfo(String appId,String mainNo,String lang,String orderBy,String sign) + { + if(StringUtils.isAnyEmpty(mainNo,appId,sign)){ return AjaxResult.error("appId,sign,mainNo required!"); } - if (!"xdadan20240614".equals(appId)) { + if(!"xdadan20240614".equals(appId)){ return AjaxResult.error("appId error!"); } + + List rstList = new ArrayList(); - Map rstMap = new HashMap<>(); - String sendCountry = ""; - String receiveCountry = ""; + Map rstMap = new HashMap<>(); + String sendCountry=""; + String receiveCountry=""; try { // 虚拟单,面单删除 不能查询路由 + EmisWaybill emisWaybill = emisWaybillService.selectEmisWaybillByBillCode(mainNo); if (emisWaybill != null) { String sendCountryCode = emisWaybill.getSendCountry(); @@ -604,49 +627,49 @@ public class EmisCommonController extends EmisBaseController { // 发件 EmisCountry emisSendCountry = emisBaseService.getCountryByCode(sendCountryCode); - if (emisSendCountry != null) { - sendCountry = emisSendCountry.getTwoCode(); + if(emisSendCountry!=null) { + sendCountry =emisSendCountry.getTwoCode(); } // 收件 EmisCountry emisReceiveCountry = emisBaseService.getCountryByCode(receiveCountryCode); - if (emisReceiveCountry != null) { - receiveCountry = emisReceiveCountry.getTwoCode(); + if(emisReceiveCountry!=null) { + receiveCountry =emisReceiveCountry.getTwoCode(); } } - } catch (Exception ex) { + }catch (Exception ex){ } - rstMap.put("sendCountry", sendCountry); - rstMap.put("receiveCountry", receiveCountry); + rstMap.put("sendCountry",sendCountry); + rstMap.put("receiveCountry",receiveCountry); // sendCountry -- 发件国二字码 // receiveCountry -- 收件国二字码 - rstMap.put("billCode", mainNo); - List stepList = emisTmsScanRecordService.queryWaybillTraceInfo(mainNo, lang, false); - rstMap.put("steps", stepList); + rstMap.put("billCode",mainNo); + List stepList=emisTmsScanRecordService.queryWaybillTraceInfo(mainNo,lang,false); + rstMap.put("steps",stepList); rstList.add(rstMap); - return AjaxResult.success("成功", rstList); + return AjaxResult.success("成功",rstList); } + /** * 短信发送触发 - * * @return */ @GetMapping("/autoDoSendSmsTrigger") - public AjaxResult autoDoSendSmsTrigger() { - String lockKey = "autoDoSendSmsTrigger"; + public AjaxResult autoDoSendSmsTrigger(){ + String lockKey="autoDoSendSmsTrigger"; log.info("autoDoSendSmsTrigger start"); // 加锁查询 - redissonService.lock(lockKey, 300); - try { + redissonService.lock(lockKey,300); + try{ emisBaseService.autoDoSmsSend(); - } catch (Exception ex) { + }catch(Exception ex){ ex.printStackTrace(); - log.error("autoDoSendSmsTrigger exception:" + ex.getMessage()); + log.error("autoDoSendSmsTrigger exception:"+ex.getMessage()); } log.info("autoDoSendSmsTrigger end"); @@ -656,17 +679,17 @@ public class EmisCommonController extends EmisBaseController { } @GetMapping("/autoQueryInvoiceStatusTrigger") - public AjaxResult autoQueryInvoiceStatusTrigger() { - String lockKey = "autoQueryInvoiceStatusTrigger"; + public AjaxResult autoQueryInvoiceStatusTrigger(){ + String lockKey="autoQueryInvoiceStatusTrigger"; log.info("autoQueryInvoiceStatusTrigger start"); // 加锁查询 - redissonService.lock(lockKey, 300); - try { + redissonService.lock(lockKey,300); + try{ emisSettleInvoiceChRecordService.autoDoQueryOpenBillStatus(); - } catch (Exception ex) { + }catch(Exception ex){ ex.printStackTrace(); - log.error("autoQueryInvoiceStatusTrigger exception:" + ex.getMessage()); + log.error("autoQueryInvoiceStatusTrigger exception:"+ex.getMessage()); } log.info("autoQueryInvoiceStatusTrigger end"); @@ -677,23 +700,23 @@ public class EmisCommonController extends EmisBaseController { /** * 单独查询状态 - * * @return */ @GetMapping("/redoQueryInvoiceStatus") - public AjaxResult redoQueryInvoiceStatus(String seqNo) { - String lockKey = "redoQueryInvoiceStatus:" + seqNo; + public AjaxResult redoQueryInvoiceStatus(String seqNo){ + String lockKey="redoQueryInvoiceStatus:"+seqNo; // 加锁查询 - redissonService.lock(lockKey, 300); - try { + redissonService.lock(lockKey,300); + try{ emisSettleInvoiceChRecordService.doQueryAndUpdateChOpenBillStatus(seqNo); - } catch (Exception ex) { + } + catch (Exception ex){ redissonService.unlock(lockKey); ex.printStackTrace(); // 返回子定义异常 - if (ex instanceof EmisBizError) { - return AjaxResult.error(ex.getMessage(), ((EmisBizError) ex).getErrorCode()); + if(ex instanceof EmisBizError){ + return AjaxResult.error(ex.getMessage(),((EmisBizError)ex).getErrorCode()); } return AjaxResult.error("确认异常,联系客服"); @@ -703,23 +726,23 @@ public class EmisCommonController extends EmisBaseController { } + /** * 自动出账触发 - * * @return */ @GetMapping("/autoDoBillProfitTrigger") - public AjaxResult autoDoBillProfitTrigger(EmisWaybill emisWaybill) { - String lockKey = "autoDoBillProfitTrigger"; + public AjaxResult autoDoBillProfitTrigger(EmisWaybill emisWaybill){ + String lockKey="autoDoBillProfitTrigger"; log.info("autoDoBillProfitTrigger start"); // 加锁查询 - redissonService.lock(lockKey, 300); - try { + redissonService.lock(lockKey,300); + try{ emisCommissionProfitService.autoDoBillProfit(emisWaybill); - } catch (Exception ex) { + }catch(Exception ex){ ex.printStackTrace(); - log.error("autoDoBillProfitTrigger exception:" + ex.getMessage()); + log.error("autoDoBillProfitTrigger exception:"+ex.getMessage()); } log.info("autoDoBillProfitTrigger end"); @@ -730,21 +753,20 @@ public class EmisCommonController extends EmisBaseController { /** * 自动出账触发 - * * @return */ @GetMapping("/autoDoBatchProfitTrigger") - public AjaxResult autoDoBatchProfitTrigger(EmisTmsSiteBatch emisTmsSiteBatch) { - String lockKey = "autoDoBatchProfitTrigger"; + public AjaxResult autoDoBatchProfitTrigger(EmisTmsSiteBatch emisTmsSiteBatch){ + String lockKey="autoDoBatchProfitTrigger"; log.info("autoDoBatchProfitTrigger start"); // 加锁查询 - redissonService.lock(lockKey, 300); - try { + redissonService.lock(lockKey,300); + try{ emisCommissionProfitService.autoDoBatchProfit(emisTmsSiteBatch); - } catch (Exception ex) { + }catch(Exception ex){ ex.printStackTrace(); - log.error("autoDoBatchProfitTrigger exception:" + ex.getMessage()); + log.error("autoDoBatchProfitTrigger exception:"+ex.getMessage()); } log.info("autoDoBatchProfitTrigger end"); @@ -755,18 +777,18 @@ public class EmisCommonController extends EmisBaseController { /** * 计算运单提成 - * * @return */ @GetMapping("/reCalcEmpProfitByBillCode") - public AjaxResult reCalcEmpProfitByBillCode(String billCode) { - try { + public AjaxResult reCalcEmpProfitByBillCode(String billCode){ + try{ emisCommissionProfitService.reCalcProfitByBillCode(billCode); - } catch (Exception ex) { + } + catch (Exception ex){ ex.printStackTrace(); // 返回子定义异常 - if (ex instanceof EmisBizError) { - return AjaxResult.error(ex.getMessage(), ((EmisBizError) ex).getErrorCode()); + if(ex instanceof EmisBizError){ + return AjaxResult.error(ex.getMessage(),((EmisBizError)ex).getErrorCode()); } return AjaxResult.error("确认异常,联系客服"); @@ -777,21 +799,20 @@ public class EmisCommonController extends EmisBaseController { /** * 自动出账触发 - * * @return */ @GetMapping("/autoDoBillTrigger") - public AjaxResult autoDoBillTrigger() { - String lockKey = "autoDoBillTrigger"; + public AjaxResult autoDoBillTrigger(){ + String lockKey="autoDoBillTrigger"; log.info("autoDoBillTrigger start"); // 加锁查询 - redissonService.lock(lockKey, 300); - try { + redissonService.lock(lockKey,300); + try{ emisBaseService.autoDoBill(); - } catch (Exception ex) { + }catch(Exception ex){ ex.printStackTrace(); - log.error("autoDoBillTrigger exception:" + ex.getMessage()); + log.error("autoDoBillTrigger exception:"+ex.getMessage()); } log.info("autoDoBillTrigger end"); @@ -802,21 +823,20 @@ public class EmisCommonController extends EmisBaseController { /** * 自动出账触发 - * * @return */ @GetMapping("/autoDoCreditTrigger") - public AjaxResult autoDoCreditTrigger() { - String lockKey = "autoDoCreditTrigger"; + public AjaxResult autoDoCreditTrigger(){ + String lockKey="autoDoCreditTrigger"; log.info("autoDoCreditTrigger start"); // 加锁查询 - redissonService.lock(lockKey, 300); - try { + redissonService.lock(lockKey,300); + try{ emisBaseService.autoDoCredit(); - } catch (Exception ex) { + }catch(Exception ex){ ex.printStackTrace(); - log.error("autoDoCreditTrigger exception:" + ex.getMessage()); + log.error("autoDoCreditTrigger exception:"+ex.getMessage()); } log.info("autoDoCreditTrigger end"); @@ -825,23 +845,24 @@ public class EmisCommonController extends EmisBaseController { } + + /** * 定时扫描运单货物组批次是否正确录入 - * * @return */ @GetMapping("/autoScanSiteBatch") - public AjaxResult autoScanSiteBatch() { - String lockKey = "autoScanSiteBatch"; + public AjaxResult autoScanSiteBatch(){ + String lockKey="autoScanSiteBatch"; log.info("autoScanSiteBatch start"); // 加锁查询 - redissonService.lock(lockKey, 300); - try { + redissonService.lock(lockKey,300); + try{ emisTmsSiteBatchMissService.autoScanSiteBatch(); - } catch (Exception ex) { + }catch(Exception ex){ ex.printStackTrace(); - log.error("autoScanSiteBatch exception:" + ex.getMessage()); + log.error("autoScanSiteBatch exception:"+ex.getMessage()); } log.info("autoScanSiteBatch end"); @@ -850,25 +871,27 @@ public class EmisCommonController extends EmisBaseController { } + + /** * 单独出账 - * * @return */ @GetMapping("/redoBillByBillCode") - public AjaxResult redoBillByBillCode(String billCode) { - String lockKey = "redoBillByBillCode_" + billCode; + public AjaxResult redoBillByBillCode(String billCode){ + String lockKey="redoBillByBillCode_"+billCode; // 加锁查询 - redissonService.lock(lockKey, 300); - try { + redissonService.lock(lockKey,300); + try{ emisBaseService.redoGenerateBill(billCode); - } catch (Exception ex) { + } + catch (Exception ex){ redissonService.unlock(lockKey); ex.printStackTrace(); // 返回子定义异常 - if (ex instanceof EmisBizError) { - return AjaxResult.error(ex.getMessage(), ((EmisBizError) ex).getErrorCode()); + if(ex instanceof EmisBizError){ + return AjaxResult.error(ex.getMessage(),((EmisBizError)ex).getErrorCode()); } return AjaxResult.error("确认异常,联系客服"); @@ -878,23 +901,24 @@ public class EmisCommonController extends EmisBaseController { } + + /** * 自动出账触发 - * * @return */ @GetMapping("/redoGenerateBillFeeItem") - public AjaxResult redoGenerateBillFeeItem(String billCode) { - String lockKey = "redoGenerateBillFeeItem"; + public AjaxResult redoGenerateBillFeeItem(String billCode){ + String lockKey="redoGenerateBillFeeItem"; log.info("redoGenerateBillFeeItem start"); // 加锁查询 - redissonService.lock(lockKey, 300); - try { + redissonService.lock(lockKey,300); + try{ emisBaseService.redoGenerateBillFeeItem(billCode); - } catch (Exception ex) { + }catch(Exception ex){ ex.printStackTrace(); - log.error("redoGenerateBillFeeItem exception:" + ex.getMessage()); + log.error("redoGenerateBillFeeItem exception:"+ex.getMessage()); } log.info("redoGenerateBillFeeItem end"); @@ -905,21 +929,20 @@ public class EmisCommonController extends EmisBaseController { /** * 物流轨迹采集触发 - * * @return */ @GetMapping("/autoDoQueryTransferInfoTrigger") - public AjaxResult autoDoQueryTransferInfoTrigger() { - String lockKey = "autoDoQueryTransferInfoTrigger"; + public AjaxResult autoDoQueryTransferInfoTrigger(){ + String lockKey="autoDoQueryTransferInfoTrigger"; log.info("autoDoQueryTransferInfoTrigger start"); // 加锁查询 - redissonService.lock(lockKey, 300); - try { + redissonService.lock(lockKey,300); + try{ emisBaseService.doTransferTraceUpdate(); - } catch (Exception ex) { + }catch(Exception ex){ ex.printStackTrace(); - log.error("autoDoQueryTransferInfoTrigger exception:" + ex.getMessage()); + log.error("autoDoQueryTransferInfoTrigger exception:"+ex.getMessage()); } log.info("autoDoQueryTransferInfoTrigger end"); @@ -927,11 +950,13 @@ public class EmisCommonController extends EmisBaseController { return AjaxResult.success("发送成功"); } + + @PostMapping("/notifyTraceByKD100") - public String notifyTraceByKD100() { - String lockKey = "notifyTraceByKD100"; + public String notifyTraceByKD100(){ + String lockKey="notifyTraceByKD100"; log.info("notifyTraceByKD100 start"); - String rst = "{\n" + + String rst="{\n" + " \"result\":true,\n" + " \"returnCode\":\"200\",\n" + " \"message\":\"成功\"\n" + @@ -941,189 +966,190 @@ public class EmisCommonController extends EmisBaseController { return rst; } + @PostMapping("/notifyTraceBy17track") - public void notifyTraceBy17track(@RequestBody String body) { - String lockKey = "notifyTraceBy17track"; + public void notifyTraceBy17track(@RequestBody String body){ + String lockKey="notifyTraceBy17track"; log.info("notifyTraceBy17track start"); /* - * { - * "event": "TRACKING_UPDATED", - * "data": { - * "number": "RR123456789CN", - * "carrier": 3011, - * "param": "518000", - * "tag": "myID", - * "track_info": { - * "shipping_info": { - * "shipper_address": { - * "country": "CN", - * "state": "GD", - * "city": "SHENZHEN", - * "street": "HARTFORD CT DISTRIBUTION CENTER", - * "postal_code": "518000", - * "coordinates": { - * "longitude": "114.085947", - * "latitude": "22.547" - * } - * }, - * "recipient_address": { - * "country": "AF", - * "state": null, - * "city": "KABUL", - * "street": null, - * "postal_code": null, - * "coordinates": { - * "longitude": null, - * "latitude": null - * } - * } - * }, - * "latest_status": { - * "status": "InfoReceived", - * "sub_status": "InfoReceived", - * "sub_status_descr": null - * }, - * "latest_event": { - * "time_iso": "2022-05-23T22:22:00+08:00", - * "time_utc": "2022-05-23T14:22:00Z", - * "description": "Shipment information sent to FedEx", - * "description_translation": { - * "lang": "en", - * "description": "Shipment information sent to FedEx" - * }, - * "location": "NJ", - * "stage": "InfoReceived", - * "address": { - * "country": "US", - * "state": "NJ", - * "city": "MARLTON", - * "street": null, - * "postal_code": "08053", - * "coordinates": { - * "longitude": null, - * "latitude": null - * } - * } - * }, - * "time_metrics": { - * "days_after_order": 7, - * "days_of_transit": 7, - * "days_of_transit_done": 7, - * "days_after_last_update": 57, - * "estimated_delivery_date": { - * "source":"Official", - * "from": "2022-03-02T18:43:24-06:00", - * "to": "2022-03-03T19:43:24-06:00" - * } - * }, - * "milestone": [ - * { - * "key_stage": "InfoReceived", - * "time_iso": "2022-04-25T22:22:47-05:00", - * "time_utc": "2022-04-26T03:22:47Z" - * }, - * { - * "key_stage": "PickedUp", - * "time_iso": "2022-04-25T16:22:00+08:00", - * "time_utc": "2022-04-25T08:22:00Z" - * }, - * { - * "key_stage": "Departure", - * "time_iso": "2022-05-19T21:40:00+08:00", - * "time_utc": "2022-05-19T13:40:00Z" - * }, - * { - * "key_stage": "Arrival", - * "time_iso": null, - * "time_utc": null - * }, - * { - * "key_stage": "AvailableForPickup", - * "time_iso": null, - * "time_utc": null - * }, - * { - * "key_stage": "OutForDelivery", - * "time_iso": null, - * "time_utc": null - * }, - * { - * "key_stage": "Delivered", - * "time_iso": null, - * "time_utc": null - * }, - * { - * "key_stage": "Returning", - * "time_iso": null, - * "time_utc": null - * }, - * { - * "key_stage": "Returned", - * "time_iso": null, - * "time_utc": null - * } - * ], - * "misc_info": { - * "risk_factor": 0, - * "service_type": "FedEx International Priority", - * "weight_raw": "1.1 KG", - * "weight_kg": "1.1", - * "pieces": "1", - * "dimensions": "22*20*16 CM", - * "customer_number": "2459642000~270434455123~FX", - * "reference_number": null, - * "local_number": "270434455123", - * "local_provider": "Fedex", - * "local_key": 100003 - * }, - * "tracking": { - * "providers_hash": 2067301750, - * "providers": [ - * { - * "provider": { - * "key": 3011, - * "name": "China Post", - * "alias": "China Post", - * "tel": null, - * "homepage": "http://www.17track.net", - * "country": "CN" - * }, - * "service_type": "International Priority", - * "latest_sync_status": "Success", - * "latest_sync_time": "2022-06-09T05:46:31Z", - * "events_hash": -227928244, - * "events": [ - * { - * "time_iso": "2022-04-29T09:19:00-08:00", - * "time_utc": "2022-04-29T17:19:00Z", - * "description": "At local FedEx facility", - * "description_translation": { - * "lang": "en", - * "description": "At local FedEx facility" - * }, - * "location": "ANCHORAGE, AK, US", - * "stage": "InfoReceived", - * "address": { - * "country": "US", - * "state": "AK", - * "city": "ANCHORAGE", - * "street": null, - * "postal_code": "99502", - * "coordinates": { - * "longitude": "35.86166", - * "latitude": "104.195397" - * } - * } - * } - * ] - * } - * ] - * } - * } - * } - * } + { + "event": "TRACKING_UPDATED", + "data": { + "number": "RR123456789CN", + "carrier": 3011, + "param": "518000", + "tag": "myID", + "track_info": { + "shipping_info": { + "shipper_address": { + "country": "CN", + "state": "GD", + "city": "SHENZHEN", + "street": "HARTFORD CT DISTRIBUTION CENTER", + "postal_code": "518000", + "coordinates": { + "longitude": "114.085947", + "latitude": "22.547" + } + }, + "recipient_address": { + "country": "AF", + "state": null, + "city": "KABUL", + "street": null, + "postal_code": null, + "coordinates": { + "longitude": null, + "latitude": null + } + } + }, + "latest_status": { + "status": "InfoReceived", + "sub_status": "InfoReceived", + "sub_status_descr": null + }, + "latest_event": { + "time_iso": "2022-05-23T22:22:00+08:00", + "time_utc": "2022-05-23T14:22:00Z", + "description": "Shipment information sent to FedEx", + "description_translation": { + "lang": "en", + "description": "Shipment information sent to FedEx" + }, + "location": "NJ", + "stage": "InfoReceived", + "address": { + "country": "US", + "state": "NJ", + "city": "MARLTON", + "street": null, + "postal_code": "08053", + "coordinates": { + "longitude": null, + "latitude": null + } + } + }, + "time_metrics": { + "days_after_order": 7, + "days_of_transit": 7, + "days_of_transit_done": 7, + "days_after_last_update": 57, + "estimated_delivery_date": { + "source":"Official", + "from": "2022-03-02T18:43:24-06:00", + "to": "2022-03-03T19:43:24-06:00" + } + }, + "milestone": [ + { + "key_stage": "InfoReceived", + "time_iso": "2022-04-25T22:22:47-05:00", + "time_utc": "2022-04-26T03:22:47Z" + }, + { + "key_stage": "PickedUp", + "time_iso": "2022-04-25T16:22:00+08:00", + "time_utc": "2022-04-25T08:22:00Z" + }, + { + "key_stage": "Departure", + "time_iso": "2022-05-19T21:40:00+08:00", + "time_utc": "2022-05-19T13:40:00Z" + }, + { + "key_stage": "Arrival", + "time_iso": null, + "time_utc": null + }, + { + "key_stage": "AvailableForPickup", + "time_iso": null, + "time_utc": null + }, + { + "key_stage": "OutForDelivery", + "time_iso": null, + "time_utc": null + }, + { + "key_stage": "Delivered", + "time_iso": null, + "time_utc": null + }, + { + "key_stage": "Returning", + "time_iso": null, + "time_utc": null + }, + { + "key_stage": "Returned", + "time_iso": null, + "time_utc": null + } + ], + "misc_info": { + "risk_factor": 0, + "service_type": "FedEx International Priority", + "weight_raw": "1.1 KG", + "weight_kg": "1.1", + "pieces": "1", + "dimensions": "22*20*16 CM", + "customer_number": "2459642000~270434455123~FX", + "reference_number": null, + "local_number": "270434455123", + "local_provider": "Fedex", + "local_key": 100003 + }, + "tracking": { + "providers_hash": 2067301750, + "providers": [ + { + "provider": { + "key": 3011, + "name": "China Post", + "alias": "China Post", + "tel": null, + "homepage": "http://www.17track.net", + "country": "CN" + }, + "service_type": "International Priority", + "latest_sync_status": "Success", + "latest_sync_time": "2022-06-09T05:46:31Z", + "events_hash": -227928244, + "events": [ + { + "time_iso": "2022-04-29T09:19:00-08:00", + "time_utc": "2022-04-29T17:19:00Z", + "description": "At local FedEx facility", + "description_translation": { + "lang": "en", + "description": "At local FedEx facility" + }, + "location": "ANCHORAGE, AK, US", + "stage": "InfoReceived", + "address": { + "country": "US", + "state": "AK", + "city": "ANCHORAGE", + "street": null, + "postal_code": "99502", + "coordinates": { + "longitude": "35.86166", + "latitude": "104.195397" + } + } + } + ] + } + ] + } + } + } + } */ - String rst = "{\n" + + String rst="{\n" + " \"result\":true,\n" + " \"returnCode\":\"200\",\n" + " \"message\":\"成功\"\n" + @@ -1135,83 +1161,90 @@ public class EmisCommonController extends EmisBaseController { /** * 导出进仓单模板 - * * @param response * @param orderSn */ @Log(title = "导出进仓单", businessType = BusinessType.EXPORT) @RequestMapping("/exportWarehouseInTpl") - public void exportWarehouseInTpl(HttpServletResponse response, String orderSn, String fileType) { - try { - emisWaybillService.genWarehouseInTplFile(response, orderSn, fileType); - } catch (EmisBizError ex) { + public void exportWarehouseInTpl(HttpServletResponse response,String orderSn,String fileType) { + try{ + emisWaybillService.genWarehouseInTplFile(response,orderSn,fileType); + } + catch(EmisBizError ex){ ex.printStackTrace(); - } catch (Exception ex) { + } + catch (Exception ex){ ex.printStackTrace(); } } /** * 重新计算账单开票状态 - * * @param settleBillNo */ @Log(title = "重新计算账单开票状态", businessType = BusinessType.UPDATE) @RequestMapping("/reCalcSettleBillInvoiceStatus") - public void reCalcSettleBillInvoiceStatus(String settleBillNo) { - try { + public void reCalcSettleBillInvoiceStatus(String settleBillNo) { + try{ emisSettleBillService.reCalcSettleBillInvoiceStatus(settleBillNo); - } catch (Exception ex) { + } + catch (Exception ex){ ex.printStackTrace(); } } @Log(title = "重新计算入仓重量状态", businessType = BusinessType.UPDATE) @RequestMapping("/reCalcWareHouseInTotalInfo") - public void reCalcWareHouseInTotalInfo(String settleBillNo) { - try { + public void reCalcWareHouseInTotalInfo(String settleBillNo) { + try{ emisWarehouseInBatchService.reCalcWareHouseInTotalInfo(settleBillNo); - } catch (Exception ex) { + } + catch (Exception ex){ ex.printStackTrace(); } } + + + /** * 重新计算账单开票状态 - * * @param settleBillNo */ @Log(title = "重新计算收款状态", businessType = BusinessType.UPDATE) @RequestMapping("/reCalcSettleBillPayStatus") - public void reCalcSettleBillPayStatus(String settleBillNo) { - try { + public void reCalcSettleBillPayStatus(String settleBillNo) { + try{ emisSettleBillService.reCalcSettleBillPayStatus(settleBillNo); - } catch (Exception ex) { + } + catch (Exception ex){ ex.printStackTrace(); } } /** * 重新计算收款账期 - * * @param settleBillNo */ @Log(title = "重新计算收款账期", businessType = BusinessType.UPDATE) @RequestMapping("/reCalcBillMonthPayDueDate") - public void reCalcBillMonthPayDueDate(String settleBillNo) { - try { + public void reCalcBillMonthPayDueDate(String settleBillNo) { + try{ emisSettleBillService.reCalcBillMonthPayDueDate(settleBillNo); - } catch (Exception ex) { + } + catch (Exception ex){ ex.printStackTrace(); } } + @GetMapping(value = "/getKefuSsoToken") - public AjaxResult getKefuSsoToken() { - String token = null; + public AjaxResult getKefuSsoToken() + { + String token= null; try { token = rl7moorService.getSsoTokenByEmpCode(getLoginUser().getUser().getEmpCode()); - return AjaxResult.success("获取成功", token); + return AjaxResult.success("获取成功",token); } catch (Exception e) { e.printStackTrace(); return AjaxResult.error("获取token异常"); @@ -1219,65 +1252,58 @@ public class EmisCommonController extends EmisBaseController { } + /** * 触发生成用户必要通知 - * * @return */ @GetMapping("/autoDoGenerateNotifyTrigger") public AjaxResult autoDoSendNotifyTrigger() { // 0.催款,有超期回款的5分钟催一次 - EmisSettleBill queryRecBill = new EmisSettleBill(); - queryRecBill.getParams().put("isNeedRecdPay", 1); + EmisSettleBill queryRecBill=new EmisSettleBill(); + queryRecBill.getParams().put("isNeedRecdPay",1); List listExpireNoPayStatInfo = emisSettleBillService.selectBillPayStatInfoList(queryRecBill); - if (!CollectionUtils.isEmpty(listExpireNoPayStatInfo)) { - for (BillPayStatInfo item : listExpireNoPayStatInfo) { - String salesmen = item.getSalesmen(); - String billMonth = item.getBillMonth(); - String msg = "截止" + DateUtils.parseDateToStr("yyyy-MM-dd HH点", new Date()) + "有未回款,尽快联系客户收款,账期:" - + billMonth + ",待收:" + item.getNoRecdPayMoney() + "元,超期:" + item.getExpiredNoRecdPayMoney() - + "元!"; - AjaxResult rst = NoticeUtils.outSendNoticeToInner(msg, msg, "/ruyERj/BillPaybackSumList", salesmen, 3); + if(!CollectionUtils.isEmpty(listExpireNoPayStatInfo)){ + for (BillPayStatInfo item:listExpireNoPayStatInfo) { + String salesmen=item.getSalesmen(); + String billMonth=item.getBillMonth(); + String msg="截止"+DateUtils.parseDateToStr("yyyy-MM-dd HH点",new Date())+"有未回款,尽快联系客户收款,账期:"+billMonth+",待收:"+item.getNoRecdPayMoney()+"元,超期:"+item.getExpiredNoRecdPayMoney()+"元!"; + AjaxResult rst=NoticeUtils.outSendNoticeToInner(msg,msg,"/ruyERj/BillPaybackSumList",salesmen,3); log.info(msg); } } // 1.销售开票统计通知 - EmisSettleBill queryInvoice = new EmisSettleBill(); - queryInvoice.getParams().put("isNeedRecdInvoice", 1); - List listExpireNoInvoiceStatInfo = emisSettleBillService - .selectOpenBillStatInfoList(queryInvoice); - if (!CollectionUtils.isEmpty(listExpireNoInvoiceStatInfo)) { - for (OpenBillStatInfo item : listExpireNoInvoiceStatInfo) { - String salesmen = item.getSalesmen(); - String billMonth = item.getBillMonth(); - String msg = "截止" + DateUtils.parseDateToStr("yyyy-MM-dd HH点", new Date()) + " 有账单未开票,尽快联系客户开票,账期:" - + billMonth + ",待开票:" + item.getNoOpenBillCount() + ",超期未开票:" + item.getExpiredNoOpenBillCount() - + "!"; - AjaxResult rst = NoticeUtils.outSendNoticeToInner(msg, msg, "/ruyERj/BillPaybackSumList", salesmen, 3); + EmisSettleBill queryInvoice=new EmisSettleBill(); + queryInvoice.getParams().put("isNeedRecdInvoice",1); + List listExpireNoInvoiceStatInfo = emisSettleBillService.selectOpenBillStatInfoList(queryInvoice); + if(!CollectionUtils.isEmpty(listExpireNoInvoiceStatInfo)){ + for (OpenBillStatInfo item:listExpireNoInvoiceStatInfo) { + String salesmen=item.getSalesmen(); + String billMonth=item.getBillMonth(); + String msg="截止"+DateUtils.parseDateToStr("yyyy-MM-dd HH点",new Date())+" 有账单未开票,尽快联系客户开票,账期:"+billMonth+",待开票:"+item.getNoOpenBillCount()+",超期未开票:"+item.getExpiredNoOpenBillCount()+"!"; + AjaxResult rst=NoticeUtils.outSendNoticeToInner(msg,msg,"/ruyERj/BillPaybackSumList",salesmen,3); log.info(msg); } } + // 2.开票收款统计通知 - // if(empcodes!=null && empcodes.length>0) { - // for(int i=0;i0) { +// for(int i=0;i