Browse Source

add erp对接

master
张江玮 2 years ago
parent
commit
6d5a963c9a
  1. 2
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/wql/QMD_ME_MATERIAL.wql
  2. 3
      lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  3. 2
      lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/dto/WorkorderDto.java
  4. 10
      lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkorderServiceImpl.java
  5. 3
      lms/nladmin-system/src/main/java/org/nl/wms/pdm/wql/MPS_PRODUCEDURE001.wql
  6. 35
      lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/RegionInType.java
  7. 31
      lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/RegionOutType.java
  8. 5
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/FJCallMaterialTask.java
  9. 1
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/SZCallMaterialTask.java
  10. 1
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/YZCallMaterialTask.java
  11. 4
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/wql/CALL_MATERIAL_TASK.wql
  12. 10
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/FJSendMaterialTask.java
  13. 11
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/SZSendMaterialTask.java
  14. 8
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/to/pack/BTHCToPackageTask.java
  15. 8
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/to/pack/FJToPackageTask.java
  16. 61
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/util/TaskUtils.java
  17. 71
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/util/wql/TASK_UTILS.wql
  18. BIN
      lms/nladmin-system/src/main/java/org/nl/wms/wms.xls
  19. 14
      lms/nladmin-ui/src/views/wms/basedata/material/index.vue
  20. 16
      lms/nladmin-ui/src/views/wms/pdm/workerorder/hl/index.vue
  21. 111
      lms/nladmin-ui/src/views/wms/pdm/workerorder/index.vue
  22. 5
      lms/nladmin-ui/src/views/wms/pub/MaterDialog.vue

2
lms/nladmin-system/src/main/java/org/nl/wms/basedata/wql/QMD_ME_MATERIAL.wql

@ -60,7 +60,7 @@
mb.material_type = 输入.material_type mb.material_type = 输入.material_type
ENDOPTION ENDOPTION
OPTION 输入.order_code <> "" OPTION 输入.order_code <> ""
mb.order_code LIKE '%' order_code '%' mb.order_code LIKE '%' 输入.order_code '%'
ENDOPTION ENDOPTION
OPTION 输入.product_grade <> "" OPTION 输入.product_grade <> ""
mb.product_grade LIKE '%' 输入.product_grade '%' mb.product_grade LIKE '%' 输入.product_grade '%'

3
lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java

