rev:修改工单状态为枚举判断;

This commit is contained in:
2023-04-10 17:33:42 +08:00
parent 2fa2ec70a3
commit 2d0c08748f
5 changed files with 28 additions and 19 deletions

View File

@@ -53,11 +53,11 @@ public enum StatusEnum {
START_CACHELINE("2","启动",""),
//设备状态枚举1-关机、2-开机、3-生产中、4-待机、5-故障
DEVICE_STATUS_OFF("1","启动",""),
DEVICE_STATUS_ON("2","启动",""),
DEVICE_STATUS_RUNING("3","启动",""),
DEVICE_STATUS_WAITING("4","启动",""),
DEVICE_STATUS_ERROR("5","启动",""),
DEVICE_STATUS_OFF("1","关机",""),
DEVICE_STATUS_ON("2","开机",""),
DEVICE_STATUS_RUNING("3","生产中",""),
DEVICE_STATUS_WAITING("4","待机",""),
DEVICE_STATUS_ERROR("5","故障",""),
// 点位表点位状态
POINT_STATUS_EMPTY("1", "空位", ""),

View File

@@ -14,6 +14,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.enums.StatusEnum;
import org.nl.common.enums.WorkerOrderEnum;
import org.nl.common.utils.MapOf;
import org.nl.common.utils.api.CommonResult;
@@ -219,21 +220,24 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService{
List<DeviceDto> list = WQL.getWO("ONEPART_QUERY").addParam("flag", "1").addParam("condition", param).process().getResultJSONArray(0).toJavaList(DeviceDto.class);
list.forEach(r -> {
//状态为为关机
if(StrUtil.isEmpty(r.getDevice_status())) {
r.setDevice_status("1");
r.setDevice_status_name("关机");
}
else{
if(StrUtil.isNotEmpty(r.getDevice_status())) {
//不是关机与故障状态则为运行
if(!Objects.equals(r.getDevice_status(), "1") && !Objects.equals(r.getDevice_status(), "5")) {
if(!Objects.equals(r.getDevice_status(), StatusEnum.DEVICE_STATUS_OFF.getCode()) && !Objects.equals(r.getDevice_status(), StatusEnum.DEVICE_STATUS_ERROR.getCode())) {
r.setIs_run("1");
//todo 当前工单数
r.setJob_count("1");
}
else{
r.setIs_run("0");
r.setJob_count("0");
}
}
//todo 当前工单数
r.setJob_count("1");
else{
r.setDevice_status(StatusEnum.DEVICE_STATUS_OFF.getCode());
r.setDevice_status_name("关机");
r.setIs_run("0");
r.setJob_count("0");
}
});
return list;
}

View File

@@ -82,6 +82,7 @@
dict1.label shift_type_scode_name,
dict2.label order_status_name,
mater.material_name,
mater.material_code,
workorder.shift_type_scode,
workprocedure.workprocedure_name,
workorder.workorder_status order_status,

View File

@@ -260,18 +260,18 @@ public class CacheLineHandController{
}
@PostMapping("/agvOutBoxExceptionQuery")
@Log("AGV出箱异常-查询")
@ApiOperation("AGV出箱异常-查询")
@Log("AGV异常-查询")
@ApiOperation("AGV异常-查询")
public ResponseEntity<JSONArray> agvOutBoxExceptionQuery(@RequestBody JSONObject param) {
log.info("海亮缓存线手持服务 [AGV出箱异常-查询] 接口被请求, 请求参数-{}", param);
log.info("海亮缓存线手持服务 [AGV异常-查询] 接口被请求, 请求参数-{}", param);
return new ResponseEntity<>(cacheLineHandService.agvOutBoxExceptionQuery(param), HttpStatus.OK);
}
@PostMapping("/agvOutBoxExceptionConfirm")
@Log("AGV出箱异常-确认")
@ApiOperation("AGV出箱异常-确认")
@Log("AGV异常-确认")
@ApiOperation("AGV异常-确认")
public ResponseEntity<Object> agvOutBoxExceptionConfirm(@RequestBody JSONObject param) {
log.info("海亮缓存线手持服务 [AGV出箱异常-确认] 接口被请求, 请求参数-{}", param);
log.info("海亮缓存线手持服务 [AGV异常-确认] 接口被请求, 请求参数-{}", param);
cacheLineHandService.agvOutBoxExceptionConfirm(param);
return new ResponseEntity<>(HttpStatus.OK);
}

View File

@@ -574,7 +574,11 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
}
}
/**
* 缓存线异常确认
*/
@Override
@Transactional(rollbackFor = Exception.class)
public CommonResult<JSONObject> cacheLineExcepOpt(JSONObject param) {
// 缓存线编码
String wcsdevice_code = param.getString("wcsdevice_code");