|
|
@@ -22,10 +22,7 @@ import org.springframework.validation.annotation.Validated;
|
|
22
|
22
|
|
|
23
|
23
|
import javax.annotation.Resource;
|
|
24
|
24
|
import javax.validation.constraints.NotBlank;
|
|
25
|
|
-import java.util.ArrayList;
|
|
26
|
|
-import java.util.HashMap;
|
|
27
|
|
-import java.util.List;
|
|
28
|
|
-import java.util.Map;
|
|
|
25
|
+import java.util.*;
|
|
29
|
26
|
|
|
30
|
27
|
/**
|
|
31
|
28
|
* @author qingsong.han
|
|
|
@@ -54,7 +51,7 @@ public class QualityInspectionServiceImpl implements QualityInspectionService {
|
|
54
|
51
|
if (!StringUtils.isEmpty(xh)) {
|
|
55
|
52
|
String substring = xh.substring(xh.length() - 4);
|
|
56
|
53
|
int i = Integer.parseInt(substring);
|
|
57
|
|
- if (i < 999)
|
|
|
54
|
+ if (i < 9999)
|
|
58
|
55
|
num += i;
|
|
59
|
56
|
}
|
|
60
|
57
|
// 生成质检报告单(检验类别+检验日期(yyyyMMdd)+4位顺序号组成)
|
|
|
@@ -65,6 +62,9 @@ public class QualityInspectionServiceImpl implements QualityInspectionService {
|
|
65
|
62
|
GenerateNumberUtil.integerToString(4, num)
|
|
66
|
63
|
)
|
|
67
|
64
|
);
|
|
|
65
|
+ Date date = new Date();
|
|
|
66
|
+ saveParam.setCreatedate(date);
|
|
|
67
|
+ saveParam.setUpdatedate(date);
|
|
68
|
68
|
int insert = qualityInspectionMapper.insert(saveParam);
|
|
69
|
69
|
Integer id = saveParam.getId();
|
|
70
|
70
|
log.info("id: {}", id);
|
|
|
@@ -73,6 +73,9 @@ public class QualityInspectionServiceImpl implements QualityInspectionService {
|
|
73
|
73
|
List<BusinessQcQualityInspectionItem> item = saveParam.getItem();
|
|
74
|
74
|
if (!ObjectUtils.isEmpty(item)) {
|
|
75
|
75
|
item.forEach(i -> {
|
|
|
76
|
+ Date now = new Date();
|
|
|
77
|
+ i.setCreatedate(now);
|
|
|
78
|
+ i.setUpdatedate(now);
|
|
76
|
79
|
i.setQcQualityInspectionId(id);
|
|
77
|
80
|
qualityInspectionItemMapper.insert(i);
|
|
78
|
81
|
});
|
|
|
@@ -91,9 +94,13 @@ public class QualityInspectionServiceImpl implements QualityInspectionService {
|
|
91
|
94
|
@Override
|
|
92
|
95
|
@Transactional(rollbackFor = Exception.class)
|
|
93
|
96
|
public int update(BusinessQcQualityInspection saveParam) {
|
|
|
97
|
+ saveParam.setUpdatedate(new Date());
|
|
94
|
98
|
int i = qualityInspectionMapper.updateByPrimaryKey(saveParam);
|
|
95
|
99
|
if (i > 0) {
|
|
96
|
|
- saveParam.getItem().forEach(it -> qualityInspectionItemMapper.updateByPrimaryKey(it));
|
|
|
100
|
+ saveParam.getItem().forEach(it -> {
|
|
|
101
|
+ it.setUpdatedate(new Date());
|
|
|
102
|
+ qualityInspectionItemMapper.updateByPrimaryKey(it);
|
|
|
103
|
+ });
|
|
97
|
104
|
}
|
|
98
|
105
|
return i;
|
|
99
|
106
|
}
|