@ -704,6 +704,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
String unqualified_qty = jsonObject.getString("unqualified_qty"); String unqualified_qty = jsonObject.getString("unqualified_qty");
if (StrUtil.isNotBlank(unqualified_qty) && !"0".equals(unqualified_qty)) { if (StrUtil.isNotBlank(unqualified_qty) && !"0".equals(unqualified_qty)) {
workorder.put("unqualified_qty", unqualified_qty); workorder.put("unqualified_qty", unqualified_qty);
JSONObject regionIn = TaskUtils.buildRegionInFromWorkorder(workorder, RegionInType.FPRK);
WQLObject.getWQLObject("st_ivt_regionio").insert(regionIn);
} }
String qualified_qty = jsonObject.getString("qualified_qty"); String qualified_qty = jsonObject.getString("qualified_qty");
if (StrUtil.isNotBlank(qualified_qty) && !"0".equals(qualified_qty)) { if (StrUtil.isNotBlank(qualified_qty) && !"0".equals(qualified_qty)) {

2
lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/dto/WorkorderDto.java

@ -110,4 +110,6 @@ public class WorkorderDto implements Serializable {
private String ext_code; private String ext_code;
private String region_code; private String region_code;
private String plan_date;
} }

10
lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkorderServiceImpl.java

@ -23,6 +23,7 @@ import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.nl.wms.pdm.service.WorkordeService; import org.nl.wms.pdm.service.WorkordeService;
import org.nl.wms.pdm.service.dto.WorkorderDto; import org.nl.wms.pdm.service.dto.WorkorderDto;
import org.nl.wms.sch.manage.Region; import org.nl.wms.sch.manage.Region;
import org.nl.wms.sch.manage.RegionInType;
import org.nl.wms.sch.manage.WorkOrderEnum; import org.nl.wms.sch.manage.WorkOrderEnum;
import org.nl.wms.sch.task.util.TaskUtils; import org.nl.wms.sch.task.util.TaskUtils;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@ -133,6 +134,7 @@ public class WorkorderServiceImpl implements WorkordeService {
work_order.put("is_pri", dto.getIs_pri()); work_order.put("is_pri", dto.getIs_pri());
work_order.put("ext_code", dto.getExt_code()); work_order.put("ext_code", dto.getExt_code());
work_order.put("is_delete", TrueOrFalse.FALSE.value()); work_order.put("is_delete", TrueOrFalse.FALSE.value());
work_order.put("plan_date", dto.getPlan_date());
Long user_id = SecurityUtils.getCurrentUserId(); Long user_id = SecurityUtils.getCurrentUserId();
String nick_name = SecurityUtils.getCurrentNickName(); String nick_name = SecurityUtils.getCurrentNickName();
String now = DateUtil.now(); String now = DateUtil.now();
@ -209,6 +211,11 @@ public class WorkorderServiceImpl implements WorkordeService {
throw new BadRequestException("该设备已下发其它工单!"); throw new BadRequestException("该设备已下发其它工单!");
} }
if (Region.HL.value().equals(submit_obj.getString("region_code"))) {
String material_code = submit_obj.getString("material_code");
submit_obj.put("material_code", material_code.substring(5, 11));
}
JSONArray request = new JSONArray(); JSONArray request = new JSONArray();
request.add(submit_obj); request.add(submit_obj);
Map<String, Object> result; Map<String, Object> result;
@ -431,6 +438,9 @@ public class WorkorderServiceImpl implements WorkordeService {
String unqualified_qty = row.getString("unqualified_qty"); String unqualified_qty = row.getString("unqualified_qty");
if (StrUtil.isNotBlank(unqualified_qty) && !"0".equals(unqualified_qty)) { if (StrUtil.isNotBlank(unqualified_qty) && !"0".equals(unqualified_qty)) {
workorder.put("unqualified_qty", unqualified_qty); workorder.put("unqualified_qty", unqualified_qty);
JSONObject regionIn = TaskUtils.buildRegionInFromWorkorder(workorder, RegionInType.FPRK);
WQLObject.getWQLObject("st_ivt_regionio").insert(regionIn);
} }
String qualified_qty = row.getString("qualified_qty"); String qualified_qty = row.getString("qualified_qty");
if (StrUtil.isNotBlank(qualified_qty) && !"0".equals(qualified_qty)) { if (StrUtil.isNotBlank(qualified_qty) && !"0".equals(qualified_qty)) {

3
lms/nladmin-system/src/main/java/org/nl/wms/pdm/wql/MPS_PRODUCEDURE001.wql

@ -176,7 +176,8 @@
material.a, material.a,
material.b, material.b,
material.h, material.h,
material.w material.w,
device.region_code
FROM FROM
pdm_bd_workorder workorder pdm_bd_workorder workorder
LEFT JOIN md_me_materialbase material ON workorder.material_id = material.material_id LEFT JOIN md_me_materialbase material ON workorder.material_id = material.material_id

35
lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/RegionInType.java

@ -0,0 +1,35 @@
package org.nl.wms.sch.manage;
import lombok.RequiredArgsConstructor;
import java.util.Arrays;
import java.util.stream.Collectors;
/**
* 入库类型
*
* @author zhangjiangwei
* @date 2023/05/19 09:53
*/
@RequiredArgsConstructor
public enum RegionInType {
WGRK("完工入库", "F"),
BCPRK("半成品入库", "W"),
FPRK("废品入库", "W");
private final String label;
private final String value;
public String label() {
return this.label;
}
public String value() {
return this.value;
}
public static RegionInType get(String value) {
return Arrays.stream(RegionInType.values()).filter(r -> r.value.equals(value)).collect(Collectors.toList()).get(0);
}
}

31
lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/RegionOutType.java

@ -0,0 +1,31 @@
package org.nl.wms.sch.manage;
import lombok.RequiredArgsConstructor;
import java.util.Arrays;
import java.util.stream.Collectors;
/**
* @author zhangjiangwei
* @date 2023/05/20 14:06
*/
@RequiredArgsConstructor
public enum RegionOutType {
BCPCK("半成品出库", "W");
private final String label;
private final String value;
public String label() {
return this.label;
}
public String value() {
return this.value;
}
public static RegionOutType get(String value) {
return Arrays.stream(RegionOutType.values()).filter(r -> r.value.equals(value)).collect(Collectors.toList()).get(0);
}
}

5
lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/FJCallMaterialTask.java

@ -93,6 +93,8 @@ public class FJCallMaterialTask extends AbstractAcsTask {
task.put("task_status", TaskStatus.START_AND_END.value()); task.put("task_status", TaskStatus.START_AND_END.value());
task.put("point_code1", point.getString("point_code")); task.put("point_code1", point.getString("point_code"));
task.put("vehicle_code", TaskUtils.formatVehicleCode(point.getString("vehicle_code"))); task.put("vehicle_code", TaskUtils.formatVehicleCode(point.getString("vehicle_code")));
task.put("material_id", point.getString("material_id"));
task.put("group_id", point.getString("vd_id"));
task.put("remark", ""); task.put("remark", "");
TaskUtils.addAutoUpdateColum(task); TaskUtils.addAutoUpdateColum(task);
task_table.update(task); task_table.update(task);
@ -225,6 +227,9 @@ public class FJCallMaterialTask extends AbstractAcsTask {
} }
point_table.update(point2, "point_code = '" + point_code2 + "'"); point_table.update(point2, "point_code = '" + point_code2 + "'");
} }
JSONObject regionOut = TaskUtils.buildRegionOut(task, RegionOutType.BCPCK);
WQLObject.getWQLObject("st_ivt_regionout").insert(regionOut);
} }
} }
} }

