代码更新
This commit is contained in:
@@ -128,14 +128,14 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
String now = DateUtil.now();
|
||||
WQLObject wo = WQLObject.getWQLObject("MPS_BD_ProduceShiftOrder");
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("produceorder_id", ext_order_id);
|
||||
map.put("workorder_id", ext_order_id);
|
||||
map.put("order_status", "04");
|
||||
map.put("update_optid", 1111111111);
|
||||
map.put("device_id", "");
|
||||
map.put("update_optname", "acs");
|
||||
map.put("update_time", now);
|
||||
map.put("realproduceend_date", now);
|
||||
wo.update(map, "produceorder_id = '" + ext_order_id + "'");
|
||||
wo.update(map, "workorder_id = '" + ext_order_id + "'");
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "任务状态反馈成功!");
|
||||
|
||||
@@ -32,10 +32,10 @@ public interface ProduceshiftorderService {
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param produceorder_id ID
|
||||
* @param workorder_id ID
|
||||
* @return Produceshiftorder
|
||||
*/
|
||||
ProduceshiftorderDto findById(Long produceorder_id);
|
||||
ProduceshiftorderDto findById(Long workorder_id);
|
||||
|
||||
/**
|
||||
* 根据编码查询
|
||||
|
||||
@@ -20,7 +20,7 @@ public class ProduceshiftorderDto implements Serializable {
|
||||
* 防止精度丢失
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long produceorder_id;
|
||||
private Long workorder_id;
|
||||
|
||||
/**
|
||||
* 生产班次工单编号
|
||||
|
||||
@@ -90,9 +90,9 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProduceshiftorderDto findById(Long produceorder_id) {
|
||||
public ProduceshiftorderDto findById(Long workorder_id) {
|
||||
WQLObject wo = WQLObject.getWQLObject("mps_bd_produceshiftorder");
|
||||
JSONObject json = wo.query("produceorder_id = '" + produceorder_id + "'").uniqueResult(0);
|
||||
JSONObject json = wo.query("workorder_id = '" + workorder_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) {
|
||||
return json.toJavaObject(ProduceshiftorderDto.class);
|
||||
}
|
||||
@@ -162,9 +162,9 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||
String now = DateUtil.now();
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("mps_bd_produceshiftorder");
|
||||
for (Long produceorder_id : ids) {
|
||||
for (Long workorder_id : ids) {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("produceorder_id", String.valueOf(produceorder_id));
|
||||
param.put("workorder_id", String.valueOf(workorder_id));
|
||||
param.put("is_delete", "1");
|
||||
param.put("update_optid", currentUserId);
|
||||
param.put("update_optname", nickName);
|
||||
@@ -181,7 +181,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||
String now = DateUtil.now();
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("mps_bd_produceshiftorder");
|
||||
JSONObject json = wo.query("produceorder_id = '" + param.getString("produceorder_id") + "'").uniqueResult(0);
|
||||
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);
|
||||
@@ -250,7 +250,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||
JSONObject device = wo_device.query("device_id = '" + device_id + "'").uniqueResult(0);
|
||||
String device_code = device.getString("device_code");
|
||||
JSONObject row = param.getJSONObject("row");
|
||||
String produceorder_id = row.getString("produceorder_id");
|
||||
String workorder_id = row.getString("workorder_id");
|
||||
String workprocedure_id = row.getString("workprocedure_id");
|
||||
String produceorder_code = row.getString("produceorder_code");
|
||||
String material_id = row.getString("material_id");
|
||||
@@ -262,9 +262,9 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||
String order_status = row.getString("order_status");
|
||||
//开工时修改生产班次工单表 生产设备、以及工单状态
|
||||
WQLObject wo = WQLObject.getWQLObject("MPS_BD_ProduceShiftOrder");
|
||||
JSONObject jsonObject1 = wo.query("produceorder_id = '" + produceorder_id + "'").uniqueResult(0);
|
||||
JSONObject jsonObject1 = wo.query("workorder_id = '" + workorder_id + "'").uniqueResult(0);
|
||||
JSONObject produceorderMap = new JSONObject();
|
||||
produceorderMap.put("produceorder_id", produceorder_id);
|
||||
produceorderMap.put("workorder_id", workorder_id);
|
||||
produceorderMap.put("device_id", device_id);
|
||||
produceorderMap.put("order_status", "02");
|
||||
produceorderMap.put("update_optid", currentUserId);
|
||||
@@ -280,11 +280,11 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||
recordMap.put("macoperate_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
recordMap.put("device_id", device_id);
|
||||
recordMap.put("workprocedure_id", workprocedure_id);
|
||||
recordMap.put("produceorder_id", produceorder_id);
|
||||
recordMap.put("workorder_id", workorder_id);
|
||||
recordMap.put("produceorder_code", produceorder_code);
|
||||
recordMap.put("init_qty", jsonObject1.getString("real_qty"));
|
||||
//填写生产记录表中的生产数量时,先判断是否已经生产过了,如果没有生产过,就将工单记录表中的计划数量付给记录表中的生产数量
|
||||
final JSONArray alreadyPro = wo_record.query("produceorder_id = '" + produceorder_id + "'").getResultJSONArray(0);
|
||||
final JSONArray alreadyPro = wo_record.query("workorder_id = '" + workorder_id + "'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(alreadyPro)) {
|
||||
recordMap.put("produce_qty", plan_qty);
|
||||
//同时向acs系统下发工单 问题是现在一个工单分多次执行,现在是每开工一次,向acs发送一次工单
|
||||
@@ -293,7 +293,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||
// TODO
|
||||
JSONArray array = new JSONArray();
|
||||
JSONObject acsObj = new JSONObject();
|
||||
acsObj.put("ext_order_id",produceorder_id);
|
||||
acsObj.put("ext_order_id",workorder_id);
|
||||
acsObj.put("is_needmove",is_needmove);
|
||||
acsObj.put("order_code",produceorder_code);
|
||||
acsObj.put("qty",plan_qty);
|
||||
@@ -319,7 +319,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||
// TODO
|
||||
JSONArray array = new JSONArray();
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("ext_order_id",produceorder_id);
|
||||
map.put("ext_order_id",workorder_id);
|
||||
map.put("type","2");
|
||||
array.add(map);
|
||||
wmsToAcsService.orderStatusUpdate(array);
|
||||
@@ -337,12 +337,12 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||
String now = DateUtil.now();
|
||||
final String report_qty = param.getString("report_qty");
|
||||
final JSONObject row = param.getJSONObject("row");
|
||||
final String produceorder_id = row.getString("produceorder_id");
|
||||
final String workorder_id = row.getString("workorder_id");
|
||||
//报工时工单的工单状态为暂停,报工数量为这条工单上次加这次报工数量的和,也就是这条工单每次记录的和
|
||||
WQLObject wo = WQLObject.getWQLObject("MPS_BD_ProduceShiftOrder");
|
||||
JSONObject jsonObject = wo.query("produceorder_id = '" + produceorder_id + "'").uniqueResult(0);
|
||||
JSONObject jsonObject = wo.query("workorder_id = '" + workorder_id + "'").uniqueResult(0);
|
||||
JSONObject produceorderMap = new JSONObject();
|
||||
produceorderMap.put("produceorder_id",produceorder_id);
|
||||
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 {
|
||||
@@ -357,7 +357,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||
//同时修改这条工单对应的记录表中最新的一条数据的报工数量
|
||||
WQLObject wo_record = WQLObject.getWQLObject("MPS_BD_MacOperateRecord");
|
||||
//获取最新的工单的对应记录信息
|
||||
JSONObject newRecord = wo_record.query("produceorder_id = '"+produceorder_id+"' and (operatetime_end is null or operatetime_end = '')").uniqueResult(0);
|
||||
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"));
|
||||
@@ -369,7 +369,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||
// TODO
|
||||
JSONArray array = new JSONArray();
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("ext_order_id",produceorder_id);
|
||||
map.put("ext_order_id",workorder_id);
|
||||
map.put("type","1");
|
||||
array.add(map);
|
||||
wmsToAcsService.orderStatusUpdate(array);
|
||||
@@ -382,10 +382,10 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
JSONObject row = param.getJSONObject("row");
|
||||
String produceorder_id = row.getString("produceorder_id");
|
||||
String workorder_id = row.getString("workorder_id");
|
||||
WQLObject wo = WQLObject.getWQLObject("MPS_BD_ProduceShiftOrder");
|
||||
JSONObject produceorderMap = new JSONObject();
|
||||
produceorderMap.put("produceorder_id",produceorder_id);
|
||||
produceorderMap.put("workorder_id",workorder_id);
|
||||
produceorderMap.put("order_status","04");
|
||||
produceorderMap.put("update_optid", currentUserId);
|
||||
produceorderMap.put("device_id", null);
|
||||
@@ -397,7 +397,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||
// TODO
|
||||
JSONArray array = new JSONArray();
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("ext_order_id",produceorder_id);
|
||||
map.put("ext_order_id",workorder_id);
|
||||
map.put("type","3");
|
||||
array.add(map);
|
||||
wmsToAcsService.orderStatusUpdate(array);
|
||||
@@ -405,12 +405,12 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||
|
||||
@Override
|
||||
public JSONObject getReportWork(JSONObject param) {
|
||||
String produceorder_id = param.getString("produceorder_id");
|
||||
String workorder_id = param.getString("workorder_id");
|
||||
WQLObject wo = WQLObject.getWQLObject("MPS_BD_ProduceShiftOrder");
|
||||
JSONObject jsonProduceShiftOrder = wo.query("produceorder_id = '" + produceorder_id + "'").uniqueResult(0);
|
||||
JSONObject jsonProduceShiftOrder = wo.query("workorder_id = '" + workorder_id + "'").uniqueResult(0);
|
||||
WQLObject wo_record = WQLObject.getWQLObject("MPS_BD_MacOperateRecord");
|
||||
//获取最新的工单的对应记录信息
|
||||
JSONObject jsonObject = wo_record.query("produceorder_id = '"+produceorder_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);
|
||||
Integer finishproduct_qty = Integer.parseInt(finish_qty) - Integer.parseInt(jsonObject.getString("init_qty"));
|
||||
@@ -426,10 +426,10 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||
|
||||
@Override
|
||||
public JSONArray getDtl(JSONObject param) {
|
||||
final String produceorder_id = param.getString("produceorder_id");
|
||||
final String workorder_id = param.getString("workorder_id");
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag","5");
|
||||
map.put("produceorder_id",produceorder_id);
|
||||
map.put("workorder_id",workorder_id);
|
||||
JSONArray resultJSONArray = WQL.getWO("MPS_PRODUCEDURE001").addParamMap(map).process().getResultJSONArray(0);
|
||||
return resultJSONArray;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.jockey_id TYPEAS s_string
|
||||
输入.produceorder_id TYPEAS s_string
|
||||
输入.workorder_id TYPEAS s_string
|
||||
输入.workprocedure_id TYPEAS s_string
|
||||
输入.order_type_scode TYPEAS s_string
|
||||
输入.order_status TYPEAS s_string
|
||||
@@ -165,7 +165,7 @@
|
||||
LEFT JOIN PDM_BI_Device device ON record.device_id = device.device_id
|
||||
LEFT JOIN sys_user user ON user.user_id = record.jockey_id
|
||||
WHERE
|
||||
record.produceorder_id = 输入.produceorder_id
|
||||
record.workorder_id = 输入.workorder_id
|
||||
order by
|
||||
record.operatetime_start
|
||||
ENDSELECT
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user