From 40c75db6d335a0335e944e5196a102d8837cad6b Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期一, 15 七月 2024 21:00:28 +0800
Subject: [PATCH] 工时bug修改+光纤接头损耗报告完成
---
inspect-server/src/main/java/com/yuanchu/mom/service/InsOrderService.java | 2
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java | 209 +++++++++++++++++------------
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderServiceImpl.java | 15 ++
performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryOutputWorkingHoursServiceImpl.java | 3
performance-server/src/main/resources/mapper/AuxiliaryOriginalHoursMapper.xml | 12
performance-server/src/main/resources/mapper/AuxiliaryOutputWorkingHoursMapper.xml | 30 ++--
performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryOriginalHoursServiceImpl.java | 3
performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryWorkingHoursDayServiceImpl.java | 3
performance-server/src/main/resources/mapper/AuxiliaryCorrectionHoursMapper.xml | 8
inspect-server/src/main/resources/mapper/InsOrderMapper.xml | 31 ++++
performance-server/src/main/resources/mapper/AuxiliaryWorkingHoursDayMapper.xml | 41 ++---
inspect-server/src/main/java/com/yuanchu/mom/controller/InsOrderController.java | 9 +
performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryCorrectionHoursServiceImpl.java | 3
inspect-server/src/main/java/com/yuanchu/mom/mapper/InsOrderMapper.java | 2
14 files changed, 235 insertions(+), 136 deletions(-)
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/controller/InsOrderController.java b/inspect-server/src/main/java/com/yuanchu/mom/controller/InsOrderController.java
index a321c6e..0af2a5a 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/controller/InsOrderController.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/controller/InsOrderController.java
@@ -142,6 +142,15 @@
CostStatisticsDto costStatisticsDto = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), CostStatisticsDto.class);
return Result.success(insOrderService.costStatistics(page, costStatisticsDto));
}
+
+ @ValueAuth
+ @ApiOperation(value = "璐圭敤缁熻鑾峰彇鎬讳环")
+ @PostMapping("/costStatistics2")
+ public Result<?> costStatistics2(@RequestBody Map<String, Object> data) throws Exception {
+ CostStatisticsDto costStatisticsDto = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), CostStatisticsDto.class);
+ return Result.success(insOrderService.costStatistics2(costStatisticsDto));
+ }
+
@ValueClassify("缁熻鍥捐〃")
@ApiOperation(value = "鏍峰搧缂洪櫡鎸囨暟")
@PostMapping("/selectSampleDefects")
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/mapper/InsOrderMapper.java b/inspect-server/src/main/java/com/yuanchu/mom/mapper/InsOrderMapper.java
index 04ae100..4167ff4 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/mapper/InsOrderMapper.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/mapper/InsOrderMapper.java
@@ -35,6 +35,8 @@
IPage<CostStatisticsDto> selectCostStatistics(IPage<CostStatisticsDto> page, QueryWrapper<CostStatisticsDto> ew);
+ List<CostStatisticsDto> selectCostStatistics2(@Param("ew") QueryWrapper<CostStatisticsDto> ew);
+
List<Map<String, String>> selectDeviceList(Set<String> names);
List<SampleDefectsFatherVo> selectSampleDefects(Page page, @Param("inspectionItems") String inspectionItems, @Param("orderNumber") String orderNumber);
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/InsOrderService.java b/inspect-server/src/main/java/com/yuanchu/mom/service/InsOrderService.java
index f947c9c..f00cc68 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/service/InsOrderService.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/InsOrderService.java
@@ -34,6 +34,8 @@
Map<String, Object> costStatistics(IPage<CostStatisticsDto> page, CostStatisticsDto costStatisticsDto);
+ Map<String, Object> costStatistics2(CostStatisticsDto costStatisticsDto);
+
Map<String, Object> selectSampleDefects(Page page, String inspectionItems, String orderNumber);
int updateStatus(Integer id);
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
index 58fbd36..acfb168 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
@@ -914,8 +914,9 @@
for (long i = 0; i < size; i++) {
if (i % number == 0) {
List<RowRenderData> rows = new ArrayList<>();
- //琛ㄦ牸鐨勮鏁� 鈭� 鉁� 鉁�
- for (int j = 0; j < number + 3; j++) {
+ //琛ㄦ牸鐨勮鏁� 脳 鈭� 鉁� 鉁�
+ long count1 = size-(index-1)*number < number ? size-(index-1)*number + 3 : number + 3;
+ for (int j = 0; j <count1 ; j++) {
RowRenderData rowRenderData = new RowRenderData();
RowStyle rowStyle = new RowStyle();
rowStyle.setHeight(40);
@@ -957,7 +958,6 @@
cellRenderData.setParagraphs(paragraphRenderDataList);
cells.add(cellRenderData);
}
-
}
else if (j == 1) {
//绗簩琛�
@@ -1003,7 +1003,7 @@
cells.add(cellRenderData);
}
}
- else if (j == number + 2) {
+ else if (j == count1-1) {
//鏈�鍚庝竴琛�
if (k == 0 || k == 1) {
//鍓嶄袱鍒�
@@ -1014,7 +1014,7 @@
cellRenderData.setParagraphs(paragraphRenderDataList);
cells.add(cellRenderData);
} else {
- textRenderData.setText("鈥溾湐鈥濊〃绀洪」鐩悎鏍硷紝鈥溾湒鈥濊〃绀洪」鐩笉鍚堟牸@鈥溾湐鈥漣ndicates test Item is qualified锛屸�溾湒鈥漣ndicates test Item is unqualified鈭�19");
+ textRenderData.setText("鈥溾垰鈥濊〃绀洪」鐩悎鏍硷紝鈥溍椻�濊〃绀洪」鐩笉鍚堟牸@鈥溾垰鈥漣ndicates test Item is qualified锛屸�溍椻�漣ndicates test Item is unqualified鈭�19");
renderData.add(textRenderData);
paragraphRenderData.setContents(renderData);
paragraphRenderDataList.add(paragraphRenderData);
@@ -1031,10 +1031,14 @@
paragraphRenderDataList.add(paragraphRenderData);
cellRenderData.setParagraphs(paragraphRenderDataList);
cells.add(cellRenderData);
- }
- else if (k == 1) {
+ } else if (k == 1) {
//绗簩鍒�
- String insProduct = filteredProducts.get((int) ((j - 2) + 10 * (index - 1)));
+ String insProduct;
+ try {
+ insProduct = filteredProducts.get((int) ((j - 2) + 10 * (index - 1)));
+ } catch (Exception e) {
+ continue;
+ }
String[] split = insProduct.split(",");
if (ObjectUtils.isEmpty(split[1]) || split[1].equals("")) {
textRenderData.setText(split[0]);
@@ -1046,11 +1050,15 @@
paragraphRenderDataList.add(paragraphRenderData);
cellRenderData.setParagraphs(paragraphRenderDataList);
cells.add(cellRenderData);
- }
- else if (k == 2) {
+ } else if (k == 2) {
//绗笁鍒�
//鍏堝垽鏂楠岄」鏄惁鏈夊瓙绫�
- String insProduct = filteredProducts.get((int) ((j - 2) + 10 * (index - 1)));
+ String insProduct;
+ try {
+ insProduct = filteredProducts.get((int) ((j - 2) + 10 * (index - 1)));
+ } catch (Exception e) {
+ continue;
+ }
String[] split = insProduct.split(",");
if (ObjectUtils.isEmpty(split[2]) || split[2].equals("")) {
//濡傛灉娌℃湁瀛愮被
@@ -1069,11 +1077,15 @@
paragraphRenderDataList.add(paragraphRenderData);
cellRenderData.setParagraphs(paragraphRenderDataList);
cells.add(cellRenderData);
- }
- else if (k == 3) {
+ } else if (k == 3) {
//绗洓鍒�
//鍏堝垽鏂楠岄」鏄惁鏈夊瓙绫�
- String insProduct = filteredProducts.get((int) ((j - 2) + 10 * (index - 1)));
+ String insProduct;
+ try {
+ insProduct = filteredProducts.get((int) ((j - 2) + 10 * (index - 1)));
+ } catch (Exception e) {
+ continue;
+ }
String[] split = insProduct.split(",");
if (ObjectUtils.isEmpty(split[2]) || split[2].equals("")) {
//濡傛灉娌℃湁瀛愮被
@@ -1087,10 +1099,14 @@
paragraphRenderDataList.add(paragraphRenderData);
cellRenderData.setParagraphs(paragraphRenderDataList);
cells.add(cellRenderData);
- }
- else if (k == 4) {
+ } else if (k == 4) {
//绗簲鍒�
- String insProduct = filteredProducts.get((int) ((j - 2) + 10 * (index - 1)));
+ String insProduct;
+ try {
+ insProduct = filteredProducts.get((int) ((j - 2) + 10 * (index - 1)));
+ } catch (Exception e) {
+ continue;
+ }
String[] split = insProduct.split(",");
//鏌ヨ鎵�鏈夋牱鍝佽妫�楠岄」鐨勬楠岀粨鏋�(鏈�缁堝��)
List<InsProduct> products = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery()
@@ -1105,16 +1121,20 @@
Optional<String> min = products.stream().map(InsProduct::getLastValue)
.filter(value -> !value.isEmpty())
.min(String::compareTo);
- textRenderData.setText(min+"-"+max);//妫�楠岀粨鏋�
+ textRenderData.setText(min.get() + "-" + max.get());//妫�楠岀粨鏋�
renderData.add(textRenderData);
paragraphRenderData.setContents(renderData);
paragraphRenderDataList.add(paragraphRenderData);
cellRenderData.setParagraphs(paragraphRenderDataList);
cells.add(cellRenderData);
- }
- else {
+ } else {
//鏈�鍚庝竴鍒�
- String insProduct = filteredProducts.get((int) ((j - 2) + 10 * (index - 1)));
+ String insProduct;
+ try {
+ insProduct = filteredProducts.get((int) ((j - 2) + 10 * (index - 1)));
+ } catch (Exception e) {
+ continue;
+ }
String[] split = insProduct.split(",");
//鏌ヨ鎵�鏈夋牱鍝佽妫�楠岄」鐨勬楠岀粨璁�(ins_result)
List<InsProduct> products = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery()
@@ -1125,10 +1145,10 @@
List<Integer> result = products.stream().map(InsProduct::getInsResult).distinct().collect(Collectors.toList());
if (result.size() == 1 && result.contains(1)) {
//鍚堟牸
- textRenderData.setText("鉁�");
- }else {
+ textRenderData.setText("鈭�");
+ } else {
//涓嶅悎鏍�
- textRenderData.setText("鉁�");
+ textRenderData.setText("脳");
}
renderData.add(textRenderData);
paragraphRenderData.setContents(renderData);
@@ -1152,7 +1172,7 @@
}
System.out.println("");*/
if (row.getCells().size() != countSize) {
- throw new ErrorException("姣忚鍗曞厓鏍间笉鐩哥瓑");
+ throw new ErrorException("姣忚鍗曞厓鏍间笉鐩哥瓑1");
}
}
TableStyle tableStyle = new TableStyle();
@@ -1178,7 +1198,7 @@
long index4 = 1;
//妫�楠屾姤鍛婃姤鍛�(褰撴楠岄」鐩秴杩�7涓柊寤鸿〃)
for (long j = 0; j < size; j++) {
- if (j%number2==0){
+ if (j % number2 == 0) {
List<RowRenderData> rows = new ArrayList<>();
//琛ㄦ牸鐨勮鏁�(鏍规嵁鏍峰搧鏁伴噺鏉�)
for (int i = 0; i < samples.size() + 2; i++) {
@@ -1204,9 +1224,9 @@
style.setFontFamily("瀹嬩綋");
style.setColor("000000");
textRenderData.setStyle(style);
- if (i==0){
+ if (i == 0) {
//绗竴琛�
- if (k==0){
+ if (k == 0) {
//绗竴鍒�
textRenderData.setText("鏍峰搧缂栧彿@Sample number鈭�30");
renderData.add(textRenderData);
@@ -1214,22 +1234,26 @@
paragraphRenderDataList.add(paragraphRenderData);
cellRenderData.setParagraphs(paragraphRenderDataList);
cells.add(cellRenderData);
- }
- else {
+ } else {
//绗簩鍒�
- String product = filteredProducts.get((int) ((k - 1) + (index4 - 1) * 7));
+ String product;
+ try {
+ product = filteredProducts.get((int) ((k - 1) + (index4 - 1) * 7));
+ } catch (Exception e) {
+ continue;
+ }
String[] split = product.split(",");
- if (ObjectUtils.isEmpty(split[2])||split[2].equals("")){
- if (ObjectUtils.isEmpty(split[1]) || split[1].equals("")){
- textRenderData.setText(split[0]+"鈭�3"+k);
- }else {
- textRenderData.setText(split[0]+"@"+split[1]+"鈭�3"+k);
+ if (ObjectUtils.isEmpty(split[2]) || split[2].equals("")) {
+ if (ObjectUtils.isEmpty(split[1]) || split[1].equals("")) {
+ textRenderData.setText(split[0] + "鈭�3" + k);
+ } else {
+ textRenderData.setText(split[0] + "@" + split[1] + "鈭�3" + k);
}
- }else {
- if (ObjectUtils.isEmpty(split[1]) || split[1].equals("")){
+ } else {
+ if (ObjectUtils.isEmpty(split[1]) || split[1].equals("")) {
textRenderData.setText(split[0]);
- }else {
- textRenderData.setText(split[0]+"@"+split[1]);
+ } else {
+ textRenderData.setText(split[0] + "@" + split[1]);
}
}
renderData.add(textRenderData);
@@ -1238,10 +1262,9 @@
cellRenderData.setParagraphs(paragraphRenderDataList);
cells.add(cellRenderData);
}
- }
- else if (i==1){
+ } else if (i == 1) {
//绗簩琛�
- if (k==0){
+ if (k == 0) {
//绗竴鍒�
textRenderData.setText("鏍峰搧缂栧彿@Sample number鈭�30");
renderData.add(textRenderData);
@@ -1249,22 +1272,26 @@
paragraphRenderDataList.add(paragraphRenderData);
cellRenderData.setParagraphs(paragraphRenderDataList);
cells.add(cellRenderData);
- }
- else {
+ } else {
//绗簩鍒�
- String product = filteredProducts.get((int) ((k - 1) + (index4 - 1) * 7));
+ String product;
+ try {
+ product = filteredProducts.get((int) ((k - 1) + (index4 - 1) * 7));
+ } catch (Exception e) {
+ continue;
+ }
String[] split = product.split(",");
- if (ObjectUtils.isEmpty(split[2])||split[2].equals("")){
- if (ObjectUtils.isEmpty(split[1]) || split[1].equals("")){
- textRenderData.setText(split[0]+"鈭�3"+k);
- }else {
- textRenderData.setText(split[0]+"@"+split[1]+"鈭�3"+k);
+ if (ObjectUtils.isEmpty(split[2]) || split[2].equals("")) {
+ if (ObjectUtils.isEmpty(split[1]) || split[1].equals("")) {
+ textRenderData.setText(split[0] + "鈭�3" + k);
+ } else {
+ textRenderData.setText(split[0] + "@" + split[1] + "鈭�3" + k);
}
- }else {
- if (ObjectUtils.isEmpty(split[3]) || split[3].equals("")){
+ } else {
+ if (ObjectUtils.isEmpty(split[3]) || split[3].equals("")) {
textRenderData.setText(split[2]);
- }else {
- textRenderData.setText(split[2]+"@"+split[3]);
+ } else {
+ textRenderData.setText(split[2] + "@" + split[3]);
}
}
renderData.add(textRenderData);
@@ -1273,27 +1300,30 @@
cellRenderData.setParagraphs(paragraphRenderDataList);
cells.add(cellRenderData);
}
- }
- else {
- if (k==0){
+ } else {
+ if (k == 0) {
//绗竴鍒�
- textRenderData.setText(samples.get(i-2).getSampleCode());
+ textRenderData.setText(samples.get(i - 2).getSampleCode());
renderData.add(textRenderData);
paragraphRenderData.setContents(renderData);
paragraphRenderDataList.add(paragraphRenderData);
cellRenderData.setParagraphs(paragraphRenderDataList);
cells.add(cellRenderData);
- }
- else {
+ } else {
//鏍规嵁鏍峰搧缂栧彿鍜岄」鐩幓鏌ヨ鏈�缁堝��
- String product = filteredProducts.get((int) ((k - 1) + (index4 - 1) * 7));
+ String product;
+ try {
+ product = filteredProducts.get((int) ((k - 1) + (index4 - 1) * 7));
+ } catch (Exception e) {
+ continue;
+ }
String[] split = product.split(",");
InsProduct insProduct = insProductMapper.selectOne(Wrappers.<InsProduct>lambdaQuery()
.eq(InsProduct::getState, 1)
.eq(InsProduct::getInsSampleId, samples.get(i - 2).getId())
.eq(InsProduct::getInspectionItem, split[0])
.eq(InsProduct::getInspectionItemSubclass, split[2]));
- if (ObjectUtils.isEmpty(insProduct)){
+ if (ObjectUtils.isEmpty(insProduct)) {
//鍙兘鏍规嵁姝e父鐨勬牱鍝佺紪鍙峰拰鍏夌氦鎺ュご鎹熻�楃殑椤圭洰鏌ヤ笉鍒板搴旂殑椤圭洰,鍒欓渶瑕佹牴鎹�"/"鏉ユ煡
List<InsSample> sampleList = insSampleMapper.selectList(Wrappers.<InsSample>lambdaQuery().like(InsSample::getSampleCode, samples.get(i - 2).getSampleCode()));
List<InsProduct> products = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery()
@@ -1301,7 +1331,7 @@
.in(InsProduct::getInsSampleId, sampleList.stream().map(InsSample::getId).collect(Collectors.toList()))
.eq(InsProduct::getInspectionItem, split[0])
.eq(InsProduct::getInspectionItemSubclass, split[2]));
- insProduct=products.get(0);
+ insProduct = products.get(0);
}
textRenderData.setText(insProduct.getLastValue());
renderData.add(textRenderData);
@@ -1327,7 +1357,7 @@
}
System.out.println("");*/
if (row.getCells().size() != countSize) {
- throw new ErrorException("姣忚鍗曞厓鏍间笉鐩哥瓑");
+ throw new ErrorException("姣忚鍗曞厓鏍间笉鐩哥瓑2");
}
}
TableStyle tableStyle = new TableStyle();
@@ -1355,12 +1385,14 @@
List<InsSample> sampleList = insSamples.stream().filter(insSample -> insSample.getSampleCode().contains("/")).collect(Collectors.toList());
//杩囨护鍑哄厜绾ゆ帴澶存崯鑰楃殑妫�楠岄」鐩�
List<String> strings = filteredProducts.stream().filter(s -> s.contains("鍏夌氦鎺ュご鎹熻��")).distinct().collect(Collectors.toList());
+ long index41 = 1;
for (int i = 0; i < sampleList.size(); i++) {
- if (i%16==0){
+ if (i % 16 == 0) {
//鏍峰搧鏁伴噺瓒呰繃16闇�瑕佹柊澧炶〃鏍�
List<RowRenderData> rows = new ArrayList<>();
+ int count2 = sampleList.size()-(index41-1)*16 < 16 ? (int) (sampleList.size() - (index41 - 1) * 16 + 1) : 17;
//琛ㄦ牸鐨勮鏁�
- for (int j = 0; j < 17; j++) {
+ for (int j = 0; j < count2; j++) {
RowRenderData rowRenderData = new RowRenderData();
RowStyle rowStyle = new RowStyle();
rowStyle.setHeight(40);
@@ -1383,9 +1415,9 @@
style.setFontFamily("瀹嬩綋");
style.setColor("000000");
textRenderData.setStyle(style);
- if (j==0){
+ if (j == 0) {
//绗竴琛�
- if (k==0){
+ if (k == 0) {
//绗竴鍒�
textRenderData.setText("鍏夌氦绫诲瀷@Fiber type");
renderData.add(textRenderData);
@@ -1393,7 +1425,7 @@
paragraphRenderDataList.add(paragraphRenderData);
cellRenderData.setParagraphs(paragraphRenderDataList);
cells.add(cellRenderData);
- }else if (k==1 || k==2){
+ } else if (k == 1 || k == 2) {
//绗簩 涓夊垪
textRenderData.setText("鏍峰搧缂栧彿@Sample number");
renderData.add(textRenderData);
@@ -1401,12 +1433,12 @@
paragraphRenderDataList.add(paragraphRenderData);
cellRenderData.setParagraphs(paragraphRenderDataList);
cells.add(cellRenderData);
- }else {
+ } else {
String[] split = strings.get(k - 3).split(",");
- if (ObjectUtils.isEmpty(split[3])|| split[3].equals("")){
+ if (ObjectUtils.isEmpty(split[3]) || split[3].equals("")) {
textRenderData.setText(split[2]);
- }else {
- textRenderData.setText(split[2]+"@"+split[3]);
+ } else {
+ textRenderData.setText(split[2] + "@" + split[3]);
}
renderData.add(textRenderData);
paragraphRenderData.setContents(renderData);
@@ -1416,34 +1448,31 @@
}
}
else {
- if (k==0){
+ if (k == 0) {
//绗竴鍒�
- textRenderData.setText(sampleList.get(0).getSampleCode()+"鈭�44");
+ textRenderData.setText(sampleList.get(0).getModel() + "鈭�44");
renderData.add(textRenderData);
paragraphRenderData.setContents(renderData);
paragraphRenderDataList.add(paragraphRenderData);
cellRenderData.setParagraphs(paragraphRenderDataList);
cells.add(cellRenderData);
- }
- else if (k==1){
+ } else if (k == 1) {
//绗簩鍒�
- textRenderData.setText(sampleList.get(j-1).getSampleCode().split("/")[0]);
+ textRenderData.setText(sampleList.get(j - 1).getSampleCode().split("/")[0]);
renderData.add(textRenderData);
paragraphRenderData.setContents(renderData);
paragraphRenderDataList.add(paragraphRenderData);
cellRenderData.setParagraphs(paragraphRenderDataList);
cells.add(cellRenderData);
- }
- else if (k==2){
+ } else if (k == 2) {
//绗笁鍒�
- textRenderData.setText(sampleList.get(j-1).getSampleCode().split("/")[1]);
+ textRenderData.setText(sampleList.get(j - 1).getSampleCode().split("/")[1]);
renderData.add(textRenderData);
paragraphRenderData.setContents(renderData);
paragraphRenderDataList.add(paragraphRenderData);
cellRenderData.setParagraphs(paragraphRenderDataList);
cells.add(cellRenderData);
- }
- else {
+ } else {
//鏍规嵁瀵瑰簲鐨勬牱鍝佺紪鍙峰拰妫�楠岄」鐩煡璇㈠搴旀暟鎹�(鏈�缁堝��)
String[] split = strings.get(k - 3).split(",");
InsProduct insProduct = insProductMapper.selectOne(Wrappers.<InsProduct>lambdaQuery()
@@ -1474,7 +1503,7 @@
}
System.out.println("");*/
if (row.getCells().size() != countSize) {
- throw new ErrorException("姣忚鍗曞厓鏍间笉鐩哥瓑");
+ throw new ErrorException("姣忚鍗曞厓鏍间笉鐩哥瓑3");
}
}
TableStyle tableStyle = new TableStyle();
@@ -1492,9 +1521,10 @@
Map<String, Object> table = new HashMap<>();
table.put("table4", tableRenderData);
table.put("report", insReport);
- table.put("index4", index4+1);
+ table.put("index4", index4 + 1);
tables4.add(table);
index4++;
+ index41++;
}
}
tables4.forEach(table4 -> {
@@ -1762,7 +1792,7 @@
}
System.out.println("");*/
if (row.getCells().size() != countSize) {
- throw new ErrorException("姣忚鍗曞厓鏍间笉鐩哥瓑");
+ throw new ErrorException("姣忚鍗曞厓鏍间笉鐩哥瓑4");
}
}
TableStyle tableStyle = new TableStyle();
@@ -2200,8 +2230,7 @@
if (rowRenderData.getCells().size() != 0) {
rows.add(rowRenderData);
}
- }
- else {
+ } else {
//濡傛灉鏈夊娆″惊鐜�
if (i == 0) {
//绗竴娆″惊鐜殑鍒楁暟,閭d箞鍒楁暟鍖呮嫭20鈩冨父娓�(2 * (size-nm.size()) -nm.size()+1)
@@ -3044,7 +3073,7 @@
}
System.out.println("");*/
if (row.getCells().size() != countSize) {
- throw new ErrorException("姣忚鍗曞厓鏍间笉鐩哥瓑");
+ throw new ErrorException("姣忚鍗曞厓鏍间笉鐩哥瓑5");
}
}
TableStyle tableStyle = new TableStyle();
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderServiceImpl.java
index a9cc3f9..952e942 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderServiceImpl.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderServiceImpl.java
@@ -404,6 +404,21 @@
}
@Override
+ public Map<String, Object> costStatistics2(CostStatisticsDto costStatisticsDto) {
+ Map<String, Object> map = new HashMap<>();
+ String dates = costStatisticsDto.getDates();
+ String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(",");
+ costStatisticsDto.setDates(null);
+ List<CostStatisticsDto> costStatisticsDtos = insOrderMapper.selectCostStatistics2(QueryWrappers.queryWrappers(costStatisticsDto).ge("create_time", split[0]).le("create_time", split[1] + " 23:59:59"));
+ double totalPrice = costStatisticsDtos.stream()
+ .filter(dto -> dto.getPrice() != null) // 杩囨护鎺変环鏍间负 null 鐨勫璞�
+ .mapToDouble(value -> value.getPrice().doubleValue())
+ .sum();
+ map.put("total",totalPrice);
+ return map;
+ }
+
+ @Override
public Map<String, Object> selectSampleDefects(Page page, String inspectionItems, String orderNumber) {
List<SampleDefectsFatherVo> sampleDefectsFatherVos = insOrderMapper.selectSampleDefects(page, inspectionItems, orderNumber);
Map<String, Object> map = new HashMap<>();
diff --git a/inspect-server/src/main/resources/mapper/InsOrderMapper.xml b/inspect-server/src/main/resources/mapper/InsOrderMapper.xml
index 2b23894..658c793 100644
--- a/inspect-server/src/main/resources/mapper/InsOrderMapper.xml
+++ b/inspect-server/src/main/resources/mapper/InsOrderMapper.xml
@@ -300,4 +300,35 @@
and ins_sample_id in
(select id from ins_sample where ins_order_id = #{id}))
</select>
+
+ <select id="selectCostStatistics2" resultType="com.yuanchu.mom.dto.CostStatisticsDto">
+ select * from (
+ SELECT
+ i.id,
+ i.entrust_code,
+ i.create_time,
+ isa.sample,
+ isa.model,
+ c.price,
+ c.cost,
+ c.inspection_item,
+ u.company,
+ u.`name`,
+ i.create_user,
+ c.ins_sample_id
+ FROM
+ ins_order i
+ LEFT JOIN ins_sample isa ON isa.ins_order_id = i.id
+ LEFT JOIN `user` u ON u.id = i.user_id
+ LEFT JOIN (select SUM(b.price) price, sum(b.man_hour) cost,b.ins_sample_id,GROUP_CONCAT(b.inspection_item2
+ SEPARATOR ',')
+ inspection_item from (select *,GROUP_CONCAT(inspection_item
+ SEPARATOR ',') inspection_item2 from ins_product where state = 1 GROUP BY ins_sample_id,man_hour_group) b GROUP
+ BY b.ins_sample_id) c ON c.ins_sample_id = isa.id
+ where (i.state = 1 or i.state = 3 or i.state = 4)
+ ) a
+ <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
+ ${ew.customSqlSegment}
+ </if>
+ </select>
</mapper>
diff --git a/performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryCorrectionHoursServiceImpl.java b/performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryCorrectionHoursServiceImpl.java
index 957044d..4eb65ab 100644
--- a/performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryCorrectionHoursServiceImpl.java
+++ b/performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryCorrectionHoursServiceImpl.java
@@ -96,6 +96,9 @@
}
}
}
+ if (ids.size()==0){
+ ids=null;
+ }
map.put("body", auxiliaryCorrectionHoursMapper.selectAuxiliaryCorrectionHours(page, QueryWrappers.queryWrappers(auxiliaryCorrectionHoursDto).eq("month", auxiliaryCorrectionHoursDto.getMonth()), ids));
return map;
}
diff --git a/performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryOriginalHoursServiceImpl.java b/performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryOriginalHoursServiceImpl.java
index c09609b..3331665 100644
--- a/performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryOriginalHoursServiceImpl.java
+++ b/performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryOriginalHoursServiceImpl.java
@@ -102,6 +102,9 @@
ids.clear();
ids.add(userMapper.selectOne(Wrappers.<User>lambdaQuery().like(User::getName, name)).getId());
}
+ if (ids.size()==0){
+ ids=null;
+ }
IPage<AuxiliaryOriginalHoursDto> originalHoursDtoIPage = new Page<>();
originalHoursDtoIPage.setSize(page.getSize());
originalHoursDtoIPage.setCurrent(page.getCurrent());
diff --git a/performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryOutputWorkingHoursServiceImpl.java b/performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryOutputWorkingHoursServiceImpl.java
index fdd03cf..753a514 100644
--- a/performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryOutputWorkingHoursServiceImpl.java
+++ b/performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryOutputWorkingHoursServiceImpl.java
@@ -90,6 +90,9 @@
ids.addAll(users.stream().map(User::getId).distinct().collect(Collectors.toList()));
}
}
+ if (ids.size()==0){
+ ids=null;
+ }
if (ObjectUtils.isNotEmpty(dates) && ObjectUtils.isNotEmpty(week)){
String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(",");
String[] weeks = week.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(",");
diff --git a/performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryWorkingHoursDayServiceImpl.java b/performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryWorkingHoursDayServiceImpl.java
index d94d359..0a1f27d 100644
--- a/performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryWorkingHoursDayServiceImpl.java
+++ b/performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryWorkingHoursDayServiceImpl.java
@@ -86,6 +86,9 @@
ids.addAll(users.stream().map(User::getId).distinct().collect(Collectors.toList()));
}
}
+ if (ids.size()==0){
+ ids=null;
+ }
if (ObjectUtils.isNotEmpty(dates) && ObjectUtils.isNotEmpty(week)) {
String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(",");
String[] weeks = week.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(",");
diff --git a/performance-server/src/main/resources/mapper/AuxiliaryCorrectionHoursMapper.xml b/performance-server/src/main/resources/mapper/AuxiliaryCorrectionHoursMapper.xml
index a57a4c3..d898a23 100644
--- a/performance-server/src/main/resources/mapper/AuxiliaryCorrectionHoursMapper.xml
+++ b/performance-server/src/main/resources/mapper/AuxiliaryCorrectionHoursMapper.xml
@@ -49,13 +49,13 @@
select ach.*,name
FROM auxiliary_correction_hours ach
left join user on user.id=ach.name_user
- WHERE name_user in(#{ids})
- <!--<if test="ids !=null and ids != ''">
- WHERE name_user in
+ WHERE 1=1
+ <if test="ids !=null and ids != ''">
+ and name_user in
<foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
#{val}
</foreach>
- </if>-->
+ </if>
) A
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
${ew.customSqlSegment}
diff --git a/performance-server/src/main/resources/mapper/AuxiliaryOriginalHoursMapper.xml b/performance-server/src/main/resources/mapper/AuxiliaryOriginalHoursMapper.xml
index 1e9a012..110813c 100644
--- a/performance-server/src/main/resources/mapper/AuxiliaryOriginalHoursMapper.xml
+++ b/performance-server/src/main/resources/mapper/AuxiliaryOriginalHoursMapper.xml
@@ -18,13 +18,13 @@
left join department_lims dl on depart_lims_id = dl.id
where date_time LIKE CONCAT('%', #{month}, '%')
and awhd.state='宸叉壒鍑�'
- and name_user in(#{ids})
- <!-- <if test="ids !=null and ids != ''">
+ <!--and name_user in(#{ids})-->
+ <if test="ids !=null and ids != ''">
and name_user in
<foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
#{val}
</foreach>
- </if>-->
+ </if>
order by month
) A
group by A.name, A.month) C
@@ -40,13 +40,13 @@
left join user on user.id = aowh.`check`
left join department_lims dl on depart_lims_id = dl.id
where date_time LIKE CONCAT('%', #{month}, '%')
- and `check` in(#{ids})
- <!--<if test="ids !=null and ids != ''">
+ <!--and `check` in(#{ids})-->
+ <if test="ids !=null and ids != ''">
and `check` in
<foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
#{val}
</foreach>
- </if>-->
+ </if>
group by user.name, month
order by user.name, month
) B
diff --git a/performance-server/src/main/resources/mapper/AuxiliaryOutputWorkingHoursMapper.xml b/performance-server/src/main/resources/mapper/AuxiliaryOutputWorkingHoursMapper.xml
index 228be28..aca6fec 100644
--- a/performance-server/src/main/resources/mapper/AuxiliaryOutputWorkingHoursMapper.xml
+++ b/performance-server/src/main/resources/mapper/AuxiliaryOutputWorkingHoursMapper.xml
@@ -39,13 +39,13 @@
name
FROM auxiliary_output_working_hours aowh
left join user on user.id=aowh.`check`
- WHERE `check` in(#{ids})
- <!--<if test="ids !=null and ids != ''">
- WHERE `check` in
+ WHERE 1=1
+ <if test="ids !=null and ids != ''">
+ and `check` in
<foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
#{val}
</foreach>
- </if>-->
+ </if>
) A
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
${ew.customSqlSegment}
@@ -55,13 +55,13 @@
select aowh.*,name
FROM auxiliary_output_working_hours aowh
left join user on user.id=aowh.`check`
- WHERE `check` in(#{ids})
- <!-- <if test="ids !=null and ids != ''">
- WHERE `check` in
+ WHERE 1=1
+ <if test="ids !=null and ids != ''">
+ and `check` in
<foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
#{val}
</foreach>
- </if>-->
+ </if>
</select>
<select id="totalHours" resultType="java.util.Map">
select A.name,
@@ -75,13 +75,13 @@
left join user on user.id=aowh.`check`
left join department_lims dl on depart_lims_id=dl.id
where date_time LIKE CONCAT('%', #{month}, '%')
- and `check` in (#{ids})
- <!--<if test="ids !=null and ids != ''">
- and `check` in (#ids)
+ <!--and `check` in (#{ids})-->
+ <if test="ids !=null and ids != ''">
+ and `check` in
<foreach collection="ids" open="(" separator="," close=")" item="val">
#{val}
</foreach>
- </if>-->
+ </if>
group by user.name,date_time
order by user.name,date_time
)A
@@ -89,12 +89,12 @@
<select id="selectListByIds" resultType="com.yuanchu.mom.pojo.AuxiliaryOutputWorkingHours">
select * from auxiliary_output_working_hours
where 1=1
- and `check` in(#{ids})
- <!--<if test="ids !=null and ids != ''">
+ <!--and `check` in(#{ids})-->
+ <if test="ids !=null and ids != ''">
and `check` in
<foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
#{val}
</foreach>
- </if>-->
+ </if>
</select>
</mapper>
diff --git a/performance-server/src/main/resources/mapper/AuxiliaryWorkingHoursDayMapper.xml b/performance-server/src/main/resources/mapper/AuxiliaryWorkingHoursDayMapper.xml
index 4a77ae2..48b7a4a 100644
--- a/performance-server/src/main/resources/mapper/AuxiliaryWorkingHoursDayMapper.xml
+++ b/performance-server/src/main/resources/mapper/AuxiliaryWorkingHoursDayMapper.xml
@@ -31,13 +31,13 @@
select awhd.*,name
FROM auxiliary_working_hours_day awhd
left join user on name_user=user.id
- WHERE name_user in(#{ids})
- <!--<if test="ids !=null and ids != ''">
- WHERE name_user in
+ WHERE 1=1
+ <if test="ids !=null and ids != ''">
+ and name_user in
<foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
#{val}
</foreach>
- </if>-->
+ </if>
) A
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
${ew.customSqlSegment}
@@ -47,24 +47,24 @@
select awhd.*,name
FROM auxiliary_working_hours_day awhd
left join user on name_user=user.id
- WHERE name_user in(#{ids})
- <!--<if test="ids !=null and ids != ''">
- WHERE name_user in
- <foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
- #{val}
- </foreach>
- </if>-->
- </select>
- <select id="selectListByIds" resultType="com.yuanchu.mom.pojo.AuxiliaryWorkingHoursDay">
- select * from auxiliary_working_hours_day
- where 1=1
- and name_user in(#{ids})
- <!-- <if test="ids !=null and ids != ''">
+ WHERE 1=1
+ <if test="ids !=null and ids != ''">
and name_user in
<foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
#{val}
</foreach>
- </if>-->
+ </if>
+ </select>
+ <select id="selectListByIds" resultType="com.yuanchu.mom.pojo.AuxiliaryWorkingHoursDay">
+ select * from auxiliary_working_hours_day
+ where 1=1
+
+ <if test="ids !=null and ids != ''">
+ and name_user in
+ <foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
+ #{val}
+ </foreach>
+ </if>
</select>
<select id="totalHours" resultType="java.util.Map">
select A.name,
@@ -80,13 +80,12 @@
left join department_lims dl on depart_lims_id=dl.id
where date_time LIKE CONCAT('%', #{month}, '%')
and awhd.state='宸叉壒鍑�'
- and name_user in (#{ids})
- <!-- <if test="ids !=null and ids != ''">
+ <if test="ids !=null and ids != ''">
and name_user in
<foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
#{val}
</foreach>
- </if>-->
+ </if>
order by month,user.name
)A
group by A.name,A.month
--
Gitblit v1.9.3