rev:修改表处问题

This commit is contained in:
zhouz
2024-04-29 09:34:10 +08:00
parent c76498597a
commit f3a03ae6ea
4 changed files with 31 additions and 15 deletions

View File

@@ -106,7 +106,7 @@ 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");
String container_name = jsonTask.getString("material_code");
if ("010701".equals(task_type)) {
//维护冷却区满轴点位的库存
@@ -115,9 +115,10 @@ public class ProcessTask extends AbstractAcsTask {
HashMap map = new HashMap();
map.put("container_name", "");
map.put("full_vehicle_code", "");
map.put("full_point_status", "01");
ivtTab.update(map, "full_point_code = '" + point_code1 + "'");
//维护表处区点位
JSONObject st_jo1 = stTab.query("point_code = '" + point_code2 + "'").uniqueResult(0);
JSONObject st_jo1 = stTab.query("up_point_code = '" + point_code2.split("_M")[0] + "'").uniqueResult(0);
String empty_vehicle_code = st_jo1.getString("up_scroll");
HashMap map2 = new HashMap();
map2.put("up_scroll", full_vehicle_code);
@@ -125,6 +126,7 @@ public class ProcessTask extends AbstractAcsTask {
//维护冷却区空轴点位的库存
HashMap map3 = new HashMap();
map3.put("empty_vehicle_code", empty_vehicle_code);
map3.put("empty_point_status", "02");
ivtTab.update(map3, "empty_point_code = '" + point_code4 + "'");
}
if ("010702".equals(task_type)) {
@@ -139,7 +141,7 @@ public class ProcessTask extends AbstractAcsTask {
//维护表处区点位
HashMap map2 = new HashMap();
map2.put("up_scroll", full_vehicle_code);
stTab.update(map2, "up_point_code = '" + point_code2 + "'").uniqueResult(0);
stTab.update(map2, "up_point_code = '" + point_code2.split("_K")[0] + "'").uniqueResult(0);
}
if ("010703".equals(task_type)) {
//维护表处区点位
@@ -151,19 +153,21 @@ public class ProcessTask extends AbstractAcsTask {
//维护冷却区空轴点位的库存
HashMap map3 = new HashMap();
map3.put("empty_vehicle_code", empty_vehicle_code);
map3.put("empty_point_status", "02");
ivtTab.update(map3, "empty_point_code = '" + point_code2 + "'");
}
if ("010704".equals(task_type)) {
//维护表处区点位
JSONObject st_jo1 = stTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
JSONObject st_jo1 = stTab.query("up_point_code = '" + point_code1.split("_M")[0] + "'").uniqueResult(0);
String full_vehicle_code = st_jo1.getString("up_scroll");
HashMap map1 = new HashMap();
map1.put("up_scroll", "");
stTab.update(map1, "point_code = '" + point_code1 + "'").uniqueResult(0);
stTab.update(map1, "up_point_code = '" + point_code1.split("_M")[0] + "'").uniqueResult(0);
//维护冷却区空轴点位的库存
HashMap map3 = new HashMap();
map3.put("full_vehicle_code", full_vehicle_code);
map3.put("container_name", container_name);
map3.put("full_point_status", "02");
ivtTab.update(map3, "full_point_code = '" + point_code2 + "'");
}
}

View File

@@ -25,15 +25,14 @@ public class SurfaceController {
@PostMapping("/operate")
@Log("表处上料、退料")
public ResponseEntity<Object> operate(@RequestBody JSONObject whereJson) {
serfaceService.operate(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
return new ResponseEntity<>(serfaceService.operate(whereJson), HttpStatus.OK);
}
@PostMapping("/confirm")
@Log("允许进入")
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
serfaceService.confirm(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
return new ResponseEntity<>(serfaceService.confirm(whereJson), HttpStatus.OK);
}
}

View File

@@ -11,7 +11,7 @@ public interface SerfaceService {
* @param whereJson /
* @return JSONObject
*/
void operate(JSONObject whereJson);
JSONObject operate(JSONObject whereJson);
/**
@@ -20,6 +20,6 @@ public interface SerfaceService {
* @param whereJson /
* @return JSONObject
*/
void confirm(JSONObject whereJson);
JSONObject confirm(JSONObject whereJson);
}

View File

@@ -24,7 +24,7 @@ public class SerfaceServiceImpl implements SerfaceService {
@Override
@Transactional(rollbackFor = Exception.class)
public void operate(JSONObject whereJson) {
public JSONObject operate(JSONObject whereJson) {
String option = whereJson.getString("option");
String container_name = whereJson.getString("container_name");
String device_code = whereJson.getString("point_code");
@@ -37,6 +37,9 @@ public class SerfaceServiceImpl implements SerfaceService {
throw new BadRequestException("当前工单为锂电工单,不允许表处!");
}
JSONObject device_jo = WQLObject.getWQLObject("st_ivt_stpointivt").query("point_code = '" + device_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(device_jo)){
throw new BadRequestException("未查询到设备号为["+device_code+"]的表处设备!");
}
JSONObject param = new JSONObject();
param.put("ContainerName", container_name);
param.put("ResourceName", device_jo.getString("ext_code"));
@@ -46,13 +49,20 @@ public class SerfaceServiceImpl implements SerfaceService {
if (jsonObject.getString("RTYPE").equals("E")) {
throw new BadRequestException(jsonObject.getString("RTMSG"));
}
JSONObject result = new JSONObject();
result.put("message","下发成功!");
return result;
}
@Override
public void confirm(JSONObject whereJson) {
public JSONObject confirm(JSONObject whereJson) {
String point_code = whereJson.getString("point_code");
JSONObject st_jo = WQLObject.getWQLObject("st_ivt_stpointivt").query("point_code = '"+point_code+"'").uniqueResult(0);
if (ObjectUtil.isEmpty(st_jo)){
throw new BadRequestException("未查询到对应的表处设备!");
}
//查询该点位对应的任务
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("(point_code1 like '%" + point_code + "%' + OR point_code2 like '%" + point_code + "%' AND is_delete = '0'").uniqueResult(0);
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("(point_code1 like '%" + point_code + "%' OR point_code2 like '%" + point_code + "%') AND is_delete = '0' AND task_status < '07'").uniqueResult(0);
if (ObjectUtil.isEmpty(task_jo)) {
throw new BadRequestException("未查询到该点位对应的任务!");
}
@@ -60,7 +70,7 @@ public class SerfaceServiceImpl implements SerfaceService {
//下发ACS执行允许进入
JSONArray paramArr = new JSONArray();
JSONObject param = new JSONObject();
param.put("device_code", point_code);
param.put("device_code", st_jo.getString("up_point_code"));
param.put("task_code", task_jo.getString("task_code"));
param.put("product_area", task_jo.getString("product_area"));
param.put("option", "1");
@@ -72,5 +82,8 @@ public class SerfaceServiceImpl implements SerfaceService {
if (!StrUtil.equals(result.getString("status"), "200")) {
throw new BadRequestException("操作失败:" + result.getString("message "));
}
JSONObject jo = new JSONObject();
jo.put("message","下发成功!");
return jo;
}
}