opt:优化日志;add:包装机一体机页面新增空筐送回

This commit is contained in:
zhangzq
2023-12-26 16:25:20 +08:00
parent fbd5e1ca7e
commit a596caddfe
188 changed files with 2874 additions and 1543 deletions

View File

@@ -335,6 +335,10 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
String target_roadway = "";
String is_flip = "";
String tray_full_num = "";
if (checkParam(errArr, workorder_id, workorder_code, material_code, qty, device_code, is_needmove)) {
continue;
}
if (ObjectUtil.isNotEmpty(package_ext)) {
//是否启用封箱线
is_used_fxx = ObjectUtil.isEmpty(package_ext.get("is_used_fxx")) ? null : package_ext.get("is_used_fxx").toString();
@@ -406,65 +410,13 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
//码盘数量
tray_num = ObjectUtil.isEmpty(extra_map.get("tray_num")) ? null : extra_map.get("tray_num").toString();
}
Map<String, Object> params = param.getJSONObject("params");
if (ObjectUtil.isNotEmpty(params)) {
ealingOrderDto = JSONObject.toJavaObject(JSON.parseObject(JSON.toJSONString(params)), EalingOrderDto.class);
ealingOrderDto.setOrder_code(workorder_code);
}
if (StrUtil.isEmpty(workorder_id)) {
JSONObject json = new JSONObject();
json.put("workorder_id", workorder_id);
json.put("message", "工单id不能为空");
errArr.add(json);
continue;
}
if (StrUtil.isEmpty(workorder_code)) {
JSONObject json = new JSONObject();
json.put("workorder_id", workorder_id);
json.put("message", "工单编码不能为空");
errArr.add(json);
continue;
}
ProduceshiftorderDto byCode = produceshiftorderService.findByCode(workorder_code);
if (ObjectUtil.isNotEmpty(byCode)) {
if (!byCode.getOrder_status().equals(WorkerOrderEnum.FORCEFINISH.getCode())&&!byCode.getOrder_status().equals(WorkerOrderEnum.COMPLETE.getCode())){
JSONObject json = new JSONObject();
json.put("workorder_id", workorder_id);
json.put("message", "下发执行工单不是完成状态");
errArr.add(json);
continue;
}
}
if (StrUtil.isEmpty(material_code)) {
JSONObject json = new JSONObject();
json.put("workorder_id", workorder_id);
json.put("message", "物料编码不能为空");
errArr.add(json);
continue;
}
if (StrUtil.isEmpty(qty)) {
JSONObject json = new JSONObject();
json.put("workorder_id", workorder_id);
json.put("message", "生产数量不能为空");
errArr.add(json);
continue;
}
if (StrUtil.isEmpty(device_code)) {
JSONObject json = new JSONObject();
json.put("workorder_id", workorder_id);
json.put("message", "生产设备编码不能为空");
errArr.add(json);
continue;
}
if (StrUtil.isEmpty(is_needmove)) {
JSONObject json = new JSONObject();
json.put("workorder_id", workorder_id);
json.put("message", "是否需要AGV搬运不能为空");
errArr.add(json);
continue;
}
ProduceshiftorderDto dto = new ProduceshiftorderDto();
dto.setExt_order_id(workorder_id);
dto.setOrder_code(workorder_code);
@@ -521,6 +473,62 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
return resultJson;
}
private boolean checkParam(JSONArray errArr, String workorder_id, String workorder_code, String material_code, String qty, String device_code, String is_needmove) {
if (StrUtil.isEmpty(workorder_id)) {
JSONObject json = new JSONObject();
json.put("workorder_id", workorder_id);
json.put("message", "工单id不能为空");
errArr.add(json);
return true;
}
if (StrUtil.isEmpty(workorder_code)) {
JSONObject json = new JSONObject();
json.put("workorder_id", workorder_id);
json.put("message", "工单编码不能为空");
errArr.add(json);
return true;
}
ProduceshiftorderDto byCode = produceshiftorderService.findByCode(workorder_code);
if (ObjectUtil.isNotEmpty(byCode)) {
if (!byCode.getOrder_status().equals(WorkerOrderEnum.FORCEFINISH.getCode())&&!byCode.getOrder_status().equals(WorkerOrderEnum.COMPLETE.getCode())){
JSONObject json = new JSONObject();
json.put("workorder_id", workorder_id);
json.put("message", "下发执行工单不是完成状态");
errArr.add(json);
return true;
}
}
if (StrUtil.isEmpty(material_code)) {
JSONObject json = new JSONObject();
json.put("workorder_id", workorder_id);
json.put("message", "物料编码不能为空");
errArr.add(json);
return true;
}
if (StrUtil.isEmpty(qty)) {
JSONObject json = new JSONObject();
json.put("workorder_id", workorder_id);
json.put("message", "生产数量不能为空");
errArr.add(json);
return true;
}
if (StrUtil.isEmpty(device_code)) {
JSONObject json = new JSONObject();
json.put("workorder_id", workorder_id);
json.put("message", "生产设备编码不能为空");
errArr.add(json);
return true;
}
if (StrUtil.isEmpty(is_needmove)) {
JSONObject json = new JSONObject();
json.put("workorder_id", workorder_id);
json.put("message", "是否需要AGV搬运不能为空");
errArr.add(json);
return true;
}
return false;
}
@Override
public Map<String, Object> updateTaskStatus(List<JSONObject> taskStatus) {

View File

@@ -89,7 +89,6 @@ public class LuceneExecuteLogServiceImpl implements LuceneExecuteLogService {
long endTime = System.currentTimeMillis();
log.info("建立索引共耗时{}毫秒", endTime - startTime);
indexWriter.commit();
indexWriter.close();
// MDC.put("DEVICECODE", luceneLogDto.getDevice_code());
} catch (Exception e) {
log.error(e.getMessage(), e);