跳过困料暂存区 后端数据校验
This commit is contained in:
@@ -317,13 +317,13 @@ public class HfStationDeviceDriver extends AbstractOpcDeviceDriver implements De
|
|||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
//呼叫空盅
|
//呼叫空盅
|
||||||
if (!callEmptyRequireSucess && StrUtil.isNotEmpty(order)) {
|
if (!callEmptyRequireSucess && move == 0) {
|
||||||
callEmpty();
|
callEmpty();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
//满盅入库
|
//满盅入库
|
||||||
if (!fullInRequireSucess && StrUtil.isNotEmpty(order)) {
|
if (!fullInRequireSucess && move != 0) {
|
||||||
fullIn();
|
fullIn();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -69,6 +69,14 @@ public class WmsToAcsController {
|
|||||||
return new ResponseEntity<>(wmstoacsService.forceFinishFromWms(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(wmstoacsService.forceFinishFromWms(whereJson), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/queryGT04Status")
|
||||||
|
@Log("查询GT04状态")
|
||||||
|
@ApiOperation("查询GT04状态")
|
||||||
|
@SaIgnore
|
||||||
|
public ResponseEntity<Object> queryGT04Status() throws Exception {
|
||||||
|
return new ResponseEntity<>(wmstoacsService.queryGT04Status(), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,5 +41,5 @@ public interface WmsToAcsService {
|
|||||||
Map<String, Object> forceFinishFromWms(String jsonObject) throws Exception;
|
Map<String, Object> forceFinishFromWms(String jsonObject) throws Exception;
|
||||||
|
|
||||||
|
|
||||||
|
Map<String, Object> queryGT04Status();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -363,4 +363,11 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
return resultJson;
|
return resultJson;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> queryGT04Status() {
|
||||||
|
HfStationDeviceDriver gt04 = (HfStationDeviceDriver) deviceAppService.findDeviceByCode("GT04").getDeviceDriver();
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
result.put("GT04", gt04.getMode() != 0 && gt04.getMove() == 0);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,4 +57,6 @@ public interface WmsToAcsService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
JSONObject getPointStatus(JSONArray whereJson);
|
JSONObject getPointStatus(JSONArray whereJson);
|
||||||
|
|
||||||
|
JSONObject queryGT04Status();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -256,6 +256,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
String point_code = whereJson.getString("device_code");
|
String point_code = whereJson.getString("device_code");
|
||||||
String create_mode = whereJson.getString("create_mode");
|
String create_mode = whereJson.getString("create_mode");
|
||||||
String is_auto_issue = whereJson.getString("is_auto_issue");
|
String is_auto_issue = whereJson.getString("is_auto_issue");
|
||||||
|
StringBuilder barcode = new StringBuilder(whereJson.getString("barcode"));
|
||||||
|
|
||||||
if (ObjectUtil.isEmpty(type)) throw new BadRequestException("类型不能为空");
|
if (ObjectUtil.isEmpty(type)) throw new BadRequestException("类型不能为空");
|
||||||
if (ObjectUtil.isEmpty(point_code)) throw new BadRequestException("点位不能为空");
|
if (ObjectUtil.isEmpty(point_code)) throw new BadRequestException("点位不能为空");
|
||||||
@@ -282,6 +283,20 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
param.put("point_code1", point_code); // 满料位
|
param.put("point_code1", point_code); // 满料位
|
||||||
param.put("create_mode", create_mode);
|
param.put("create_mode", create_mode);
|
||||||
param.put("is_auto_issue", is_auto_issue);
|
param.put("is_auto_issue", is_auto_issue);
|
||||||
|
if (StrUtil.isNotEmpty(barcode.toString()) && !"0".equals(barcode.toString())) {
|
||||||
|
for (int i = barcode.length(); i < 4; i++) {
|
||||||
|
barcode.insert(0, "0");
|
||||||
|
}
|
||||||
|
JSONObject vehicle = new JSONObject() {{
|
||||||
|
put("vehicle_type", "1");
|
||||||
|
put("vehicle_code", barcode.toString());
|
||||||
|
}};
|
||||||
|
|
||||||
|
WQLObject.getWQLObject("sch_base_point")
|
||||||
|
.update(vehicle, "point_code = '" + point_code + "'");
|
||||||
|
WQLObject.getWQLObject("st_ivt_structivt")
|
||||||
|
.update(vehicle, "point_code = '" + point_code + "'");
|
||||||
|
}
|
||||||
HnjSendMaterialTask taskBean = SpringContextHolder.getBean(HnjSendMaterialTask.class);
|
HnjSendMaterialTask taskBean = SpringContextHolder.getBean(HnjSendMaterialTask.class);
|
||||||
taskBean.createTask(param); // 创建任务
|
taskBean.createTask(param); // 创建任务
|
||||||
} else if (StrUtil.equals(type, "3")) {
|
} else if (StrUtil.equals(type, "3")) {
|
||||||
@@ -323,14 +338,14 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
//Long material_id = null;
|
//Long material_id = null;
|
||||||
//首先判断条码变化的是不是第一个满料盅缓存位
|
//首先判断条码变化的是不是第一个满料盅缓存位
|
||||||
//如果是的话说明困料区来的 先去库存表查询对应的条码的物料信息 并将对应的物料信息保存在redis中
|
//如果是的话说明困料区来的 先去库存表查询对应的条码的物料信息 并将对应的物料信息保存在redis中
|
||||||
if (StrUtil.equals(is_first, "true")) {
|
// if (StrUtil.equals(is_first, "true")) {
|
||||||
JSONObject ivtJson = wo_ivt.query("vehicle_code = '" + barcode + "'").uniqueResult(0);
|
// JSONObject ivtJson = wo_ivt.query("vehicle_code = '" + barcode + "'").uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(ivtJson)) {
|
// if (ObjectUtil.isNotEmpty(ivtJson)) {
|
||||||
redisUtils.set(barcode, ivtJson.getString("material_id"));
|
// redisUtils.set(barcode, ivtJson.getString("material_id"));
|
||||||
redisUtils.set(barcode + "-ivt_qty", ivtJson.getString("ivt_qty"));
|
// redisUtils.set(barcode + "-ivt_qty", ivtJson.getString("ivt_qty"));
|
||||||
materialbaseDto = materialbaseService.findById(ivtJson.getLong("material_id"));
|
// materialbaseDto = materialbaseService.findById(ivtJson.getLong("material_id"));
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
Object redis_material_id = redisUtils.get(barcode);
|
Object redis_material_id = redisUtils.get(barcode);
|
||||||
String material_id = ObjectUtil.isEmpty(redis_material_id) ? null : String.valueOf(redis_material_id);
|
String material_id = ObjectUtil.isEmpty(redis_material_id) ? null : String.valueOf(redis_material_id);
|
||||||
Object redis_ivt_qty = redisUtils.get(barcode + "-ivt_qty");
|
Object redis_ivt_qty = redisUtils.get(barcode + "-ivt_qty");
|
||||||
|
|||||||
@@ -60,4 +60,9 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
return AcsUtil.notifyAcs(api, whereJson);
|
return AcsUtil.notifyAcs(api, whereJson);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject queryGT04Status() {
|
||||||
|
String api = "api/wms/queryGT04Status";
|
||||||
|
return AcsUtil.notifyAcs(api, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
package org.nl.wms.pda.inStruct.service.impl;
|
package org.nl.wms.pda.inStruct.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
|
import org.nl.modules.common.utils.RedisUtils;
|
||||||
import org.nl.modules.wql.WQL;
|
import org.nl.modules.wql.WQL;
|
||||||
|
import org.nl.wms.basedata.service.MaterialbaseService;
|
||||||
import org.nl.wms.basedata.service.VehicleService;
|
import org.nl.wms.basedata.service.VehicleService;
|
||||||
|
import org.nl.wms.basedata.service.dto.MaterialbaseDto;
|
||||||
import org.nl.wms.basedata.service.dto.VehicleDto;
|
import org.nl.wms.basedata.service.dto.VehicleDto;
|
||||||
import org.nl.wms.ext.acs.service.AcsToWmsService;
|
import org.nl.wms.ext.acs.service.AcsToWmsService;
|
||||||
import org.nl.wms.pda.inStruct.service.InStructService;
|
import org.nl.wms.pda.inStruct.service.InStructService;
|
||||||
@@ -24,6 +29,8 @@ public class InStructServiceImpl implements InStructService {
|
|||||||
private final AcsToWmsService acsToWmsService;
|
private final AcsToWmsService acsToWmsService;
|
||||||
private final KlzhcwUtil klzhcwUtil;
|
private final KlzhcwUtil klzhcwUtil;
|
||||||
private final VehicleService vehicleService;
|
private final VehicleService vehicleService;
|
||||||
|
private final RedisUtils redisUtils;
|
||||||
|
private final MaterialbaseService materialbaseService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject queryPoint() {
|
public JSONObject queryPoint() {
|
||||||
@@ -47,15 +54,35 @@ public class InStructServiceImpl implements InStructService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public JSONObject confirm(JSONObject param) {
|
public JSONObject confirm(JSONObject param) {
|
||||||
|
String vehicle_code = param.getString("carrier_code");
|
||||||
|
if (StrUtil.isNotBlank(vehicle_code)) {
|
||||||
|
throw new BadRequestException("载具号不能为空");
|
||||||
|
}
|
||||||
|
VehicleDto vehicle = vehicleService.findByCode(vehicle_code);
|
||||||
|
if (ObjectUtil.isNotEmpty(vehicle)) {
|
||||||
|
throw new BadRequestException("载具号不存在");
|
||||||
|
}
|
||||||
JSONObject map = new JSONObject();
|
JSONObject map = new JSONObject();
|
||||||
VehicleDto vehicle = vehicleService.findByCode(param.getString("carrier_code"));
|
|
||||||
String vehicle_type = "";
|
String vehicle_type = "";
|
||||||
if (ObjectUtil.isNotEmpty(vehicle)) {
|
if (ObjectUtil.isNotEmpty(vehicle)) {
|
||||||
vehicle_type = vehicle.getVehicle_type();
|
vehicle_type = vehicle.getVehicle_type();
|
||||||
}
|
}
|
||||||
map.put("vehicle_code", param.getString("carrier_code"));
|
String type = param.getString("type");
|
||||||
|
if ("2".equals(type)) {
|
||||||
|
String material_code = param.getString("material_code");
|
||||||
|
if (StrUtil.isBlank(material_code)) {
|
||||||
|
throw new BadRequestException("满盅必须选择物料编码");
|
||||||
|
}
|
||||||
|
MaterialbaseDto material = materialbaseService.findByCode(material_code);
|
||||||
|
if (ObjectUtil.isEmpty(material)) {
|
||||||
|
throw new BadRequestException("物料不存在");
|
||||||
|
}
|
||||||
|
redisUtils.set(vehicle_code, material.getMaterial_id());
|
||||||
|
redisUtils.set(vehicle_code + "-ivt_qty", "1");
|
||||||
|
map.put("material_code", material_code);
|
||||||
|
}
|
||||||
|
map.put("vehicle_code", vehicle_code);
|
||||||
map.put("vehicle_type", vehicle_type);
|
map.put("vehicle_type", vehicle_type);
|
||||||
map.put("material_code", param.getString("material_code"));
|
|
||||||
LinkedList<JSONObject> ll = MyLinkedListService.getLinkedList();
|
LinkedList<JSONObject> ll = MyLinkedListService.getLinkedList();
|
||||||
klzhcwUtil.judge(ll, map);
|
klzhcwUtil.judge(ll, map);
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
|
|||||||
@@ -1,10 +1,15 @@
|
|||||||
package org.nl.wms.pda.outStruct.service.impl;
|
package org.nl.wms.pda.outStruct.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
|
import org.nl.modules.common.utils.RedisUtils;
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
|
import org.nl.wms.basedata.service.VehicleService;
|
||||||
|
import org.nl.wms.basedata.service.dto.VehicleDto;
|
||||||
import org.nl.wms.pda.outStruct.service.OutStructService;
|
import org.nl.wms.pda.outStruct.service.OutStructService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -14,13 +19,26 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class OutStructServiceImpl implements OutStructService {
|
public class OutStructServiceImpl implements OutStructService {
|
||||||
|
|
||||||
|
private final RedisUtils redisUtils;
|
||||||
|
|
||||||
|
private final VehicleService vehicleService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public JSONObject confirm(JSONObject param) {
|
public JSONObject confirm(JSONObject param) {
|
||||||
String carrier_code = param.getString("carrier_code");
|
String vehicle_code = param.getString("carrier_code");
|
||||||
|
if (StrUtil.isNotBlank(vehicle_code)) {
|
||||||
|
throw new BadRequestException("载具号不能为空");
|
||||||
|
}
|
||||||
|
VehicleDto vehicle = vehicleService.findByCode(vehicle_code);
|
||||||
|
if (ObjectUtil.isNotEmpty(vehicle)) {
|
||||||
|
throw new BadRequestException("载具号不存在");
|
||||||
|
}
|
||||||
WQLObject wo = WQLObject.getWQLObject("ST_IVT_StructIvt");
|
WQLObject wo = WQLObject.getWQLObject("ST_IVT_StructIvt");
|
||||||
WQLObject wo_point = WQLObject.getWQLObject("sch_base_point");
|
WQLObject wo_point = WQLObject.getWQLObject("sch_base_point");
|
||||||
JSONObject jsonObject = wo.query("vehicle_code = '" + carrier_code + "'").uniqueResult(0);
|
redisUtils.del(vehicle_code);
|
||||||
|
redisUtils.del(vehicle_code + "-ivt_qty");
|
||||||
|
JSONObject jsonObject = wo.query("vehicle_code = '" + vehicle + "'").uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(jsonObject)){
|
if (ObjectUtil.isNotEmpty(jsonObject)){
|
||||||
jsonObject.put("vehicle_type","");
|
jsonObject.put("vehicle_type","");
|
||||||
jsonObject.put("vehicle_code","");
|
jsonObject.put("vehicle_code","");
|
||||||
@@ -32,7 +50,8 @@ public class OutStructServiceImpl implements OutStructService {
|
|||||||
jsonObject1.put("point_status","1");
|
jsonObject1.put("point_status","1");
|
||||||
jsonObject1.put("lock_type","1");
|
jsonObject1.put("lock_type","1");
|
||||||
jsonObject1.put("task_id","");
|
jsonObject1.put("task_id","");
|
||||||
jsonObject1.put("task_id","");
|
jsonObject1.put("vehicle_type", "");
|
||||||
|
jsonObject1.put("vehicle_code", "");
|
||||||
wo_point.update(jsonObject1);
|
wo_point.update(jsonObject1);
|
||||||
}
|
}
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ package org.nl.wms.pda.scanGroup;
|
|||||||
*/
|
*/
|
||||||
public enum HcwNumEnum {
|
public enum HcwNumEnum {
|
||||||
KLZHCQ(1, "KLZHCQ", 10),
|
KLZHCQ(1, "KLZHCQ", 10),
|
||||||
KLZCQ(2, "KLZCQ", 25),
|
KLZCQ(2, "KLZCQ", 26),
|
||||||
MLZZCQ(3, "MLZZCQ", 26),
|
MLZZCQ(3, "MLZZCQ", 26),
|
||||||
YLJQ(4, "YLJQ", 8),
|
YLJQ(4, "YLJQ", 8),
|
||||||
HNJQ(5, "HNJQ", 2),
|
HNJQ(5, "HNJQ", 2),
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ public class WorkorderServiceImpl implements WorkordeService {
|
|||||||
Long deptId = currentUser.getUser().getDeptId();
|
Long deptId = currentUser.getUser().getDeptId();
|
||||||
// String newCode = CodeUtil.getNewCode("PDM_SHIFTORDER");
|
// String newCode = CodeUtil.getNewCode("PDM_SHIFTORDER");
|
||||||
dto.setWorkorder_id(IdUtil.getSnowflake(1, 1).nextId());
|
dto.setWorkorder_id(IdUtil.getSnowflake(1, 1).nextId());
|
||||||
// dto.setWorkorder_code(newCode);
|
dto.setWorkorder_code(CodeUtil.getNewCode("PDM_SHIFTORDER"));
|
||||||
dto.setCreate_id(currentUserId);
|
dto.setCreate_id(currentUserId);
|
||||||
dto.setCreate_time(now);
|
dto.setCreate_time(now);
|
||||||
dto.setCreate_name(nickName);
|
dto.setCreate_name(nickName);
|
||||||
@@ -222,6 +222,8 @@ public class WorkorderServiceImpl implements WorkordeService {
|
|||||||
json.put("update_optname", nickName);
|
json.put("update_optname", nickName);
|
||||||
json.put("update_time", now);
|
json.put("update_time", now);
|
||||||
wo.update(json);
|
wo.update(json);
|
||||||
|
} else {
|
||||||
|
throw new BadRequestException(resp.get("message").toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,11 +9,13 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
|
import org.nl.modules.common.utils.RedisUtils;
|
||||||
import org.nl.modules.system.util.CodeUtil;
|
import org.nl.modules.system.util.CodeUtil;
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
import org.nl.modules.wql.util.SpringContextHolder;
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
import org.nl.wms.basedata.service.dto.MaterialbaseDto;
|
import org.nl.wms.basedata.service.dto.MaterialbaseDto;
|
||||||
import org.nl.wms.basedata.service.impl.MaterialbaseServiceImpl;
|
import org.nl.wms.basedata.service.impl.MaterialbaseServiceImpl;
|
||||||
|
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||||
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
|
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
|
||||||
import org.nl.wms.pda.scanGroup.KlzhcwUtil;
|
import org.nl.wms.pda.scanGroup.KlzhcwUtil;
|
||||||
import org.nl.wms.pda.scanGroup.MyLinkedListService;
|
import org.nl.wms.pda.scanGroup.MyLinkedListService;
|
||||||
@@ -228,6 +230,8 @@ public class HnjSendMaterialTask extends AbstractAcsTask {
|
|||||||
//1、查询未锁定,空料盅,空盅位暂存区的起始点位 如果有取空的点位 再判断取满时 是否有放货位
|
//1、查询未锁定,空料盅,空盅位暂存区的起始点位 如果有取空的点位 再判断取满时 是否有放货位
|
||||||
JSONObject json1 = pointTab.query("is_used = '1' AND is_delete = '0' AND lock_type = '1' AND point_status = '2' AND region_code = '" + RegionTypeEnum.KLZHCQ.getCode() + "'").uniqueResult(0);
|
JSONObject json1 = pointTab.query("is_used = '1' AND is_delete = '0' AND lock_type = '1' AND point_status = '2' AND region_code = '" + RegionTypeEnum.KLZHCQ.getCode() + "'").uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(json1)) {
|
if (ObjectUtil.isNotEmpty(json1)) {
|
||||||
|
JSONObject jsonObject = SpringContextHolder.getBean(WmsToAcsService.class).queryGT04Status();
|
||||||
|
if (jsonObject.getBoolean("GT04")) {
|
||||||
JSONObject json2 = pointTab.query("is_used = '1' AND is_delete = '0' AND lock_type = '1' AND point_status = '1' AND region_code = '" + RegionTypeEnum.GT1.getCode() + "'").uniqueResult(0);
|
JSONObject json2 = pointTab.query("is_used = '1' AND is_delete = '0' AND lock_type = '1' AND point_status = '1' AND region_code = '" + RegionTypeEnum.GT1.getCode() + "'").uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(json2)) {
|
if (ObjectUtil.isNotEmpty(json2)) {
|
||||||
//锁定取空任务的起点
|
//锁定取空任务的起点
|
||||||
@@ -260,6 +264,7 @@ public class HnjSendMaterialTask extends AbstractAcsTask {
|
|||||||
taskObj2.put("update_time", DateUtil.now());
|
taskObj2.put("update_time", DateUtil.now());
|
||||||
taskTab.update(taskObj2);
|
taskTab.update(taskObj2);
|
||||||
|
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
JSONObject json3 = pointTab.query("is_used = '1' AND is_delete = '0' AND lock_type = '1' AND point_status = '1' AND region_code = '" + RegionTypeEnum.KLZHCQ.getCode() + "' and point_code = 'KLZHC12'").uniqueResult(0);
|
JSONObject json3 = pointTab.query("is_used = '1' AND is_delete = '0' AND lock_type = '1' AND point_status = '1' AND region_code = '" + RegionTypeEnum.KLZHCQ.getCode() + "' and point_code = 'KLZHC12'").uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(json3)) {
|
if (ObjectUtil.isNotEmpty(json3)) {
|
||||||
@@ -360,11 +365,15 @@ public class HnjSendMaterialTask extends AbstractAcsTask {
|
|||||||
JSONObject taskObj1 = taskTab.query("is_delete='0' and point_code2 = '" + point_code1 + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
JSONObject taskObj1 = taskTab.query("is_delete='0' and point_code2 = '" + point_code1 + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(taskObj1)) throw new BadRequestException("当前点位" + point_code1 + "存在未完成的终点任务");
|
if (ObjectUtil.isNotEmpty(taskObj1)) throw new BadRequestException("当前点位" + point_code1 + "存在未完成的终点任务");
|
||||||
|
|
||||||
String device_code = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0).getString("point_code");
|
|
||||||
|
|
||||||
JSONObject workOrderObj = workOrderTab.query("device_code = '" + workDevice + "' and order_status = '3' and is_delete ='0'").uniqueResult(0);
|
JSONObject workOrderObj = workOrderTab.query("device_code = '" + workDevice + "' and order_status = '3' and is_delete ='0'").uniqueResult(0);
|
||||||
if (ObjectUtil.isEmpty(workOrderObj)) throw new BadRequestException("该设备当前未生产或者已删除");
|
if (ObjectUtil.isEmpty(workOrderObj)) throw new BadRequestException("该设备当前未生产或者已删除");
|
||||||
|
|
||||||
|
JSONObject point = pointTab.query("is_delete = '0' AND point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
|
String vehicle_code = point.getString("vehicle_code");
|
||||||
|
RedisUtils redisUtils = SpringContextHolder.getBean(RedisUtils.class);
|
||||||
|
redisUtils.set(vehicle_code, workOrderObj.getString("material_id"));
|
||||||
|
redisUtils.set(vehicle_code + "-ivt_qty", "1");
|
||||||
|
|
||||||
Long task_group_id = IdUtil.getLongId();
|
Long task_group_id = IdUtil.getLongId();
|
||||||
|
|
||||||
SchTaskDto emptyDto = SchTaskDto.builder()
|
SchTaskDto emptyDto = SchTaskDto.builder()
|
||||||
|
|||||||
@@ -139,8 +139,20 @@ public class StructivtServiceImpl implements StructivtService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void update(StructivtDto dto) {
|
public void update(StructivtDto dto) {
|
||||||
|
if (StrUtil.isNotBlank(dto.getVehicle_type()) && StrUtil.isBlank(dto.getVehicle_code())) {
|
||||||
|
throw new BadRequestException("请选择托盘编号");
|
||||||
|
}
|
||||||
|
if (StrUtil.isBlank(dto.getVehicle_type())
|
||||||
|
&& StrUtil.isBlank(dto.getVehicle_code())
|
||||||
|
&& ObjectUtil.isNotEmpty(dto.getMaterial_id())) {
|
||||||
|
throw new BadRequestException("选择物料编码必须选择托盘编号");
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotEmpty(dto.getVehicle_code())
|
||||||
|
&& ObjectUtil.isNotEmpty(dto.getMaterial_id())) {
|
||||||
|
redisUtils.set(dto.getVehicle_code(), dto.getMaterial_id().toString());
|
||||||
|
redisUtils.set(dto.getVehicle_code() + "-ivt_qty", "1");
|
||||||
|
}
|
||||||
WQLObject wo_point = WQLObject.getWQLObject("sch_base_point");
|
WQLObject wo_point = WQLObject.getWQLObject("sch_base_point");
|
||||||
System.out.println(dto.toString());
|
|
||||||
// 找主表获取之前的数据
|
// 找主表获取之前的数据
|
||||||
StructivtDto structivtDto = this.findById(dto.getStockrecord_id());
|
StructivtDto structivtDto = this.findById(dto.getStockrecord_id());
|
||||||
String region_code = structivtDto.getRegion_code();
|
String region_code = structivtDto.getRegion_code();
|
||||||
|
|||||||
@@ -129,13 +129,13 @@
|
|||||||
width="400px"
|
width="400px"
|
||||||
>
|
>
|
||||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px">
|
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px">
|
||||||
<el-row>
|
<!-- <el-row>-->
|
||||||
<el-col :span="16">
|
<!-- <el-col :span="16">-->
|
||||||
<el-form-item label="工单编号" prop="workorder_code">
|
<!-- <el-form-item label="工单编号" prop="workorder_code">-->
|
||||||
<el-input v-model="form.workorder_code" :disabled="crud.status.edit" style="width: 200px;" />
|
<!-- <el-input v-model="form.workorder_code" :disabled="crud.status.edit" style="width: 200px;" />-->
|
||||||
</el-form-item>
|
<!-- </el-form-item>-->
|
||||||
</el-col>
|
<!-- </el-col>-->
|
||||||
</el-row>
|
<!-- </el-row>-->
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<el-form-item label="物料编码" prop="material_code">
|
<el-form-item label="物料编码" prop="material_code">
|
||||||
@@ -462,9 +462,9 @@ export default {
|
|||||||
// produce_date: [
|
// produce_date: [
|
||||||
// { required: true, message: '生产日期不能为空', trigger: 'blur' }
|
// { required: true, message: '生产日期不能为空', trigger: 'blur' }
|
||||||
// ],
|
// ],
|
||||||
workorder_code: [
|
// workorder_code: [
|
||||||
{ required: true, message: '工单编号不能为空', trigger: 'change' }
|
// { required: true, message: '工单编号不能为空', trigger: 'change' }
|
||||||
],
|
// ],
|
||||||
plan_qty: [
|
plan_qty: [
|
||||||
{ required: true, message: '计划数量不能为空', trigger: 'change' }
|
{ required: true, message: '计划数量不能为空', trigger: 'change' }
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user