|
@@ -1,9 +1,11 @@
|
1
|
1
|
package com.example.civilizedcity.service.impl;
|
2
|
2
|
|
|
3
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
3
|
4
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
4
|
5
|
import com.example.civilizedcity.common.Constants;
|
5
|
6
|
import com.example.civilizedcity.common.ResponseBean;
|
6
|
7
|
import com.example.civilizedcity.entity.SysUser;
|
|
8
|
+import com.example.civilizedcity.entity.TaIssue;
|
7
|
9
|
import com.example.civilizedcity.entity.TaOrgIssue;
|
8
|
10
|
import com.example.civilizedcity.event.MessagEvent;
|
9
|
11
|
import com.example.civilizedcity.mapper.TaIssueMapper;
|
|
@@ -14,6 +16,7 @@ import org.springframework.stereotype.Service;
|
14
|
16
|
import com.example.civilizedcity.entity.TaIssueApply;
|
15
|
17
|
import com.example.civilizedcity.mapper.TaIssueApplyMapper;
|
16
|
18
|
import com.example.civilizedcity.service.TaIssueApplyService;
|
|
19
|
+import org.springframework.transaction.annotation.Transactional;
|
17
|
20
|
|
18
|
21
|
import java.time.LocalDateTime;
|
19
|
22
|
|
|
@@ -74,4 +77,74 @@ public class TaIssueApplyServiceImpl extends BaseServiceImpl<TaIssueApplyMapper,
|
74
|
77
|
public IPage<TaIssueApply> getPageBy(IPage<TaIssueApply> pg, Integer issueId, String applyType, String orgId, String sourceType) {
|
75
|
78
|
return baseMapper.getPageBy(pg, issueId, applyType, orgId, sourceType);
|
76
|
79
|
}
|
|
80
|
+
|
|
81
|
+ @Transactional(rollbackFor = Exception.class)
|
|
82
|
+ @Override
|
|
83
|
+ public void verify(TaIssueApply taIssueApply, SysUser sysUser, TaIssueApply origin) throws Exception {
|
|
84
|
+ // 先更新审核信息
|
|
85
|
+ origin.setVerifyStatus(taIssueApply.getVerifyStatus());
|
|
86
|
+ origin.setVerifyDesc(taIssueApply.getVerifyDesc());
|
|
87
|
+ origin.setVerifyOrg(sysUser.getOrgId());
|
|
88
|
+ origin.setVerifyUser(sysUser.getUserId());
|
|
89
|
+ origin.setVerifyUserName(sysUser.getName());
|
|
90
|
+ origin.setVerifyDate(LocalDateTime.now());
|
|
91
|
+ updateById(origin);
|
|
92
|
+
|
|
93
|
+ // 再判断审核类型
|
|
94
|
+ switch (origin.getApplyType()) {
|
|
95
|
+ case Constants.APPLY_VERIFY:
|
|
96
|
+ // 问题单审核
|
|
97
|
+ verifyIssue();
|
|
98
|
+ break;
|
|
99
|
+ case Constants.APPLY_REJECT:
|
|
100
|
+ // 问题单驳回
|
|
101
|
+ verifyReject();
|
|
102
|
+ break;
|
|
103
|
+ case Constants.APPLY_DELAY:
|
|
104
|
+ // 延期申请
|
|
105
|
+ verifyDelay(taIssueApply, origin);
|
|
106
|
+ break;
|
|
107
|
+ case Constants.APPLY_END:
|
|
108
|
+ // 销单申请
|
|
109
|
+ break;
|
|
110
|
+ default:
|
|
111
|
+ // 其他
|
|
112
|
+ break;
|
|
113
|
+ }
|
|
114
|
+
|
|
115
|
+ }
|
|
116
|
+
|
|
117
|
+ // 问题单审核
|
|
118
|
+ public void verifyIssue() throws Exception {
|
|
119
|
+ // TODO;
|
|
120
|
+ }
|
|
121
|
+
|
|
122
|
+ // 驳回审核
|
|
123
|
+ public void verifyReject() throws Exception {
|
|
124
|
+ // TODO;
|
|
125
|
+ }
|
|
126
|
+
|
|
127
|
+ // 延期审核
|
|
128
|
+ public void verifyDelay(TaIssueApply taIssueApply, TaIssueApply origin) throws Exception {
|
|
129
|
+ if (Constants.APPLY_STATUS_REJECT.equals(taIssueApply.getVerifyStatus())) {
|
|
130
|
+ // 如果审核不通过
|
|
131
|
+ // TODO;
|
|
132
|
+ } else {
|
|
133
|
+ // 问题单截止日期更新为申请的截止日期
|
|
134
|
+ // 问题单的申请关联清空
|
|
135
|
+ UpdateWrapper<TaIssue> updateWrapper = new UpdateWrapper<>();
|
|
136
|
+ updateWrapper.set("expire_date", taIssueApply.getContent());
|
|
137
|
+ updateWrapper.set("apply_type", null);
|
|
138
|
+ updateWrapper.set("apply_id", null);
|
|
139
|
+ updateWrapper.eq("issue_id", origin.getIssueId());
|
|
140
|
+
|
|
141
|
+ }
|
|
142
|
+ }
|
|
143
|
+
|
|
144
|
+ // 问题单审核
|
|
145
|
+ public void verifyIssue() throws Exception {
|
|
146
|
+ // TODO;
|
|
147
|
+ }
|
|
148
|
+
|
|
149
|
+
|
77
|
150
|
}
|