更新日志

This commit is contained in:
2022-12-17 19:43:05 +08:00
parent 575472fca6
commit 54d5312cc5
51 changed files with 595 additions and 5007 deletions

View File

@@ -238,7 +238,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
map.put("realproduceend_date", now);
wo.update(map, "workorder_id = '" + ext_order_id + "'");
JSONObject result = new JSONObject();
result.put("status", HttpStatus.OK.value());
result.put("status", "200");
result.put("message", "任务状态反馈成功!");
return result;
}
@@ -321,18 +321,18 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
//如果是的话说明困料区来的 先去库存表查询对应的条码的物料信息 并将对应的物料信息保存在redis中
if (StrUtil.equals(is_first, "true")) {
JSONObject ivtJson = wo_ivt.query("vehicle_code = '" + barcode + "'").uniqueResult(0);
redisUtils.set(barcode,ivtJson.getString("material_id"));
redisUtils.set(barcode+"-ivt_qty",ivtJson.getString("ivt_qty"));
redisUtils.set(barcode, ivtJson.getString("material_id"));
redisUtils.set(barcode + "-ivt_qty", ivtJson.getString("ivt_qty"));
materialbaseDto = materialbaseService.findById(ivtJson.getLong("material_id"));
}
String material_id = String.valueOf(redisUtils.get(barcode));
String ivt_qty = String.valueOf(redisUtils.get(barcode+"-ivt_qty"));
String ivt_qty = String.valueOf(redisUtils.get(barcode + "-ivt_qty"));
Long materialId = null;
String point_status = "2";
if (StrUtil.equals("0",barcode)){
if (StrUtil.equals("0", barcode)) {
point_status = "1";
}
if (StrUtil.isNotEmpty(material_id)){
if (StrUtil.isNotEmpty(material_id)) {
point_status = "3";
materialId = Long.valueOf(materialId);
}
@@ -351,21 +351,21 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
structivtService.update(structivtDto);
//同时修改该工位的点位状态
JSONObject pointJson = wo.query("point_code = '" + device_code + "'").uniqueResult(0);
pointJson.put("point_status",point_status);
pointJson.put("update_time",DateUtil.now());
pointJson.put("point_status", point_status);
pointJson.put("update_time", DateUtil.now());
wo.update(pointJson);
//如果是第一个工位的条码变化 则需要更新困料区等的库存信息 因为第一个是从困料区过来的
if (StrUtil.equals(is_first,"true")){
if (StrUtil.equals(is_first, "true")) {
//获取困料区的缓存信息
LinkedList<JSONObject> ll = MyLinkedListService.getLinkedList();
if (ll.size() == 0) ll = structivtService.reload();
Boolean isHasGoods = false;
JSONObject jsonObject = wo.query("is_used = '1' and is_delete = '0' and lock_type = '2' and region_code = '" + RegionTypeEnum.GT1.getCode() + "'").uniqueResult(0);
JSONObject ivtJsonObject = new JSONObject();
if (ObjectUtil.isNotEmpty(jsonObject)){
if (ObjectUtil.isNotEmpty(jsonObject)) {
ivtJsonObject = wo_ivt.query("point_code = '" + jsonObject.getString("point_code") + "' and (vehicle_code <> '' or vehicle_code is not null)").uniqueResult(0);
if (ObjectUtil.isNotEmpty(ivtJsonObject)){
if (ObjectUtil.isNotEmpty(ivtJsonObject)) {
isHasGoods = true;
}
}
@@ -378,7 +378,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
if (ObjectUtil.isNotEmpty(materialbaseDto)) {
map.put("material_code", materialbaseDto.getMaterial_code());
}
map.put("ivt_qty",ivtJsonObject.getString("ivt_qty"));
map.put("ivt_qty", ivtJsonObject.getString("ivt_qty"));
boolean flag = klzhcwUtil.judge(ll, map);
if (flag) {
jsonObject.put("lock_type", "1");
@@ -417,33 +417,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
@Override
public JSONObject orderConfirm(JSONObject whereJson) {
JSONObject resp = new JSONObject();
WQLObject wo = WQLObject.getWQLObject("PDM_BD_WorkOrder");
String device_code = whereJson.getString("device_code");
String material_code = whereJson.getString("material_code");
String order_code = whereJson.getString("order_code");
String ext_order_id = whereJson.getString("ext_order_id");
DeviceDto deviceDto = deviceService.findByCode(device_code);
MaterialbaseDto materialbaseDto = materialbaseService.findByCode(material_code);
if (ObjectUtil.isEmpty(deviceDto)) {
throw new BadRequestException("设备不存在:" + device_code);
}
if (ObjectUtil.isEmpty(materialbaseDto)) {
throw new BadRequestException("物料不存在::" + material_code);
}
JSONObject jsonObject = wo.query("workorder_id = '" + ext_order_id + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonObject)) {
boolean material_flag = StrUtil.equals(String.valueOf(materialbaseDto.getMaterial_id()), jsonObject.getString("material_id"));
boolean device_flag = StrUtil.equals(String.valueOf(deviceDto.getDevice_id()), jsonObject.getString("device_id"));
if (material_flag && device_flag) {
resp.put("status", "200");
resp.put("message", "人工排产确认成功!");
return resp;
}
} else {
throw new BadRequestException("工单不存在!" + order_code);
}
resp.put("status", "400");
resp.put("message", "人工排产确认失败!");
WorkorderDto dto = workordeService.findById(Long.valueOf(ext_order_id));
dto.setOrder_status("3");
dto.setUpdate_time(DateUtil.now());
workordeService.update(dto);
resp.put("status", "200");
resp.put("message", "人工排产确认成功!");
return resp;
}
}

View File

@@ -206,15 +206,15 @@ public class WorkorderServiceImpl implements WorkordeService {
JSONArray array = new JSONArray();
JSONObject map = new JSONObject();
map.put("ext_order_id",json.getString("workorder_id"));
map.put("order_code",json.getString("workorder_code"));
map.put("qty",json.getString("plan_qty"));
map.put("material_code",jsonObject.getString("material_code"));
map.put("device_code",json.getString("device_code"));
map.put("ext_order_id", json.getString("workorder_id"));
map.put("order_code", json.getString("workorder_code"));
map.put("qty", json.getString("plan_qty"));
map.put("material_code", jsonObject.getString("material_code"));
map.put("device_code", json.getString("device_code"));
array.add(map);
Map<String, Object> resp = wmsToAcsService.order(array);
if (StrUtil.equals(String.valueOf(resp.get("status")),"200")){
json.put("order_status", "3");
if (StrUtil.equals(String.valueOf(resp.get("status")), "200")) {
json.put("order_status", "2");
json.put("update_optid", currentUserId);
json.put("update_optname", nickName);
json.put("update_time", now);
@@ -298,7 +298,7 @@ public class WorkorderServiceImpl implements WorkordeService {
produceorderMap.put("update_optid", currentUserId);
produceorderMap.put("update_optname", nickName);
produceorderMap.put("update_time", now);
if (order_status.equals("01")){
if (order_status.equals("01")) {
produceorderMap.put("realproducestart_date", now);
}
wo.update(produceorderMap);
@@ -321,15 +321,15 @@ public class WorkorderServiceImpl implements WorkordeService {
// TODO
JSONArray array = new JSONArray();
JSONObject acsObj = new JSONObject();
acsObj.put("ext_order_id",workorder_id);
acsObj.put("is_needmove",is_needmove);
acsObj.put("order_code",produceorder_code);
acsObj.put("qty",plan_qty);
acsObj.put("material_uuid",material_id);
acsObj.put("material_code",material_code);
acsObj.put("material_name",material_name);
acsObj.put("material_spec",material_spec);
acsObj.put("device_code",device_code);
acsObj.put("ext_order_id", workorder_id);
acsObj.put("is_needmove", is_needmove);
acsObj.put("order_code", produceorder_code);
acsObj.put("qty", plan_qty);
acsObj.put("material_uuid", material_id);
acsObj.put("material_code", material_code);
acsObj.put("material_name", material_name);
acsObj.put("material_spec", material_spec);
acsObj.put("device_code", device_code);
array.add(acsObj);
wmsToAcsService.order(array);
} else {
@@ -347,8 +347,8 @@ public class WorkorderServiceImpl implements WorkordeService {
// TODO
JSONArray array = new JSONArray();
JSONObject map = new JSONObject();
map.put("ext_order_id",workorder_id);
map.put("type","2");
map.put("ext_order_id", workorder_id);
map.put("type", "2");
array.add(map);
wmsToAcsService.orderStatusUpdate(array);
}
@@ -370,12 +370,12 @@ public class WorkorderServiceImpl implements WorkordeService {
WQLObject wo = WQLObject.getWQLObject("PDM_BD_WORKORDER");
JSONObject jsonObject = wo.query("workorder_id = '" + workorder_id + "'").uniqueResult(0);
JSONObject produceorderMap = new JSONObject();
produceorderMap.put("workorder_id",workorder_id);
if (row.getString("report_qty").equals("0") || StrUtil.isEmpty(row.getString("report_qty"))){
produceorderMap.put("report_qty",report_qty);
}else {
produceorderMap.put("workorder_id", workorder_id);
if (row.getString("report_qty").equals("0") || StrUtil.isEmpty(row.getString("report_qty"))) {
produceorderMap.put("report_qty", report_qty);
} else {
Integer sum = Integer.parseInt(row.getString("report_qty")) + Integer.parseInt(report_qty);
produceorderMap.put("report_qty",sum);
produceorderMap.put("report_qty", sum);
}
produceorderMap.put("order_status", "03");
produceorderMap.put("update_optid", currentUserId);
@@ -385,20 +385,20 @@ public class WorkorderServiceImpl implements WorkordeService {
//同时修改这条工单对应的记录表中最新的一条数据的报工数量
WQLObject wo_record = WQLObject.getWQLObject("MPS_BD_MacOperateRecord");
//获取最新的工单的对应记录信息
JSONObject newRecord = wo_record.query("workorder_id = '"+workorder_id+"' and (operatetime_end is null or operatetime_end = '')").uniqueResult(0);
newRecord.put("report_qty",report_qty);
newRecord.put("finish_qty",jsonObject.getString("real_qty"));
JSONObject newRecord = wo_record.query("workorder_id = '" + workorder_id + "' and (operatetime_end is null or operatetime_end = '')").uniqueResult(0);
newRecord.put("report_qty", report_qty);
newRecord.put("finish_qty", jsonObject.getString("real_qty"));
Integer finishproduct_qty = Integer.parseInt(jsonObject.getString("real_qty")) - Integer.parseInt(newRecord.getString("init_qty"));
newRecord.put("finishproduct_qty",finishproduct_qty);
newRecord.put("operatetime_end",now);
newRecord.put("finishproduct_qty", finishproduct_qty);
newRecord.put("operatetime_end", now);
wo_record.update(newRecord);
//wms向acs发送请求 工单暂停
// 报工的时候同时向acs发送工单暂停状态
// TODO
JSONArray array = new JSONArray();
JSONObject map = new JSONObject();
map.put("ext_order_id",workorder_id);
map.put("type","1");
map.put("ext_order_id", workorder_id);
map.put("type", "1");
array.add(map);
wmsToAcsService.orderStatusUpdate(array);
}
@@ -417,14 +417,14 @@ public class WorkorderServiceImpl implements WorkordeService {
// TODO
JSONArray array = new JSONArray();
JSONObject map = new JSONObject();
map.put("ext_order_id",workorder_id);
map.put("type","3");
map.put("ext_order_id", workorder_id);
map.put("type", "3");
array.add(map);
Map<String, Object> resp = wmsToAcsService.orderStatusUpdate(array);
if (StrUtil.equals(String.valueOf(resp.get("status")),"200")){
if (StrUtil.equals(String.valueOf(resp.get("status")), "200")) {
JSONObject produceorderMap = new JSONObject();
produceorderMap.put("workorder_id",workorder_id);
produceorderMap.put("order_status","5");
produceorderMap.put("workorder_id", workorder_id);
produceorderMap.put("order_status", "5");
produceorderMap.put("update_optid", currentUserId);
produceorderMap.put("update_optname", nickName);
produceorderMap.put("update_time", now);
@@ -440,11 +440,11 @@ public class WorkorderServiceImpl implements WorkordeService {
JSONObject jsonProduceShiftOrder = wo.query("workorder_id = '" + workorder_id + "'").uniqueResult(0);
WQLObject wo_record = WQLObject.getWQLObject("MPS_BD_MacOperateRecord");
//获取最新的工单的对应记录信息
JSONObject jsonObject = wo_record.query("workorder_id = '"+workorder_id+"' and (operatetime_end is null or operatetime_end = '')").uniqueResult(0);
JSONObject jsonObject = wo_record.query("workorder_id = '" + workorder_id + "' and (operatetime_end is null or operatetime_end = '')").uniqueResult(0);
String finish_qty = jsonProduceShiftOrder.getString("real_qty");
jsonObject.put("finish_qty",finish_qty);
jsonObject.put("finish_qty", finish_qty);
Integer finishproduct_qty = Integer.parseInt(finish_qty) - Integer.parseInt(jsonObject.getString("init_qty"));
jsonObject.put("finishproduct_qty",finishproduct_qty);
jsonObject.put("finishproduct_qty", finishproduct_qty);
return jsonObject;
}
@@ -458,8 +458,8 @@ public class WorkorderServiceImpl implements WorkordeService {
public JSONArray getDtl(JSONObject param) {
final String workorder_id = param.getString("workorder_id");
JSONObject map = new JSONObject();
map.put("flag","5");
map.put("workorder_id",workorder_id);
map.put("flag", "5");
map.put("workorder_id", workorder_id);
JSONArray resultJSONArray = WQL.getWO("MPS_PRODUCEDURE001").addParamMap(map).process().getResultJSONArray(0);
return resultJSONArray;
}