rev:一体机工单强制完成

This commit is contained in:
zhangzhiqiang
2023-04-10 17:53:39 +08:00
parent 2d0c08748f
commit e16a1fd440
3 changed files with 14 additions and 33 deletions

View File

@@ -7,4 +7,6 @@ package org.nl.common;
public class ConstantParam {
//深坑清洗区域编码
public static String SK_REGION = "QSQX";
//物料 数量/重量系数
public static Double MATERAIL_RATIO = 1.1;
}

View File

@@ -37,7 +37,7 @@ public class CachelineVehicleServiceImpl implements CachelineVehicleService {
@Override
public Map<String,Object> queryAll(Map whereJson, Pageable page){
WQLObject wo = WQLObject.getWQLObject("sch_cacheline_vehicle");
WQLObject wo = WQLObject.getWQLObject("SCH_CacheLine_VehileMaterial");
String where = "1=1";
Object search = whereJson.get("search");
if (ObjectUtil.isNotEmpty(search))

View File

@@ -353,13 +353,12 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService{
String workorder_id = param.getString("workorder_id");
WQLObject wo = WQLObject.getWQLObject("pdm_produce_workorder");
//1.更新工单表报工数量
wo.update(MapOf.of("workorder_status", WorkerOrderEnum.STOP.getCode(), "real_qty", report_qty, "update_id", currentUserId, "update_name", nickName), "workorder_id = '" + workorder_id + "'");
wo.update(MapOf.of("workorder_status", WorkerOrderEnum.STOP.getCode(), "report_qty", report_qty, "update_id", currentUserId, "update_name", nickName), "workorder_id = '" + workorder_id + "'");
//2.下发acs更新暂停状态
JSONArray arr = new JSONArray();
arr.add(MapOf.of("workorder_id", workorder_id, "status", WorkerOrderEnum.STOP.getCode()));
// Map<String,Object> resp = wmsToAcsService.orderStatusUpdate(arr);
//return RestBusinessTemplate.execute(() -> resp);
return RestBusinessTemplate.execute(() -> new JSONObject());
Map<String,Object> resp = wmsToAcsService.orderStatusUpdate(arr);
return RestBusinessTemplate.execute(() -> resp);
}
/**
@@ -381,41 +380,21 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService{
WQLObject wo = WQLObject.getWQLObject("pdm_produce_workorder");
JSONObject map = new JSONObject();
map.put("produceorder_id", workorder_id);
map.put("workorder_status", "4");
map.put("workorder_status", WorkerOrderEnum.FORCE_COMPLETE.getCode());
map.put("current_device_code", null);
map.put("update_id", currentUserId);
map.put("update_name", nickName);
map.put("update_time", DateUtil.now());
map.put("realproduceend_date", DateUtil.now());
wo.update(map, "workorder_id = '" + workorder_id + "'");
//2.设置实际数量
JSONObject jsonObject = wo.query("workorder_id = '" + workorder_id + "'").uniqueResult(0);
String real_qty = jsonObject.getString("real_qty");
if(StrUtil.isEmpty(real_qty)) {
real_qty = "0";
}
//3.修改工单记录表中的期末数量及完成数量
WQLObject wo_record = WQLObject.getWQLObject("pdm_produce_workorderrecord");
JSONObject result = wo_record.query("workorder_id = '" + workorder_id + "' and (operatetime_end = '' or operatetime_end is null) ").uniqueResult(0);
if(ObjectUtil.isNotEmpty(result)) {
result.put("dq_finish_qty", real_qty);
result.put("person_finish_qty", real_qty);
result.put("operatetime_end", DateUtil.now());
wo_record.update(result);
}
//2.设置实际数量:数量待确认: 是否需要从报工记录表统计
JSONArray arr = new JSONArray();
arr.add(MapOf.of("workorder_id", workorder_id, "status", WorkerOrderEnum.FORCE_COMPLETE.getCode()));
//4.工单开工以后需要向acs强制完成,wms向acs发送请求,工单强制完成
String workorder_status = jsonObject.getString("workorder_status");
if(!workorder_status.equals("0") && !workorder_status.equals("1")) {
JSONArray array = new JSONArray();
JSONObject acs = new JSONObject();
acs.put("ext_order_id", workorder_id);
acs.put("type", "3");
array.add(acs);
//Map<String,Object> resp = wmsToAcsService.orderStatusUpdate(array);
// return RestBusinessTemplate.execute(() -> resp);
return RestBusinessTemplate.execute(() -> new JSONObject());
}
return RestBusinessTemplate.execute(() -> new JSONObject());
Map<String,Object> resp = wmsToAcsService.orderStatusUpdate(arr);
return RestBusinessTemplate.execute(() -> resp);
}
@Override