修改
This commit is contained in:
@@ -188,6 +188,10 @@
|
|||||||
<artifactId>commons-lang</artifactId>
|
<artifactId>commons-lang</artifactId>
|
||||||
<groupId>commons-lang</groupId>
|
<groupId>commons-lang</groupId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>nladmin-logging</artifactId>
|
||||||
|
<groupId>org.nl</groupId>
|
||||||
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -228,12 +228,23 @@ public class PdmWorkTaskServiceImpl implements PdmWorkTaskService {
|
|||||||
String button_name = jo.getString("button_name");
|
String button_name = jo.getString("button_name");
|
||||||
|
|
||||||
JSONObject work_task = WQLObject.getWQLObject("PDM_BI_WorkTask").query("worktask_id = '" + worktask_id + "'").uniqueResult(0);
|
JSONObject work_task = WQLObject.getWQLObject("PDM_BI_WorkTask").query("worktask_id = '" + worktask_id + "'").uniqueResult(0);
|
||||||
|
JSONObject work_order = WQLObject.getWQLObject("PDM_BI_WorkOrder").query("workorder_id = '"+work_task.getString("workorder_id")+"'").uniqueResult(0);
|
||||||
String now_status = work_task.getString("status");
|
String now_status = work_task.getString("status");
|
||||||
|
|
||||||
String currentUserId = SecurityUtils.getCurrentUserId() + "";
|
String currentUserId = SecurityUtils.getCurrentUserId() + "";
|
||||||
String nickName = SecurityUtils.getNickName();
|
String nickName = SecurityUtils.getNickName();
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
if (StrUtil.isNotEmpty(status)) {
|
if (StrUtil.isNotEmpty(status)) {
|
||||||
|
WQLObject PDM_BI_ProduceProcessRoute = WQLObject.getWQLObject("pdm_bi_productprocessroute");
|
||||||
|
WQLObject PDM_BI_ProduceProcessRouteDtl = WQLObject.getWQLObject("pdm_bi_productprocessrouteDtl");
|
||||||
|
JSONObject Route = PDM_BI_ProduceProcessRoute.query("is_delete='0' and productprocess_status='20' and material_id='" + work_task.getString("material_id") + "'").uniqueResult(0);
|
||||||
|
if (Route == null) {
|
||||||
|
throw new BadRequestException(jo.getString("worktask_code") + "查不到对应产品工艺!");
|
||||||
|
}
|
||||||
|
String productprocess_id = Route.getString("productprocess_id");
|
||||||
|
|
||||||
|
JSONObject topDtl = PDM_BI_ProduceProcessRouteDtl.query("productprocess_id='" + productprocess_id + "'", "workprocedure_no").uniqueResult(0);
|
||||||
|
JSONObject lastDtl = PDM_BI_ProduceProcessRouteDtl.query("productprocess_id='" + productprocess_id + "'", "workprocedure_no desc").uniqueResult(0);
|
||||||
if (status.equals("20")) {
|
if (status.equals("20")) {
|
||||||
if (!now_status.equals("10")) {
|
if (!now_status.equals("10")) {
|
||||||
throw new PdaRequestException("当前工令工序任务状态不为生成!");
|
throw new PdaRequestException("当前工令工序任务状态不为生成!");
|
||||||
@@ -257,6 +268,11 @@ public class PdmWorkTaskServiceImpl implements PdmWorkTaskService {
|
|||||||
work_task.put("start_name", nickName);
|
work_task.put("start_name", nickName);
|
||||||
work_task.put("start_time", now);
|
work_task.put("start_time", now);
|
||||||
|
|
||||||
|
work_order.put("workprocedure_id",work_task.getString("workprocedure_id"));
|
||||||
|
work_order.put("workprocedure_code",work_task.getString("workprocedure_code"));
|
||||||
|
work_order.put("workprocedure_name",work_task.getString("workprocedure_name"));
|
||||||
|
|
||||||
|
|
||||||
//如果是配粉工序的开始,修改配方的状态
|
//如果是配粉工序的开始,修改配方的状态
|
||||||
if (work_task.getString("workprocedure_code").equals("GX001")) {
|
if (work_task.getString("workprocedure_code").equals("GX001")) {
|
||||||
/*HashMap<String, String> map = new HashMap<>();
|
/*HashMap<String, String> map = new HashMap<>();
|
||||||
@@ -273,6 +289,11 @@ public class PdmWorkTaskServiceImpl implements PdmWorkTaskService {
|
|||||||
work_task.put("device_id", device_info.getString("device_id"));
|
work_task.put("device_id", device_info.getString("device_id"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//更新工令表实际开始时间
|
||||||
|
if (topDtl.getString("workprocedure_code").equals(work_task.getString("workprocedure_code"))){
|
||||||
|
work_order.put("realstart_time", now);
|
||||||
|
}
|
||||||
|
WQLObject.getWQLObject("PDM_BI_WorkOrder").update(work_order);
|
||||||
}
|
}
|
||||||
if (status.equals("99")) {
|
if (status.equals("99")) {
|
||||||
if (!now_status.equals("30")) {
|
if (!now_status.equals("30")) {
|
||||||
@@ -285,6 +306,13 @@ public class PdmWorkTaskServiceImpl implements PdmWorkTaskService {
|
|||||||
throw new PdaRequestException("存在未完成的配方,无法结束!");
|
throw new PdaRequestException("存在未完成的配方,无法结束!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//更新工令表实际结束时间
|
||||||
|
if (lastDtl.getString("workprocedure_code").equals(work_task.getString("workprocedure_code"))){
|
||||||
|
work_order.put("realend_time", now);
|
||||||
|
}
|
||||||
|
WQLObject.getWQLObject("PDM_BI_WorkOrder").update(work_order);
|
||||||
|
|
||||||
work_task.put("status", "99");
|
work_task.put("status", "99");
|
||||||
work_task.put("end_id", currentUserId);
|
work_task.put("end_id", currentUserId);
|
||||||
work_task.put("end_name", nickName);
|
work_task.put("end_name", nickName);
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public class SparePartServiceImpl implements SparePartService {
|
|||||||
|
|
||||||
JSONObject returnjo = new JSONObject();
|
JSONObject returnjo = new JSONObject();
|
||||||
returnjo.put("code", "1");
|
returnjo.put("code", "1");
|
||||||
returnjo.put("row", row);
|
returnjo.put("content", row);
|
||||||
returnjo.put("desc", "操作成功!");
|
returnjo.put("desc", "操作成功!");
|
||||||
return returnjo;
|
return returnjo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
输入.sparepart_only_id TYPEAS s_string
|
输入.sparepart_only_id TYPEAS s_string
|
||||||
输入.device_code TYPEAS s_string
|
输入.device_code TYPEAS s_string
|
||||||
输入.maintenance_flag TYPEAS s_string
|
输入.maintenance_flag TYPEAS s_string
|
||||||
|
输入.iostorinvdtl_id TYPEAS s_string
|
||||||
|
|
||||||
|
|
||||||
[临时表]
|
[临时表]
|
||||||
@@ -64,10 +65,10 @@
|
|||||||
LEFT JOIN em_bi_iostorinvdtl dtl ON dtl.iostorinvdtl_id = dis.iostorinvdtl_id
|
LEFT JOIN em_bi_iostorinvdtl dtl ON dtl.iostorinvdtl_id = dis.iostorinvdtl_id
|
||||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = dis.material_id
|
LEFT JOIN md_me_materialbase mb ON mb.material_id = dis.material_id
|
||||||
LEFT JOIN em_bi_equipmentfile file ON file.devicerecord_id = mst.device_id
|
LEFT JOIN em_bi_equipmentfile file ON file.devicerecord_id = mst.device_id
|
||||||
LEFT JOIN
|
|
||||||
WHERE
|
WHERE
|
||||||
dis.sparepart_only_id = 输入.sparepart_only_id
|
dis.sparepart_only_id = 输入.sparepart_only_id
|
||||||
AND mst.device_id = 输入.device_id
|
AND mst.device_id = 输入.device_id
|
||||||
|
AND mst.bill_type = '010901'
|
||||||
AND mst.bill_status = '99'
|
AND mst.bill_status = '99'
|
||||||
AND mst.is_delete = '0'
|
AND mst.is_delete = '0'
|
||||||
AND dis.work_status = '99'
|
AND dis.work_status = '99'
|
||||||
@@ -164,6 +165,8 @@
|
|||||||
dis.iostorinvdtl_id = 输入.iostorinvdtl_id
|
dis.iostorinvdtl_id = 输入.iostorinvdtl_id
|
||||||
AND
|
AND
|
||||||
dis.sparepart_only_id = 输入.sparepart_only_id
|
dis.sparepart_only_id = 输入.sparepart_only_id
|
||||||
|
AND
|
||||||
|
dis.work_status = '01'
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDQUERY
|
ENDQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|||||||
@@ -157,17 +157,17 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
if (StrUtil.equals("Y", value2.toString())) {
|
if (StrUtil.equals("Y", value2.toString())) {
|
||||||
Object value3 = XmlUtil.getByXPath("//ufinterface/sendresult/content", xml, XPathConstants.STRING);
|
Object value3 = XmlUtil.getByXPath("//ufinterface/sendresult/content", xml, XPathConstants.STRING);
|
||||||
log.info("回传ERP成功!ID为------------------------:" + value3.toString());
|
log.info("回传ERP成功!ID为------------------------:" + value3.toString());
|
||||||
|
String currentUserId = SecurityUtils.getCurrentUserId() + "";
|
||||||
|
HashMap<String, String> map3 = new HashMap<>();
|
||||||
|
map3.put("is_upload", "1");
|
||||||
|
map3.put("upload_optid", currentUserId);
|
||||||
|
map3.put("upload_time", DateUtil.now());
|
||||||
|
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(map3, "iostorinv_id in " + finalIds);
|
||||||
} else {
|
} else {
|
||||||
throw new BadRequestException(value.toString());
|
throw new BadRequestException(value.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String currentUserId = SecurityUtils.getCurrentUserId() + "";
|
|
||||||
HashMap<String, String> map3 = new HashMap<>();
|
|
||||||
map3.put("is_upload", "1");
|
|
||||||
map3.put("upload_optid", currentUserId);
|
|
||||||
map3.put("upload_time", DateUtil.now());
|
|
||||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(map3, "iostorinv_id in " + finalIds);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -245,17 +245,17 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
if (StrUtil.equals("Y", value2.toString())) {
|
if (StrUtil.equals("Y", value2.toString())) {
|
||||||
Object value3 = XmlUtil.getByXPath("//ufinterface/sendresult/content", xml, XPathConstants.STRING);
|
Object value3 = XmlUtil.getByXPath("//ufinterface/sendresult/content", xml, XPathConstants.STRING);
|
||||||
log.info("回传ERP成功!ID为------------------------:" + value3.toString());
|
log.info("回传ERP成功!ID为------------------------:" + value3.toString());
|
||||||
|
String currentUserId = SecurityUtils.getCurrentUserId() + "";
|
||||||
|
HashMap<String, String> map3 = new HashMap<>();
|
||||||
|
map3.put("is_upload", "1");
|
||||||
|
map3.put("upload_optid", currentUserId);
|
||||||
|
map3.put("upload_time", DateUtil.now());
|
||||||
|
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(map3, "iostorinv_id in " + ids);
|
||||||
} else {
|
} else {
|
||||||
throw new BadRequestException(value.toString());
|
throw new BadRequestException(value.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String currentUserId = SecurityUtils.getCurrentUserId() + "";
|
|
||||||
HashMap<String, String> map3 = new HashMap<>();
|
|
||||||
map3.put("is_upload", "1");
|
|
||||||
map3.put("upload_optid", currentUserId);
|
|
||||||
map3.put("upload_time", DateUtil.now());
|
|
||||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(map3, "iostorinv_id in " + ids);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user