其他出库申请关闭

This commit is contained in:
sez 2025-11-05 11:33:38 +08:00
parent f7594c6494
commit 21a7526446
1 changed files with 66 additions and 26 deletions

View File

@ -15,7 +15,6 @@ import java.util.Map;
public class BillCloseCancelUtils { public class BillCloseCancelUtils {
/** /**
* 通天晓单据取消接口 * 通天晓单据取消接口
* *
@ -23,11 +22,11 @@ public class BillCloseCancelUtils {
* @param warehouseCode 仓库编号 * @param warehouseCode 仓库编号
* @param billNo 单据编号 * @param billNo 单据编号
* @param entityType 单据标识 * @param entityType 单据标识
* @param entityName 单据名称 * @param entityName 单据名称
* @param label 推送标识 * @param label 推送标识
* @return 取消结果 * @return 取消结果
*/ */
public static String wmsCancel(String orderType, String warehouseCode, String billNo,String entityType,String entityName,String label) { public static String wmsCancel(String orderType, String warehouseCode, String billNo, String entityType, String entityName, String label) {
String method = "order.cancel"; String method = "order.cancel";
String message = null; String message = null;
Map<String, Object> request = new HashMap<>(); Map<String, Object> request = new HashMap<>();
@ -56,8 +55,8 @@ public class BillCloseCancelUtils {
message = response.getString("message"); message = response.getString("message");
LCLogServiceImpl lcLogService = new LCLogServiceImpl(); LCLogServiceImpl lcLogService = new LCLogServiceImpl();
lcLogService.savelog(entityName,ttx_mainUrl,true, code.equals("200"),xmlBuilder.toString(),result); lcLogService.savelog(entityName, ttx_mainUrl, true, code.equals("200"), xmlBuilder.toString(), result);
lcLogService.isSuccess(entityType,billNo,"billno",label,code.equals("200")); lcLogService.isSuccess(entityType, billNo, "billno", label, code.equals("200"));
} }
} catch ( } catch (
@ -69,21 +68,19 @@ public class BillCloseCancelUtils {
return message; return message;
} }
/** /**
* 北广 收货通知单关闭采购订单关闭 * 北广 收货通知单关闭采购订单关闭
* *
* @param billNo 单据编号 * @param billNo 单据编号
* @param url 接口地址北京还是广州 * @param url 接口地址北京还是广州
* @param entityType 单据标识 * @param entityType 单据标识
* @param entityName 单据名称 * @param entityName 单据名称
* @param label 推送标识 * @param label 推送标识
* @return 关闭结果 * @return 关闭结果
*/ */
public static String BGPurOrderCancel(String billNo, String url,String entityType,String entityName,String label) { public static String BGPurOrderCancel(String billNo, String url, String entityType, String entityName, String label) {
String message = null; String message = null;
String method = "/api/PU/Close_PurOrder"; String method = "/api/PU/Close_PurOrder";
Map<String, Object> bj_map = new HashMap<>(); Map<String, Object> bj_map = new HashMap<>();
@ -95,10 +92,10 @@ public class BillCloseCancelUtils {
JsonNode rootNode = objectMapper.readTree(result); JsonNode rootNode = objectMapper.readTree(result);
if (null != rootNode) { if (null != rootNode) {
message = String.valueOf(rootNode.get("message")); message = String.valueOf(rootNode.get("message"));
String code = String.valueOf(rootNode.get("code")); String code = String.valueOf(rootNode.get("code"));
LCLogServiceImpl lcLogService = new LCLogServiceImpl(); LCLogServiceImpl lcLogService = new LCLogServiceImpl();
lcLogService.savelog(entityName,url,true, code.equals("0"),bjjsonBody,result); lcLogService.savelog(entityName, url, true, code.equals("0"), bjjsonBody, result);
lcLogService.isSuccess(entityType,billNo,"billno",label,code.equals("0")); lcLogService.isSuccess(entityType, billNo, "billno", label, code.equals("0"));
} }
} catch (IOException e) { } catch (IOException e) {
@ -110,14 +107,14 @@ public class BillCloseCancelUtils {
/** /**
* 北广 其他入库申请单取消 * 北广 其他入库申请单取消
* *
* @param billNo 单据编号 * @param billNo 单据编号
* @param url 接口地址北京还是广州 * @param url 接口地址北京还是广州
* @param entityType 单据标识 * @param entityType 单据标识
* @param entityName 单据名称 * @param entityName 单据名称
* @param label 推送标识 * @param label 推送标识
* @return 关闭结果 * @return 关闭结果
*/ */
public static String BGCloseOtherVouchIn(String billNo, String url,String entityType,String entityName,String label) { public static String BGCloseOtherVouchIn(String billNo, String url, String entityType, String entityName, String label) {
String message = null; String message = null;
String method = "/api/WMS/Close_OtherVouchIn"; String method = "/api/WMS/Close_OtherVouchIn";
Map<String, Object> bj_map = new HashMap<>(); Map<String, Object> bj_map = new HashMap<>();
@ -129,10 +126,10 @@ public class BillCloseCancelUtils {
JsonNode rootNode = objectMapper.readTree(result); JsonNode rootNode = objectMapper.readTree(result);
if (null != rootNode) { if (null != rootNode) {
message = String.valueOf(rootNode.get("message")); message = String.valueOf(rootNode.get("message"));
String code = String.valueOf(rootNode.get("code")); String code = String.valueOf(rootNode.get("code"));
LCLogServiceImpl lcLogService = new LCLogServiceImpl(); LCLogServiceImpl lcLogService = new LCLogServiceImpl();
lcLogService.savelog(entityName,url,true, code.equals("0"),bjjsonBody,result); lcLogService.savelog(entityName, url, true, code.equals("0"), bjjsonBody, result);
lcLogService.isSuccess(entityType,billNo,"billno",label,code.equals("0")); lcLogService.isSuccess(entityType, billNo, "billno", label, code.equals("0"));
} }
} catch (IOException e) { } catch (IOException e) {
@ -141,4 +138,47 @@ public class BillCloseCancelUtils {
return message; return message;
} }
/**
* 北广 其他出库申请单取消
*
* @param billNo 单据编号
* @param url 接口地址北京还是广州
* @param entityType 单据标识
* @param entityName 单据名称
* @param label 推送标识
* @param orderType 业务类型
* @return 关闭结果
*/
public static String BGCloseOtherVouchOut(String billNo, String url, String entityType, String entityName, String label, String orderType) {
String message = null;
Map<String, Object> bj_map = new HashMap<>();
String method;//其他出库撤销
if ("DBCK".equals(orderType)) {
method = "/api/WMS/Cancel_TransVouch ";//调拨出库撤销
bj_map.put("cTVCode",billNo);
}else {
method = "/api/WMS/Cancel_OtherVouchOut";
bj_map.put("cOVCode", billNo);
}
String bjjsonBody = JSON.toJSONString(bj_map);
try {
String result = HttpRequestUtils.postJson(url + method, bjjsonBody, null);
ObjectMapper objectMapper = new ObjectMapper();
JsonNode rootNode = objectMapper.readTree(result);
if (null != rootNode) {
message = String.valueOf(rootNode.get("message"));
String code = String.valueOf(rootNode.get("code"));
LCLogServiceImpl lcLogService = new LCLogServiceImpl();
lcLogService.savelog(entityName, url, true, code.equals("0"), bjjsonBody, result);
lcLogService.isSuccess(entityType, billNo, "billno", label, code.equals("0"));
}
} catch (IOException e) {
throw new RuntimeException(e);
}
return message;
}
} }