Merge branch 'master' of http://git.xdadan.loc/tanex/emis-service
This commit is contained in:
commit
a6c8700f9d
@ -852,14 +852,14 @@ public class EmisCommonController extends EmisBaseController
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/autoScanSiteBatch")
|
||||
public AjaxResult autoScanSiteBatch(){
|
||||
public AjaxResult autoScanSiteBatch(String lineCode){
|
||||
String lockKey="autoScanSiteBatch";
|
||||
log.info("autoScanSiteBatch start");
|
||||
|
||||
// 加锁查询
|
||||
redissonService.lock(lockKey,300);
|
||||
try{
|
||||
emisTmsSiteBatchMissService.autoScanSiteBatch();
|
||||
emisTmsSiteBatchMissService.autoScanSiteBatch(lineCode);
|
||||
}catch(Exception ex){
|
||||
ex.printStackTrace();
|
||||
log.error("autoScanSiteBatch exception:"+ex.getMessage());
|
||||
@ -1317,6 +1317,55 @@ public class EmisCommonController extends EmisBaseController
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出进仓单-对接外部
|
||||
*
|
||||
* @param response HTTP响应对象
|
||||
* @param queryInfo 查询参数JSON对象
|
||||
* @return JSONObject 统一格式的响应
|
||||
*/
|
||||
@Log(title = "导出进仓单", businessType = BusinessType.EXPORT)
|
||||
@RequestMapping("/exportCustomerWarehouse")
|
||||
public void exportCustomerWarehouse(HttpServletResponse response, @RequestBody JSONObject queryInfo) {
|
||||
try {
|
||||
// 1. 参数校验
|
||||
if (queryInfo == null) {
|
||||
log.error("查询参数不能为空");
|
||||
}
|
||||
|
||||
// 2. 获取参数
|
||||
String logisticNo = queryInfo.getString("logisticNo");
|
||||
String fileType = queryInfo.getString("fileType");
|
||||
String appId = queryInfo.getString("appId");
|
||||
String appKey = queryInfo.getString("appKey");
|
||||
String sign = queryInfo.getString("sign");
|
||||
|
||||
// 3. 参数完整性校验
|
||||
if (StringUtils.isAnyEmpty(logisticNo, fileType, appId, appKey, sign)) {
|
||||
log.error("参数不完整");
|
||||
}
|
||||
|
||||
// 4. 验证签名
|
||||
if (!emisCustomerSignService.verifySign(appId, appKey, logisticNo, sign)) {
|
||||
log.error("签名验证失败");
|
||||
}
|
||||
|
||||
EmisWaybill emisWaybill = emisWaybillService.selectCustEmisWaybillByBillCode(logisticNo, appId);
|
||||
if (emisWaybill == null) {
|
||||
log.error("运单号不存在");
|
||||
}
|
||||
|
||||
// 5. 调用service处理导出
|
||||
emisWaybillService.genWarehouseInTplFile(response, emisWaybill.getOrderSn(), fileType);
|
||||
log.debug("导出成功");
|
||||
|
||||
} catch (EmisBizError ex) {
|
||||
log.error("导出异常", ex.getMessage());
|
||||
} catch (Exception ex) {
|
||||
log.error("导出异常,请联系客服", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 对接外部接口-根据订单信息生成运单
|
||||
*/
|
||||
@ -1418,10 +1467,281 @@ public class EmisCommonController extends EmisBaseController
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 对接外部接口-查询运单信息
|
||||
*/
|
||||
@PostMapping("/queryWaybillInfo")
|
||||
@ResponseBody
|
||||
public JSONObject queryWaybillInfo(@RequestBody JSONObject queryInfo) {
|
||||
try {
|
||||
if (queryInfo == null) {
|
||||
JSONObject errorResponse = new JSONObject();
|
||||
errorResponse.put("code", 1);
|
||||
errorResponse.put("message", "查询信息不能为空");
|
||||
errorResponse.put("data", "[]");
|
||||
return errorResponse;
|
||||
}
|
||||
|
||||
// 1. 获取参数
|
||||
String appId = queryInfo.getString("appId");
|
||||
String appKey = queryInfo.getString("appKey");
|
||||
String logisticNo = queryInfo.getString("logisticNo");
|
||||
String sign = queryInfo.getString("sign");
|
||||
|
||||
// 2. 参数校验
|
||||
if (StringUtils.isAnyEmpty(appId, appKey, logisticNo, sign)) {
|
||||
JSONObject errorResponse = new JSONObject();
|
||||
errorResponse.put("code", 1);
|
||||
errorResponse.put("message", "参数不完整");
|
||||
errorResponse.put("data", "[]");
|
||||
return errorResponse;
|
||||
}
|
||||
|
||||
// 3. 验证签名
|
||||
if (!emisCustomerSignService.verifySign(appId, appKey, logisticNo, sign)) {
|
||||
JSONObject errorResponse = new JSONObject();
|
||||
errorResponse.put("code", 1);
|
||||
errorResponse.put("message", "签名验证失败");
|
||||
errorResponse.put("data", "[]");
|
||||
return errorResponse;
|
||||
}
|
||||
|
||||
// 4. 解码查询数据
|
||||
|
||||
// 5. 调用service处理查询
|
||||
Map<String, Object> result = emisWaybillService.queryWaybillInfo(logisticNo, appId);
|
||||
|
||||
// 6. 转换返回结果
|
||||
JSONObject response = new JSONObject();
|
||||
List<Map<String, Object>> resultList = (List<Map<String, Object>>) result.get("result");
|
||||
|
||||
// 构建返回的data数据
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (resultList != null) {
|
||||
for (Map<String, Object> item : resultList) {
|
||||
JSONObject dataItem = new JSONObject();
|
||||
// 订单基本信息
|
||||
dataItem.put("orderNo", item.get("orderNo"));
|
||||
dataItem.put("logisticNo", item.get("logisticNo"));
|
||||
dataItem.put("orderDate", item.get("orderDate"));
|
||||
dataItem.put("intoWarehouseBillCode", item.get("intoWarehouseBillCode"));
|
||||
dataItem.put("intoWarehouseName", item.get("intoWarehouseName"));
|
||||
dataItem.put("intoWarehouseContact", item.get("intoWarehouseContact"));
|
||||
dataItem.put("intoWarehousePhone", item.get("intoWarehousePhone"));
|
||||
dataItem.put("intoWarehouseAddress", item.get("intoWarehouseAddress"));
|
||||
dataItem.put("pickStartDate", item.get("pickStartDate"));
|
||||
dataItem.put("sendDate", item.get("sendDate"));
|
||||
dataItem.put("blSign", item.get("blSign"));
|
||||
dataItem.put("orderStatus", item.get("orderStatus"));
|
||||
|
||||
// 运输信息
|
||||
dataItem.put("transLine", item.get("transLine"));
|
||||
dataItem.put("productType", item.get("productType"));
|
||||
dataItem.put("customsClear", item.get("customsClear"));
|
||||
dataItem.put("customsEclaration", item.get("customsEclaration"));
|
||||
dataItem.put("pickupMethod", item.get("pickupMethod"));
|
||||
dataItem.put("dispatchMethod", item.get("dispatchMethod"));
|
||||
dataItem.put("packType", item.get("packType"));
|
||||
dataItem.put("paymentType", item.get("paymentType"));
|
||||
dataItem.put("custNo", item.get("custNo"));
|
||||
dataItem.put("salemen", item.get("salemen"));
|
||||
|
||||
// 收件人信息
|
||||
dataItem.put("country", item.get("country"));
|
||||
dataItem.put("province", item.get("province"));
|
||||
dataItem.put("city", item.get("city"));
|
||||
dataItem.put("district", item.get("district"));
|
||||
dataItem.put("consignee", item.get("consignee"));
|
||||
dataItem.put("company", item.get("company"));
|
||||
dataItem.put("tel", item.get("tel"));
|
||||
dataItem.put("address", item.get("address"));
|
||||
dataItem.put("postCode", item.get("postCode"));
|
||||
|
||||
// 寄件人信息
|
||||
dataItem.put("sender", item.get("sender"));
|
||||
dataItem.put("senderCountry", item.get("senderCountry"));
|
||||
dataItem.put("senderProvince", item.get("senderProvince"));
|
||||
dataItem.put("senderCity", item.get("senderCity"));
|
||||
dataItem.put("senderDistrict", item.get("senderDistrict"));
|
||||
dataItem.put("senderCompany", item.get("senderCompany"));
|
||||
dataItem.put("senderTel", item.get("senderTel"));
|
||||
dataItem.put("senderAddress", item.get("senderAddress"));
|
||||
|
||||
// 包裹信息
|
||||
dataItem.put("batchNumber", item.get("batchNumber"));
|
||||
dataItem.put("parcelQty", item.get("parcelQty"));
|
||||
dataItem.put("weight", item.get("weight"));
|
||||
dataItem.put("volume", item.get("volume"));
|
||||
dataItem.put("goodsInfo", item.get("goodsInfo"));
|
||||
|
||||
// 其他信息
|
||||
dataItem.put("estimateFreight", item.get("estimateFreight"));
|
||||
dataItem.put("signDate", item.get("signDate"));
|
||||
dataItem.put("signMan", item.get("signMan"));
|
||||
dataItem.put("remark", item.get("remark"));
|
||||
|
||||
dataArray.add(dataItem);
|
||||
}
|
||||
}
|
||||
|
||||
// 设置返回状态
|
||||
response.put("code", 0); // 查询成功
|
||||
response.put("message", "查询成功");
|
||||
response.put("data", dataArray.toJSONString());
|
||||
|
||||
return response;
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
JSONObject response = new JSONObject();
|
||||
response.put("code", 1);
|
||||
response.put("message", ex instanceof EmisBizError ? ex.getMessage() : "查询异常,请联系客服");
|
||||
response.put("data", "[]");
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 对接客户接口-查询物流轨迹信息
|
||||
*/
|
||||
@PostMapping("/queryCustomerTraceInfo")
|
||||
@ResponseBody
|
||||
public JSONObject queryCustomerTraceInfo(@RequestBody JSONObject queryInfo) {
|
||||
try {
|
||||
if (queryInfo == null) {
|
||||
JSONObject errorResponse = new JSONObject();
|
||||
errorResponse.put("code", 1);
|
||||
errorResponse.put("message", "查询信息不能为空");
|
||||
errorResponse.put("data", "[]");
|
||||
return errorResponse;
|
||||
}
|
||||
|
||||
// 1. 获取参数
|
||||
String appId = queryInfo.getString("appId");
|
||||
String appKey = queryInfo.getString("appKey");
|
||||
String logisticNo = queryInfo.getString("logisticNo");
|
||||
String lang = queryInfo.getString("lang");
|
||||
String sign = queryInfo.getString("sign");
|
||||
|
||||
// 2. 参数校验
|
||||
if (StringUtils.isAnyEmpty(appId, appKey, logisticNo, sign)) {
|
||||
JSONObject errorResponse = new JSONObject();
|
||||
errorResponse.put("code", 1);
|
||||
errorResponse.put("message", "参数不完整");
|
||||
errorResponse.put("data", "[]");
|
||||
return errorResponse;
|
||||
}
|
||||
|
||||
// 3. 验证签名
|
||||
if (!emisCustomerSignService.verifySign(appId, appKey, logisticNo, sign)) {
|
||||
JSONObject errorResponse = new JSONObject();
|
||||
errorResponse.put("code", 1);
|
||||
errorResponse.put("message", "签名验证失败");
|
||||
errorResponse.put("data", "[]");
|
||||
return errorResponse;
|
||||
}
|
||||
|
||||
// 4. 调用service处理查询
|
||||
EmisWaybill emisWaybill = emisWaybillService.selectCustEmisWaybillByBillCode(logisticNo, appId);
|
||||
if (emisWaybill == null) {
|
||||
JSONObject errorResponse = new JSONObject();
|
||||
errorResponse.put("code", 1);
|
||||
errorResponse.put("message", "运单不存在");
|
||||
errorResponse.put("data", "[]");
|
||||
return errorResponse;
|
||||
}
|
||||
|
||||
// 获取轨迹信息
|
||||
List<Map> stepList = emisTmsScanRecordService.queryWaybillTraceInfo(logisticNo, lang, false);
|
||||
|
||||
// 构建返回数据
|
||||
JSONObject response = new JSONObject();
|
||||
JSONArray dataArray = new JSONArray();
|
||||
|
||||
JSONObject dataItem = new JSONObject();
|
||||
dataItem.put("logisticNo", logisticNo);
|
||||
dataItem.put("sendCountry", emisWaybill.getSendCountryName());
|
||||
dataItem.put("country", emisWaybill.getReceiveCountryName());
|
||||
dataItem.put("steps", stepList);
|
||||
dataArray.add(dataItem);
|
||||
|
||||
// 设置返回状态
|
||||
response.put("code", 0); // 查询成功
|
||||
response.put("message", "查询成功");
|
||||
response.put("data", dataArray.toJSONString());
|
||||
|
||||
return response;
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
JSONObject response = new JSONObject();
|
||||
response.put("code", 1);
|
||||
response.put("message", ex instanceof EmisBizError ? ex.getMessage() : "查询异常,请联系客服");
|
||||
response.put("data", "[]");
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 对接外部接口-更新运单信息
|
||||
*/
|
||||
@PostMapping("/updateWaybillInfo")
|
||||
@ResponseBody
|
||||
public JSONObject updateWaybillInfo(@RequestBody JSONObject orderInfo) {
|
||||
try {
|
||||
if (orderInfo == null) {
|
||||
JSONObject errorResponse = new JSONObject();
|
||||
errorResponse.put("code", 1);
|
||||
errorResponse.put("message", "订单信息不能为空");
|
||||
return errorResponse;
|
||||
}
|
||||
|
||||
// 1. 获取参数
|
||||
String appId = orderInfo.getString("appId");
|
||||
String appKey = orderInfo.getString("appKey");
|
||||
String orderBase64Data = orderInfo.getString("orderBase64Data");
|
||||
String sign = orderInfo.getString("sign");
|
||||
|
||||
// 2. 参数校验
|
||||
if (StringUtils.isAnyEmpty(appId, appKey, orderBase64Data, sign)) {
|
||||
JSONObject errorResponse = new JSONObject();
|
||||
errorResponse.put("code", 1);
|
||||
errorResponse.put("message", "参数不完整");
|
||||
return errorResponse;
|
||||
}
|
||||
|
||||
// 3. 验证签名
|
||||
if (!emisCustomerSignService.verifySign(appId, appKey, orderBase64Data, sign)) {
|
||||
JSONObject errorResponse = new JSONObject();
|
||||
errorResponse.put("code", 1);
|
||||
errorResponse.put("message", "签名验证失败");
|
||||
return errorResponse;
|
||||
}
|
||||
|
||||
// 4. 解码订单数据
|
||||
String orderDataStr = new String(Base64.getDecoder().decode(orderBase64Data), StandardCharsets.UTF_8);
|
||||
JSONObject orderData = JSONObject.parseObject(orderDataStr);
|
||||
|
||||
// 5. 调用service处理更新
|
||||
emisWaybillService.updateWaybillInfo(orderData, appId);
|
||||
|
||||
// 6. 返回成功响应
|
||||
JSONObject response = new JSONObject();
|
||||
response.put("code", 0);
|
||||
response.put("message", "更新成功");
|
||||
return response;
|
||||
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
JSONObject response = new JSONObject();
|
||||
response.put("code", 1);
|
||||
response.put("message", ex instanceof EmisBizError ? ex.getMessage() : "处理异常,请联系客服");
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String appId = "APP17490075851304001";
|
||||
String appKey = "sDAbUqxjsWCbHGJlEi0bL3OXgB9SoyK4";
|
||||
String orderBase64Data = "W3sKICAib3JkZXJObyI6ICIxOTIxMDMwNzI3Njc2MTk4OTE0IiwKICAidHJhbnNMaW5lIjogIuafrOWflOWvqOmZhui/kCIsCiAgInByb2R1Y3RUeXBlIjogIumZhui/kOeJueaDoOi+viIsCiAgImN1c3RvbXNDbGVhciI6ICIzIiwKICAiY3VzdG9tc0VjbGFyYXRpb24iOiAiMyIsCiAgInBpY2t1cE1ldGhvZCI6ICIxIiwKICAiZGlzcGF0Y2hNZXRob2QiOiAiMSIsCiAgInBhY2tUeXBlIjogIjIiLAogICJwYXltZW50VHlwZSI6ICIyIiwKICAiY3VzdE5vIjogIlRMWjA1MTIzMDE2IiwKICAic2FsZW1lbiI6ICLnlLDlsI/ovokiLAogICJjb3VudHJ5IjogIuafrOWflOWvqCIsCiAgInByb3ZpbmNlIjogIumHkei+uSIsCiAgImNpdHkiOiAiIiwKICAiZGlzdHJpY3QiOiAiIiwKICAiY29uc2lnbmVlIjogIuWNjuS4sCIsCiAgImNvbXBhbnkiOiAi5Y2O5LiwU09LIEhVT04iLAogICJ0ZWwiOiAiMDk3NzU3MDI3NSIsCiAgImFkZHJlc3MiOiAiWWFucWluZyBJbmR1c3RyaWFsIFBhcmsgSUlJLCBLbS4zNCBSb2FkICM0IFNhbmdrcm9zIGNoZWF0IHZpbGxhZ2UsIFRyYXBlYW5nIEtvbmcgY29tbXVuZSwgU2FtcmFvbmcgVG9uZyBkaXN0cmljdCBLYW1wb25nIFNwZXUgcHJvdmluY2UsQ2FtYm9kaWEiLAogICJwb3N0Q29kZSI6ICIiLAogICJzZW5kZXIiOiAi6buE5ZON5oOgIiwKICAic2VuZGVyQ291bnRyeSI6ICLkuK3lm70iLAogICJzZW5kZXJQcm92aW5jZSI6ICLmsZ/oi4/nnIEiLAogICJzZW5kZXJDaXR5IjogIiIsCiAgInNlbmRlckRpc3RyaWN0IjogIiIsCiAgInNlbmRlckNvbXBhbnkiOiAi5rGf6IuP5Zu95rOw5Lq/6L6+5a6e5Lia5pyJ6ZmQ5YWs5Y+4IiwKICAic2VuZGVyVGVsIjogIjEzOTIxOTYxODYzIiwKICAic2VuZGVyQWRkcmVzcyI6ICLmsZ/oi4/nnIHlvKDlrrbmuK/luILkurrmsJHot68xMjXlj7flm73ms7DmlrDkuJbnuqrlub/lnLoyN+alvCIsCiAgImJhdGNoTnVtYmVyIjogIiIsCiAgInBhcmNlbFF0eSI6IDEsCiAgIndlaWdodCI6IDEsCiAgInZvbHVtZSI6IDEwLAogICJnb29kc0luZm8iOiAi6Z2i6L6F5paZIiwKICAiZ29vZHMiOiAiW3sgXCJpdGVtTm9cIjpcIjFcIiwgXCJuYW1lXCI6XCIyXCIsIFwiYnJhbmRcIjpcIjNcIiwgXCJtb2RlbFwiOlwiMVwiLCBcImJhcmNvZGVcIjpcIjFcIiwgXCJoc2NvZGVcIjpcIjFcIiwgXCJxdHlcIjpcIjFcIiwgXCJwcmljZVwiOjEwMCwgXCJ1bml0XCI6MSwgXCJuZXRXZWlnaHRcIjoyLCBcImdyb3NzV2VpZ2h0XCI6MywgXCJ0ZXh0dXJlXCI6XCI0XCIsIFwicHVycG9zZVwiOlwiNVwiLCBcIm5hdGl2ZUNvdW50cnlcIjpcIjZcIiB9LCB7IFwiaXRlbU5vXCI6XCIxXCIsIFwibmFtZVwiOlwiMlwiLCBcImJyYW5kXCI6XCIzXCIsIFwibW9kZWxcIjpcIjFcIiwgXCJiYXJjb2RlXCI6XCIxXCIsIFwiaHNjb2RlXCI6XCIxXCIsIFwicXR5XCI6XCIxXCIsIFwicHJpY2VcIjoxMDAsIFwidW5pdFwiOjEsIFwibmV0V2VpZ2h0XCI6MiwgXCJncm9zc1dlaWdodFwiOjMsIFwidGV4dHVyZVwiOlwiNFwiLCBcInB1cnBvc2VcIjpcIjVcIiwgXCJuYXRpdmVDb3VudHJ5XCI6XCI2XCIgfSBdIiwKICAicmVtYXJrIjogIjAiCn0sCnsKICAib3JkZXJObyI6ICIxOTIxMDMwNzI3Njc2MTk4OTE1IiwKICAidHJhbnNMaW5lIjogIuafrOWflOWvqOmZhui/kCIsCiAgInByb2R1Y3RUeXBlIjogIumZhui/kOeJueaDoOi+viIsCiAgImN1c3RvbXNDbGVhciI6ICIzIiwKICAiY3VzdG9tc0VjbGFyYXRpb24iOiAiMyIsCiAgInBpY2t1cE1ldGhvZCI6ICIxIiwKICAiZGlzcGF0Y2hNZXRob2QiOiAiMSIsCiAgInBhY2tUeXBlIjogIjIiLAogICJwYXltZW50VHlwZSI6ICIyIiwKICAiY3VzdE5vIjogIlRMWjA1MTIzMDE2IiwKICAic2FsZW1lbiI6ICLnlLDlsI/ovokiLAogICJjb3VudHJ5IjogIuafrOWflOWvqCIsCiAgInByb3ZpbmNlIjogIumHkei+uSIsCiAgImNpdHkiOiAiIiwKICAiZGlzdHJpY3QiOiAiIiwKICAiY29uc2lnbmVlIjogIuWNjuS4sCIsCiAgImNvbXBhbnkiOiAi5Y2O5LiwU09LIEhVT04iLAogICJ0ZWwiOiAiMDk3NzU3MDI3NSIsCiAgImFkZHJlc3MiOiAiWWFucWluZyBJbmR1c3RyaWFsIFBhcmsgSUlJLCBLbS4zNCBSb2FkICM0IFNhbmdrcm9zIGNoZWF0IHZpbGxhZ2UsIFRyYXBlYW5nIEtvbmcgY29tbXVuZSwgU2FtcmFvbmcgVG9uZyBkaXN0cmljdCBLYW1wb25nIFNwZXUgcHJvdmluY2UsQ2FtYm9kaWEiLAogICJwb3N0Q29kZSI6ICIiLAogICJzZW5kZXIiOiAi6buE5ZON5oOgIiwKICAic2VuZGVyQ291bnRyeSI6ICLkuK3lm70iLAogICJzZW5kZXJQcm92aW5jZSI6ICLmsZ/oi4/nnIEiLAogICJzZW5kZXJDaXR5IjogIiIsCiAgInNlbmRlckRpc3RyaWN0IjogIiIsCiAgInNlbmRlckNvbXBhbnkiOiAi5rGf6IuP5Zu95rOw5Lq/6L6+5a6e5Lia5pyJ6ZmQ5YWs5Y+4IiwKICAic2VuZGVyVGVsIjogIjEzOTIxOTYxODYzIiwKICAic2VuZGVyQWRkcmVzcyI6ICLmsZ/oi4/nnIHlvKDlrrbmuK/luILkurrmsJHot68xMjXlj7flm73ms7DmlrDkuJbnuqrlub/lnLoyN+alvCIsCiAgImJhdGNoTnVtYmVyIjogIiIsCiAgInBhcmNlbFF0eSI6IDEsCiAgIndlaWdodCI6IDEsCiAgInZvbHVtZSI6IDEwLAogICJnb29kc0luZm8iOiAi6Z2i6L6F5paZIiwKICAiZ29vZHMiOiAiW3sgXCJpdGVtTm9cIjpcIjFcIiwgXCJuYW1lXCI6XCIyXCIsIFwiYnJhbmRcIjpcIjNcIiwgXCJtb2RlbFwiOlwiMVwiLCBcImJhcmNvZGVcIjpcIjFcIiwgXCJoc2NvZGVcIjpcIjFcIiwgXCJxdHlcIjpcIjFcIiwgXCJwcmljZVwiOjEwMCwgXCJ1bml0XCI6MSwgXCJuZXRXZWlnaHRcIjoyLCBcImdyb3NzV2VpZ2h0XCI6MywgXCJ0ZXh0dXJlXCI6XCI0XCIsIFwicHVycG9zZVwiOlwiNVwiLCBcIm5hdGl2ZUNvdW50cnlcIjpcIjZcIiB9LCB7IFwiaXRlbU5vXCI6XCIxXCIsIFwibmFtZVwiOlwiMlwiLCBcImJyYW5kXCI6XCIzXCIsIFwibW9kZWxcIjpcIjFcIiwgXCJiYXJjb2RlXCI6XCIxXCIsIFwiaHNjb2RlXCI6XCIxXCIsIFwicXR5XCI6XCIxXCIsIFwicHJpY2VcIjoxMDAsIFwidW5pdFwiOjEsIFwibmV0V2VpZ2h0XCI6MiwgXCJncm9zc1dlaWdodFwiOjMsIFwidGV4dHVyZVwiOlwiNFwiLCBcInB1cnBvc2VcIjpcIjVcIiwgXCJuYXRpdmVDb3VudHJ5XCI6XCI2XCIgfSBdIiwKICAicmVtYXJrIjogIjAiCn0KCl0=";
|
||||
String orderBase64Data = "ewogICJsb2dpc3RpY05vIjogIlQ3MDgwMzAwMDk2MzA4IiwKICAidHJhbnNMaW5lIjogIuafrOWflOWvqOmZhui/kCIsCiAgInByb2R1Y3RUeXBlIjogIumZhui/kOeJueaDoOi+viIsCiAgImN1c3RvbXNDbGVhciI6ICIzIiwKICAiY3VzdG9tc0VjbGFyYXRpb24iOiAiMyIsCiAgInBpY2t1cE1ldGhvZCI6ICIyIiwKICAiZGlzcGF0Y2hNZXRob2QiOiAiMSIsCiAgInBhY2tUeXBlIjogIjIiLAogICJwYXltZW50VHlwZSI6ICIyIiwKICAiY291bnRyeSI6ICLmn6zln5Tlr6giLAogICJwcm92aW5jZSI6ICLph5HovrkiLAogICJjb25zaWduZWUiOiAi5Y2O5LiwIiwKICAidGVsIjogIjA5Nzc1NzAyNzUiLAogICJhZGRyZXNzIjogIllhbnFpbmcgSW5kdXN0cmlhbCBQYXJrIElJSSwgS20uMzQgUm9hZCAjNCBTYW5na3JvcyBjaGVhdCB2aWxsYWdlLCBUcmFwZWFuZyBLb25nIGNvbW11bmUsIFNhbXJhb25nIFRvbmcgZGlzdHJpY3QgS2FtcG9uZyBTcGV1IHByb3ZpbmNlLENhbWJvZGlhIiwKICAicG9zdENvZGUiOiAiIiwKICAic2VuZGVyIjogIum7hOWTjeaDoDEiLAogICJzZW5kZXJDb3VudHJ5IjogIuS4reWbvSIsCiAgInNlbmRlclByb3ZpbmNlIjogIuWuieW+veecgSIsCiAgInNlbmRlclRlbCI6ICIxMjM0NTYiLAogICJzZW5kZXJBZGRyZXNzIjogIuaxn+iLj+ecgeW8oOWutua4r+W4guS6uuawkei3rzEyNeWPt+WbveazsOaWsOS4lue6quW5v+WcujI35qW8MSIsCiAgInBhcmNlbFF0eSI6IDEsCiAgIndlaWdodCI6IDEwMDAsCiAgImdvb2RzSW5mbyI6ICLpnaLovoXmlpkiCn0=";
|
||||
String securityKey = "M7SGAUenMSkYfBZR8t9FQjwqwbZCDaGY";
|
||||
String signStr = appId + appKey + orderBase64Data + securityKey;
|
||||
String generatedSign = DigestUtils.md5Hex(signStr);
|
||||
|
||||
@ -37,7 +37,7 @@ public class EmisTmsSiteBatchMissController extends BaseController {
|
||||
/**
|
||||
* 查询TMS漏组批次信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:tms:site:batch:miss:list')")
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisTmsSiteBatchMiss:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EmisTmsSiteBatchMiss emisTmsSiteBatchMiss) {
|
||||
startPage();
|
||||
@ -73,7 +73,7 @@ public class EmisTmsSiteBatchMissController extends BaseController {
|
||||
/**
|
||||
* 导出TMS漏组批次信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:tms:site:batch:miss:export')")
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisTmsSiteBatchMiss:export')")
|
||||
@Log(title = "TMS漏组批次信息", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(EmisTmsSiteBatchMiss emisTmsSiteBatchMiss) {
|
||||
@ -86,7 +86,7 @@ public class EmisTmsSiteBatchMissController extends BaseController {
|
||||
/**
|
||||
* 获取TMS漏组批次信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:tms:site:batch:miss:query')")
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisTmsSiteBatchMiss:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(emisTmsSiteBatchMissService.selectEmisTmsSiteBatchMissById(id));
|
||||
@ -95,7 +95,7 @@ public class EmisTmsSiteBatchMissController extends BaseController {
|
||||
/**
|
||||
* 新增TMS漏组批次信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:tms:site:batch:miss:add')")
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisTmsSiteBatchMiss:add')")
|
||||
@Log(title = "TMS漏组批次信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EmisTmsSiteBatchMiss emisTmsSiteBatchMiss) {
|
||||
@ -105,7 +105,7 @@ public class EmisTmsSiteBatchMissController extends BaseController {
|
||||
/**
|
||||
* 修改TMS漏组批次信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:tms:site:batch:miss:edit')")
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisTmsSiteBatchMiss:edit')")
|
||||
@Log(title = "TMS漏组批次信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EmisTmsSiteBatchMiss emisTmsSiteBatchMiss) {
|
||||
@ -115,7 +115,7 @@ public class EmisTmsSiteBatchMissController extends BaseController {
|
||||
/**
|
||||
* 删除TMS漏组批次信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:tms:site:batch:miss:remove')")
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisTmsSiteBatchMiss:remove')")
|
||||
@Log(title = "TMS漏组批次信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
|
||||
@ -3,6 +3,7 @@ package com.xdadan.erp.web.emis;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.excel.support.ExcelTypeEnum;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.xdadan.erp.common.annotation.filter.jackson.JacksonFilter;
|
||||
import com.xdadan.erp.common.core.domain.AjaxResult;
|
||||
import com.xdadan.erp.common.core.page.TableDataInfo;
|
||||
@ -19,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.xdadan.erp.emis.domain.EmisTransPlanRule;
|
||||
import com.xdadan.erp.emis.service.IEmisTransPlanRuleService;
|
||||
import org.springframework.dao.DuplicateKeyException;
|
||||
|
||||
/**
|
||||
* 供应商线路规划Controller
|
||||
@ -77,8 +79,32 @@ public class EmisTransPlanRuleController extends EmisBaseController {
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisTransPlanRule:draftSubmitRule')")
|
||||
@PostMapping(value = "/draftSubmitRule")
|
||||
public AjaxResult draftSubmitRule(@RequestBody EmisTransPlanRule emisTransPlanRule) throws EmisBizError {
|
||||
return toAjax(emisTransPlanRuleService.draftSubmitRule(emisTransPlanRule));
|
||||
public AjaxResult draftSubmitRule(@RequestBody EmisTransPlanRule emisTransPlanRule) {
|
||||
JSONObject jObjOut = new JSONObject();
|
||||
String result = "success";
|
||||
String msg = "提交成功";
|
||||
try {
|
||||
emisTransPlanRuleService.draftSubmitRule(emisTransPlanRule);
|
||||
jObjOut.put("ruleDetail", emisTransPlanRule);
|
||||
} catch (EmisBizError ex) {
|
||||
ex.printStackTrace();
|
||||
result = "fail";
|
||||
msg = ex.getErrorCode() + ":" + ex.getMessage();
|
||||
} catch (DuplicateKeyException e) {
|
||||
e.printStackTrace();
|
||||
result = "fail";
|
||||
msg = "数据重复";
|
||||
} catch (Exception ex) {
|
||||
result = "fail";
|
||||
ex.printStackTrace();
|
||||
msg = "系统异常:" + ex.getMessage();
|
||||
if (ex instanceof EmisBizError) {
|
||||
msg = ((EmisBizError) ex).getErrorCode() + ":" + ex.getMessage();
|
||||
}
|
||||
}
|
||||
jObjOut.put("result", result);
|
||||
jObjOut.put("msg", msg);
|
||||
return AjaxResult.success("成功", jObjOut);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -65,7 +65,7 @@ public interface EmisTmsSiteBatchMissMapper {
|
||||
*/
|
||||
public int batchInsertEmisTmsSiteBatchMiss(List<EmisTmsSiteBatchMiss> list);
|
||||
|
||||
void deleteAll();
|
||||
void deleteAll(String lineCode);
|
||||
|
||||
/**
|
||||
* 根据bill_code出现次数查询TMS漏组批次信息
|
||||
|
||||
@ -104,9 +104,10 @@ public interface EmisTransPlanRuleMapper {
|
||||
* 根据产品类型名称查询产品类型信息
|
||||
*
|
||||
* @param productTypeNames 产品类型名称列表
|
||||
* @param code 线路编码
|
||||
* @return 产品类型信息列表
|
||||
*/
|
||||
public List<Map<String, String>> selectProductTypeInfoByNames(List<String> productTypeNames);
|
||||
public List<Map<String, String>> selectProductTypeInfoByNamesAndLineCode(@Param("productTypeNames") List<String> productTypeNames, @Param("lineCode") String code);
|
||||
|
||||
/**
|
||||
* 根据网点名称查询网点信息
|
||||
|
||||
@ -10,7 +10,6 @@
|
||||
*/
|
||||
package com.xdadan.erp.emis.mapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -18,7 +17,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
//import com.xdadan.erp.common.annotation.audit.DataAuditFilter;
|
||||
import com.xdadan.erp.common.annotation.audit.DataAuditLog;
|
||||
import com.xdadan.erp.common.annotation.audit.OperateType;
|
||||
import com.xdadan.erp.emis.domain.EmisSettleSubBill;
|
||||
import com.xdadan.erp.emis.domain.EmisWaybill;
|
||||
import com.xdadan.erp.emis.service.impl.EmisWaybillServiceImpl;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -57,6 +55,14 @@ public interface EmisWaybillMapper extends BaseMapper<EmisWaybill>
|
||||
*/
|
||||
public List<EmisWaybill> selectEmisWaybillList(EmisWaybill emisWaybill);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*
|
||||
* @param emisWaybill
|
||||
* @return 集合
|
||||
*/
|
||||
public List<EmisWaybill> selectEmisWaybillListByExternal(EmisWaybill emisWaybill);
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
* @param emisWaybill
|
||||
@ -282,18 +288,20 @@ public interface EmisWaybillMapper extends BaseMapper<EmisWaybill>
|
||||
public int setBindSalesmenDefault(@Param("customerCode") String customerCode,@Param("empCode") String empCode);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param offset 起始位置
|
||||
* @param pageSize 每页大小
|
||||
* @param lineCode
|
||||
* @return 运单列表
|
||||
*/
|
||||
List<EmisWaybill> selectWaybillListBySiteBatchStatus(@Param("offset") int offset, @Param("pageSize") int pageSize);
|
||||
List<EmisWaybill> selectWaybillListBySiteBatchStatus(@Param("offset") int offset, @Param("pageSize") int pageSize, @Param("lineCode") String lineCode);
|
||||
|
||||
/**
|
||||
* 根据客户单号查运单
|
||||
* 查询客户运单信息
|
||||
*
|
||||
* @param custOrderId
|
||||
* @param queryWaybill
|
||||
* @return
|
||||
*/
|
||||
EmisWaybill selectCustEmisWaybillByBillCode(EmisWaybill queryWaybill);
|
||||
|
||||
EmisWaybill selectEmisWaybillByCustOrderId(String custOrderId);
|
||||
}
|
||||
|
||||
@ -61,7 +61,7 @@ public interface IEmisTmsSiteBatchMissService {
|
||||
* 定时扫描运单货物组批次是否正确录入
|
||||
*
|
||||
*/
|
||||
void autoScanSiteBatch();
|
||||
void autoScanSiteBatch(String lineCode);
|
||||
|
||||
/**
|
||||
* 根据bill_code出现次数查询TMS漏组批次信息
|
||||
|
||||
@ -13,6 +13,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.xdadan.erp.common.core.audit.IDataAuditService;
|
||||
import com.xdadan.erp.emis.domain.EmisWaybill;
|
||||
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
||||
@ -261,4 +262,31 @@ public interface IEmisWaybillService extends IDataAuditService
|
||||
*/
|
||||
Map<String, Object> processOrderToWaybill(JSONArray orderInfo, String appId) throws EmisBizError;
|
||||
|
||||
/**
|
||||
* 查询运单信息
|
||||
*
|
||||
* @param logisticNo 运单号
|
||||
* @param appId 应用ID
|
||||
* @return 查询结果
|
||||
* @throws EmisBizError 业务异常
|
||||
*/
|
||||
Map<String, Object> queryWaybillInfo(String logisticNo, String appId) throws EmisBizError;
|
||||
|
||||
/**
|
||||
* 查询客户运单信息
|
||||
*
|
||||
* @param logisticNo
|
||||
* @param appId
|
||||
* @return
|
||||
*/
|
||||
EmisWaybill selectCustEmisWaybillByBillCode(String logisticNo, String appId);
|
||||
|
||||
/**
|
||||
* 更新运单信息
|
||||
*
|
||||
* @param orderData 订单数据
|
||||
* @param appId 应用ID
|
||||
* @throws EmisBizError 业务异常
|
||||
*/
|
||||
void updateWaybillInfo(JSONObject orderData, String appId) throws EmisBizError;
|
||||
}
|
||||
|
||||
@ -31,6 +31,7 @@ import com.xdadan.erp.emis.mapper.*;
|
||||
import com.xdadan.erp.emis.service.EmisBaseService;
|
||||
import com.xdadan.erp.emis.utils.Kd100Helper;
|
||||
import com.xdadan.erp.emis.utils.WaybillHelper;
|
||||
import jodd.util.StringUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -2661,6 +2662,9 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
|
||||
Map<String, Object> step = new HashMap<>();
|
||||
step.put("time", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,scanRecord.getScanDate()));
|
||||
step.put("status",scanRecord.getScanType());
|
||||
if (StringUtil.isNotBlank(scanRecord.getScanType())) {
|
||||
step.put("scanType", DictUtils.getDictLabel("emis_scan_type", scanRecord.getScanType()));
|
||||
}
|
||||
step.put("content", content);
|
||||
stepList.add(step);
|
||||
}
|
||||
|
||||
@ -133,9 +133,9 @@ public class EmisTmsSiteBatchMissServiceImpl extends EmisBaseService implements
|
||||
|
||||
@Async
|
||||
@Override
|
||||
public void autoScanSiteBatch() {
|
||||
public void autoScanSiteBatch(String lineCode) {
|
||||
try {
|
||||
emisTmsSiteBatchMissMapper.deleteAll();
|
||||
emisTmsSiteBatchMissMapper.deleteAll(lineCode);
|
||||
long startTime = System.currentTimeMillis();
|
||||
int pageSize = 1000;
|
||||
int offset = 0;
|
||||
@ -145,7 +145,7 @@ public class EmisTmsSiteBatchMissServiceImpl extends EmisBaseService implements
|
||||
List<String> failedBillCodes = new ArrayList<>();
|
||||
|
||||
// 获取所有线路规划
|
||||
List<EmisTransPlanRule> treeRules = this.selectEmisTransPlanRuleTree();
|
||||
List<EmisTransPlanRule> treeRules = this.selectEmisTransPlanRuleTree(lineCode);
|
||||
if (treeRules.isEmpty()) {
|
||||
log.info("No trans plan rules found, skip auto scan");
|
||||
return;
|
||||
@ -162,7 +162,7 @@ public class EmisTmsSiteBatchMissServiceImpl extends EmisBaseService implements
|
||||
|
||||
// 先查询所有数据
|
||||
while (true) {
|
||||
List<EmisWaybill> waybills = emisWaybillMapper.selectWaybillListBySiteBatchStatus(offset, pageSize);
|
||||
List<EmisWaybill> waybills = emisWaybillMapper.selectWaybillListBySiteBatchStatus(offset, pageSize,lineCode);
|
||||
if (waybills.isEmpty()) {
|
||||
break;
|
||||
}
|
||||
@ -344,6 +344,8 @@ public class EmisTmsSiteBatchMissServiceImpl extends EmisBaseService implements
|
||||
EmisTmsSiteBatchMiss miss = createMissRecord(waybill);
|
||||
miss.setMissReason("当前线路没有创建对应的线路规划");
|
||||
miss.setMissType("1");
|
||||
miss.setLineCode(waybill.getTransLineType());
|
||||
miss.setProductType(waybill.getProductType());
|
||||
missRecords.add(miss);
|
||||
successCount++;
|
||||
continue;
|
||||
@ -359,6 +361,8 @@ public class EmisTmsSiteBatchMissServiceImpl extends EmisBaseService implements
|
||||
EmisTmsSiteBatchMiss miss = createMissRecord(waybill);
|
||||
miss.setMissReason("当前线路没有创建对应的产品类型");
|
||||
miss.setMissType("1");
|
||||
miss.setLineCode(waybill.getTransLineType());
|
||||
miss.setProductType(waybill.getProductType());
|
||||
missRecords.add(miss);
|
||||
successCount++;
|
||||
continue;
|
||||
@ -371,6 +375,8 @@ public class EmisTmsSiteBatchMissServiceImpl extends EmisBaseService implements
|
||||
EmisTmsSiteBatchMiss miss = createMissRecord(waybill);
|
||||
miss.setMissReason("当前运单没有组批次");
|
||||
miss.setMissType("2");
|
||||
miss.setLineCode(waybill.getTransLineType());
|
||||
miss.setProductType(waybill.getProductType());
|
||||
missRecords.add(miss);
|
||||
successCount++;
|
||||
continue;
|
||||
@ -419,9 +425,11 @@ public class EmisTmsSiteBatchMissServiceImpl extends EmisBaseService implements
|
||||
return new ProcessResult(successCount, failCount, failedBillCodes, batchStatusList, missRecords);
|
||||
}
|
||||
|
||||
public List<EmisTransPlanRule> selectEmisTransPlanRuleTree() {
|
||||
public List<EmisTransPlanRule> selectEmisTransPlanRuleTree(String lineCode) {
|
||||
log.info("Start querying supplier route plan tree");
|
||||
List<EmisTransPlanRule> list = emisTransPlanRuleMapper.selectEmisTransPlanRuleList(new EmisTransPlanRule());
|
||||
EmisTransPlanRule emisTransPlanRule = new EmisTransPlanRule();
|
||||
emisTransPlanRule.setLineCode(lineCode);
|
||||
List<EmisTransPlanRule> list = emisTransPlanRuleMapper.selectEmisTransPlanRuleList(emisTransPlanRule);
|
||||
List<EmisTransPlanRule> tree = buildTree(list);
|
||||
log.info("Queried supplier route plan tree, node count={}", tree != null ? tree.size() : 0);
|
||||
return tree;
|
||||
@ -468,6 +476,8 @@ public class EmisTmsSiteBatchMissServiceImpl extends EmisBaseService implements
|
||||
EmisTmsSiteBatchMiss miss = createMissRecord(waybill);
|
||||
miss.setMissReason("该运单所有组批次信息都不匹配,请仔细核对");
|
||||
miss.setMissType("3");
|
||||
miss.setLineCode(waybill.getTransLineType());
|
||||
miss.setProductType(waybill.getProductType());
|
||||
missRecords.add(miss);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ public class EmisTransPlanRuleServiceImpl extends EmisBaseService implements IEm
|
||||
|
||||
// 产品类型(支持多个,逗号分隔)
|
||||
String[] productTypeNames = emisTransPlanRule.getProductTypeName().split(",");
|
||||
List<Map<String, String>> productTypeInfo = emisTransPlanRuleMapper.selectProductTypeInfoByNames(Arrays.asList(productTypeNames));
|
||||
List<Map<String, String>> productTypeInfo = emisTransPlanRuleMapper.selectProductTypeInfoByNamesAndLineCode(Arrays.asList(productTypeNames),lineInfo.get(0).get("code"));
|
||||
if (productTypeInfo == null || productTypeInfo.isEmpty()) {
|
||||
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "未找到对应的产品类型:" + emisTransPlanRule.getProductTypeName());
|
||||
}
|
||||
|
||||
@ -49,6 +49,7 @@ package com.xdadan.erp.emis.service.impl;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
@ -60,6 +61,7 @@ package com.xdadan.erp.emis.service.impl;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.DecimalFormat;
|
||||
import java.time.LocalDate;
|
||||
@ -5026,6 +5028,87 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
||||
// }
|
||||
}
|
||||
|
||||
private void cvtWaybillByUpdateExternal(EmisWaybill emisWaybillSave) throws EmisBizError {
|
||||
|
||||
// 线路转换
|
||||
EmisTransLine transLine = getTransLineByName(emisWaybillSave.getTransLineType());
|
||||
if (transLine == null) {
|
||||
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "线路不正确");
|
||||
}
|
||||
emisWaybillSave.setTransLineType(transLine.getLineCode());
|
||||
|
||||
// 产品转换
|
||||
EmisTransProduct transProduct = getTransProductByName(transLine.getLineCode(),
|
||||
emisWaybillSave.getProductType());
|
||||
if (transProduct == null) {
|
||||
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "产品不正确");
|
||||
}
|
||||
emisWaybillSave.setProductType(transProduct.getProdCode());
|
||||
|
||||
// 收件国家省市区转换
|
||||
String receiveCountryCode = getCountryCodeByName(emisWaybillSave.getReceiveCountry());
|
||||
if (receiveCountryCode == null) {
|
||||
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "收件国家不正确");
|
||||
}
|
||||
|
||||
String rcvProviceCode = getChildRegionCodeByName(receiveCountryCode, null,
|
||||
emisWaybillSave.getReceiveProvince());
|
||||
if (rcvProviceCode == null) {
|
||||
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "收件省不正确");
|
||||
}
|
||||
|
||||
String rcvCityCode = null;
|
||||
if (!StringUtils.isEmpty(emisWaybillSave.getReceiveCity())) {
|
||||
rcvCityCode = getChildRegionCodeByName(receiveCountryCode, rcvProviceCode,
|
||||
emisWaybillSave.getReceiveCity());
|
||||
}
|
||||
|
||||
String rcvDistrictCode = null;
|
||||
if (!StringUtils.isEmpty(emisWaybillSave.getReceiveCounty())) {
|
||||
rcvDistrictCode = getChildRegionCodeByName(receiveCountryCode, rcvCityCode,
|
||||
emisWaybillSave.getReceiveCounty());
|
||||
}
|
||||
|
||||
emisWaybillSave.setReceiveCountry(receiveCountryCode);
|
||||
emisWaybillSave.setReceiveProvince(rcvProviceCode);
|
||||
emisWaybillSave.setReceiveCity(rcvCityCode);
|
||||
emisWaybillSave.setReceiveCounty(rcvDistrictCode);
|
||||
|
||||
// 寄件国家省市区
|
||||
String sendCountryCode = getCountryCodeByName(emisWaybillSave.getSendCountry());
|
||||
if (sendCountryCode == null) {
|
||||
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "寄件国家不正确");
|
||||
}
|
||||
String sendProviceCode = getChildRegionCodeByName(sendCountryCode, null, emisWaybillSave.getSendProvince());
|
||||
if (sendProviceCode == null) {
|
||||
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "寄件省不正确");
|
||||
}
|
||||
|
||||
String sendCityCode = null;
|
||||
if (!StringUtils.isEmpty(emisWaybillSave.getSendCity())) {
|
||||
sendCityCode = getChildRegionCodeByName(sendCountryCode, sendProviceCode, emisWaybillSave.getSendCity());
|
||||
}
|
||||
String sendDistrictCode = null;
|
||||
if (!StringUtils.isEmpty(emisWaybillSave.getSendCounty())) {
|
||||
sendDistrictCode = getChildRegionCodeByName(sendCountryCode, sendCityCode, emisWaybillSave.getSendCounty());
|
||||
}
|
||||
|
||||
emisWaybillSave.setSendCountry(sendCountryCode);
|
||||
emisWaybillSave.setSendProvince(sendProviceCode);
|
||||
emisWaybillSave.setSendCity(sendCityCode);
|
||||
emisWaybillSave.setSendCounty(sendDistrictCode);
|
||||
|
||||
// // 获取月结客户的编码和名称
|
||||
// EmisCustomerUser emisCustomerUser = getCustomerUserByMonthlyPayCode(emisWaybillSave.getCustNo());
|
||||
// if (emisCustomerUser == null) {
|
||||
// throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "月结客户不存在");
|
||||
// }
|
||||
// emisWaybillSave.setCustomerCode(emisCustomerUser.getCustomerCode());
|
||||
// emisWaybillSave.setPayee(emisCustomerUser.getPayee());
|
||||
// emisWaybillSave.setSalesmen(emisCustomerUser.getSalesmen());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 新开单-外部
|
||||
*
|
||||
@ -5498,6 +5581,238 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryWaybillInfo(String logisticNo, String appId) throws EmisBizError {
|
||||
// 1. 构建查询条件
|
||||
EmisWaybill queryWaybill = new EmisWaybill();
|
||||
|
||||
EmisCustomerSign emisCustomerSign = emisCustomerSignMapper.selectEmisCustomerSignByAppId(appId);
|
||||
queryWaybill.setCustNo(emisCustomerSign.getCustNo());
|
||||
queryWaybill.setBillCode(logisticNo);
|
||||
|
||||
// 2. 执行查询
|
||||
List<EmisWaybill> waybillList = emisWaybillMapper.selectEmisWaybillListByExternal(queryWaybill);
|
||||
|
||||
// 3. 转换结果
|
||||
List<Map<String, Object>> resultList = new ArrayList<>();
|
||||
for (EmisWaybill waybill : waybillList) {
|
||||
Map<String, Object> resultItem = new HashMap<>();
|
||||
|
||||
// 订单基本信息
|
||||
resultItem.put("orderNo", waybill.getCustOrderId());
|
||||
resultItem.put("logisticNo", waybill.getBillCode());
|
||||
resultItem.put("orderDate",
|
||||
DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, waybill.getOrderDate()));
|
||||
resultItem.put("intoWarehouseBillCode", waybill.getIntoWarehouseBillCode());
|
||||
|
||||
// 获取仓库信息
|
||||
if (StringUtils.isNotEmpty(waybill.getIntoWarehouseCode())) {
|
||||
EmisSite warehouse = getSiteByCode(waybill.getIntoWarehouseCode());
|
||||
if (warehouse != null) {
|
||||
resultItem.put("intoWarehouseName", warehouse.getSiteName());
|
||||
resultItem.put("intoWarehouseContact", warehouse.getManager());
|
||||
resultItem.put("intoWarehousePhone", warehouse.getManagerPhone());
|
||||
resultItem.put("intoWarehouseAddress", warehouse.getAddress());
|
||||
}
|
||||
}
|
||||
|
||||
resultItem.put("blSign", waybill.getBlSign());
|
||||
resultItem.put("orderStatus", waybill.getOrderStatus());
|
||||
|
||||
// 运输信息
|
||||
resultItem.put("transLine", waybill.getTransLineTypeName());
|
||||
resultItem.put("productType", waybill.getProductTypeName());
|
||||
// resultItem.put("customsClear", DictUtils.getDictLabel("emis_customs_clear",
|
||||
// waybill.getCustomsClear()));
|
||||
// resultItem.put("customsEclaration",
|
||||
// DictUtils.getDictLabel("emis_declare_mode", waybill.getCustomsEclaration()));
|
||||
// resultItem.put("pickupMethod", DictUtils.getDictLabel("emis_qujian_fangshi",
|
||||
// waybill.getPickupMethod()));
|
||||
// resultItem.put("dispatchMethod",
|
||||
// DictUtils.getDictLabel("emis_tab_dispatch_mode",
|
||||
// waybill.getDispatchMethod()));
|
||||
// resultItem.put("packType", DictUtils.getDictLabel("emis_tab_packing_type",
|
||||
// waybill.getPackType()));
|
||||
// resultItem.put("paymentType", DictUtils.getDictLabel("emis_payment_type",
|
||||
// waybill.getPaymentType()));
|
||||
resultItem.put("customsClear", waybill.getCustomsClear());
|
||||
resultItem.put("customsEclaration", waybill.getCustomsEclaration());
|
||||
resultItem.put("pickupMethod", waybill.getPickupMethod());
|
||||
resultItem.put("dispatchMethod", waybill.getDispatchMethod());
|
||||
resultItem.put("packType", waybill.getPackType());
|
||||
resultItem.put("paymentType", waybill.getPaymentType());
|
||||
resultItem.put("custNo", waybill.getCustNo());
|
||||
resultItem.put("salemen", waybill.getSalesmen());
|
||||
|
||||
// 收件人信息
|
||||
resultItem.put("country", waybill.getReceiveCountryName());
|
||||
resultItem.put("province", waybill.getReceiveProvinceName());
|
||||
resultItem.put("city", waybill.getReceiveCityName());
|
||||
resultItem.put("district", waybill.getReceiveCountyName());
|
||||
resultItem.put("consignee", waybill.getReceiveName());
|
||||
resultItem.put("company", waybill.getReceiveCompany());
|
||||
resultItem.put("tel", waybill.getReceiveMobile());
|
||||
resultItem.put("address", waybill.getReceiveAddress());
|
||||
resultItem.put("postCode", waybill.getReceivePostcode());
|
||||
|
||||
// 寄件人信息
|
||||
resultItem.put("sender", waybill.getSendName());
|
||||
resultItem.put("senderCountry", waybill.getSendCountryName());
|
||||
resultItem.put("senderProvince", waybill.getSendProvinceName());
|
||||
resultItem.put("senderCity", waybill.getSendCityName());
|
||||
resultItem.put("senderDistrict", waybill.getSendCountyName());
|
||||
resultItem.put("senderCompany", waybill.getSendCompany());
|
||||
resultItem.put("senderTel", waybill.getSendMobile());
|
||||
resultItem.put("senderAddress", waybill.getSendAddress());
|
||||
|
||||
// 包裹信息
|
||||
resultItem.put("parcelQty", waybill.getParcelQty());
|
||||
if (waybill.getBillWeight() != null) {
|
||||
resultItem.put("weight", waybill.getBillWeight().setScale(2, RoundingMode.HALF_UP));
|
||||
|
||||
}
|
||||
if (waybill.getSettlementWeight() != null) {
|
||||
resultItem.put("settlementWeight", waybill.getSettlementWeight().setScale(2, RoundingMode.HALF_UP));
|
||||
}
|
||||
if (waybill.getTotalVolume() != null) {
|
||||
resultItem.put("volume", waybill.getTotalVolume().setScale(2, RoundingMode.HALF_UP));
|
||||
}
|
||||
resultItem.put("goodsInfo", waybill.getGoodsInfo());
|
||||
|
||||
// 其他信息
|
||||
resultItem.put("estimateFreight", waybill.getFreight().setScale(2, RoundingMode.HALF_UP));
|
||||
if (waybill.getSignDate() != null) {
|
||||
resultItem.put("signDate",
|
||||
DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, waybill.getSignDate()));
|
||||
}
|
||||
resultItem.put("signMan", waybill.getSignMan());
|
||||
resultItem.put("remark", waybill.getRemark());
|
||||
|
||||
resultList.add(resultItem);
|
||||
}
|
||||
|
||||
// 4. 返回结果
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("result", resultList);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EmisWaybill selectCustEmisWaybillByBillCode(String logisticNo, String appId) {
|
||||
if (StringUtils.isAnyBlank(logisticNo, appId)) {
|
||||
return null;
|
||||
}
|
||||
EmisCustomerSign emisCustomerSign = emisCustomerSignMapper.selectEmisCustomerSignByAppId(appId);
|
||||
if (emisCustomerSign == null) {
|
||||
return null;
|
||||
}
|
||||
EmisWaybill queryWaybill = new EmisWaybill();
|
||||
queryWaybill.setCustNo(emisCustomerSign.getCustNo());
|
||||
queryWaybill.setBillCode(logisticNo);
|
||||
return emisWaybillMapper.selectCustEmisWaybillByBillCode(queryWaybill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateWaybillInfo(JSONObject orderData, String appId) throws EmisBizError {
|
||||
// 1. 获取订单号
|
||||
String logisticNo = orderData.getString("logisticNo");
|
||||
if (StringUtils.isEmpty(logisticNo)) {
|
||||
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "运单号不能为空");
|
||||
}
|
||||
|
||||
// 2. 查询原运单信息
|
||||
EmisWaybill oldWaybill = selectCustEmisWaybillByBillCode(logisticNo,appId);
|
||||
if (oldWaybill == null) {
|
||||
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "运单不存在");
|
||||
}
|
||||
|
||||
// 3. 检查运单状态
|
||||
if (OrderStatus.CANCEL.statusCode.equals(oldWaybill.getOrderStatus())) {
|
||||
throw new EmisBizError(EmisBizErrorType.FAIL, "已取消,不能修改");
|
||||
}
|
||||
if (!"0".equals(oldWaybill.getOrderStatus())) {
|
||||
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR1, "已揽件,不能修改!");
|
||||
}
|
||||
|
||||
// 4. 构建更新对象
|
||||
EmisWaybill waybillUpdate = new EmisWaybill();
|
||||
BeanUtils.copyProperties(oldWaybill, waybillUpdate);
|
||||
|
||||
// 5. 更新基本信息
|
||||
waybillUpdate.setTransLineType(orderData.getString("transLine"));
|
||||
waybillUpdate.setProductType(orderData.getString("productType"));
|
||||
waybillUpdate.setCustomsClear(orderData.getString("customsClear"));
|
||||
waybillUpdate.setCustomsEclaration(orderData.getString("customsEclaration"));
|
||||
waybillUpdate.setPickupMethod(orderData.getString("pickupMethod"));
|
||||
waybillUpdate.setDispatchMethod(orderData.getString("dispatchMethod"));
|
||||
waybillUpdate.setPackType(orderData.getString("packType"));
|
||||
waybillUpdate.setPaymentType(orderData.getString("paymentType"));
|
||||
// waybillUpdate.setCustNo(orderData.getString("custNo"));
|
||||
// waybillUpdate.setSalesmen(orderData.getString("salemen"));
|
||||
|
||||
// 6. 更新收件人信息
|
||||
waybillUpdate.setReceiveCountry(orderData.getString("country"));
|
||||
waybillUpdate.setReceiveProvince(orderData.getString("province"));
|
||||
waybillUpdate.setReceiveCity(orderData.getString("city"));
|
||||
waybillUpdate.setReceiveCounty(orderData.getString("district"));
|
||||
waybillUpdate.setReceiveName(orderData.getString("consignee"));
|
||||
waybillUpdate.setReceiveCompany(orderData.getString("company"));
|
||||
waybillUpdate.setReceiveTel(orderData.getString("tel"));
|
||||
waybillUpdate.setReceiveAddress(orderData.getString("address"));
|
||||
waybillUpdate.setReceivePostcode(orderData.getString("postCode"));
|
||||
|
||||
// 7. 更新寄件人信息
|
||||
waybillUpdate.setSendName(orderData.getString("sender"));
|
||||
waybillUpdate.setSendCountry(orderData.getString("senderCountry"));
|
||||
waybillUpdate.setSendProvince(orderData.getString("senderProvince"));
|
||||
waybillUpdate.setSendCity(orderData.getString("senderCity"));
|
||||
waybillUpdate.setSendCounty(orderData.getString("senderDistrict"));
|
||||
waybillUpdate.setSendCompany(orderData.getString("senderCompany"));
|
||||
waybillUpdate.setSendTel(orderData.getString("senderTel"));
|
||||
waybillUpdate.setSendAddress(orderData.getString("senderAddress"));
|
||||
|
||||
// 8. 更新包裹信息
|
||||
waybillUpdate.setParcelQty(orderData.getInteger("parcelQty"));
|
||||
waybillUpdate.setBillWeight(orderData.getBigDecimal("weight"));
|
||||
waybillUpdate.setTotalVolume(orderData.getBigDecimal("volume"));
|
||||
waybillUpdate.setGoodsInfo(orderData.getString("goodsInfo"));
|
||||
waybillUpdate.setOrderRemark(orderData.getString("remark"));
|
||||
|
||||
// 9. 更新货物信息
|
||||
String goods = orderData.getString("goods");
|
||||
// 处理goods信息
|
||||
List<EmisWaybillDeclareGoods> declareGoodsList = new ArrayList<>();
|
||||
if (StringUtils.isNotEmpty(goods)) {
|
||||
JSONArray goodsArray = JSON.parseArray(goods);
|
||||
if (CollectionUtil.isNotEmpty(goodsArray)) {
|
||||
for (int j = 0; j < goodsArray.size(); j++) {
|
||||
JSONObject goodsItem = goodsArray.getJSONObject(j);
|
||||
EmisWaybillDeclareGoods declareGoods = new EmisWaybillDeclareGoods();
|
||||
declareGoods.setHscode(goodsItem.getString("itemNo"));
|
||||
declareGoods.setGoodsName(goodsItem.getString("name"));
|
||||
declareGoods.setBrand(goodsItem.getString("brand"));
|
||||
declareGoods.setGoodsModel(goodsItem.getString("model"));
|
||||
declareGoods.setBarcode(goodsItem.getString("barcode"));
|
||||
declareGoods.setHscode(goodsItem.getString("hscode"));
|
||||
declareGoods.setCargoQty(BigDecimal.valueOf(goodsItem.getInteger("qty")));
|
||||
declareGoods.setPrice(goodsItem.getBigDecimal("price"));
|
||||
declareGoods.setUnit(goodsItem.getString("unit"));
|
||||
declareGoods.setMaterial(goodsItem.getString("texture"));
|
||||
declareGoods.setPurpose(goodsItem.getString("purpose"));
|
||||
declareGoods.setNationArea(goodsItem.getString("nativeCountry"));
|
||||
declareGoodsList.add(declareGoods);
|
||||
}
|
||||
}
|
||||
}
|
||||
waybillUpdate.setDeclareGoodsList(declareGoodsList);
|
||||
|
||||
cvtWaybillByUpdateExternal(waybillUpdate);
|
||||
|
||||
waybillUpdate.setId(oldWaybill.getId());
|
||||
waybillUpdate.setCustomerCode(oldWaybill.getCustomerCode());
|
||||
reUpdateWayBillByOms(oldWaybill, waybillUpdate);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -49,24 +49,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select
|
||||
m.id, m.bill_code, m.miss_reason, m.create_by, m.create_time, m.update_by, m.update_time, m.remark, m.del_flag,
|
||||
m.line_code, m.product_type, m.start_site_code, m.next_site_code, m.supplier_code, m.start_date, m.end_date,
|
||||
w.send_site_code, s.site_name as send_site_name, w.send_country, c1.name as send_country_name, w.destination_code, n.dest_name as destination_name,w.bl_is_question,
|
||||
w.send_site_code, s1.site_name as send_site_name,s2.site_name as start_site_name,s3.site_name as next_site_name, w.send_country, c1.name as send_country_name, w.destination_code, n.dest_name as destination_name,w.bl_is_question,
|
||||
l.line_name as line_name,
|
||||
w.receive_country, c2.name as receive_country_name, w.send_date, w.bl_sign, w.sign_date,
|
||||
w.product_type, j.prod_name as product_type_name, w.payment_type, w.parcel_qty, w.bill_weight, w.total_volume, w.volume_weight,
|
||||
w.settlement_weight, w.freight, w.remark as waybill_remark, w.fee_remark, m.manager, k.trans_manager
|
||||
w.product_type,
|
||||
w.payment_type, w.parcel_qty, w.bill_weight, w.total_volume, w.volume_weight,
|
||||
w.settlement_weight, w.freight, w.remark as waybill_remark, w.fee_remark, m.manager, k.trans_manager,
|
||||
(SELECT GROUP_CONCAT(s.name)
|
||||
FROM emis_supplier s
|
||||
WHERE FIND_IN_SET(s.code, m.supplier_code)
|
||||
AND s.del_flag = '0') as supplier_name,
|
||||
(SELECT GROUP_CONCAT(p.prod_name)
|
||||
FROM emis_trans_product p
|
||||
WHERE FIND_IN_SET(p.prod_code, m.product_type)
|
||||
AND p.del_flag = '0') as product_type_name
|
||||
from emis_tms_site_batch_miss m
|
||||
left join emis_waybill w on m.bill_code = w.bill_code and w.del_flag='0'
|
||||
left join emis_site s on w.send_site_code=s.site_code and s.del_flag=0
|
||||
left join emis_site s1 on w.send_site_code=s1.site_code and s1.del_flag=0
|
||||
left join emis_site s2 on m.start_site_code=s2.site_code and s2.del_flag=0
|
||||
left join emis_site s3 on m.next_site_code=s3.site_code and s3.del_flag=0
|
||||
left join emis_country c1 on w.send_country=c1.code and c1.del_flag='0'
|
||||
left join emis_country c2 on w.receive_country=c2.code and c2.del_flag='0'
|
||||
left join emis_destination n on w.destination_code=n.dest_code and n.del_flag='0'
|
||||
left join emis_trans_line k on w.trans_line_type=k.line_code and k.del_flag='0'
|
||||
left join emis_trans_product j on w.product_type=j.prod_code and j.del_flag='0'
|
||||
left join emis_trans_plan_rule r on m.trans_plan_rule_id=r.id and r.del_flag='0'
|
||||
left join emis_trans_line l on m.line_code=l.line_code and l.del_flag='0'
|
||||
left join emis_trans_product p on m.product_type=p.prod_code and p.del_flag='0'
|
||||
left join emis_site s1 on m.start_site_code=s1.site_code and s1.del_flag='0'
|
||||
left join emis_site s2 on m.next_site_code=s2.site_code and s2.del_flag='0'
|
||||
left join emis_supplier sup on m.supplier_code=sup.code and sup.del_flag='0'
|
||||
</sql>
|
||||
|
||||
<!-- <select id="selectEmisTmsSiteBatchMissList" parameterType="EmisTmsSiteBatchMiss" resultMap="EmisTmsSiteBatchMissResult">-->
|
||||
@ -163,7 +170,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND m.line_code = #{lineCode}
|
||||
</if>
|
||||
<if test="productType != null and productType != ''">
|
||||
AND m.product_type = #{productType}
|
||||
AND FIND_IN_SET(#{productType}, m.product_type)
|
||||
</if>
|
||||
<if test="startSiteCode != null and startSiteCode != ''">
|
||||
AND m.start_site_code = #{startSiteCode}
|
||||
@ -172,7 +179,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND m.next_site_code = #{nextSiteCode}
|
||||
</if>
|
||||
<if test="supplierCode != null and supplierCode != ''">
|
||||
AND m.supplier_code = #{supplierCode}
|
||||
AND FIND_IN_SET(#{supplierCode}, m.supplier_code)
|
||||
</if>
|
||||
<if test="startDate != null">
|
||||
AND m.start_date = #{startDate}
|
||||
@ -183,6 +190,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="blIsQuestion != null and blIsQuestion != ''">
|
||||
AND w.bl_is_question = #{blIsQuestion}
|
||||
</if>
|
||||
<if test="params.beginSendDate != null and params.beginSendDate != ''">
|
||||
and w.send_date <![CDATA[ >= ]]> #{params.beginSendDate}
|
||||
</if>
|
||||
<if test="params.endSendDate != null and params.endSendDate != ''">
|
||||
and w.send_date <![CDATA[ <= ]]> #{params.endSendDate}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -238,6 +251,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<update id="deleteAll">
|
||||
update emis_tms_site_batch_miss set del_flag = '1'
|
||||
<if test="lineCode != null and lineCode != ''">
|
||||
where line_code = #{lineCode}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<insert id="batchInsertEmisTmsSiteBatchMiss" parameterType="java.util.List">
|
||||
|
||||
@ -74,13 +74,13 @@
|
||||
</select>
|
||||
|
||||
<select id="selectEmisTransLineById" parameterType="Long" resultMap="EmisTransLineResult">
|
||||
select id, line_code, line_name, line_name_en,trans_manager meter_rate, status, site_audit_man, site_audit_man_code, market_man, market_man_code, operate_man, operate_man_code, from_country, country, apply_scope, logo_type, trans_type, order_num, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
|
||||
select id, line_code, line_name, line_name_en,trans_manager, meter_rate, status, site_audit_man, site_audit_man_code, market_man, market_man_code, operate_man, operate_man_code, from_country, country, apply_scope, logo_type, trans_type, order_num, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
|
||||
from emis_trans_line a
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectTransLineByName" parameterType="String" resultMap="EmisTransLineResult">
|
||||
select id, line_code, line_name, line_name_en,trans_manager meter_rate, status, site_audit_man, site_audit_man_code, market_man, market_man_code, operate_man, operate_man_code, from_country, country, apply_scope, logo_type, trans_type, order_num, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
|
||||
select id, line_code, line_name, line_name_en,trans_manager, meter_rate, status, site_audit_man, site_audit_man_code, market_man, market_man_code, operate_man, operate_man_code, from_country, country, apply_scope, logo_type, trans_type, order_num, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
|
||||
from emis_trans_line a
|
||||
where a.del_flag = '0' and a.line_name = #{lineName}
|
||||
</select>
|
||||
|
||||
@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="nextSiteCode" column="next_site_code" />
|
||||
<result property="nextSiteName" column="next_site_name" />
|
||||
<result property="manager" column="manager" />
|
||||
<result property="transManager" column="trans_manager" />
|
||||
<result property="supplierCode" column="supplier_code" />
|
||||
<result property="startDate" column="start_date" />
|
||||
<result property="endDate" column="end_date" />
|
||||
@ -26,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
s1.site_name as start_site_name, r.next_site_code, s2.site_name as next_site_name,
|
||||
r.manager, r.supplier_code, r.start_date, r.end_date, r.remark,
|
||||
r.del_flag, r.create_by, r.create_time, r.update_by, r.update_time, r.create_site, r.update_site,
|
||||
l.line_name,
|
||||
l.line_name,l.trans_manager,
|
||||
(SELECT GROUP_CONCAT(s.name)
|
||||
FROM emis_supplier s
|
||||
WHERE FIND_IN_SET(s.code, r.supplier_code)
|
||||
@ -199,13 +200,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectProductTypeInfoByNames" parameterType="java.util.List" resultType="java.util.Map">
|
||||
<select id="selectProductTypeInfoByNamesAndLineCode" parameterType="java.util.List" resultType="java.util.Map">
|
||||
SELECT prod_code as code, prod_name as name
|
||||
FROM emis_trans_product
|
||||
WHERE prod_name IN
|
||||
<foreach collection="list" item="name" open="(" separator="," close=")">
|
||||
<foreach collection="productTypeNames" item="name" open="(" separator="," close=")">
|
||||
#{name}
|
||||
</foreach>
|
||||
and trans_line_code =#{lineCode}
|
||||
AND del_flag = '0'
|
||||
</select>
|
||||
|
||||
|
||||
@ -1482,6 +1482,362 @@
|
||||
createDay
|
||||
</select>
|
||||
|
||||
<select id="selectEmisWaybillListByExternal" parameterType="EmisWaybill" resultMap="EmisWaybillResult">
|
||||
<include refid="selectEmisWaybillVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="id != null "> and a.id = #{id}</if>
|
||||
|
||||
<if test="orderSn != null and orderSn != ''"> and ( FIND_IN_SET(`order_sn`,#{orderSn}) or order_sn like concat('%', #{orderSn}, '%') ) </if>
|
||||
|
||||
<if test="billCode != null and billCode != '' and ( params.billCodeSortList == null or (params.billCodeSortList != null and params.billCodeSortList.size() == 1 ) )">
|
||||
and ( a.`bill_code`=#{billCode} or a.bill_code like concat('%',#{billCode}) )
|
||||
</if>
|
||||
<if test="params.billCodeSortList != null and params.billCodeSortList.size() > 1 ">
|
||||
and a.bill_code in
|
||||
<foreach collection="params.billCodeSortList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="custOrderId != null and custOrderId != ''"> and cust_order_id=#{custOrderId}</if>
|
||||
<if test="billCodeSub != null and billCodeSub != ''"> and bill_code_sub like concat('%', #{billCodeSub}, '%')</if>
|
||||
<if test="orderStatus != null and orderStatus != ''"> and order_status=#{orderStatus}</if>
|
||||
<if test="waybillStatus != null and waybillStatus != ''"> and waybill_status=#{waybillStatus}</if>
|
||||
<if test="orderType != null and orderType != ''"> and order_type=#{orderType}</if>
|
||||
<if test="orderDate != null "> and order_date = #{orderDate}</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="customerCode != null and customerCode != ''"> and customer_code=#{customerCode}</if>
|
||||
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
|
||||
<if test="openId != null and openId != ''"> and open_id like concat('%', #{openId}, '%')</if>
|
||||
<if test="receiveName != null and receiveName != ''"> and receive_name like concat('%', #{receiveName}, '%')</if>
|
||||
<if test="receiveCompany != null and receiveCompany != ''"> and receive_company like concat('%', #{receiveCompany}, '%')</if>
|
||||
<if test="receiveMobile != null and receiveMobile != ''"> and receive_mobile like concat('%', #{receiveMobile}, '%')</if>
|
||||
<if test="receiveTel != null and receiveTel != ''"> and receive_tel like concat('%', #{receiveTel}, '%')</if>
|
||||
<if test="receiveCountry != null and receiveCountry != ''"> and receive_country=#{receiveCountry}</if>
|
||||
<if test="receiveProvince != null and receiveProvince != ''"> and receive_province=#{receiveProvince}</if>
|
||||
<if test="receiveCity != null and receiveCity != ''"> and receive_city=#{receiveCity}</if>
|
||||
<if test="receiveCounty != null and receiveCounty != ''"> and receive_county=#{receiveCounty}</if>
|
||||
<if test="receiveTown != null and receiveTown != ''"> and receive_town=#{receiveTown}</if>
|
||||
<if test="receiveAddress != null and receiveAddress != ''"> and receive_address like concat('%', #{receiveAddress}, '%')</if>
|
||||
<if test="receivePostcode != null and receivePostcode != ''"> and receive_postcode like concat('%', #{receivePostcode}, '%')</if>
|
||||
<if test="receivePcd != null and receivePcd != ''"> and receive_pcd like concat('%', #{receivePcd}, '%')</if>
|
||||
<if test="sendName != null and sendName != ''"> and send_name like concat('%', #{sendName}, '%')</if>
|
||||
<if test="sendCompany != null and sendCompany != ''"> and send_company like concat('%', #{sendCompany}, '%')</if>
|
||||
<if test="sendMobile != null and sendMobile != ''"> and send_mobile like concat('%', #{sendMobile}, '%')</if>
|
||||
<if test="sendTel != null and sendTel != ''"> and send_tel like concat('%', #{sendTel}, '%')</if>
|
||||
<if test="sendCountry != null and sendCountry != ''"> and send_country=#{sendCountry}</if>
|
||||
<if test="sendProvince != null and sendProvince != ''"> and send_province=#{sendProvince}</if>
|
||||
<if test="sendCity != null and sendCity != ''"> and send_city=#{sendCity}</if>
|
||||
<if test="sendCounty != null and sendCounty != ''"> and send_county=#{sendCounty}</if>
|
||||
<if test="sendTown != null and sendTown != ''"> and send_town=#{sendTown}</if>
|
||||
<if test="sendAddress != null and sendAddress != ''"> and send_address like concat('%', #{sendAddress}, '%')</if>
|
||||
<if test="sendPostcode != null and sendPostcode != ''"> and send_postcode like concat('%', #{sendPostcode}, '%')</if>
|
||||
<if test="paymentType != null and paymentType != ''"> and FIND_IN_SET(payment_type,#{paymentType})</if>
|
||||
<if test="calcFeeType != null and calcFeeType != ''"> and calc_fee_type=#{calcFeeType}</if>
|
||||
<if test="custNo != null and custNo != ''"> and cust_no like concat('%', #{custNo}, '%')</if>
|
||||
<if test="custName != null and custName != ''"> and cust_name like concat('%', #{custName}, '%')</if>
|
||||
<if test="transLineType != null and transLineType != ''"> and trans_line_type=#{transLineType}</if>
|
||||
<if test="productType != null and productType != ''"> and product_type=#{productType}</if>
|
||||
<if test="timeType != null and timeType != ''"> and time_type like concat('%', #{timeType}, '%')</if>
|
||||
<if test="meterType != null and meterType != ''"> and meter_type=#{meterType}</if>
|
||||
<if test="carryType != null and carryType != ''">and FIND_IN_SET(a.carry_type,#{carryType})</if>
|
||||
<if test="customsClear != null and customsClear != ''"> and customs_clear=#{customsClear}</if>
|
||||
<if test="customsEclaration != null and customsEclaration != ''"> and customs_eclaration=#{customsEclaration}</if>
|
||||
<if test="estimateDate != null "> and estimate_date = #{estimateDate}</if>
|
||||
<if test="packType != null and packType != ''"> and FIND_IN_SET(#{packType},pack_type)</if>
|
||||
<if test="dispatchMethod != null and dispatchMethod != ''"> and dispatch_method=#{dispatchMethod}</if>
|
||||
<if test="pickupMethod != null and pickupMethod != ''"> and pickup_method= #{pickupMethod}</if>
|
||||
<if test="pickStartDate != null "> and pick_start_date = #{pickStartDate}</if>
|
||||
<if test="pickFinishDate != null "> and pick_finish_date = #{pickFinishDate}</if>
|
||||
<if test="pickFailReason != null and pickFailReason != ''"> and pick_fail_reason like concat('%', #{pickFailReason}, '%')</if>
|
||||
<if test="intoWarehouseCode != null and intoWarehouseCode != ''"> and into_warehouse_code like concat('%', #{intoWarehouseCode}, '%')</if>
|
||||
<if test="intoWarehouseName != null and intoWarehouseName != ''"> and into_warehouse_name like concat('%', #{intoWarehouseName}, '%')</if>
|
||||
<if test="intoWarehouseAddress != null and intoWarehouseAddress != ''"> and into_warehouse_address like concat('%', #{intoWarehouseAddress}, '%')</if>
|
||||
<if test="intoWarehouseContact != null and intoWarehouseContact != ''"> and into_warehouse_contact like concat('%', #{intoWarehouseContact}, '%')</if>
|
||||
<if test="intoWarehousePhone != null and intoWarehousePhone != ''"> and into_warehouse_phone like concat('%', #{intoWarehousePhone}, '%')</if>
|
||||
<if test="intoWarehouseBillCode != null and intoWarehouseBillCode != ''"> and into_warehouse_bill_code like concat('%', #{intoWarehouseBillCode}, '%')</if>
|
||||
<if test="warehouseInNo != null and warehouseInNo != ''"> and warehouse_in_no like concat('%', #{warehouseInNo}, '%')</if>
|
||||
<if test="customerDeliveryBeginTime != null and customerDeliveryBeginTime != ''"> and customer_delivery_begin_time like concat('%', #{customerDeliveryBeginTime}, '%')</if>
|
||||
<if test="customerDeliveryEndTime != null and customerDeliveryEndTime != ''"> and customer_delivery_end_time like concat('%', #{customerDeliveryEndTime}, '%')</if>
|
||||
<if test="goodsInfo != null and goodsInfo != ''"> and goods_info like concat('%', #{goodsInfo}, '%')</if>
|
||||
<if test="blPrepareInFreight != null and blPrepareInFreight != ''"> and bl_prepare_in_freight=#{blPrepareInFreight}</if>
|
||||
<if test="prepareInEstFee != null "> and prepare_in_est_fee = #{prepareInEstFee}</if>
|
||||
<if test="prepareInRealFee != null "> and prepare_in_real_fee = #{prepareInRealFee}</if>
|
||||
<if test="prepareInExpress != null and prepareInExpress != ''"> and prepare_in_express like concat('%', #{prepareInExpress}, '%')</if>
|
||||
<if test="prepareInBillCode != null and prepareInBillCode != ''"> and prepare_in_bill_code like concat('%', #{prepareInBillCode}, '%')</if>
|
||||
<if test="prepareInRemark != null and prepareInRemark != ''"> and prepare_in_remark like concat('%', #{prepareInRemark}, '%')</if>
|
||||
<if test="prepareInSupplier != null and prepareInSupplier != ''"> and prepare_in_supplier like concat('%', #{prepareInSupplier}, '%')</if>
|
||||
<if test="totalWeight != null "> and total_weight = #{totalWeight}</if>
|
||||
<if test="totalVolume != null "> and total_volume = #{totalVolume}</if>
|
||||
<if test="parcelQty != null "> and parcel_qty = #{parcelQty}</if>
|
||||
<if test="billWeight != null "> and bill_weight = #{billWeight}</if>
|
||||
<if test="volumeWeight != null "> and volume_weight = #{volumeWeight}</if>
|
||||
<if test="currency != null and currency != ''"> and currency= #{currency}</if>
|
||||
<if test="settlementWeight != null "> and settlement_weight = #{settlementWeight}</if>
|
||||
<if test="scanWeight != null "> and scan_weight = #{scanWeight}</if>
|
||||
<if test="feeWeight != null "> and fee_weight = #{feeWeight}</if>
|
||||
<if test="freight != null "> and freight = #{freight}</if>
|
||||
<if test="realPaymentType != null and realPaymentType != ''"> and real_payment_type=#{realPaymentType}</if>
|
||||
<if test="realFee != null "> and real_fee = #{realFee}</if>
|
||||
<if test="blSpecialQuote != null and blSpecialQuote != ''"> and bl_special_quote=#{blSpecialQuote}</if>
|
||||
<if test="blOverLong != null and blOverLong != ''"> and bl_over_long=#{blOverLong}</if>
|
||||
<if test="blBill != null and blBill != ''"> and bl_bill=#{blBill}</if>
|
||||
<if test="blBillText != null and blBillText != ''"> and bl_bill_text like concat('%', #{blBillText}, '%')</if>
|
||||
<if test="blOverWeight != null and blOverWeight != ''"> and bl_over_weight like concat('%', #{blOverWeight}, '%')</if>
|
||||
<if test="overWeightNumber != null and overWeightNumber != ''"> and over_weight_number like concat('%', #{overWeightNumber}, '%')</if>
|
||||
<if test="feeRemark != null and feeRemark != ''"> and fee_remark like concat('%', #{feeRemark}, '%')</if>
|
||||
<if test="thirdCode != null and thirdCode != ''"> and third_code like concat('%', #{thirdCode}, '%')</if>
|
||||
<if test="realValue != null and realValue != ''"> and real_value like concat('%', #{realValue}, '%')</if>
|
||||
<if test="blInsure != null and blInsure != ''"> and bl_insure= #{blInsure}</if>
|
||||
<if test="insureValue != null and insureValue != ''"> and insure_value like concat('%', #{insureValue}, '%')</if>
|
||||
<if test="insureValueCurrency != null and insureValueCurrency != ''"> and insure_value_currency like concat('%', #{insureValueCurrency}, '%')</if>
|
||||
<if test="insureFeeCurrency != null and insureFeeCurrency != ''"> and insure_fee_currency like concat('%', #{insureFeeCurrency}, '%')</if>
|
||||
<if test="insureFee != null "> and insure_fee = #{insureFee}</if>
|
||||
<if test="insureRemark != null and insureRemark != ''"> and insure_remark like concat('%', #{insureRemark}, '%')</if>
|
||||
<if test="insureSiteCode != null and insureSiteCode != ''"> and insure_site_code=#{insureSiteCode}</if>
|
||||
<if test="blPrint != null and blPrint != ''"> and bl_print=#{blPrint}</if>
|
||||
<if test="printManCode != null and printManCode != ''"> and print_man_code like concat('%', #{printManCode}, '%')</if>
|
||||
<if test="printSite != null and printSite != ''"> and print_site=#{printSite},</if>
|
||||
<if test="printDate != null and printDate != ''"> and print_date like concat('%', #{printDate}, '%')</if>
|
||||
<if test="blDispFd != null and blDispFd != ''"> and bl_disp_fd=#{blDispFd}</if>
|
||||
<if test="transferCode != null and transferCode != ''"> and transfer_code like concat('%', #{transferCode}, '%')</if>
|
||||
<if test="transferBillcode != null and transferBillcode != ''"> and transfer_billcode like concat('%', #{transferBillcode}, '%')</if>
|
||||
<if test="dispFdDate != null "> and disp_fd_date = #{dispFdDate}</if>
|
||||
<if test="dispFdReason != null and dispFdReason != ''"> and disp_fd_reason like concat('%', #{dispFdReason}, '%')</if>
|
||||
<if test="currentSiteCode != null and currentSiteCode != ''"> and current_site_code=#{currentSiteCode}</if>
|
||||
<if test="nextSiteCode != null and nextSiteCode != ''"> and next_site_code= #{nextSiteCode}</if>
|
||||
<if test="lastSiteCode != null and lastSiteCode != ''"> and last_site_code=#{lastSiteCode}</if>
|
||||
<if test="registerSiteCode != null and registerSiteCode != ''"> and register_site_code=#{registerSiteCode}</if>
|
||||
<if test="registerDate != null "> and register_date = #{registerDate}</if>
|
||||
<if test="registerManCode != null and registerManCode != ''"> and register_man_code= #{registerManCode}</if>
|
||||
<if test="takePieceEmployeeCode != null and takePieceEmployeeCode != ''"> and take_piece_employee_code=#{takePieceEmployeeCode}</if>
|
||||
|
||||
<if test="sendDate != null "> and send_date = #{sendDate}</if>
|
||||
<if test="dispatchManCode != null and dispatchManCode != ''"> and dispatch_man_code=#{dispatchManCode}</if>
|
||||
<if test="dispatchSiteCode != null and dispatchSiteCode != ''"> and dispatch_site_code=#{dispatchSiteCode}</if>
|
||||
<if test="produceBillDate != null "> and produce_bill_date = #{produceBillDate}</if>
|
||||
<if test="produceBillSiteCode != null and produceBillSiteCode != ''"> and produce_bill_site_code=#{produceBillSiteCode}</if>
|
||||
<if test="produceBillManCode != null and produceBillManCode != ''"> and produce_bill_man_code=#{produceBillManCode}</if>
|
||||
<if test="destinationCode != null and destinationCode != ''"> and destination_code =#{destinationCode}</if>
|
||||
<if test="destinationProvince != null and destinationProvince != ''"> and destination_province=#{destinationProvince}</if>
|
||||
<if test="destinationCity != null and destinationCity != ''"> and destination_city=#{destinationCity}</if>
|
||||
<if test="destinationCounty != null and destinationCounty != ''"> and destination_county=#{destinationCounty}</if>
|
||||
<if test="dispatchUnderlingSiteCode != null and dispatchUnderlingSiteCode != ''"> and dispatch_underling_site_code=#{dispatchUnderlingSiteCode}</if>
|
||||
<if test="destinationCenterCode != null and destinationCenterCode != ''"> and destination_center_code=#{destinationCenterCode}</if>
|
||||
<if test="marketManCode != null and marketManCode != ''"> and market_man_code = #{marketManCode}</if>
|
||||
<if test="payee != null and payee != ''"> and a.payee=#{payee}</if>
|
||||
<if test="salesmen != null and salesmen != ''"> and a.salesmen like concat('%', #{salesmen}, '%')</if>
|
||||
<if test="operateEmployeeCode != null and operateEmployeeCode != ''"> and operate_employee_code=#{operateEmployeeCode}</if>
|
||||
<if test="blIsQuestion != null and blIsQuestion != ''"> and bl_is_question=#{blIsQuestion}</if>
|
||||
<if test="problemType != null and problemType != ''"> and problem_type=#{problemType}</if>
|
||||
<if test="problemCause != null and problemCause != ''"> and problem_cause like concat('%', #{problemCause}, '%')</if>
|
||||
<if test="problemDelayDays != null "> and problem_delay_days = #{problemDelayDays}</if>
|
||||
<if test="blMessage != null and blMessage != ''"> and bl_message=#{blMessage}</if>
|
||||
<if test="blAcceptMessage != null and blAcceptMessage != ''"> and bl_accept_message=#{blAcceptMessage}</if>
|
||||
<if test="blGenSubbill != null and blGenSubbill != ''"> and bl_gen_subbill=#{blGenSubbill}</if>
|
||||
<if test="signMan != null and signMan != ''"> and sign_man like concat('%', #{signMan}, '%')</if>
|
||||
<if test="signManCode != null and signManCode != ''"> and sign_man_code=#{signManCode}</if>
|
||||
<if test="signSiteCode != null and signSiteCode != ''"> and sign_site_code=#{signSiteCode}</if>
|
||||
<if test="paymentStatus != null and paymentStatus != ''"> and FIND_IN_SET(payment_status,#{paymentStatus})</if>
|
||||
<if test="paymentDate != null "> and payment_date = #{paymentDate}</if>
|
||||
<if test="paymentRemark != null and paymentRemark != ''"> and payment_remark like concat('%', #{paymentRemark}, '%')</if>
|
||||
<if test="orderRemark != null and orderRemark != ''"> and order_remark like concat('%', #{orderRemark}, '%')</if>
|
||||
|
||||
<if test="sendSiteCode != null and sendSiteCode != ''"> and FIND_IN_SET(`send_site_code`,#{sendSiteCode})</if>
|
||||
|
||||
<if test="remark != null and remark != ''"> and a.remark like concat('%', #{remark}, '%')</if>
|
||||
<if test="createBy != null and createBy != ''"> and a.create_by= #{createBy}</if>
|
||||
<if test="updateBy != null and updateBy != ''"> and a.update_by=#{updateBy}</if>
|
||||
<if test="createSite != null and createSite != ''"> and a.create_site=#{createSite}</if>
|
||||
<if test="updateSite != null and updateSite != ''"> and a.update_site=#{updateSite}</if>
|
||||
|
||||
|
||||
<if test="params.problemQueryType != null and params.problemQueryType == 1 and params.problemQueryIds != null and params.problemQueryIds !=''">
|
||||
and exists (
|
||||
select 1 from emis_waybill_problem_info ewpi where a.bill_code=ewpi.bill_code and ewpi.del_flag='0' and FIND_IN_SET( ewpi.`problem_type`, #{params.problemQueryIds} )
|
||||
)
|
||||
</if>
|
||||
|
||||
<if test="params.problemQueryType != null and params.problemQueryType == 2 and params.problemQueryIds != null and params.problemQueryIds !=''">
|
||||
and not exists (
|
||||
select 1 from emis_waybill_problem_info ewpi where a.bill_code=ewpi.bill_code and ewpi.del_flag='0' and FIND_IN_SET( ewpi.`problem_type`, #{params.problemQueryIds} )
|
||||
)
|
||||
</if>
|
||||
|
||||
|
||||
<if test="params.waybillStatType != null and params.waybillStatType == 1">
|
||||
and a.order_type='0'
|
||||
and a.waybill_status='0'
|
||||
and a.order_status in('0','3')
|
||||
and (
|
||||
a.take_piece_employee_code=#{params.privEmpCode}
|
||||
or (a.pickup_method in('1','3') and a.operate_employee_code is null )
|
||||
or (a.operate_employee_code=#{params.privEmpCode} )
|
||||
)
|
||||
</if>
|
||||
|
||||
<if test="params.waybillStatType != null and params.waybillStatType == 2">
|
||||
and a.waybill_status!='0' and a.order_status!='2'
|
||||
and (
|
||||
a.operate_employee_code=#{params.privEmpCode}
|
||||
or a.take_piece_employee_code=#{params.privEmpCode}
|
||||
or a.register_man_code=#{params.privEmpCode}
|
||||
)
|
||||
</if>
|
||||
|
||||
<if test="params.waybillStatType != null and params.waybillStatType == 3">
|
||||
and a.order_status='2'
|
||||
and (
|
||||
a.operate_employee_code=#{params.privEmpCode}
|
||||
or a.take_piece_employee_code=#{params.privEmpCode}
|
||||
)
|
||||
</if>
|
||||
|
||||
<!-- 转单 -->
|
||||
<if test="params.waybillStatType != null and params.waybillStatType == 4">
|
||||
and a.order_status in('0','3') and exists (
|
||||
select 1 from emis_waybill_change_to ewcto where a.bill_code=ewcto.bill_code and ewcto.change_from=#{params.privEmpCode}
|
||||
)
|
||||
</if>
|
||||
|
||||
|
||||
<if test="params.beginOrderDate != null and params.beginOrderDate != ''">
|
||||
and a.order_date <![CDATA[ >= ]]> #{params.beginOrderDate}
|
||||
</if>
|
||||
<if test="params.endOrderDate != null and params.endOrderDate != ''">
|
||||
and a.order_date <![CDATA[ <= ]]> #{params.endOrderDate}
|
||||
</if>
|
||||
|
||||
<if test="payee != null and payee != ''">
|
||||
and a.payee=#{payee}
|
||||
</if>
|
||||
|
||||
<if test="salesmen != null and salesmen != '' " >
|
||||
and a.salesmen=#{salesmen}
|
||||
</if>
|
||||
|
||||
<if test="blSign != null and blSign != ''">
|
||||
and a.bl_sign=#{blSign}
|
||||
</if>
|
||||
|
||||
<if test="params.beginDate != null and params.beginDate != ''">
|
||||
and a.send_date <![CDATA[ >= ]]> #{params.beginDate}
|
||||
</if>
|
||||
<if test="params.endDate != null and params.endDate != ''">
|
||||
and a.send_date <![CDATA[ <= ]]> #{params.endDate}
|
||||
</if>
|
||||
|
||||
<if test="params.blUploadGoodsPic != null and params.blUploadGoodsPic != '' and params.blUploadGoodsPic == 1">
|
||||
and a.goods_pics is not null
|
||||
</if>
|
||||
|
||||
<if test="params.blUploadGoodsPic != null and params.blUploadGoodsPic != '' and params.blUploadGoodsPic == 0">
|
||||
and a.goods_pics is null
|
||||
</if>
|
||||
|
||||
|
||||
<if test="params.beginSendDate != null and params.beginSendDate != ''">
|
||||
and a.send_date <![CDATA[ >= ]]> #{params.beginSendDate}
|
||||
</if>
|
||||
<if test="params.endSendDate != null and params.endSendDate != ''">
|
||||
and a.send_date <![CDATA[ <= ]]> #{params.endSendDate}
|
||||
</if>
|
||||
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != ''">
|
||||
and a.create_time <![CDATA[ >= ]]> #{params.beginCreateTime}
|
||||
</if>
|
||||
<if test="params.endCreateTime != null and params.endCreateTime != ''">
|
||||
and a.create_time <![CDATA[ <= ]]> #{params.endCreateTime}
|
||||
</if>
|
||||
|
||||
<if test="params.expireNotSign != null and params.expireNotSign == 1">
|
||||
and a.estimate_date <![CDATA[ < ]]> now() and bl_sign!='1'
|
||||
</if>
|
||||
|
||||
<if test="params.printFlag != null ">
|
||||
and a.bl_print=#{params.printFlag}
|
||||
</if>
|
||||
|
||||
<if test="params.isNeedPack != null and params.isNeedPack == 1">
|
||||
and not EXISTS ( select 1 from emis_tms_pack_dtl etp where etp.del_flag='0' and etp.main_bill_code=a.bill_code )
|
||||
and a.trans_line_type in(
|
||||
select line_code from emis_trans_line etl where etl.trans_type=1
|
||||
)
|
||||
and bl_sign!='1' and waybill_status!='40'
|
||||
and a.send_site_code=#{params.privSiteCode} and a.current_site_code=#{params.privSiteCode}
|
||||
</if>
|
||||
|
||||
|
||||
<if test="params.isNeedBatch != null and params.isNeedBatch == 1">
|
||||
and a.bill_code = #{billCode}
|
||||
<!--
|
||||
and a.bill_code not in(
|
||||
select etsbd.bill_code from emis_tms_site_batch_dtl etsbd,emis_tms_site_batch etsb
|
||||
where etsbd.batch_no=etsb.batch_no and etsbd.del_flag='0' and etsb.del_flag='0' and etsb.batch_type=#{params.batchType}
|
||||
)
|
||||
-->
|
||||
</if>
|
||||
|
||||
<!-- 查询现金客户额度属性; 1:查询超期额度,2:查询账期内额度 -->
|
||||
<if test="params.queryQuotaType != null and params.queryQuotaType == 1">
|
||||
and a.send_date is not null
|
||||
and DATEDIFF(NOW(), a.send_date) > 10
|
||||
</if>
|
||||
<if test="params.queryQuotaType != null and params.queryQuotaType == 2">
|
||||
and a.send_date is not null
|
||||
and DATEDIFF(NOW(), a.send_date) <![CDATA[ <= ]]> 10
|
||||
</if>
|
||||
|
||||
<if test="(params.isNeedBatch == null or (params.isNeedBatch != null and params.isNeedBatch != 1) ) " >
|
||||
<if test="(salesmen == null or salesmen=='') and params.privSiteCode != null and params.privSiteCode != '88888'">
|
||||
and (
|
||||
|
||||
a.send_site_code=#{params.privSiteCode}
|
||||
or a.dispatch_site_code=#{params.privSiteCode}
|
||||
<if test="params.isQueryPrintOrder != null and params.isQueryPrintOrder == 1">
|
||||
or EXISTS (select 1 from emis_tms_scan_record etsr where a.bill_code=etsr.main_bill_code and etsr.scan_site_code=#{params.privSiteCode})
|
||||
</if>
|
||||
<if test="custNo != null and custNo != ''">
|
||||
or EXISTS (
|
||||
select 1 from emis_customer_user ecu where a.cust_no=ecu.monthly_pay_code and ecu.owner_site=#{params.privSiteCode}
|
||||
)
|
||||
</if>
|
||||
|
||||
or a.salesmen=#{params.privEmpName}
|
||||
or a.payee=#{params.privEmpName}
|
||||
or a.salesmen in(
|
||||
select salesmen from emis_salesmen_rel esr where esr.del_flag='0' and esr.bl_open='1' and now() <![CDATA[ >= ]]> esr.start_date and now() <![CDATA[ <= ]]> esr.end_date and esr.sales_ass=#{params.privEmpName}
|
||||
)
|
||||
or a.operate_employee_code=#{params.privEmpCode}
|
||||
or a.take_piece_employee_code=#{params.privEmpCode}
|
||||
)
|
||||
</if>
|
||||
</if>
|
||||
|
||||
</where>
|
||||
|
||||
<if test="params.orderSnSortList != null ">
|
||||
ORDER BY FIELD
|
||||
<foreach collection="params.orderSnSortList" item="item" open="(order_sn," separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
||||
</if>
|
||||
<if test="params.billCodeSortList != null ">
|
||||
ORDER BY FIELD
|
||||
<foreach collection="params.billCodeSortList" item="item" open="(bill_code," separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
||||
</if>
|
||||
|
||||
<if test="params.billCodeSortList == null ">
|
||||
ORDER BY a.send_date desc
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 寄件网点寄件统计-->
|
||||
<select id="getSiteSendStatInfoMap" parameterType="EmisWaybill" resultType="map">
|
||||
@ -3181,7 +3537,27 @@
|
||||
where a.bl_sign = '1'
|
||||
and a.del_flag = '0'
|
||||
and (b.site_batch_status is null or b.site_batch_status != '1')
|
||||
<if test="lineCode != null and lineCode != ''">
|
||||
and a.trans_line_type = #{lineCode}
|
||||
</if>
|
||||
order by a.create_time desc
|
||||
limit #{offset}, #{pageSize}
|
||||
</select>
|
||||
|
||||
<select id="selectCustEmisWaybillById" parameterType="Long" resultMap="EmisWaybillResult">
|
||||
<include refid="selectEmisWaybillVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectCustEmisWaybillByBillCode" parameterType="EmisWaybill" resultMap="EmisWaybillResult">
|
||||
<include refid="selectEmisWaybillVo"/>
|
||||
where a.del_flag='0'
|
||||
<if test="custNo != null and custNo != ''">
|
||||
and a.cust_no=#{custNo}
|
||||
</if>
|
||||
<if test="billCode != null and billCode != ''">
|
||||
and a.bill_code=#{billCode}
|
||||
</if>
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user