Browse Source

fix: 晟华二期手持部分

modify-1
李永德 5 months ago
parent
commit
c84b5095ed
  1. 58
      lms/nladmin-system/src/main/java/org/nl/wms/pda/rest/PdaController.java
  2. 46
      lms/nladmin-system/src/main/java/org/nl/wms/pda/service/PdaService.java
  3. 127
      lms/nladmin-system/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java
  4. 14
      lms/nladmin-system/src/main/java/org/nl/wms/pda/util/PdaUtils.java
  5. 17
      lms/nladmin-system/src/main/java/org/nl/wms/pda/wql/PDA.wql
  6. 1
      lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/dto/WorkorderDto.java
  7. 15
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/HLSendMaterialTask.java
  8. 17
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/YZSendMaterialTask.java
  9. BIN
      lms/nladmin-system/src/main/java/org/nl/wms/wms.xls
  10. 14
      lms/nladmin-ui/src/views/wms/pdm/workerorder/hl/index.vue
  11. 11
      lms/nladmin-ui/src/views/wms/pdm/workerorder/index.vue

58
lms/nladmin-system/src/main/java/org/nl/wms/pda/rest/PdaController.java

@ -466,4 +466,62 @@ public class PdaController {
pdaService.samplingCountNum(param);
return PdaUtils.buildSuccessResultJSON(null);
}
// ====================================================================
@PostMapping("/manual/loamCompare/list")
@Log("搬运点位下拉框")
@ApiOperation("搬运点位下拉框")
@PdaAnnotation
public JSONObject getLoamComparePointList() {
return PdaUtils.buildSuccessResultJSON(pdaService.getLoamComparePointList());
}
@PostMapping("/manual/loamCompare/doCheck")
@Log("校验任务与组盘是否一致")
@ApiOperation("校验任务与组盘是否一致")
@PdaAnnotation
public JSONObject getLoamCompareDoCheck(@RequestBody JSONObject param) {
return PdaUtils.buildSuccessResultWithMessage(pdaService.getLoamCompareDoCheck(param));
}
// ====================================================================
@PostMapping("/manual/updateInfo/getInfo")
@Log("根据载具编码获取组盘信息")
@ApiOperation("根据载具编码获取组盘信息")
@PdaAnnotation
public JSONObject getGroupInfoByVehicleCode(@RequestBody JSONObject param) {
return PdaUtils.buildSuccessResultJSON(pdaService.getGroupInfoByVehicleCode(param));
}
@PostMapping("/manual/updateInfo/updateWeight")
@Log("修改料盅重量")
@ApiOperation("修改料盅重量")
@PdaAnnotation
public JSONObject doUpdateWeight(@RequestBody JSONObject param) {
pdaService.doUpdateWeight(param);
return PdaUtils.buildSuccessResultJSON(null);
}
// ====================================================================
@PostMapping("/manual/updateInfo/updateQty")
@Log("修改重量/数量")
@ApiOperation("修改重量/数量")
@PdaAnnotation
public JSONObject doUpdateQty(@RequestBody JSONObject param) {
pdaService.doUpdateQty(param);
return PdaUtils.buildSuccessResultJSON(null);
}
// ====================================================================
@PostMapping("/manual/unbindVehicle/checkHaveMaterial")
@Log("校验托盘是否有货")
@ApiOperation("校验托盘是否有货")
@PdaAnnotation
public JSONObject checkHaveMaterial(@RequestBody JSONObject param) {
return PdaUtils.buildSuccessResultJSON(pdaService.checkHaveMaterial(param));
}
@PostMapping("/manual/unbindVehicle/doUnbindVehicle")
@Log("解绑托盘信息")
@ApiOperation("解绑托盘信息")
@PdaAnnotation
public JSONObject doUnbindVehicle(@RequestBody JSONObject param) {
pdaService.doUnbindVehicle(param);
return PdaUtils.buildSuccessResultWithMessage("成功解绑");
}
}

46
lms/nladmin-system/src/main/java/org/nl/wms/pda/service/PdaService.java