1
lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/SZCallMaterialTask.java

@ -91,6 +91,7 @@ public class SZCallMaterialTask extends AbstractAcsTask {
task.put("point_code1", point.getString("point_code")); task.put("point_code1", point.getString("point_code"));
task.put("material_id", point.getString("material_id")); task.put("material_id", point.getString("material_id"));
task.put("vehicle_code", TaskUtils.formatVehicleCode(point.getString("vehicle_code"))); task.put("vehicle_code", TaskUtils.formatVehicleCode(point.getString("vehicle_code")));
task.put("group_id", point.getString("vd_id"));
task.put("remark", ""); task.put("remark", "");
TaskUtils.addAutoUpdateColum(task); TaskUtils.addAutoUpdateColum(task);
task_table.update(task); task_table.update(task);

1
lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/YZCallMaterialTask.java

@ -93,6 +93,7 @@ public class YZCallMaterialTask extends AbstractAcsTask {
task.put("task_status", TaskStatus.START_AND_END.value()); task.put("task_status", TaskStatus.START_AND_END.value());
task.put("point_code1", point.getString("point_code")); task.put("point_code1", point.getString("point_code"));
task.put("vehicle_code", TaskUtils.formatVehicleCode(point.getString("vehicle_code"))); task.put("vehicle_code", TaskUtils.formatVehicleCode(point.getString("vehicle_code")));
task.put("group_id", point.getString("vd_id"));
task.put("material_id", point.getString("material_id")); task.put("material_id", point.getString("material_id"));
task.put("remark", ""); task.put("remark", "");
TaskUtils.addAutoUpdateColum(task); TaskUtils.addAutoUpdateColum(task);

4
lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/wql/CALL_MATERIAL_TASK.wql

@ -84,6 +84,7 @@
QUERY QUERY
SELECT SELECT
point.*, point.*,
vd.material_id,
vd.vd_id vd.vd_id
FROM FROM
sch_base_point point sch_base_point point
@ -109,7 +110,8 @@
QUERY QUERY
SELECT SELECT
point.*, point.*,
mb1.material_id mb1.material_id,
vd.vd_id
FROM FROM
sch_base_point point sch_base_point point
LEFT JOIN st_ivt_vehicle_detail vd ON point.vehicle_type = vd.vehicle_type LEFT JOIN st_ivt_vehicle_detail vd ON point.vehicle_type = vd.vehicle_type

10
lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/FJSendMaterialTask.java

@ -86,7 +86,7 @@ public class FJSendMaterialTask extends AbstractAcsTask {
form.getString("create_id"), form.getString("create_id"),
form.getString("create_name") form.getString("create_name")
); );
empty_task.put("task_group_id", material_task.getLongValue("task_id")); empty_task.put("table_fk_id", material_task.getLongValue("task_id"));
WQLObject.getWQLObject("sch_base_task").insert(empty_task); WQLObject.getWQLObject("sch_base_task").insert(empty_task);
} }
@ -309,6 +309,14 @@ public class FJSendMaterialTask extends AbstractAcsTask {
} }
// todo 如果是送料任务需要发送唛头信息到包装机 // todo 如果是送料任务需要发送唛头信息到包装机
if (TaskType.SEND_MATERIAL.value().equals(task.getString("task_type"))) {
JSONObject point2 = WQLObject.getWQLObject("sch_base_point").query("point_code = '" + point_code2 + "'").uniqueResult(0);
if (Region.FJ.value().equals(point2.getString("region_code")) && "5".equals(point2.getString("point_type"))) {
JSONObject regionIn = TaskUtils.buildRegionInFromTask(task, RegionInType.WGRK);
WQLObject.getWQLObject("st_ivt_regionio").insert(regionIn);
}
}
} }
} }
} }

11
lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/SZSendMaterialTask.java

