From 1ef275124e5c311daf06b84e961c62e43b748778 Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期二, 21 五月 2024 11:41:07 +0800
Subject: [PATCH] 后端获取报表数据
---
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java b/north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java
index 0e02dec..7a351f4 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java
@@ -68,11 +68,11 @@
//鏌ヨ娴佺▼鍗″伐鑹烘祦绋�
String technologicalProcess = reportingWorkMapper.SelectTechnologicalProcess(processIdStr);
- //瀹氫箟-鐨勪綅缃�
- int index = technologicalProcess.indexOf("-");
- //鑾峰彇宸ヨ壓娴佺▼绗竴涓伐搴�
- String interceptProcess = technologicalProcess.substring(0, index);
+
+
String[] processList = technologicalProcess.split("->");
+ //鑾峰彇宸ヨ壓娴佺▼绗竴涓伐搴�
+ String interceptProcess = processList[0];
int length = processList.length;
//瀹氫箟褰撳墠宸ュ簭涓婁笅宸ュ簭
@@ -356,6 +356,7 @@
JSONObject reportingWorkJson = new JSONObject(reportingWorkMap);
ReportingWork reportingWork = JSONObject.parseObject(JSONObject.toJSONString(reportingWorkJson.get("title")), ReportingWork.class);
List<ReportingWorkDetail> reportingWorkDetails = JSONArray.parseArray(JSONObject.toJSONString(reportingWorkJson.get("detail")), ReportingWorkDetail.class);
+
//鍒犻櫎鍒虹牬鏄庣粏琛ㄥ埡鐮存暟鎹�
damageDetailsMapper.delete(
new LambdaQueryWrapper<DamageDetails>()
@@ -371,6 +372,7 @@
//鏇寸粏鎶ュ伐涓昏〃
reportingWorkMapper.updateById(reportingWork);
reportingWorkDetails.forEach(reportingWorkDetail -> {
+ reportingWorkDetail.setReportingWorkId(reportingWork.getReportingWorkId());
List<DamageDetails> damageDetails = reportingWorkDetail.getDamageDetails();
//姣忎竴鏉℃姤宸ユ暟鎹惊鐜彃鍏ユ鐮存槑缁嗚〃
if (damageDetails != null && !damageDetails.isEmpty()) {
@@ -387,6 +389,14 @@
}
//鎻掑叆鎶ュ伐鏁版嵁
reportingWorkDetailMapper.insert(reportingWorkDetail);
+ orderProcessDetailMapper.insertByReportingWorkDetail(reportingWorkDetail,reportingWork.getProcessId(),reportingWork.getThisProcess());
+ //淇敼鍖呰鏃朵慨鏀瑰簱瀛樻暟閲�
+ if (reportingWork.getNextProcess()==null || reportingWork.getNextProcess().isEmpty()){
+ //鑾峰彇璇ユ姤宸ヤ慨鏀瑰悗鐨勫彲鍏ュ簱鏁伴噺
+ Integer inventory = reportingWorkDetailMapper.selectInventory(reportingWork.getProcessId(),Integer.parseInt(reportingWorkDetail.getOrderNumber()),Integer.parseInt(reportingWorkDetail.getTechnologyNumber()));
+ //淇敼娴佺▼鍗¤〃搴撳瓨鏁伴噺
+ flowCardMapper.updateInventory(reportingWork.getProcessId(),reportingWorkDetail.getOrderNumber(),reportingWorkDetail.getTechnologyNumber(),inventory);
+ }
});
//鑾峰彇璐ㄦ鏃堕棿
if (Objects.equals(reviewState, "review")) {
@@ -397,7 +407,7 @@
}
//淇敼灏忕墖娴佺▼琛ㄦ暟閲忎负鎶ュ伐鏄庣粏琛ㄦ暟閲�
- orderProcessDetailMapper.updateQuantity(reportingWork.getReportingWorkId(), reportingWork.getThisProcess(), "add");
+ //orderProcessDetailMapper.updateQuantity(reportingWork.getReportingWorkId(), reportingWork.getThisProcess(), "add");
return true;
}
--
Gitblit v1.8.0