|
|
@ -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); |
|
|
|
} |
|
|
|
} |
|
|
|