更新
This commit is contained in:
0
mes/hd/logPath_IS_UNDEFINED/2022-09-01.0.log
Normal file
0
mes/hd/logPath_IS_UNDEFINED/2022-09-01.0.log
Normal file
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -147,6 +148,18 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
map.put("update_time", now);
|
||||
map.put("realproduceend_date", now);
|
||||
wo.update(map, "produceorder_id = '" + ext_order_id + "'");
|
||||
JSONObject jsonObject = wo.query("produceorder_id = '" + ext_order_id + "'").uniqueResult(0);
|
||||
String real_qty = jsonObject.getString("real_qty");
|
||||
if (StrUtil.isEmpty(real_qty)){
|
||||
real_qty = "0";
|
||||
}
|
||||
//同时修改工单记录表中的期末数量及完成数量
|
||||
WQLObject wo_record = WQLObject.getWQLObject("MPS_BD_MacOperateRecord");
|
||||
JSONObject result1 = wo_record.query("produceorder_id = '" + ext_order_id + "' and (operatetime_end = '' or operatetime_end is null) ").uniqueResult(0);
|
||||
result1.put("finish_qty",real_qty);
|
||||
result1.put("finishproduct_qty",real_qty);
|
||||
result1.put("operatetime_end",now);
|
||||
wo_record.update(result1);
|
||||
} catch (Exception e){
|
||||
result.put("status", 400);
|
||||
result.put("message", e.getMessage());
|
||||
|
||||
@@ -417,7 +417,7 @@ public class DeviceScreenServiceImpl implements DeviceScreenService {
|
||||
int nowproductivity = WQL.getWO("QDEVICE_SCREEN").addParam("flag", "13").addParam("workprocedure_id", workprocedure_id).addParam("produce_date", today)
|
||||
.process().uniqueResult(0).getIntValue("real_qty");
|
||||
BigDecimal teep = new BigDecimal(0);
|
||||
if (nowproductivity != 0) {
|
||||
if (nowproductivity != 0 && Maxproductivity > 0) {
|
||||
teep = NumberUtil.round(NumberUtil.div(nowproductivity * 100, Maxproductivity), 2);
|
||||
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@
|
||||
SELECT
|
||||
device.productivity,
|
||||
CASE WHEN TIMESTAMPDIFF( HOUR, realproducestart_date, now( ) ) = '0' THEN device.productivity
|
||||
ELSE device.productivity * TIMESTAMPDIFF( HOUR, realproducestart_date, now( ) ) END AS max_productivity,
|
||||
ELSE device.productivity * (TIMESTAMPDIFF( HOUR, realproducestart_date, now( ) ) + 1) END AS max_productivity,
|
||||
shiftorder.produceorder_code,
|
||||
shiftorder.realproducestart_date
|
||||
FROM
|
||||
|
||||
@@ -408,6 +408,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||
String nickName = SecurityUtils.getNickName();
|
||||
String now = DateUtil.now();
|
||||
JSONObject row = param.getJSONObject("row");
|
||||
//强制完成时修改工单状态
|
||||
String produceorder_id = row.getString("produceorder_id");
|
||||
WQLObject wo = WQLObject.getWQLObject("MPS_BD_ProduceShiftOrder");
|
||||
JSONObject produceorderMap = new JSONObject();
|
||||
@@ -419,6 +420,20 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||
produceorderMap.put("update_time", now);
|
||||
produceorderMap.put("realproduceend_date", now);
|
||||
wo.update(produceorderMap);
|
||||
JSONObject jsonObject = wo.query("produceorder_id = '" + produceorder_id + "'").uniqueResult(0);
|
||||
String real_qty = jsonObject.getString("real_qty");
|
||||
if (StrUtil.isEmpty(real_qty)){
|
||||
real_qty = "0";
|
||||
}
|
||||
//同时修改工单记录表中的期末数量及完成数量
|
||||
WQLObject wo_record = WQLObject.getWQLObject("MPS_BD_MacOperateRecord");
|
||||
JSONObject result = wo_record.query("produceorder_id = '" + produceorder_id + "' and (operatetime_end = '' or operatetime_end is null) ").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(result)){
|
||||
result.put("finish_qty",real_qty);
|
||||
result.put("finishproduct_qty",real_qty);
|
||||
result.put("operatetime_end",now);
|
||||
wo_record.update(result);
|
||||
}
|
||||
//wms向acs发送请求 工单强制完成
|
||||
// TODO
|
||||
JSONArray array = new JSONArray();
|
||||
|
||||
@@ -135,11 +135,14 @@
|
||||
workprocedure.workprocedure_name,
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
material.material_spec
|
||||
material.material_spec,
|
||||
device.device_code,
|
||||
device.device_name
|
||||
FROM
|
||||
MPS_BD_ProduceShiftOrder shiftOrder
|
||||
left join PDM_BI_WorkProcedure workprocedure on workprocedure.workprocedure_id = shiftOrder.workprocedure_id
|
||||
left join md_me_materialbase material on material.material_id = shiftOrder.material_id
|
||||
left join pdm_bi_device device on device.device_id = shiftOrder.device_id
|
||||
WHERE
|
||||
shiftOrder.is_delete = '0' and shiftOrder.order_status in ('01', '02', '03')
|
||||
and shiftOrder.workprocedure_id in 输入.workprocedure_ids
|
||||
|
||||
Reference in New Issue
Block a user