rev:表处优化

This commit is contained in:
2024-03-21 10:13:25 +08:00
parent d0b46cc42a
commit c1b6bee8f8
6 changed files with 98 additions and 30 deletions

View File

@@ -106,11 +106,11 @@ public class ProcessTask extends AbstractAcsTask {
String point_code2 = jsonTask.getString("point_code2");
String point_code4 = jsonTask.getString("point_code4");
String task_type = jsonTask.getString("task_type");
String container_name = jsonTask.getString("container_name");
if ("010701".equals(task_type)) {
//维护冷却区满轴点位的库存
JSONObject cool_jo1 = ivtTab.query("full_point_code = '" + point_code1 + "'").uniqueResult(0);
String container_name = cool_jo1.getString("container_name");
String full_vehicle_code = cool_jo1.getString("full_vehicle_code");
HashMap map = new HashMap();
map.put("container_name", "");
@@ -121,7 +121,6 @@ public class ProcessTask extends AbstractAcsTask {
String empty_vehicle_code = st_jo1.getString("up_scroll");
HashMap map2 = new HashMap();
map2.put("up_scroll", full_vehicle_code);
map2.put("up_pcsn", container_name);
stTab.update(map2, "point_code = '" + point_code2 + "'").uniqueResult(0);
//维护冷却区空轴点位的库存
HashMap map3 = new HashMap();
@@ -131,7 +130,6 @@ public class ProcessTask extends AbstractAcsTask {
if ("010702".equals(task_type)) {
//维护冷却区满轴点位的库存
JSONObject cool_jo1 = ivtTab.query("full_point_code = '" + point_code1 + "'").uniqueResult(0);
String container_name = cool_jo1.getString("container_name");
String full_vehicle_code = cool_jo1.getString("full_vehicle_code");
HashMap map = new HashMap();
map.put("container_name", "");
@@ -141,7 +139,6 @@ public class ProcessTask extends AbstractAcsTask {
//维护表处区点位
HashMap map2 = new HashMap();
map2.put("up_scroll", full_vehicle_code);
map2.put("up_pcsn", container_name);
stTab.update(map2, "up_point_code = '" + point_code2 + "'").uniqueResult(0);
}
if ("010703".equals(task_type)) {
@@ -150,7 +147,6 @@ public class ProcessTask extends AbstractAcsTask {
String empty_vehicle_code = st_jo1.getString("up_scroll");
HashMap map1 = new HashMap();
map1.put("up_scroll", "");
map1.put("up_pcsn", "");
stTab.update(map1, "point_code = '" + point_code1 + "'").uniqueResult(0);
//维护冷却区空轴点位的库存
HashMap map3 = new HashMap();
@@ -161,10 +157,8 @@ public class ProcessTask extends AbstractAcsTask {
//维护表处区点位
JSONObject st_jo1 = stTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
String full_vehicle_code = st_jo1.getString("up_scroll");
String container_name = st_jo1.getString("up_pcsn");
HashMap map1 = new HashMap();
map1.put("up_scroll", "");
map1.put("up_pcsn", "");
stTab.update(map1, "point_code = '" + point_code1 + "'").uniqueResult(0);
//维护冷却区空轴点位的库存
HashMap map3 = new HashMap();

View File

@@ -113,6 +113,13 @@ public class MesToLmsController {
return new ResponseEntity<>(mesToLmsService.sendProcessInfo(jo), HttpStatus.OK);
}
@PostMapping("/processFoilStart")
@Log("表处工单推送")
@SaIgnore
public ResponseEntity<Object> processFoilStart(@RequestBody JSONObject jo) {
return new ResponseEntity<>(mesToLmsService.processFoilStart(jo), HttpStatus.OK);
}
@PostMapping("/sendTargetHouse")
@Log("MES传递给LMS入线边库或者入成品库")

View File

@@ -63,6 +63,8 @@ public interface MesToLmsService {
JSONObject sendProcessInfo(JSONObject param);
JSONObject processFoilStart(JSONObject param);
/**
* MES传递给LMS入线边库或者入成品库
*/

View File

@@ -1471,7 +1471,8 @@ public class MesToLmsServiceImpl implements MesToLmsService {
public JSONObject sendProcessInfo(JSONObject param) {
log.info("sendProcessInfo输入参数为-------------------" + param.toString());
WQLObject coolIvtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区点位库存表
// 冷却区点位库存表
WQLObject coolIvtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt");
JSONObject resultParam = new JSONObject();
try {
@@ -1500,10 +1501,6 @@ public class MesToLmsServiceImpl implements MesToLmsService {
//上料
if ("1".equals(Type)) {
String up_scroll = device_jo.getString("up_scroll");
String up_pcsn = device_jo.getString("up_pcsn");
/*if (StrUtil.isNotEmpty(up_pcsn)) {
throw new BadRequestException("LMS系统上【" + ResourceName + "】表处机上还存在母卷号,不能进行上料!");
}*/
//查询母卷所在点位
JSONObject jsonCoolIvt = coolIvtTab.query("container_name = '" + containerName + "' and full_point_status = '02' and cool_ivt_status <> '04'").uniqueResult(0);
JSONObject form = new JSONObject();
@@ -1512,7 +1509,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
form.put("point_code1", jsonCoolIvt.getString("full_point_code"));
form.put("point_code2", device_jo.getString("up_point_code"));
form.put("task_type", "010702");
form.put("material_code", jsonCoolIvt.getString("container_name"));
form.put("material_code", containerName);
form.put("vehicle_code", jsonCoolIvt.getString("full_vehicle_code"));
form.put("product_area", device_jo.getString("product_area"));
} else {
@@ -1531,7 +1528,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
form.put("point_code4", jsonIvt.getString("empty_point_code"));
}
form.put("task_type", "010701");
form.put("material_code", jsonCoolIvt.getString("container_name"));
form.put("material_code", containerName);
form.put("vehicle_code", jsonCoolIvt.getString("full_vehicle_code"));
form.put("product_area", device_jo.getString("product_area"));
}
@@ -1549,7 +1546,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
//寻找可用的冷却区满轴点位
form.put("point_code2", jsonIvt.getString("full_point_code"));
form.put("task_type", "010704");
form.put("material_code", device_jo.getString("up_pcsn"));
form.put("material_code", containerName);
form.put("vehicle_code", device_jo.getString("up_scroll"));
form.put("product_area", device_jo.getString("product_area"));
processTask.createTask(form);
@@ -1568,6 +1565,89 @@ public class MesToLmsServiceImpl implements MesToLmsService {
return resultParam;
}
@Override
@Transactional(rollbackFor = Exception.class)
public JSONObject processFoilStart(JSONObject param) {
log.info("processFoilStart接口输入参数为-------------------" + param.toString());
String FoilContainerName = param.getString("FoilContainerName");
String TRContainerName = param.getString("TRContainerName");
String ResourceName = param.getString("ResourceName");
String MfgOrderName = param.getString("MfgOrderName");
String ProductName = param.getString("ProductName");
String Description = param.getString("Description");
String UpCoilerDate = param.getString("UpCoilerDate");
WQLObject pointTab = WQLObject.getWQLObject("st_ivt_stpointivt");
WQLObject orderTab = WQLObject.getWQLObject("PDM_BI_SurProcessOrder");
JSONObject result = new JSONObject();
try {
// 校验数据
if (ObjectUtil.isEmpty(FoilContainerName)) {
throw new BadRequestException("母卷号不能为空");
}
if (ObjectUtil.isEmpty(TRContainerName)) {
throw new BadRequestException("表处批次号不能为空");
}
if (ObjectUtil.isEmpty(ResourceName)) {
throw new BadRequestException("机台编码不能为空");
}
if (ObjectUtil.isEmpty(MfgOrderName)) {
throw new BadRequestException("生产工单不能为空");
}
if (ObjectUtil.isEmpty(ProductName)) {
throw new BadRequestException("产品编码不能为空");
}
if (ObjectUtil.isEmpty(Description)) {
throw new BadRequestException("产品名称不能为空");
}
if (ObjectUtil.isEmpty(UpCoilerDate)) {
throw new BadRequestException("开始时间不能为空");
}
JSONObject jsonPoint = pointTab.query("ext_code ='" + ResourceName + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonPoint)) {
jsonPoint = new JSONObject();
}
// 插入生箔工序工单表
JSONObject json = new JSONObject();
json.put("workorder_id", IdUtil.getSnowflake(1, 1).nextId());
json.put("foil_container_ame", FoilContainerName);
json.put("container_name", TRContainerName);
json.put("resource_name", ResourceName);
json.put("mfg_order_name", MfgOrderName);
json.put("product_name", ProductName);
json.put("description", Description);
json.put("up_coiler_date", UpCoilerDate);
json.put("product_area", jsonPoint.getString("product_area"));
json.put("point_code", jsonPoint.getString("point_code"));
json.put("realstart_time", DateUtil.now());
json.put("status", "01");
json.put("is_delete", "0");
json.put("productin_qty", 0);
json.put("create_id", "1");
json.put("create_name", "管理员");
json.put("create_time", DateUtil.now());
orderTab.insert(json);
// 返回成功
result.put("RTYPE", "S");
result.put("RTMSG", "操作成功!");
result.put("RTOAL", 1);
result.put("RTDAT", null);
} catch (Exception e) {
// 返回失败
result.put("RTYPE", "E");
result.put("RTMSG", "操作失败!" + e.getMessage());
result.put("RTOAL", 0);
result.put("RTDAT", null);
}
log.info("processFoilStart接口输出参数为-------------------" + result.toString());
return result;
}
@Override
public JSONObject sendTargetHouse(JSONObject param) {
log.info("sendTargetHouse输入参数为-------------------" + param.toString());

View File

@@ -131,7 +131,6 @@ import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import DateRangePicker from '@/components/DateRangePicker'
import crudMaterialbase from '@/views/wms/basedata/master/material/materialbase'
import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
const defaultForm = {
@@ -192,20 +191,6 @@ export default {
crudUserStor.getUserStor().then(res => {
this.storList = res
})
const param = {
'materOpt_code': '00'
}
/* crudMaterialbase.getMaterOptType(param).then(res => {
this.class_idStr = res.class_idStr
this.crud.query.class_idStr = res.class_idStr
this.queryClassId()
})*/
/* crudBucketrecord.getQualityList().then(res => {
this.QualityList = res
})
crudBucketrecord.getIvtList().then(res => {
this.IvtList = res
})*/
},
methods: {
// 钩子在获取表格数据之前执行false 则代表不获取数据