|
@@ -4,16 +4,15 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
4
|
4
|
import com.example.civilizedcity.common.Constants;
|
5
|
5
|
import com.example.civilizedcity.common.StringUtils;
|
6
|
6
|
import com.example.civilizedcity.entity.*;
|
7
|
|
-import com.example.civilizedcity.mapper.TaFeedbackMapper;
|
8
|
|
-import com.example.civilizedcity.mapper.TaIssueMapper;
|
9
|
|
-import com.example.civilizedcity.mapper.TaIssueProcessMapper;
|
|
7
|
+import com.example.civilizedcity.mapper.*;
|
10
|
8
|
import org.springframework.beans.factory.annotation.Autowired;
|
11
|
9
|
import org.springframework.stereotype.Service;
|
12
|
|
-import com.example.civilizedcity.mapper.TaOrgIssueMapper;
|
13
|
10
|
import com.example.civilizedcity.service.TaOrgIssueService;
|
14
|
11
|
import org.springframework.transaction.annotation.Transactional;
|
15
|
12
|
|
16
|
13
|
import java.time.LocalDateTime;
|
|
14
|
+import java.util.ArrayList;
|
|
15
|
+import java.util.List;
|
17
|
16
|
|
18
|
17
|
/**
|
19
|
18
|
* 单位问题单;(ta_org_issue)表服务实现类
|
|
@@ -33,6 +32,9 @@ public class TaOrgIssueServiceImpl extends BaseServiceImpl<TaOrgIssueMapper, TaO
|
33
|
32
|
@Autowired
|
34
|
33
|
TaFeedbackMapper taFeedbackMapper;
|
35
|
34
|
|
|
35
|
+ @Autowired
|
|
36
|
+ TaAttachMapper taAttachMapper;
|
|
37
|
+
|
36
|
38
|
@Override
|
37
|
39
|
public IPage<TaIssue> getIssuePageBy(IPage<TaIssue> pg, String orgId, String sourceType, String bizStatus) {
|
38
|
40
|
|
|
@@ -77,8 +79,8 @@ public class TaOrgIssueServiceImpl extends BaseServiceImpl<TaOrgIssueMapper, TaO
|
77
|
79
|
TaOrgIssue taOrgIssue = new TaOrgIssue();
|
78
|
80
|
taOrgIssue.setIssueId(taIssue.getIssueId());
|
79
|
81
|
taOrgIssue.setOrgId(taIssue.getOrgId());
|
80
|
|
- taOrgIssue.setProcessNode(Constants.PROCESS_START);
|
81
|
|
- taOrgIssue.setProcessStatus(Constants.APPLY_READY); // 状态是未审核
|
|
82
|
+ taOrgIssue.setProcessNode(Constants.PROCESS_ASSIGNED);
|
|
83
|
+ taOrgIssue.setProcessStatus(null);
|
82
|
84
|
taOrgIssue.setStatus(Constants.STATUS_NORMAL);
|
83
|
85
|
taOrgIssue.setCreateDate(LocalDateTime.now());
|
84
|
86
|
taOrgIssue.setCreateUser(sysUser.getUserId());
|
|
@@ -98,4 +100,31 @@ public class TaOrgIssueServiceImpl extends BaseServiceImpl<TaOrgIssueMapper, TaO
|
98
|
100
|
public TaOrgIssue getByIssueAndOrg(Integer issueId, String orgId) {
|
99
|
101
|
return baseMapper.getByIssueAndOrg(issueId, orgId);
|
100
|
102
|
}
|
|
103
|
+
|
|
104
|
+ @Transactional(rollbackFor = Exception.class)
|
|
105
|
+ @Override
|
|
106
|
+ public void updateData(TaOrgIssue taOrgIssue) throws Exception {
|
|
107
|
+ updateById(taOrgIssue);
|
|
108
|
+
|
|
109
|
+ // 保存文件
|
|
110
|
+ List<TaAttach> attachList = taOrgIssue.getAttachList();
|
|
111
|
+ List<Integer> idList = new ArrayList<>();
|
|
112
|
+ for (TaAttach item : attachList) {
|
|
113
|
+ item.setOwnerType(Constants.SOURCE_ORG_ISSUE);
|
|
114
|
+ item.setOwnerId(taOrgIssue.getOrgIssueId().toString());
|
|
115
|
+ item.setStatus(Constants.STATUS_NORMAL);
|
|
116
|
+ item.setCreateDate(LocalDateTime.now());
|
|
117
|
+
|
|
118
|
+ if (null == item.getAttachId()) {
|
|
119
|
+ taAttachMapper.insert(item);
|
|
120
|
+ } else {
|
|
121
|
+ taAttachMapper.updateById(item);
|
|
122
|
+ }
|
|
123
|
+ idList.add(item.getAttachId());
|
|
124
|
+ }
|
|
125
|
+
|
|
126
|
+ // 删除部分文件
|
|
127
|
+ taAttachMapper.deleteNotIn(idList, Constants.SOURCE_ISSUE, taOrgIssue.getOrgIssueId().toString());
|
|
128
|
+ taOrgIssue.setAttachList(attachList);
|
|
129
|
+ }
|
101
|
130
|
}
|