@ -167,14 +167,14 @@ public class SZSendMaterialTask extends AbstractAcsTask {
} }
public void finishTask(JSONObject task, OperationType operation_type) { public void finishTask(JSONObject task, OperationType operation_type) {
int current_task_status = task.getIntValue("task_status"); int current_task_status = task.getIntValue("task_status");
if (current_task_status < Integer.parseInt(TaskStatus.FINISHED.value())) { if (current_task_status < Integer.parseInt(TaskStatus.FINISHED.value())) {
if (operation_type == OperationType.MANUAL if (operation_type == OperationType.MANUAL
&& current_task_status < Integer.parseInt(TaskStatus.START_AND_END.value())) { && current_task_status < Integer.parseInt(TaskStatus.START_AND_END.value())) {
throw new BadRequestException("只能手动完成 [确认起点和终点] 之后的任务!"); throw new BadRequestException("只能手动完成 [确认起点和终点] 之后的任务!");
} }
task.put("task_status", TaskStatus.FINISHED.value()); task.put("task_status", TaskStatus.FINISHED.value());
if (operation_type == OperationType.AUTO) { if (operation_type == OperationType.AUTO) {
TaskUtils.addACSUpdateColum(task); TaskUtils.addACSUpdateColum(task);
@ -218,8 +218,11 @@ public class SZSendMaterialTask extends AbstractAcsTask {
} else if (operation_type == OperationType.MANUAL) { } else if (operation_type == OperationType.MANUAL) {
TaskUtils.addCurrentUpdateColum(point2); TaskUtils.addCurrentUpdateColum(point2);
} }
point_table.update(point2, "point_code = '" + point_code2 +"'"); point_table.update(point2, "point_code = '" + point_code2 + "'");
} }
JSONObject regionIn = TaskUtils.buildRegionInFromTask(task, RegionInType.BCPRK);
WQLObject.getWQLObject("st_ivt_regionio").insert(regionIn);
} }
} }
} }

8
lms/nladmin-system/src/main/java/org/nl/wms/sch/task/to/pack/BTHCToPackageTask.java

@ -49,7 +49,7 @@ public class BTHCToPackageTask extends AbstractAcsTask {
TaskStatus.SURE_START.value(), TaskStatus.SURE_START.value(),
point.getString("point_code"), point.getString("point_code"),
null, null,
pn.getLongValue("data_id"), vd.getLongValue("vd_id"),
vd.getString("material_id"), vd.getString("material_id"),
vd.getString("vehicle_type"), vd.getString("vehicle_type"),
vd.getString("vehicle_code"), vd.getString("vehicle_code"),
@ -60,6 +60,7 @@ public class BTHCToPackageTask extends AbstractAcsTask {
form.getString("create_id"), form.getString("create_id"),
form.getString("create_name") form.getString("create_name")
); );
task.put("table_fk_id", pn.getLong("data_id"));
WQLObject.getWQLObject("sch_base_task").insert(task); WQLObject.getWQLObject("sch_base_task").insert(task);
point.put("lock_type", LockType.TASK_LOCKED.value()); point.put("lock_type", LockType.TASK_LOCKED.value());
@ -168,7 +169,7 @@ public class BTHCToPackageTask extends AbstractAcsTask {
point_table.update(point2, "point_code = '" + point_code2 + "'"); point_table.update(point2, "point_code = '" + point_code2 + "'");
} }
WQLObject.getWQLObject("das_produce_number").delete("data_id = " + task.getLongValue("group_id")); WQLObject.getWQLObject("das_produce_number").delete("data_id = " + task.getLongValue("table_fk_id"));
} }
} }
@ -223,6 +224,9 @@ public class BTHCToPackageTask extends AbstractAcsTask {
} }
point_table.update(point2, "point_code = '" + point_code2 + "'"); point_table.update(point2, "point_code = '" + point_code2 + "'");
} }
JSONObject regionIn = TaskUtils.buildRegionInFromTask(task, RegionInType.WGRK);
WQLObject.getWQLObject("st_ivt_regionio").insert(regionIn);
} }
} }
} }

8
lms/nladmin-system/src/main/java/org/nl/wms/sch/task/to/pack/FJToPackageTask.java

@ -51,7 +51,7 @@ public class FJToPackageTask extends AbstractAcsTask {
TaskStatus.SURE_START.value(), TaskStatus.SURE_START.value(),
point.getString("point_code"), point.getString("point_code"),
null, null,
pn.getLongValue("data_id"), vd.getLongValue("vd_id"),
vd.getString("material_id"), vd.getString("material_id"),
vd.getString("vehicle_type"), vd.getString("vehicle_type"),
vd.getString("vehicle_code"), vd.getString("vehicle_code"),
@ -62,6 +62,7 @@ public class FJToPackageTask extends AbstractAcsTask {
form.getString("create_id"), form.getString("create_id"),
form.getString("create_name") form.getString("create_name")
); );
task.put("table_fk_id", pn.getLong("data_id"));
WQLObject.getWQLObject("sch_base_task").insert(task); WQLObject.getWQLObject("sch_base_task").insert(task);
point.put("lock_type", LockType.TASK_LOCKED.value()); point.put("lock_type", LockType.TASK_LOCKED.value());
@ -170,7 +171,7 @@ public class FJToPackageTask extends AbstractAcsTask {
point_table.update(point2, "point_code = '" + point_code2 + "'"); point_table.update(point2, "point_code = '" + point_code2 + "'");
} }
WQLObject.getWQLObject("das_produce_number").delete("data_id = " + task.getLongValue("group_id")); WQLObject.getWQLObject("das_produce_number").delete("data_id = " + task.getLongValue("table_fk_id"));
} }
} }
@ -225,6 +226,9 @@ public class FJToPackageTask extends AbstractAcsTask {
} }
point_table.update(point2, "point_code = '" + point_code2 + "'"); point_table.update(point2, "point_code = '" + point_code2 + "'");
} }
JSONObject regionIn = TaskUtils.buildRegionInFromTask(task, RegionInType.WGRK);
WQLObject.getWQLObject("st_ivt_regionio").insert(regionIn);
} }
} }
} }

