代码修改

This commit is contained in:
2022-12-28 09:58:53 +08:00
parent 803d291204
commit 8464f85667
12 changed files with 77 additions and 15 deletions

View File

@@ -102,4 +102,6 @@ public class MaterialbaseDto implements Serializable {
private Long product_series;
private Integer standing_time;
private Integer material_qty;
}

View File

@@ -176,7 +176,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
//载具数量
String vehicle_num = whereJson.getString("vehicle_num");
//物料数量
String material_num = whereJson.getString("material_num");
String material_num = whereJson.getString("qty");
if (ObjectUtil.isEmpty(type)) throw new BadRequestException("类型不能为空");
if (ObjectUtil.isEmpty(point_code)) throw new BadRequestException("点位不能为空");

View File

@@ -74,6 +74,15 @@ public class WorkorderController {
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PutMapping("/executes")
@Log("手持确认工单执行")
@ApiOperation("手持确认工单执行")
//@SaCheckPermission("produceshiftorder:edit")
public ResponseEntity<Object> executes(@RequestBody JSONObject param){
workordeService.executes(param);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/getDevice")
@Log("根据登录用户设备下拉")
@ApiOperation("根据登录用户设备下拉")

View File

@@ -121,4 +121,10 @@ public interface WorkordeService {
* @return
*/
JSONArray getDtl(JSONObject param);
/**
* 工单执行
* @param param
*/
void executes(JSONObject param);
}

View File

@@ -189,7 +189,7 @@ public class WorkorderServiceImpl implements WorkordeService {
JSONObject json = wo.query("workorder_id = '" + param.getString("workorder_id") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(json.getString("device_id"))) throw new BadRequestException("请先绑定设备");
JSONArray orderArr = wo.query("device_id = '" + param.getString("device_id") + "' and order_status = '02'").getResultJSONArray(0);
JSONArray orderArr = wo.query("device_id = '" + param.getString("device_id") + "' and order_status = '3'").getResultJSONArray(0);
if (ObjectUtil.isNotEmpty(orderArr)) throw new BadRequestException("当前设备正在生产中");
json.put("order_status", "2");
@@ -439,4 +439,24 @@ public class WorkorderServiceImpl implements WorkordeService {
return resultJSONArray;
}
@Override
public void executes(JSONObject param) {
Long currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
WQLObject wo = WQLObject.getWQLObject("PDM_BD_WorkOrder");
JSONObject json = wo.query("workorder_id = '" + param.getString("workorder_id") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(json.getString("device_id"))) throw new BadRequestException("请先绑定设备");
JSONArray orderArr = wo.query("device_id = '" + json.getString("device_id") + "' and order_status = '3'").getResultJSONArray(0);
if (ObjectUtil.isNotEmpty(orderArr)) throw new BadRequestException("当前设备正在生产中");
json.put("order_status", "3");
json.put("update_optid", currentUserId);
json.put("update_optname", nickName);
json.put("update_time", now);
wo.update(json);
}
}

View File

@@ -100,6 +100,7 @@ public class YqxSendMaterialTask extends AbstractAcsTask {
}
@Override
@Transactional(rollbackFor = Exception.class)
public void findNextPoint() {
String task_status = TaskStatusEnum.SURE_START.getCode();
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
@@ -141,8 +142,6 @@ public class YqxSendMaterialTask extends AbstractAcsTask {
@Transactional(rollbackFor = Exception.class)
public String createTask(JSONObject whereJson) {
String point_code1 = whereJson.getString("point_code1");
String vehicle_type = whereJson.getString("vehicle_type");
String vehicle_code = whereJson.getString("vehicle_code");
String qty = whereJson.getString("qty");
//生产工单表【PDM_BD_WorkOrder】
@@ -169,10 +168,9 @@ public class YqxSendMaterialTask extends AbstractAcsTask {
.task_name("油漆线满料")
.task_status(TaskStatusEnum.SURE_START.getCode())
.point_code1(point_code1)
.vehicle_code(vehicle_code)
.material_info_id(workOrderObj.getLong("workorder_id"))
.material_id(workOrderObj.getLong("material_id"))
.vehicle_type(vehicle_type)
.vehicle_type(workOrderObj.getString("vehicle_type"))
.handle_class(THIS_CLASS)
.material_qty(qty)
.create_time(DateUtil.now())