@ -262,4 +262,50 @@ public interface PdaService {
* @return /
*/
JSONArray kilnMoveCreateTaskShow();
/**
* 获取泥料比对的点位列表
* @return /
*/
JSONArray getLoamComparePointList();
/**
* 校验任务与组盘是否一致
* @param param /
* @return /
*/
String getLoamCompareDoCheck(JSONObject param);
/**
* 查询数据
* @param param /
* @return /
*/
JSONObject getGroupInfoByVehicleCode(JSONObject param);
/**
* 更新料盅重量
* @param param /
* @return /
*/
void doUpdateWeight(JSONObject param);
/**
* 修改重量/数量
* @param param /
*/
void doUpdateQty(JSONObject param);
/**
* 校验托盘是否有货
* @param param /
* @return /
*/
JSONObject checkHaveMaterial(JSONObject param);
/**
* 校验托盘是否有货
* @param param /
*/
void doUnbindVehicle(JSONObject param);
}

127
lms/nladmin-system/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java

@ -18,6 +18,8 @@ import org.nl.wms.basedata.eum.StandStatus;
import org.nl.wms.basedata.eum.TrueOrFalse;
import org.nl.wms.basedata.eum.VehicleType;
import org.nl.wms.common.PickType;
import org.nl.wms.das.service.GroupUpdateRecordService;
import org.nl.wms.das.service.dto.GroupUpdateRecordDto;
import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.nl.wms.pda.service.PdaService;
import org.nl.wms.sch.manage.*;
@ -69,6 +71,8 @@ public class PdaServiceImpl implements PdaService {
private final WmsToAcsService wmsToAcsService;
private final GroupUpdateRecordService groupUpdateRecordService;
@Override
public JSONArray region(String func) {
switch (func) {
@ -1195,4 +1199,127 @@ public class PdaServiceImpl implements PdaService {
public JSONArray kilnMoveCreateTaskShow() {
return this.getTaskList(TaskType.PDA_VEHICLE_TRANSFER.value());
}
@Override
public JSONArray getLoamComparePointList() {
return getPositionList();
}
@Override
public String getLoamCompareDoCheck(JSONObject param) {
// param: point_code、vehicle_code
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");
JSONObject taskObj = taskTab.query("point_code2 = '" + param.getString("point_code") + "' AND point_type = '" +
TaskType.PDA_PRESS_UP.value() + "'", "update_time desc").uniqueResult(0);
if (taskObj.getString("vehicle_code").equals(param.getString("vehicle_code"))) {
return "检测符合!";
}
return "检测不符合!";
}
@Override
public JSONObject getGroupInfoByVehicleCode(JSONObject param) {
// param: vehicle_code, vehicle_type
JSONObject info = WQL.getWO("PDA")
.addParam("flag", "10")
.addParam("vehicle_code", param.getString("vehicle_code"))
.addParam("vehicle_type", param.getString("vehicle_type"))
.process()
.uniqueResult(0);
if (ObjectUtil.isEmpty(info)) {
throw new BadRequestException("托盘:[" + param.getString("vehicle_code") + "]的组盘信息不存在!");
}
return info;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void doUpdateWeight(JSONObject param) {
// param: vehicle_code, vehicle_type, current_weight
// 更新、记录信息
WQLObject vdTab = WQLObject.getWQLObject("st_ivt_vehicle_detail");
JSONObject info = vdTab.query("vehicle_code = '" + param.getString("vehicle_code") + "' AND vehicle_type = '" +
param.getString("vehicle_type") + "' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(info)) {
throw new BadRequestException("托盘:[" + param.getString("vehicle_code") + "]的组盘信息不存在!");
}
// 插入记录
GroupUpdateRecordDto dto = new GroupUpdateRecordDto();
dto.setGroup_id(info.getString("vd_id"));
dto.setOrign_weight(info.getString("weight"));
dto.setCurrent_weight(param.getString("current_weight"));
dto.setVehicle_code(param.getString("vehicle_code"));
dto.setVehicle_type(param.getString("vehicle_type"));
dto.setUpdate_type("1");
groupUpdateRecordService.create(dto);
info.put("weight", param.getString("current_weight"));
TaskUtils.addCurrentUpdateColum(info);
vdTab.update(info);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void doUpdateQty(JSONObject param) {
// param: vehicle_code, vehicle_type, current_weight,current_qty
// 更新、记录信息
WQLObject vdTab = WQLObject.getWQLObject("st_ivt_vehicle_detail");
JSONObject info = vdTab.query("vehicle_code = '" + param.getString("vehicle_code") + "' AND vehicle_type = '" +
param.getString("vehicle_type") + "' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(info)) {
throw new BadRequestException("托盘:[" + param.getString("vehicle_code") + "]的组盘信息不存在!");
}
// 获取重量
BigDecimal currentWeight = param.getBigDecimal("current_weight");
// 获取数量
BigDecimal currentQty = param.getBigDecimal("current_qty");
if (ObjectUtil.isEmpty(currentQty)) {
currentQty = info.getBigDecimal("weight");
}
// 插入记录
GroupUpdateRecordDto dto = new GroupUpdateRecordDto();
dto.setGroup_id(info.getString("vd_id"));
dto.setOrign_weight(info.getString("weight"));
dto.setCurrent_weight(String.valueOf(currentWeight.multiply(currentQty)));
dto.setOrign_qty(info.getString("qty"));
dto.setCurrent_qty(param.getString("current_qty"));
dto.setVehicle_code(param.getString("vehicle_code"));
dto.setVehicle_type(param.getString("vehicle_type"));
dto.setUpdate_type(
(ObjectUtil.isEmpty(param.getString("current_weight")) && ObjectUtil.isNotEmpty(param.getString("current_qty")))
? "2" :
(ObjectUtil.isNotEmpty(param.getString("current_weight")) && ObjectUtil.isNotEmpty(param.getString("current_qty")))
? "3" : "1");
groupUpdateRecordService.create(dto);
info.put("weight", param.getString("current_weight"));
TaskUtils.addCurrentUpdateColum(info);
vdTab.update(info);
}
@Override
public JSONObject checkHaveMaterial(JSONObject param) {
JSONObject res = new JSONObject();
// param: vehicle_code, vehicle_type
WQLObject vdTab = WQLObject.getWQLObject("st_ivt_vehicle_detail");
JSONObject info = vdTab.query("vehicle_code = '" + param.getString("vehicle_code") + "' AND vehicle_type = '" +
param.getString("vehicle_type") + "' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(info)) {
res.put("message", "该托盘系统中无组盘信息!");
return res;
}
res.put("message", "该托盘系统中存在组盘信息,如需解绑,请点击确认!");
return res;
}
@Override
public void doUnbindVehicle(JSONObject param) {
WQLObject vdTab = WQLObject.getWQLObject("st_ivt_vehicle_detail");
JSONObject info = vdTab.query("vehicle_code = '" + param.getString("vehicle_code") + "' AND vehicle_type = '" +
param.getString("vehicle_type") + "' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(info)) {
throw new BadRequestException("托盘:[" + param.getString("vehicle_code") + "]的组盘信息不存在!");
}
info.put("is_delete", "1");
TaskUtils.addCurrentUpdateColum(info);
vdTab.update(info);
}
}

14
lms/nladmin-system/src/main/java/org/nl/wms/pda/util/PdaUtils.java

@ -3,6 +3,8 @@ package org.nl.wms.pda.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import javax.validation.constraints.NotNull;
/**
* 辽宁晟华手持工具类
*
@ -26,6 +28,18 @@ public final class PdaUtils {
return resultJSON;
}
/**
* 调用成功返回String
* @param result /
* @return /
*/
public static JSONObject buildSuccessResultWithMessage(@NotNull String result) {
JSONObject resultJSON = new JSONObject();
resultJSON.put("code", "1");
resultJSON.put("desc", result);
return resultJSON;
}
/**
* 服务层调用方法
* 创建操作失败的 JSONObject

17
lms/nladmin-system/src/main/java/org/nl/wms/pda/wql/PDA.wql

@ -18,6 +18,8 @@
输入.region_code TYPEAS s_string
输入.handle_class TYPEAS s_string
输入.task_type TYPEAS s_string
输入.vehicle_code TYPEAS s_string
输入.vehicle_type TYPEAS s_string
输入.point_type TYPEAS f_string
输入.types TYPEAS f_string
@ -203,3 +205,18 @@
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "10"
QUERY
SELECT
vd.qty,
vd.weight,
mm.material_code,
mm.weight AS single_weight,
mm.material_brick_type
FROM
`st_ivt_vehicle_detail` vd
LEFT JOIN md_me_materialbase mm ON vd.material_id = mm.material_id
WHERE vd.vehicle_code = 输入.vehicle_code AND vd.vehicle_type = 输入.vehicle_type AND vd.is_delete = '0'
ENDSELECT
ENDQUERY
ENDIF

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

@ -112,4 +112,5 @@ public class WorkorderDto implements Serializable {
private String region_code;
private String plan_date;
private String is_auto;
}

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

@ -81,6 +81,7 @@ public class HLSendMaterialTask extends AbstractAcsTask {
@Override
public void findNextPoint() {
WQLObject task_table = WQLObject.getWQLObject("sch_base_task");
WQLObject vdTable = WQLObject.getWQLObject("st_ivt_vehicle_detail");
JSONArray tasks = task_table
.query("is_delete = '0' AND task_status = '" + TaskStatus.SURE_START.value() + "' AND handle_class = '" + HLSendMaterialTask.class.getName() + "'", "priority DESC, create_time ASC")
.getResultJSONArray(0);
@ -94,6 +95,20 @@ public class HLSendMaterialTask extends AbstractAcsTask {
JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0);
JSONObject point2 = null;
JSONObject workorder = WQL.getWO("SEND_MATERIAL_TASK").addParam("flag", "8").addParam("vd_id", task.getString("group_id")).process().uniqueResult(0);
// 此处判断是否不需要AGV,如果不需要直接创建人工任务,todo 状态目前设置完成。。。
if ("0".equals(workorder.getString("is_auto"))) {
task.put("task_status", TaskStatus.FINISHED.value());
task.put("point_code2", "KLXNK");
task.put("remark", "");
TaskUtils.addAutoUpdateColum(task);
task_table.update(task);
// 为了库存,把点位编码设置成虚拟库
JSONObject pa = new JSONObject();
pa.put("point_code", "KLXNK");
TaskUtils.addAutoUpdateColum(pa);
vdTable.update(pa, "vd_id = '" + task.getString("group_id") + "'");
break;
}
if (ObjectUtil.isNotEmpty(point1)
&& "2".equals(point1.getString("point_type"))
&& ObjectUtil.isNotEmpty(workorder)

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

@ -79,6 +79,7 @@ public class YZSendMaterialTask extends AbstractAcsTask {
@Override
public void findNextPoint() {
WQLObject task_table = WQLObject.getWQLObject("sch_base_task");
WQLObject vdTable = WQLObject.getWQLObject("st_ivt_vehicle_detail");
JSONArray tasks = task_table
.query("is_delete = '0' AND task_status = '" + TaskStatus.SURE_START.value() + "' AND handle_class = '" + YZSendMaterialTask.class.getName() + "'", "priority DESC, create_time ASC")
.getResultJSONArray(0);
@ -89,6 +90,22 @@ public class YZSendMaterialTask extends AbstractAcsTask {
for (int i = 0; i < tasks.size(); i++) {
JSONObject task = tasks.getJSONObject(i);
// 获取工单
JSONObject workorder = WQL.getWO("SEND_MATERIAL_TASK").addParam("flag", "8").addParam("vd_id", task.getString("group_id")).process().uniqueResult(0);
if ("0".equals(workorder.getString("is_auto"))) {
task.put("task_status", TaskStatus.FINISHED.value());
task.put("point_code2", "YQXNK");
task.put("remark", "");
TaskUtils.addAutoUpdateColum(task);
task_table.update(task);
// 为了库存,把点位编码设置成虚拟库
JSONObject pa = new JSONObject();
pa.put("point_code", "YQXNK");
TaskUtils.addAutoUpdateColum(pa);
vdTable.update(pa, "vd_id = '" + task.getString("group_id") + "'");
break;
}
JSONObject point = WQL
.getWO("SEND_MATERIAL_TASK")
.addParam("flag", "1")

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

Binary file not shown.

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

@ -146,6 +146,14 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否自动呼叫AGV" prop="is_auto">
<el-radio v-model="form.is_auto" label="1"></el-radio>
<el-radio v-model="form.is_auto" label="0"></el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否加急" prop="is_urgent">
@ -310,7 +318,8 @@ const defaultForm = {
qualified_qty: '0',
unqualified_qty: '0',
region_code: null,
plan_date: null
plan_date: null,
is_auto: '1'
}
export default {
name: 'HLWorkorder',
@ -359,6 +368,9 @@ export default {
device_name: [
{ required: true, message: '生产设备不能为空', trigger: 'change' }
],
is_auto: [
{ required: true, message: '是否自动不能为空', trigger: 'blur' }
],
is_urgent: [
{ required: true, message: '是否加急不能为空', trigger: 'blur' }
],

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

@ -179,6 +179,14 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否自动呼叫AGV" prop="is_auto">
<el-radio v-model="form.is_auto" label="1"></el-radio>
<el-radio v-model="form.is_auto" label="0"></el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否加急" prop="is_urgent">
@ -449,7 +457,8 @@ const defaultForm = {
qualified_qty: '0',
unqualified_qty: '0',
region_code: null,
plan_date: null
plan_date: null,
is_auto: '1'
}
export default {
name: 'Produceshiftorder',

Loading…
Cancel
Save