|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+package com.unis.app.controller;
|
|
|
2
|
+
|
|
|
3
|
+import com.unis.common.utils.CurrentUtil;
|
|
|
4
|
+import com.unis.common.utils.LsBeanUtils;
|
|
|
5
|
+import com.unis.common.utils.ResponseWrapper;
|
|
|
6
|
+import com.unis.flowable.common.vo.FlowAbleCompleteVO;
|
|
|
7
|
+import com.unis.qyzg.client.FlowableClient;
|
|
|
8
|
+import com.unis.qyzg.client.QyzgZgsqClient;
|
|
|
9
|
+import com.unis.qyzg.common.vo.QyzgZgsqSaveVO;
|
|
|
10
|
+import com.unis.qyzg.common.vo.QyzgZgsqVO;
|
|
|
11
|
+import com.unis.qyzg.common.vo.UpdateSqztVO;
|
|
|
12
|
+import io.swagger.annotations.Api;
|
|
|
13
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
14
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
15
|
+import io.swagger.annotations.ApiOperation;
|
|
|
16
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
17
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
18
|
+import org.springframework.http.HttpStatus;
|
|
|
19
|
+import org.springframework.web.bind.annotation.*;
|
|
|
20
|
+
|
|
|
21
|
+import java.util.Date;
|
|
|
22
|
+
|
|
|
23
|
+/**
|
|
|
24
|
+ * @Auther:张新亮
|
|
|
25
|
+ * @Date: 2019/7/25 0025 16:38
|
|
|
26
|
+ * @Description:
|
|
|
27
|
+ */
|
|
|
28
|
+@RestController
|
|
|
29
|
+@Slf4j
|
|
|
30
|
+@Api(value = "企业资格管理:资格申请", tags = "企业资格管理:资格申请")
|
|
|
31
|
+@RequestMapping("/qyzgZgsq")
|
|
|
32
|
+public class QyzgZgsqController {
|
|
|
33
|
+
|
|
|
34
|
+ @Autowired
|
|
|
35
|
+ private QyzgZgsqClient qyzgZgsqClient;
|
|
|
36
|
+
|
|
|
37
|
+ @ApiOperation(value = "资格申请列表信息", notes = "参数:模糊搜索参数 企业端:KZZD3不传值,管理端:KZZD3传'0'")
|
|
|
38
|
+ @ApiImplicitParams({@ApiImplicitParam(name = "page", value = "起始页", required = true),
|
|
|
39
|
+ @ApiImplicitParam(name = "size", value = "每页展示行数", required = true)})
|
|
|
40
|
+ @PostMapping(value = "/findByPage/{page}/{size}")
|
|
|
41
|
+ public ResponseWrapper findByPage(@RequestBody QyzgZgsqVO zgsq,
|
|
|
42
|
+ @PathVariable Integer page, @PathVariable Integer size) {
|
|
|
43
|
+ try {
|
|
|
44
|
+ ResponseWrapper byPage = qyzgZgsqClient.findByPage(zgsq, page, size);
|
|
|
45
|
+ if (byPage.getInfoCode() != 200) {
|
|
|
46
|
+ return ResponseWrapper.error("列表查询失败,请联系管理员");
|
|
|
47
|
+ }
|
|
|
48
|
+ return ResponseWrapper.success(200, "查询成功", byPage.getData());
|
|
|
49
|
+ } catch (Exception e) {
|
|
|
50
|
+ log.error("用户分页查询失败{}", e.getMessage());
|
|
|
51
|
+ return ResponseWrapper.error();
|
|
|
52
|
+ }
|
|
|
53
|
+ }
|
|
|
54
|
+
|
|
|
55
|
+ /**
|
|
|
56
|
+ * 更新接口
|
|
|
57
|
+ */
|
|
|
58
|
+ @ApiOperation(value = "更新接口", notes = "参数:QyzgZgsqSaveVO")
|
|
|
59
|
+ @PostMapping(value = "/update")
|
|
|
60
|
+ public ResponseWrapper update(@RequestBody QyzgZgsqVO zsqVO) {
|
|
|
61
|
+ zsqVO.setRefersher(CurrentUtil.getCompanyName());
|
|
|
62
|
+ //zsqVO.setQyName(CurrentUtil.getCompanyName());
|
|
|
63
|
+ zsqVO.setRefersherCode(CurrentUtil.getCreditCode());
|
|
|
64
|
+ zsqVO.setRefersherDate(new Date());
|
|
|
65
|
+ try {
|
|
|
66
|
+ ResponseWrapper responseWrapper = qyzgZgsqClient.updateQyzgZgsq(zsqVO);
|
|
|
67
|
+ if (responseWrapper.getInfoCode() != 200) {
|
|
|
68
|
+ return responseWrapper;
|
|
|
69
|
+ }
|
|
|
70
|
+ return ResponseWrapper.success();
|
|
|
71
|
+ } catch (Exception e) {
|
|
|
72
|
+ log.error("更新对象,发生异常", e.getMessage());
|
|
|
73
|
+ return ResponseWrapper.error();
|
|
|
74
|
+ }
|
|
|
75
|
+ }
|
|
|
76
|
+
|
|
|
77
|
+ /**
|
|
|
78
|
+ * 代办事项修改
|
|
|
79
|
+ *
|
|
|
80
|
+ * @param zsqVO
|
|
|
81
|
+ * @return
|
|
|
82
|
+ */
|
|
|
83
|
+ @ApiOperation(value = "代办事项修改", notes = "参数:qyzgZgsqVO")
|
|
|
84
|
+ @PostMapping(value = "/updateZgsq")
|
|
|
85
|
+ public ResponseWrapper updateZgsq(@RequestBody QyzgZgsqVO zsqVO) {
|
|
|
86
|
+ try {
|
|
|
87
|
+ if (null == zsqVO.getKzzd3()) {
|
|
|
88
|
+ zsqVO.setRefersher(CurrentUtil.getCompanyName());
|
|
|
89
|
+ zsqVO.setRefersherCode(CurrentUtil.getCreditCode());
|
|
|
90
|
+ }
|
|
|
91
|
+ zsqVO.setRefersherDate(new Date());
|
|
|
92
|
+ ResponseWrapper responseWrapper = null;
|
|
|
93
|
+ try {
|
|
|
94
|
+ responseWrapper = qyzgZgsqClient.updateZgsq(zsqVO);
|
|
|
95
|
+ } catch (Exception e) {
|
|
|
96
|
+ e.printStackTrace();
|
|
|
97
|
+ }
|
|
|
98
|
+ if (responseWrapper.getInfoCode() != 200) {
|
|
|
99
|
+ return ResponseWrapper.error("代办事项修改错误,请联系管理员");
|
|
|
100
|
+ }
|
|
|
101
|
+ return ResponseWrapper.success();
|
|
|
102
|
+ } catch (Exception e) {
|
|
|
103
|
+ e.printStackTrace();
|
|
|
104
|
+ log.error("更新对象,发生异常", e.getMessage());
|
|
|
105
|
+ return ResponseWrapper.error();
|
|
|
106
|
+ }
|
|
|
107
|
+ }
|
|
|
108
|
+
|
|
|
109
|
+ /**
|
|
|
110
|
+ * 保存----资格申请
|
|
|
111
|
+ *
|
|
|
112
|
+ * @param saveVO
|
|
|
113
|
+ * @return ResponseWrapper
|
|
|
114
|
+ */
|
|
|
115
|
+ @ApiOperation(value = "保存----资格申请", notes = "参数:资格申请 saveVO")
|
|
|
116
|
+ @PostMapping(value = "/save")
|
|
|
117
|
+ public ResponseWrapper save(@RequestBody QyzgZgsqSaveVO saveVO) {
|
|
|
118
|
+ //先判断企业是否可以新增申请
|
|
|
119
|
+ String tyshxydm = CurrentUtil.getCreditCode();
|
|
|
120
|
+ ResponseWrapper rs1 = qyzgZgsqClient.isNewApply(tyshxydm);
|
|
|
121
|
+ if (rs1.getInfoCode() != 200) {
|
|
|
122
|
+ return rs1;
|
|
|
123
|
+ }
|
|
|
124
|
+ Boolean isNewApply = (Boolean) rs1.getData();
|
|
|
125
|
+ if (!isNewApply) {
|
|
|
126
|
+ return ResponseWrapper.success(HttpStatus.BAD_REQUEST.value(), "该企业已申请且证书未过期,不能新增", null);
|
|
|
127
|
+ }
|
|
|
128
|
+ //可以新增申请
|
|
|
129
|
+ String title = "资格申请--保存";
|
|
|
130
|
+ try {
|
|
|
131
|
+ QyzgZgsqVO qyzgZgsqVO = LsBeanUtils.copyProperties(saveVO, QyzgZgsqVO.class);
|
|
|
132
|
+ qyzgZgsqVO.setQyId(CurrentUtil.getCreditCode());
|
|
|
133
|
+ qyzgZgsqVO.setCompanyName(CurrentUtil.getCompanyName());
|
|
|
134
|
+ qyzgZgsqVO.setCreateDate(new Date());
|
|
|
135
|
+ qyzgZgsqVO.setStatus(1);
|
|
|
136
|
+ qyzgZgsqVO.setCreator(CurrentUtil.getCompanyName());
|
|
|
137
|
+ qyzgZgsqVO.setCreatorCode(CurrentUtil.getCreditCode());
|
|
|
138
|
+ qyzgZgsqVO.setSqzt(saveVO.getSqzt());
|
|
|
139
|
+ qyzgZgsqVO.setAreaCode(CurrentUtil.getAreaCode());
|
|
|
140
|
+ //企业保存数据
|
|
|
141
|
+ ResponseWrapper responseWrapper = qyzgZgsqClient.save(qyzgZgsqVO);
|
|
|
142
|
+ if (responseWrapper.getInfoCode() != 200) {
|
|
|
143
|
+ return ResponseWrapper.error("对象已存在无法添加");
|
|
|
144
|
+ }
|
|
|
145
|
+ return ResponseWrapper.success(200, "保存成功", responseWrapper.getData());
|
|
|
146
|
+ } catch (Exception e) {
|
|
|
147
|
+ e.printStackTrace();
|
|
|
148
|
+ log.error(title + "发生异常", e.getMessage());
|
|
|
149
|
+ return ResponseWrapper.error();
|
|
|
150
|
+ }
|
|
|
151
|
+ }
|
|
|
152
|
+
|
|
|
153
|
+ /**
|
|
|
154
|
+ * 修改申请状态----资格申请
|
|
|
155
|
+ *
|
|
|
156
|
+ * @param
|
|
|
157
|
+ * @return ResponseWrapper
|
|
|
158
|
+ */
|
|
|
159
|
+ @ApiOperation(value = "修改申请状态----资格申请", notes = "参数:资格申请 id ,sczt 申请状态:0-草稿;1-审批中;2-审批完成(通过);3-审批完成(未通过), userType:用户类型 10 粮食局用户 20 企业用户")
|
|
|
160
|
+ @GetMapping(value = "/updateSqzt/{id}/{sqzt}/{userType}")
|
|
|
161
|
+ public ResponseWrapper updateSqzt(
|
|
|
162
|
+ @PathVariable("id") String id,
|
|
|
163
|
+ @PathVariable("sqzt") Integer sqzt,
|
|
|
164
|
+ @PathVariable("userType") String userType
|
|
|
165
|
+ ) {
|
|
|
166
|
+ String title = "资格申请--修改";
|
|
|
167
|
+ try {
|
|
|
168
|
+ UpdateSqztVO updateSqztVO = new UpdateSqztVO();
|
|
|
169
|
+ updateSqztVO.setRefersher(CurrentUtil.getCompanyName());
|
|
|
170
|
+ updateSqztVO.setRefersherCode(CurrentUtil.getCreditCode());
|
|
|
171
|
+ updateSqztVO.setRefersherDate(new Date());
|
|
|
172
|
+ updateSqztVO.setSqzt(sqzt);
|
|
|
173
|
+ updateSqztVO.setId(id);
|
|
|
174
|
+ updateSqztVO.setUserType(userType);
|
|
|
175
|
+ updateSqztVO.setAccount(CurrentUtil.getUserAccount());
|
|
|
176
|
+ updateSqztVO.setOrgName(CurrentUtil.getCompanyName());
|
|
|
177
|
+ updateSqztVO.setUserCreditCode(CurrentUtil.getCreditCode());
|
|
|
178
|
+ updateSqztVO.setAreaCode(CurrentUtil.getAreaCode());
|
|
|
179
|
+ //企业保存数据
|
|
|
180
|
+ ResponseWrapper responseWrapper = qyzgZgsqClient.updateSqzt(updateSqztVO);
|
|
|
181
|
+ if (responseWrapper.getInfoCode() != 200) {
|
|
|
182
|
+ return ResponseWrapper.error("对象已存在无法添加");
|
|
|
183
|
+ }
|
|
|
184
|
+ return ResponseWrapper.success();
|
|
|
185
|
+ } catch (Exception e) {
|
|
|
186
|
+ e.printStackTrace();
|
|
|
187
|
+ log.error(title + "发生异常", e.getMessage());
|
|
|
188
|
+ return ResponseWrapper.error();
|
|
|
189
|
+ }
|
|
|
190
|
+ }
|
|
|
191
|
+
|
|
|
192
|
+ /**
|
|
|
193
|
+ * 查询企业资格详情
|
|
|
194
|
+ *
|
|
|
195
|
+ * @param id
|
|
|
196
|
+ * @return
|
|
|
197
|
+ */
|
|
|
198
|
+ @ApiOperation(value = "根据id查询详情", notes = "参数:资格id")
|
|
|
199
|
+ @GetMapping(value = "/findById/{id}")
|
|
|
200
|
+ public ResponseWrapper findById(@PathVariable("id") String id) {
|
|
|
201
|
+ try {
|
|
|
202
|
+ ResponseWrapper responseWrapper = qyzgZgsqClient.findById(id);
|
|
|
203
|
+ if (responseWrapper.getInfoCode() != 200) {
|
|
|
204
|
+ return ResponseWrapper.error();
|
|
|
205
|
+ }
|
|
|
206
|
+ return responseWrapper;
|
|
|
207
|
+ } catch (Exception e) {
|
|
|
208
|
+ e.printStackTrace();
|
|
|
209
|
+ log.error("查找对象,发生异常", e.getMessage());
|
|
|
210
|
+ return ResponseWrapper.error();
|
|
|
211
|
+ }
|
|
|
212
|
+ }
|
|
|
213
|
+
|
|
|
214
|
+ /**
|
|
|
215
|
+ * 查询企业资格详情
|
|
|
216
|
+ *
|
|
|
217
|
+ * @param lcslId
|
|
|
218
|
+ * @return
|
|
|
219
|
+ */
|
|
|
220
|
+ @ApiOperation(value = "根据流程ID查询详情", notes = "参数:资格id")
|
|
|
221
|
+ @GetMapping(value = "/findByLcslId/{lcslId}")
|
|
|
222
|
+ public ResponseWrapper findByLcslId(@PathVariable("lcslId") String lcslId) {
|
|
|
223
|
+ try {
|
|
|
224
|
+ ResponseWrapper responseWrapper = qyzgZgsqClient.findByLcslId(lcslId);
|
|
|
225
|
+ if (responseWrapper.getInfoCode() != 200) {
|
|
|
226
|
+ return ResponseWrapper.error();
|
|
|
227
|
+ }
|
|
|
228
|
+ return responseWrapper;
|
|
|
229
|
+ } catch (Exception e) {
|
|
|
230
|
+ e.printStackTrace();
|
|
|
231
|
+ log.error("查找对象,发生异常", e.getMessage());
|
|
|
232
|
+ return ResponseWrapper.error();
|
|
|
233
|
+ }
|
|
|
234
|
+ }
|
|
|
235
|
+
|
|
|
236
|
+ /**
|
|
|
237
|
+ * 根据areaCode获取该企业下的企业资格
|
|
|
238
|
+ *
|
|
|
239
|
+ * @param
|
|
|
240
|
+ * @return
|
|
|
241
|
+ */
|
|
|
242
|
+ @ApiOperation(value = "根据areaCode获取该企业下的企业资格", notes = "参数:areaCode ")
|
|
|
243
|
+ @GetMapping(value = "/selectQyzgAreaCode/{areaCode}")
|
|
|
244
|
+ public ResponseWrapper selectQyzgAreaCode(@PathVariable("areaCode") String areaCode) {
|
|
|
245
|
+ try {
|
|
|
246
|
+ ResponseWrapper responseWrapper = qyzgZgsqClient.selectQyzgAreaCode(areaCode);
|
|
|
247
|
+ if (responseWrapper.getInfoCode() != 200) {
|
|
|
248
|
+ return ResponseWrapper.error();
|
|
|
249
|
+ }
|
|
|
250
|
+ return responseWrapper;
|
|
|
251
|
+ } catch (Exception e) {
|
|
|
252
|
+ e.printStackTrace();
|
|
|
253
|
+ log.error("查找对象,发生异常", e.getMessage());
|
|
|
254
|
+ return ResponseWrapper.error();
|
|
|
255
|
+ }
|
|
|
256
|
+ }
|
|
|
257
|
+
|
|
|
258
|
+ @ApiOperation("审核")
|
|
|
259
|
+ @PostMapping("/complete")
|
|
|
260
|
+ public ResponseWrapper complete(@RequestBody FlowAbleCompleteVO completeVO, @RequestParam("taskName") String taskName, @RequestParam("fjid") String fjid, @RequestParam("taskId") String taskId) {
|
|
|
261
|
+ return qyzgZgsqClient.complete(completeVO, taskName, fjid, taskId);
|
|
|
262
|
+ }
|
|
|
263
|
+
|
|
|
264
|
+
|
|
|
265
|
+ /**
|
|
|
266
|
+ * 功能描述: 备案填写---删除
|
|
|
267
|
+ *
|
|
|
268
|
+ * @Param: [id]
|
|
|
269
|
+ * @Return: com.unis.common.utils.ResponseWrapper
|
|
|
270
|
+ * @Author: zoujieli
|
|
|
271
|
+ * @Date: 2020-02-28 16:16
|
|
|
272
|
+ */
|
|
|
273
|
+ @ApiOperation(value = "根据备案申请ID删除备案信息")
|
|
|
274
|
+ @PutMapping(value = "/delete")
|
|
|
275
|
+ public ResponseWrapper deleteRecordCertificate(@RequestParam String id){
|
|
|
276
|
+ return qyzgZgsqClient.deleteRecordCertificate(id);
|
|
|
277
|
+ }
|
|
|
278
|
+
|
|
|
279
|
+}
|