|
@ -174,36 +174,46 @@ public class TaskUtils { |
|
|
JSONObject regionIn = new JSONObject(); |
|
|
JSONObject regionIn = new JSONObject(); |
|
|
regionIn.put("id", IdUtil.getSnowflake(1L, 1L).nextId()); |
|
|
regionIn.put("id", IdUtil.getSnowflake(1L, 1L).nextId()); |
|
|
regionIn.put("cCode", CodeUtil.getNewCode("IN_STORE_CODE")); |
|
|
regionIn.put("cCode", CodeUtil.getNewCode("IN_STORE_CODE")); |
|
|
regionIn.put("dDate", DateUtil.today()); |
|
|
regionIn.put("dDate", DateUtil.now()); |
|
|
regionIn.put("cVouchType", regionInType.label()); |
|
|
regionIn.put("cVouchType", regionInType.label()); |
|
|
String material_code = detail.getString("material_code"); |
|
|
String material_code = detail.getString("material_code"); |
|
|
String cMocode = material_code.substring(11, 16); |
|
|
String order_code = detail.getString("order_code"); |
|
|
regionIn.put("cMocode", cMocode); |
|
|
regionIn.put("cMocode", order_code); |
|
|
regionIn.put("cInvCode", regionInType.value() + material_code); |
|
|
regionIn.put("cInvCode", regionInType.value() + material_code); |
|
|
regionIn.put("iQuantity", String.format("%.3f", detail.getDoubleValue("vd_weight") / 1000)); |
|
|
double vd_weight = detail.getDoubleValue("vd_weight"); |
|
|
regionIn.put("iNum", detail.getString("qty")); |
|
|
int qty = detail.getIntValue("qty"); |
|
|
regionIn.put("iinvexchrate", String.format("%.5f", detail.getDoubleValue("material_weight") / 1000)); |
|
|
double material_weight = detail.getDoubleValue("material_weight"); |
|
|
regionIn.put("cBatch", cMocode); |
|
|
if (vd_weight == 0) { |
|
|
|
|
|
vd_weight = qty * material_weight; |
|
|
|
|
|
} |
|
|
|
|
|
regionIn.put("iQuantity", String.format("%.3f", vd_weight / 1000)); |
|
|
|
|
|
regionIn.put("iNum", qty); |
|
|
|
|
|
regionIn.put("iinvexchrate", String.format("%.5f", material_weight / 1000)); |
|
|
|
|
|
regionIn.put("cBatch", order_code); |
|
|
return regionIn; |
|
|
return regionIn; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static JSONObject buildRegionInFromWorkorder(JSONObject workorder, RegionInType regionInType) { |
|
|
public static JSONObject buildRegionInFromWorkorder(JSONObject workorder) { |
|
|
JSONObject detail = WQL.getWO("TASK_UTILS").addParam("flag", "2").addParam("workorder_id", workorder.getString("workorder_id")).process().uniqueResult(0); |
|
|
JSONObject detail = WQL.getWO("TASK_UTILS").addParam("flag", "2").addParam("workorder_id", workorder.getString("workorder_id")).process().uniqueResult(0); |
|
|
|
|
|
RegionInType regionInType = RegionInType.BCPFPRK; |
|
|
|
|
|
if (Region.FJ.value().equals(detail.getString("region_code"))) { |
|
|
|
|
|
regionInType = RegionInType.CCPFPRK; |
|
|
|
|
|
} |
|
|
JSONObject regionIn = new JSONObject(); |
|
|
JSONObject regionIn = new JSONObject(); |
|
|
regionIn.put("id", IdUtil.getSnowflake(1L, 1L).nextId()); |
|
|
regionIn.put("id", IdUtil.getSnowflake(1L, 1L).nextId()); |
|
|
regionIn.put("cCode", CodeUtil.getNewCode("IN_STORE_CODE")); |
|
|
regionIn.put("cCode", CodeUtil.getNewCode("IN_STORE_CODE")); |
|
|
regionIn.put("dDate", DateUtil.now()); |
|
|
regionIn.put("dDate", DateUtil.now()); |
|
|
regionIn.put("cVouchType", regionInType.label()); |
|
|
regionIn.put("cVouchType", regionInType.label()); |
|
|
String material_code = detail.getString("material_code"); |
|
|
String material_code = detail.getString("material_code"); |
|
|
String cMocode = material_code.substring(11, 16); |
|
|
String order_code = detail.getString("order_code"); |
|
|
regionIn.put("cMocode", cMocode); |
|
|
regionIn.put("cMocode", order_code); |
|
|
regionIn.put("cInvCode", regionInType.value() + material_code); |
|
|
regionIn.put("cInvCode", regionInType.value() + material_code); |
|
|
int qty = workorder.getIntValue("unqualified_qty"); |
|
|
int qty = workorder.getIntValue("unqualified_qty"); |
|
|
regionIn.put("iNum", qty); |
|
|
regionIn.put("iNum", qty); |
|
|
double material_weight = detail.getDoubleValue("material_weight"); |
|
|
double material_weight = detail.getDoubleValue("material_weight"); |
|
|
regionIn.put("iinvexchrate", String.format("%.5f", material_weight / 1000)); |
|
|
regionIn.put("iinvexchrate", String.format("%.5f", material_weight / 1000)); |
|
|
regionIn.put("iQuantity", String.format("%.3f", qty * material_weight / 1000)); |
|
|
regionIn.put("iQuantity", String.format("%.3f", qty * material_weight / 1000)); |
|
|
regionIn.put("cBatch", cMocode); |
|
|
regionIn.put("cBatch", order_code); |
|
|
return regionIn; |
|
|
return regionIn; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -214,13 +224,13 @@ public class TaskUtils { |
|
|
regionIn.put("cCode", CodeUtil.getNewCode("IN_STORE_CODE")); |
|
|
regionIn.put("cCode", CodeUtil.getNewCode("IN_STORE_CODE")); |
|
|
regionIn.put("dDate", DateUtil.now()); |
|
|
regionIn.put("dDate", DateUtil.now()); |
|
|
String material_code = detail.getString("material_code"); |
|
|
String material_code = detail.getString("material_code"); |
|
|
String cMocode = material_code.substring(11, 16); |
|
|
String order_code = detail.getString("order_code"); |
|
|
regionIn.put("cMocode", cMocode); |
|
|
regionIn.put("cMocode", order_code); |
|
|
regionIn.put("cInvCode", regionOutType.value() + material_code); |
|
|
regionIn.put("cInvCode", regionOutType.value() + material_code); |
|
|
regionIn.put("iQuantity", String.format("%.3f", detail.getDoubleValue("vd_weight") / 1000)); |
|
|
regionIn.put("iQuantity", String.format("%.3f", detail.getDoubleValue("vd_weight") / 1000)); |
|
|
regionIn.put("iNum", detail.getString("qty")); |
|
|
regionIn.put("iNum", detail.getString("qty")); |
|
|
regionIn.put("iinvexchrate", String.format("%.5f", detail.getDoubleValue("material_weight") / 1000)); |
|
|
regionIn.put("iinvexchrate", String.format("%.5f", detail.getDoubleValue("material_weight") / 1000)); |
|
|
regionIn.put("cBatch", cMocode); |
|
|
regionIn.put("cBatch", order_code); |
|
|
return regionIn; |
|
|
return regionIn; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|