61
lms/nladmin-system/src/main/java/org/nl/wms/sch/task/util/TaskUtils.java

@ -8,12 +8,10 @@ import com.alibaba.fastjson.JSONObject;
import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.common.utils.SecurityUtils; import org.nl.modules.common.utils.SecurityUtils;
import org.nl.modules.system.util.CodeUtil; import org.nl.modules.system.util.CodeUtil;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject; import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.wms.common.PickType; import org.nl.wms.common.PickType;
import org.nl.wms.sch.manage.ACSSystem; import org.nl.wms.sch.manage.*;
import org.nl.wms.sch.manage.AutoCreate;
import org.nl.wms.sch.manage.LockType;
import org.nl.wms.sch.manage.PointStatus;
/** /**
* 辽宁晟华任务工具类 * 辽宁晟华任务工具类
@ -170,4 +168,59 @@ public class TaskUtils {
pn.put("create_time", DateUtil.now()); pn.put("create_time", DateUtil.now());
return pn; return pn;
} }
public static JSONObject buildRegionInFromTask(JSONObject task, RegionInType regionInType) {
JSONObject detail = WQL.getWO("TASK_UTILS").addParam("flag", "1").addParam("vd_id", task.getString("group_id")).process().uniqueResult(0);
JSONObject regionIn = new JSONObject();
regionIn.put("id", IdUtil.getSnowflake(1L, 1L).nextId());
regionIn.put("cCode", CodeUtil.getNewCode("IN_STORE_CODE"));
regionIn.put("dDate", DateUtil.today());
regionIn.put("cVouchType", regionInType.label());
String material_code = detail.getString("material_code");
String cMocode = material_code.substring(11, 16);
regionIn.put("cMocode", cMocode);
regionIn.put("cInvCode", regionInType.value() + material_code);
regionIn.put("iQuantity", String.format("%.3f", detail.getDoubleValue("vd_weight") / 1000));
regionIn.put("iNum", detail.getString("qty"));
regionIn.put("iinvexchrate", String.format("%.3f", detail.getDoubleValue("material_weight") / 1000));
regionIn.put("cBatch", cMocode);
return regionIn;
}
public static JSONObject buildRegionInFromWorkorder(JSONObject workorder, RegionInType regionInType) {
JSONObject detail = WQL.getWO("TASK_UTILS").addParam("flag", "2").addParam("workorder_id", workorder.getString("workorder_id")).process().uniqueResult(0);
JSONObject regionIn = new JSONObject();
regionIn.put("id", IdUtil.getSnowflake(1L, 1L).nextId());
regionIn.put("cCode", CodeUtil.getNewCode("IN_STORE_CODE"));
regionIn.put("dDate", DateUtil.today());
regionIn.put("cVouchType", regionInType.label());
String material_code = detail.getString("material_code");
String cMocode = material_code.substring(11, 16);
regionIn.put("cMocode", cMocode);
regionIn.put("cInvCode", regionInType.value() + material_code);
int qty = detail.getIntValue("qty");
regionIn.put("iNum", qty);
double material_weight = detail.getDoubleValue("material_weight") / 1000;
regionIn.put("iinvexchrate", String.format("%.3f", material_weight));
regionIn.put("iQuantity", String.format("%.3f", qty * material_weight / 1000));
regionIn.put("cBatch", cMocode);
return regionIn;
}
public static JSONObject buildRegionOut(JSONObject task, RegionOutType regionOutType) {
JSONObject detail = WQL.getWO("TASK_UTILS").addParam("flag", "1").addParam("vd_id", task.getString("group_id")).process().uniqueResult(0);
JSONObject regionIn = new JSONObject();
regionIn.put("id", IdUtil.getSnowflake(1L, 1L).nextId());
regionIn.put("cCode", CodeUtil.getNewCode("IN_STORE_CODE"));
regionIn.put("dDate", DateUtil.today());
String material_code = detail.getString("material_code");
String cMocode = material_code.substring(11, 16);
regionIn.put("cMocode", cMocode);
regionIn.put("cInvCode", regionOutType.value() + material_code);
regionIn.put("iQuantity", String.format("%.3f", detail.getDoubleValue("vd_weight") / 1000));
regionIn.put("iNum", detail.getString("qty"));
regionIn.put("iinvexchrate", String.format("%.3f", detail.getDoubleValue("material_weight") / 1000));
regionIn.put("cBatch", cMocode);
return regionIn;
}
} }

71
lms/nladmin-system/src/main/java/org/nl/wms/sch/task/util/wql/TASK_UTILS.wql

@ -0,0 +1,71 @@
[交易说明]
交易名: 任务工具类
所属模块:
功能简述:
版权所有:
表引用:
版本经历:
[数据库]
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
[IO定义]
#################################################
## 表字段对应输入参数
#################################################
输入.flag TYPEAS s_string
输入.vd_id TYPEAS f_string
输入.workorder_id TYPEAS f_string
[临时表]
--这边列出来的临时表就会在运行期动态创建
[临时变量]
--所有中间过程变量均可在此处定义
[业务过程]
##########################################
# 1、输入输出检查 #
##########################################
##########################################
# 2、主过程前处理 #
##########################################
##########################################
# 3、业务主过程 #
##########################################
IF 输入.flag = "1"
QUERY
SELECT
vd.qty,
vd.weight AS vd_weight,
material.weight AS material_weight,
material.material_code
FROM
st_ivt_vehicle_detail vd
LEFT JOIN md_me_materialbase material ON vd.material_id = material.material_id
WHERE
vd.vd_id = 输入.vd_id
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "2"
QUERY
SELECT
workorder.unqualified_qty AS qty,
material.material_code AS material_code,
material.weight AS material_weight
FROM
pdm_bd_workorder workorder
LEFT JOIN md_me_materialbase material ON workorder.material_id = material.material_id
WHERE
workorder.vd_id = 输入.workorder_id
ENDSELECT
ENDQUERY
ENDIF

BIN
lms/nladmin-system/src/main/java/org/nl/wms/wms.xls

Binary file not shown.

14
lms/nladmin-ui/src/views/wms/basedata/material/index.vue

@ -22,7 +22,17 @@
</el-form> </el-form>
</div> </div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'--> <!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" /> <crudOperation :permission="permission">
<el-button
slot="right"
type="primary"
class="filter-item"
icon="el-icon-download"
@click="synchronize()"
>
同步
</el-button>
</crudOperation>
<!--表单组件--> <!--表单组件-->
<el-dialog <el-dialog
:close-on-click-modal="false" :close-on-click-modal="false"
@ -161,7 +171,7 @@
> >
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" /> <el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
<el-table-column prop="order_code" label="订单编码" :min-width="flexWidth('order_code',crud.data,'订单编码')" /> <el-table-column prop="order_code" label="订单编码" :min-width="flexWidth('order_code',crud.data,'订单编码')" />
<el-table-column prop="product_grade" label="部位" :min-width="flexWidth('weight',crud.data,'部位')" /> <el-table-column prop="product_grade" label="部位" :min-width="flexWidth('product_grade',crud.data,'部位')" />
<el-table-column prop="furnace" label="炉型" :min-width="flexWidth('furnace',crud.data,'炉型')" /> <el-table-column prop="furnace" label="炉型" :min-width="flexWidth('furnace',crud.data,'炉型')" />
<el-table-column prop="brick_type" label="砖型" :min-width="flexWidth('brick_type',crud.data,'砖型')" /> <el-table-column prop="brick_type" label="砖型" :min-width="flexWidth('brick_type',crud.data,'砖型')" />
<el-table-column prop="material_brick_type" label="类别" :min-width="flexWidth('material_brick_type',crud.data,'类别')" /> <el-table-column prop="material_brick_type" label="类别" :min-width="flexWidth('material_brick_type',crud.data,'类别')" />

16
lms/nladmin-ui/src/views/wms/pdm/workerorder/hl/index.vue

@ -133,6 +133,19 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="12">
<el-form-item label="计划生产日期" prop="plan_date">
<el-date-picker
v-model="form.plan_date"
style="width: 300px"
value-format="yyyy-MM-dd"
type="date"
placeholder="选择日期"
/>
</el-form-item>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="是否加急" prop="is_urgent"> <el-form-item label="是否加急" prop="is_urgent">
@ -295,7 +308,8 @@ const defaultForm = {
ext_code: null, ext_code: null,
qualified_qty: '0', qualified_qty: '0',
unqualified_qty: '0', unqualified_qty: '0',
region_code: null region_code: null,
plan_date: null
} }
export default { export default {
name: 'HLWorkorder', name: 'HLWorkorder',

111
lms/nladmin-ui/src/views/wms/pdm/workerorder/index.vue

@ -129,14 +129,27 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="计划数量" prop="plan_qty"> <el-form-item label="计划数量" prop="plan_qty">
<el-input v-model="form.plan_qty" :disabled="crud.status.edit" type="number" style="width: 300px"><i slot="suffix" style="font-style:normal;margin-right: 10px;"></i></el-input> <el-input v-model="form.plan_qty" :disabled="crud.status.edit" type="number" style="width: 300px"><i
slot="suffix"
style="font-style:normal;margin-right: 10px;"
></i></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item v-show="typeof (form.region_code) === 'string' && form.region_code === 'FJ'" label="木托盘类型" prop="vehicle_type"> <el-form-item
<el-select v-model="form.vehicle_type" :disabled="crud.status.edit" style="width: 300px" filterable placeholder="请选择"> v-show="typeof (form.region_code) === 'string' && form.region_code === 'FJ'"
label="木托盘类型"
prop="vehicle_type"
>
<el-select
v-model="form.vehicle_type"
:disabled="crud.status.edit"
style="width: 300px"
filterable
placeholder="请选择"
>
<el-option <el-option
v-for="item in dict.wood_vehicle_type" v-for="item in dict.wood_vehicle_type"
:key="item.id" :key="item.id"
@ -147,6 +160,19 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="12">
<el-form-item label="计划生产日期" prop="plan_date">
<el-date-picker
v-model="form.plan_date"
style="width: 300px"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
/>
</el-form-item>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="是否加急" prop="is_urgent"> <el-form-item label="是否加急" prop="is_urgent">
@ -180,19 +206,35 @@
> >
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column v-if="false" prop="workorder_id" label="生产班次工单标识" /> <el-table-column v-if="false" prop="workorder_id" label="生产班次工单标识" />
<el-table-column prop="workorder_code" label="工单编号" :min-width="flexWidth('workorder_code',crud.data,'工单编号')"> <el-table-column
prop="workorder_code"
label="工单编号"
:min-width="flexWidth('workorder_code',crud.data,'工单编号')"
>
<!-- <template slot-scope="scope">--> <!-- <template slot-scope="scope">-->
<!-- <el-link type="warning" @click="toView(scope.row)">{{ scope.row.produceorder_code }}</el-link>--> <!-- <el-link type="warning" @click="toView(scope.row)">{{ scope.row.produceorder_code }}</el-link>-->
<!-- </template>--> <!-- </template>-->
</el-table-column> </el-table-column>
<el-table-column prop="order_status" label="工单状态" :min-width="flexWidth('order_status',crud.data,'工单状态')"> <el-table-column
prop="order_status"
label="工单状态"
:min-width="flexWidth('order_status',crud.data,'工单状态')"
>
<template slot-scope="scope"> <template slot-scope="scope">
{{ dict.label.pdm_workorder_status[scope.row.order_status] }} {{ dict.label.pdm_workorder_status[scope.row.order_status] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="device_name" label="设备" :min-width="flexWidth('device_name',crud.data,'设备')" /> <el-table-column prop="device_name" label="设备" :min-width="flexWidth('device_name',crud.data,'设备')" />
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" /> <el-table-column
<el-table-column prop="vehicle_type" label="载具类型" :min-width="flexWidth('vehicle_type',crud.data,'载具类型')"> prop="material_code"
label="物料编码"
:min-width="flexWidth('material_code',crud.data,'物料编码')"
/>
<el-table-column
prop="vehicle_type"
label="载具类型"
:min-width="flexWidth('vehicle_type',crud.data,'载具类型')"
>
<template slot-scope="scope"> <template slot-scope="scope">
{{ dict.label.vehicle_type[scope.row.vehicle_type] }} {{ dict.label.vehicle_type[scope.row.vehicle_type] }}
</template> </template>
@ -208,15 +250,43 @@
{{ dict.label.true_or_false[scope.row.is_pri] }} {{ dict.label.true_or_false[scope.row.is_pri] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="realproducestart_date" label="实际开始时间" :min-width="flexWidth('realproducestart_date',crud.data,'实际开始时间')" /> <el-table-column
<el-table-column prop="realproduceend_date" label="实际结束时间" :min-width="flexWidth('realproduceend_date',crud.data,'实际结束时间')" /> prop="realproducestart_date"
label="实际开始时间"
:min-width="flexWidth('realproducestart_date',crud.data,'实际开始时间')"
/>
<el-table-column
prop="realproduceend_date"
label="实际结束时间"
:min-width="flexWidth('realproduceend_date',crud.data,'实际结束时间')"
/>
<el-table-column prop="real_qty" label="实际数量" :min-width="flexWidth('real_qty',crud.data,'实际数量')" /> <el-table-column prop="real_qty" label="实际数量" :min-width="flexWidth('real_qty',crud.data,'实际数量')" />
<el-table-column prop="qualified_qty" label="合格数量" :min-width="flexWidth('qualified_qty',crud.data,'合格数量')" /> <el-table-column
<el-table-column prop="unqualified_qty" label="不合格数量" :min-width="flexWidth('unqualified_qty',crud.data,'不合格数量')" /> prop="qualified_qty"
label="合格数量"
:min-width="flexWidth('qualified_qty',crud.data,'合格数量')"
/>
<el-table-column
prop="unqualified_qty"
label="不合格数量"
:min-width="flexWidth('unqualified_qty',crud.data,'不合格数量')"
/>
<el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'创建人')" /> <el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'创建人')" />
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" /> <el-table-column
<el-table-column prop="update_optname" label="修改人" :min-width="flexWidth('update_optname',crud.data,'修改人')" /> prop="create_time"
<el-table-column prop="update_time" label="修改时间" :min-width="flexWidth('update_time',crud.data,'修改时间')" /> label="创建时间"
:min-width="flexWidth('create_time',crud.data,'创建时间')"
/>
<el-table-column
prop="update_optname"
label="修改人"
:min-width="flexWidth('update_optname',crud.data,'修改人')"
/>
<el-table-column
prop="update_time"
label="修改时间"
:min-width="flexWidth('update_time',crud.data,'修改时间')"
/>
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right"> <el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<udOperation <udOperation
@ -230,7 +300,12 @@
<pagination /> <pagination />
</div> </div>
<MaterDtl :dialog-show.sync="materialShow" :is-single="true" @setMaterValue="setMaterValue" /> <MaterDtl :dialog-show.sync="materialShow" :is-single="true" @setMaterValue="setMaterValue" />
<DeviceDialog :dialog-show.sync="deviceShow" :is-single="true" :region-str="'(\'YZ\')'" @tableChanged="tableChanged" /> <DeviceDialog
:dialog-show.sync="deviceShow"
:is-single="true"
:region-str="'(\'YZ\')'"
@tableChanged="tableChanged"
/>
<ViewDialog ref="child3" /> <ViewDialog ref="child3" />
<!--表单组件--> <!--表单组件-->
<el-dialog <el-dialog
@ -338,7 +413,8 @@ const defaultForm = {
ext_code: null, ext_code: null,
qualified_qty: '0', qualified_qty: '0',
unqualified_qty: '0', unqualified_qty: '0',
region_code: null region_code: null,
plan_date: null
} }
export default { export default {
name: 'Produceshiftorder', name: 'Produceshiftorder',
@ -391,6 +467,9 @@ export default {
], ],
is_pri: [ is_pri: [
{ required: true, message: '是否优先包装不能为空', trigger: 'blur' } { required: true, message: '是否优先包装不能为空', trigger: 'blur' }
],
plan_date: [
{ required: true, message: '计划生产日期不能为空', trigger: 'blur' }
] ]
} }
} }

5
lms/nladmin-ui/src/views/wms/pub/MaterDialog.vue

@ -19,6 +19,7 @@
<el-input <el-input
v-model="query.name" v-model="query.name"
clearable clearable
style="width: 200px;"
placeholder="物料编码" placeholder="物料编码"
@keyup.enter.native="crud.toQuery" @keyup.enter.native="crud.toQuery"
/> />
@ -27,6 +28,7 @@
<el-input <el-input
v-model="query.order_code" v-model="query.order_code"
clearable clearable
style="width: 200px;"
placeholder="订单编码" placeholder="订单编码"
@keyup.enter.native="crud.toQuery" @keyup.enter.native="crud.toQuery"
/> />
@ -35,6 +37,7 @@
<el-input <el-input
v-model="query.product_grade" v-model="query.product_grade"
clearable clearable
style="width: 200px;"
placeholder="部位" placeholder="部位"
@keyup.enter.native="crud.toQuery" @keyup.enter.native="crud.toQuery"
/> />
@ -64,7 +67,7 @@
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" /> <el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
<el-table-column prop="order_code" label="订单编码" :min-width="flexWidth('order_code',crud.data,'订单编码')" /> <el-table-column prop="order_code" label="订单编码" :min-width="flexWidth('order_code',crud.data,'订单编码')" />
<el-table-column prop="product_grade" label="部位" :min-width="flexWidth('product_grade',crud.data,'部位')" /> <el-table-column prop="product_grade" label="部位" :min-width="flexWidth('product_grade',crud.data,'部位')" />
<el-table-column prop="brick" label="砖型" :min-width="flexWidth('brick',crud.data,'砖型')" /> <el-table-column prop="brick_type" label="砖型" :min-width="flexWidth('brick_type',crud.data,'砖型')" />
</el-table> </el-table>
<!--分页组件--> <!--分页组件-->
<pagination /> <pagination />

Loading…
Cancel
Save