|
|
@@ -40,28 +40,8 @@ public class QualityInspectionServiceImpl implements QualityInspectionService {
|
|
40
|
40
|
@Transactional(rollbackFor = Exception.class)
|
|
41
|
41
|
@Override
|
|
42
|
42
|
public int save(BusinessQcQualityInspection saveParam) {
|
|
43
|
|
- // 查询最后一个顺序号
|
|
44
|
|
- Map<String, Object> map = new HashMap<>();
|
|
45
|
|
- map.put("orgId", saveParam.getOrgId());
|
|
46
|
|
- map.put("basicStorehouseId", saveParam.getBasicStorehouseId());
|
|
47
|
|
- map.put("warehouseId", saveParam.getWarehouseId());
|
|
48
|
|
- String xh = qualityInspectionMapper.selectOnly(map);
|
|
49
|
|
- // 初始化
|
|
50
|
|
- int num = 1;
|
|
51
|
|
- if (!StringUtils.isEmpty(xh)) {
|
|
52
|
|
- String substring = xh.substring(xh.length() - 4);
|
|
53
|
|
- int i = Integer.parseInt(substring);
|
|
54
|
|
- if (i < 9999)
|
|
55
|
|
- num += i;
|
|
56
|
|
- }
|
|
57
|
43
|
// 生成质检报告单(检验类别+检验日期(yyyyMMdd)+4位顺序号组成)
|
|
58
|
|
- saveParam.setZjbgdh(
|
|
59
|
|
- String.format(
|
|
60
|
|
- "%s%s%s", saveParam.getJylb(),
|
|
61
|
|
- DateUtil.getYMD(saveParam.getJysj()),
|
|
62
|
|
- GenerateNumberUtil.integerToString(4, num)
|
|
63
|
|
- )
|
|
64
|
|
- );
|
|
|
44
|
+ saveParam.setZjbgdh(this.GetZjbgdh(saveParam));
|
|
65
|
45
|
Date date = new Date();
|
|
66
|
46
|
saveParam.setCreatedate(date);
|
|
67
|
47
|
saveParam.setUpdatedate(date);
|
|
|
@@ -84,6 +64,29 @@ public class QualityInspectionServiceImpl implements QualityInspectionService {
|
|
84
|
64
|
return insert;
|
|
85
|
65
|
}
|
|
86
|
66
|
|
|
|
67
|
+ // // 生成质检报告单(检验类别+检验日期(yyyyMMdd)+4位顺序号组成)
|
|
|
68
|
+ private synchronized String GetZjbgdh(BusinessQcQualityInspection saveParam) {
|
|
|
69
|
+ // 查询最后一个顺序号
|
|
|
70
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
71
|
+ map.put("orgId", saveParam.getOrgId());
|
|
|
72
|
+ map.put("basicStorehouseId", saveParam.getBasicStorehouseId());
|
|
|
73
|
+ map.put("warehouseId", saveParam.getWarehouseId());
|
|
|
74
|
+ String xh = qualityInspectionMapper.selectOnly(map);
|
|
|
75
|
+ // 初始化
|
|
|
76
|
+ int num = 1;
|
|
|
77
|
+ if (!StringUtils.isEmpty(xh)) {
|
|
|
78
|
+ String substring = xh.substring(xh.length() - 4);
|
|
|
79
|
+ int i = Integer.parseInt(substring);
|
|
|
80
|
+ if (i < 9999)
|
|
|
81
|
+ num += i;
|
|
|
82
|
+ }
|
|
|
83
|
+ return String.format(
|
|
|
84
|
+ "%s%s%s", saveParam.getJylb(),
|
|
|
85
|
+ DateUtil.getYMD(saveParam.getJysj()),
|
|
|
86
|
+ GenerateNumberUtil.integerToString(4, num)
|
|
|
87
|
+ );
|
|
|
88
|
+ }
|
|
|
89
|
+
|
|
87
|
90
|
@Override
|
|
88
|
91
|
public PageInfo<BusinessQcQualityInspection> getPageList(BusinessQcQualityInspectionPage pageParam) {
|
|
89
|
92
|
PageHelper.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|