hanqingsong 1 anno fa
commit
a998a870d7

+ 33 - 0
.gitignore

@@ -0,0 +1,33 @@
1
+HELP.md
2
+target/
3
+!.mvn/wrapper/maven-wrapper.jar
4
+!**/src/main/**/target/
5
+!**/src/test/**/target/
6
+
7
+### STS ###
8
+.apt_generated
9
+.classpath
10
+.factorypath
11
+.project
12
+.settings
13
+.springBeans
14
+.sts4-cache
15
+
16
+### IntelliJ IDEA ###
17
+.idea
18
+*.iws
19
+*.iml
20
+*.ipr
21
+
22
+### NetBeans ###
23
+/nbproject/private/
24
+/nbbuild/
25
+/dist/
26
+/nbdist/
27
+/.nb-gradle/
28
+build/
29
+!**/src/main/**/build/
30
+!**/src/test/**/build/
31
+
32
+### VS Code ###
33
+.vscode/

+ 2 - 0
README.md

@@ -0,0 +1,2 @@
1
+# qyzg-app
2
+

+ 81 - 0
pom.xml

@@ -0,0 +1,81 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://maven.apache.org/POM/4.0.0"
3
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
+    <modelVersion>4.0.0</modelVersion>
6
+
7
+    <groupId>com.unis.app</groupId>
8
+    <artifactId>qyzg-app</artifactId>
9
+    <version>1.0-SNAPSHOT</version>
10
+    <parent>
11
+        <groupId>com.unis.springcloud</groupId>
12
+        <artifactId>parent</artifactId>
13
+        <version>0.0.4-SNAPSHOT</version>
14
+    </parent>
15
+    <dependencies>
16
+        <!-- feign远程调用 -->
17
+        <dependency>
18
+            <groupId>org.springframework.cloud</groupId>
19
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
20
+        </dependency>
21
+        <!--<dependency>
22
+            <groupId>org.springframework.cloud</groupId>
23
+            <artifactId>spring-cloud-starter-stream-rabbit</artifactId>
24
+        </dependency>-->
25
+        <dependency>
26
+            <groupId>org.springframework.boot</groupId>
27
+            <artifactId>spring-boot-starter-web</artifactId>
28
+        </dependency>
29
+        <dependency>
30
+            <groupId>org.springframework.cloud</groupId>
31
+            <artifactId>spring-cloud-starter-config</artifactId>
32
+        </dependency>
33
+        <dependency>
34
+            <groupId>org.springframework.cloud</groupId>
35
+            <artifactId>spring-cloud-config-client</artifactId>
36
+        </dependency>
37
+        <dependency>
38
+            <groupId>org.springframework.cloud</groupId>
39
+            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
40
+        </dependency>
41
+        <dependency>
42
+            <groupId>com.unis.springcloud</groupId>
43
+            <artifactId>common</artifactId>
44
+            <version>0.0.5-SNAPSHOT</version>
45
+        </dependency>
46
+
47
+        <dependency>
48
+            <artifactId>qyzg-client</artifactId>
49
+            <groupId>com.unis.qyzg</groupId>
50
+            <version>1.0-SNAPSHOT</version>
51
+        </dependency>
52
+
53
+        <dependency>
54
+            <groupId>com.unis.flowable</groupId>
55
+            <artifactId>flowable-common</artifactId>
56
+            <version>0.0.1-SNAPSHOT</version>
57
+        </dependency>
58
+
59
+    </dependencies>
60
+    <build>
61
+        <plugins>
62
+            <plugin>
63
+                <groupId>org.springframework.boot</groupId>
64
+                <artifactId>spring-boot-maven-plugin</artifactId>
65
+            </plugin>
66
+        </plugins>
67
+        <finalName>qyzg-app</finalName>
68
+    </build>
69
+
70
+    <repositories>
71
+        <repository>
72
+            <id>spring-milestones</id>
73
+            <name>Spring Milestones</name>
74
+            <url>https://repo.spring.io/milestone</url>
75
+            <snapshots>
76
+                <enabled>false</enabled>
77
+            </snapshots>
78
+        </repository>
79
+    </repositories>
80
+
81
+</project>

+ 20 - 0
src/main/java/com/unis/app/AppApplication.java

@@ -0,0 +1,20 @@
1
+package com.unis.app;
2
+
3
+
4
+import org.springframework.boot.SpringApplication;
5
+import org.springframework.boot.autoconfigure.SpringBootApplication;
6
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
7
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
8
+import org.springframework.cloud.openfeign.EnableFeignClients;
9
+import org.springframework.context.annotation.ComponentScan;
10
+
11
+@EnableFeignClients(basePackages = "com.unis")
12
+@EnableDiscoveryClient
13
+@ComponentScan("com.unis")
14
+@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
15
+public class AppApplication {
16
+    public static void main(String[] args) {
17
+        SpringApplication.run(AppApplication.class, args);
18
+        System.out.println("=========================启动成功=============================");
19
+    }
20
+}

+ 28 - 0
src/main/java/com/unis/app/config/FeignConfig.java

@@ -0,0 +1,28 @@
1
+package com.unis.app.config;
2
+
3
+import feign.RequestInterceptor;
4
+import feign.RequestTemplate;
5
+import org.springframework.context.annotation.Configuration;
6
+import org.springframework.web.context.request.RequestContextHolder;
7
+import org.springframework.web.context.request.ServletRequestAttributes;
8
+
9
+import javax.servlet.http.HttpServletRequest;
10
+import java.util.Enumeration;
11
+
12
+@Configuration
13
+public class FeignConfig implements RequestInterceptor {
14
+    @Override
15
+    public void apply(RequestTemplate template) {
16
+        ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder
17
+                .getRequestAttributes();
18
+        HttpServletRequest request = attributes.getRequest();
19
+        Enumeration<String> headerNames = request.getHeaderNames();
20
+        if (headerNames != null) {
21
+            while (headerNames.hasMoreElements()) {
22
+                String name = headerNames.nextElement();
23
+                String values = request.getHeader(name);
24
+                template.header(name, values);
25
+            }
26
+        }
27
+    }
28
+}

+ 22 - 0
src/main/java/com/unis/app/config/SwaggerConfig.java

@@ -0,0 +1,22 @@
1
+package com.unis.app.config;
2
+
3
+import com.unis.common.utils.SwaggerUtil;
4
+import org.springframework.beans.factory.annotation.Value;
5
+import org.springframework.context.annotation.Bean;
6
+import org.springframework.context.annotation.Configuration;
7
+import springfox.documentation.spring.web.plugins.Docket;
8
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
9
+
10
+@Configuration
11
+@EnableSwagger2
12
+public class SwaggerConfig {
13
+
14
+    @Value("${spring.application.name}")
15
+    private String applicationName;
16
+
17
+    @Bean
18
+    public Docket createRestApi() {
19
+        return SwaggerUtil.getDocket(applicationName);
20
+    }
21
+
22
+}

+ 247 - 0
src/main/java/com/unis/app/controller/FlowAbleController.java

@@ -0,0 +1,247 @@
1
+package com.unis.app.controller;
2
+
3
+import com.unis.common.utils.CurrentUtil;
4
+import com.unis.common.utils.ResponseWrapper;
5
+import com.unis.flowable.common.vo.ExamineVO;
6
+import com.unis.qyzg.client.FlowableClient;
7
+import io.swagger.annotations.Api;
8
+import io.swagger.annotations.ApiOperation;
9
+import lombok.extern.slf4j.Slf4j;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.web.bind.annotation.*;
12
+
13
+
14
+
15
+/**
16
+ * @Auther:张新亮
17
+ * @Date: 2019/7/12 0012 13:51
18
+ * @Description:
19
+ */
20
+@RestController
21
+@RequestMapping("/flowAble")
22
+@Slf4j
23
+@Api(value = "工作流", tags = "工作流")
24
+public class FlowAbleController {
25
+    @Autowired
26
+    private FlowableClient flowAbleClient;
27
+
28
+
29
+    /**
30
+     * 查询待办个人任务和组任务合并列表---不分页
31
+     * @param
32
+     * @return
33
+     */
34
+    @ApiOperation(value = "查询待办个人任务和组任务合并列表---不分页", notes = "参数:userType 10 管理端用户 20 企业端用户 ")
35
+    @GetMapping(value = "/findByUserAndGroupTaskNoPage/{userType}")
36
+    public ResponseWrapper findByUserAndGroupTaskNoPage(
37
+            @PathVariable("userType") String  userType
38
+    ) {
39
+        String title="查询待办个人任务和组任务合并列表---不分页";
40
+        try {
41
+            String userId="";
42
+            String areaCode="";
43
+            
44
+            if(userType.equals("0")) {
45
+            	
46
+            	userType="20";
47
+            }else {
48
+            	
49
+            	userType="10";
50
+            }
51
+            
52
+            
53
+            
54
+            if("20".equals(userType)){
55
+                userId=CurrentUtil.getCreditCode();
56
+                areaCode=CurrentUtil.getAreaCode();
57
+            }else{
58
+                userId=CurrentUtil.getUserId();
59
+                areaCode=CurrentUtil.getAreaCode();
60
+            }
61
+            ResponseWrapper responseWrapper=flowAbleClient.findByUserAndGroupTaskNoPage(userId,areaCode);
62
+            return responseWrapper;
63
+        } catch (Exception e) {
64
+            e.printStackTrace();
65
+            log.error("查找对象,发生异常", e.getMessage());
66
+            return ResponseWrapper.error();
67
+        }
68
+    }
69
+
70
+
71
+
72
+    /**
73
+     * 查询办理任务明细  和审核信息
74
+     * @param taskId
75
+     * @return
76
+     */
77
+    @ApiOperation(value = "待办任务-----查询办理任务明细的---历吏记录审核信息和按钮", notes = "参数:taskId 任务ID  procInsId 流程ID ")
78
+    @GetMapping(value = "/findByFormKeyByTaskId/{taskId}/{procInsId}")
79
+    public ResponseWrapper findByFormKeyByTaskId(
80
+            @PathVariable("taskId") String taskId,
81
+            @PathVariable("procInsId") String procInsId
82
+    ) {
83
+        try {
84
+            ResponseWrapper responseWrapper=flowAbleClient.findByFormKeyByTaskId(taskId, procInsId);
85
+            return responseWrapper;
86
+        } catch (Exception e) {
87
+            e.printStackTrace();
88
+            log.error("活动分页查询失败{}", e.getMessage());
89
+            return ResponseWrapper.error();
90
+        }
91
+    }
92
+
93
+
94
+    /**
95
+     * 查询待办个人任务和组任务合并列表---不分页
96
+     * @param
97
+     * @return
98
+     */
99
+    @ApiOperation(value = "查询已办列表---不分页", notes = "参数:completeVO ")
100
+    @GetMapping(value = "/findByAlreadyDoneoPage/{userType}")
101
+    public ResponseWrapper findByAlreadyDoneoPage(
102
+            @PathVariable("userType") String  userType
103
+    ) {
104
+        String title="查询待办个人任务和组任务合并列表---不分页";
105
+        try {
106
+            String userId="";
107
+            if("20".equals(userType)){
108
+                userId=CurrentUtil.getCreditCode();
109
+            }else{
110
+                userId=CurrentUtil.getUserId();
111
+            }
112
+            ResponseWrapper responseWrapper=flowAbleClient.findByAlreadyDoneoPage(userId);
113
+            return responseWrapper;
114
+        } catch (Exception e) {
115
+            e.printStackTrace();
116
+            log.error("查找对象,发生异常", e.getMessage());
117
+            return ResponseWrapper.error();
118
+        }
119
+    }
120
+
121
+
122
+    /**
123
+     * 查询已办理任务明细  和审核信息
124
+     * @param taskId
125
+     * @return
126
+     */
127
+    @ApiOperation(value = "已办理任务-----查询办理任务明细的---历吏记录审核信息", notes = "参数:taskId 任务ID  procInsId 流程ID ")
128
+    @GetMapping(value = "/findByAlreadyDone/{taskId}/{procInsId}")
129
+    public ResponseWrapper findByAlreadyDone(
130
+            @PathVariable("taskId") String taskId,
131
+            @PathVariable("procInsId") String procInsId
132
+    ) {
133
+        try {
134
+            ResponseWrapper responseWrapper=flowAbleClient.findByAlreadyDone(taskId, procInsId);
135
+            return responseWrapper;
136
+        } catch (Exception e) {
137
+            e.printStackTrace();
138
+            log.error("活动分页查询失败{}", e.getMessage());
139
+            return ResponseWrapper.error();
140
+        }
141
+    }
142
+
143
+
144
+
145
+    @ApiOperation(value = "拾取任务,将组任务分给个人任务", notes = "参数:userId 用户  procInsId 流程ID ")
146
+    @GetMapping(value = "/claim/{taskId}")
147
+    public  ResponseWrapper claim(
148
+            @PathVariable String taskId
149
+    ) {
150
+        try {
151
+            String userId=CurrentUtil.getUserId();
152
+            ResponseWrapper responseWrapper= flowAbleClient.claim(taskId, userId);
153
+            return responseWrapper;
154
+        } catch (Exception e) {
155
+            e.printStackTrace();
156
+            return ResponseWrapper.error();
157
+        }
158
+    }
159
+
160
+
161
+
162
+
163
+
164
+
165
+    /**
166
+     * 工作流审批--通过,驳回,提交
167
+     * @param
168
+     * @return
169
+     */
170
+    @ApiOperation(value = "工作流审批--提交、通过,驳回,受理、不受理,不通过", notes = "参数:completeVO ")
171
+    @PostMapping(value = "/startExamine")
172
+    public ResponseWrapper startExamine(
173
+            @RequestBody ExamineVO examineVO
174
+    ) {
175
+        String title="工作流审批--提交、通过,驳回,受理、不受理,不通过";
176
+        try {
177
+            String userId="";
178
+            String areaCode="";
179
+            if("20".equals(examineVO.getUserType())){
180
+                userId=CurrentUtil.getCreditCode();
181
+                areaCode=CurrentUtil.getAreaCode();
182
+                examineVO.setUserName(CurrentUtil.getCompanyName());
183
+            }else{
184
+                userId=CurrentUtil.getUserId();
185
+                areaCode=CurrentUtil.getAreaCode();
186
+                examineVO.setUserName(CurrentUtil.getUserName());
187
+            }
188
+            examineVO.setUserId(userId);
189
+            examineVO.setAreaCode(areaCode);
190
+
191
+            ResponseWrapper result=flowAbleClient.startExamine(examineVO);
192
+            if(result.getInfoCode()==200){
193
+                return ResponseWrapper.success(200, "查询成功", result.getData());
194
+            }else{
195
+                String data= (String) result.getData();
196
+                return ResponseWrapper.error();
197
+            }
198
+
199
+        } catch (Exception e) {
200
+            e.printStackTrace();
201
+            log.error("查找对象,发生异常", e.getMessage());
202
+            return ResponseWrapper.error();
203
+        }
204
+    }
205
+
206
+
207
+    /**
208
+     * 查询企业资格详情
209
+     *
210
+     * @param lcslId
211
+     * @return
212
+     */
213
+    @ApiOperation(value = "根据流程ID生成流图 返回base64 编码", notes = "参数:资格id")
214
+    @GetMapping(value = "/findByLcslImage/{lcslId}")
215
+    public ResponseWrapper findByLcslImage(@PathVariable("lcslId") String lcslId) {
216
+
217
+        try {
218
+            ResponseWrapper responseWrapper = flowAbleClient.findByLcslImage(lcslId);
219
+            if (responseWrapper.getInfoCode() != 200) {
220
+                return ResponseWrapper.error();
221
+            }
222
+            return responseWrapper;
223
+        } catch (Exception e) {
224
+            e.printStackTrace();
225
+            log.error("查找对象,发生异常", e.getMessage());
226
+            return ResponseWrapper.error();
227
+        }
228
+    }
229
+
230
+
231
+
232
+    @ApiOperation(value = "根据流程ID查询审核记录", notes = "参数:procInstId 流程ID ")
233
+    @GetMapping(value = "/findByProcessInfo/{procInstId}")
234
+    public  ResponseWrapper findByProcessInfo(
235
+            @PathVariable String procInstId
236
+    ) {
237
+        try {
238
+            ResponseWrapper responseWrapper= flowAbleClient.findByProcessInfo(procInstId);
239
+            return responseWrapper;
240
+        } catch (Exception e) {
241
+            e.printStackTrace();
242
+            return ResponseWrapper.error();
243
+        }
244
+    }
245
+
246
+
247
+}

+ 93 - 0
src/main/java/com/unis/app/controller/QyzgZgController.java

@@ -0,0 +1,93 @@
1
+package com.unis.app.controller;
2
+
3
+import com.unis.common.utils.ResponseWrapper;
4
+import com.unis.qyzg.client.QyzgZgClient;
5
+import com.unis.qyzg.common.vo.QyzgQyzgxxVO;
6
+import io.swagger.annotations.Api;
7
+import io.swagger.annotations.ApiImplicitParam;
8
+import io.swagger.annotations.ApiImplicitParams;
9
+import io.swagger.annotations.ApiOperation;
10
+import lombok.extern.slf4j.Slf4j;
11
+import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.web.bind.annotation.*;
13
+
14
+
15
+/**
16
+ * @Auther:张新亮
17
+ * @Date: 2019/7/25 0025 16:38
18
+ * @Description:
19
+ */
20
+@RestController
21
+@Slf4j
22
+@Api(value = "企业资格管理:资格信息", tags = "企业资格管理:资格信息")
23
+@RequestMapping("/qyzgZg")
24
+public class QyzgZgController {
25
+
26
+
27
+    @Autowired
28
+    private QyzgZgClient qyzgZgClient;
29
+
30
+
31
+    /**
32
+     * 省级承储资格列表
33
+     * provinceFindByPage
34
+     */
35
+    @ApiOperation(value = "省级承储资格列表", notes = "参数:模糊搜索 企业名称、所属地区、承储资格类型、仓容、有效日期")
36
+    @ApiImplicitParams({ @ApiImplicitParam(name = "page", value = "起始页", required = true),
37
+            @ApiImplicitParam(name = "size", value = "每页展示行数", required = true) })
38
+    @PostMapping(value = "/provinceFindByPage/{page}/{size}")
39
+    public ResponseWrapper provinceFindByPage(@RequestBody QyzgQyzgxxVO zgVO ,
40
+                                              @PathVariable Integer page, @PathVariable Integer size) {
41
+        try {
42
+            ResponseWrapper byPage = qyzgZgClient.findByPage(zgVO, page, size);
43
+            if (byPage.getInfoCode() != 200) {
44
+                return ResponseWrapper.error("列表查询失败,请联系管理员");
45
+            }
46
+            return ResponseWrapper.success(200, "查询成功" ,byPage.getData());
47
+        } catch (Exception e) {
48
+            log.error("用户分页查询失败{}", e.getMessage());
49
+            return ResponseWrapper.error();
50
+        }
51
+    }
52
+
53
+    /**
54
+     * 撤销企业资格
55
+     */
56
+    @ApiOperation(value = "撤销企业资格信息", notes = "参数:zgVO")
57
+    @PostMapping(value = "/cancelQualification")
58
+    public ResponseWrapper cancelQualification(@RequestBody QyzgQyzgxxVO zgVO) {
59
+
60
+        try {
61
+            ResponseWrapper responseWrapper = qyzgZgClient.cancelQualification(zgVO);
62
+            if (responseWrapper.getInfoCode() != 200) {
63
+                return ResponseWrapper.error("撤销发生异常,请联系管理员");
64
+            }
65
+            return ResponseWrapper.success();
66
+        } catch (Exception e) {
67
+            log.error("撤销对象,发生异常", e.getMessage());
68
+            return ResponseWrapper.error();
69
+        }
70
+    }
71
+
72
+
73
+    /**
74
+     * 查询企业资格详情
75
+     * @param id
76
+     * @return
77
+     */
78
+    @ApiOperation(value = "根据id查询详情", notes = "参数:资格id")
79
+    @GetMapping(value = "/findById/{id}")
80
+    public ResponseWrapper findById(@PathVariable("id") String id) {
81
+
82
+        try {
83
+            ResponseWrapper byId = qyzgZgClient.findById(id);
84
+            if (byId.getInfoCode() != 200) {
85
+                return ResponseWrapper.error();
86
+            }
87
+            return ResponseWrapper.success(200, "查找成功", byId.getData());
88
+        } catch (Exception e) {
89
+            log.error("查找对象,发生异常", e.getMessage());
90
+            return ResponseWrapper.error();
91
+        }
92
+    }
93
+}

+ 279 - 0
src/main/java/com/unis/app/controller/QyzgZgsqController.java

@@ -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
+}

+ 76 - 0
src/main/java/com/unis/app/controller/RecordCertificateController.java

@@ -0,0 +1,76 @@
1
+package com.unis.app.controller;
2
+
3
+import com.unis.common.utils.CurrentUtil;
4
+import com.unis.common.utils.ResponseWrapper;
5
+import com.unis.qyzg.client.RecordCertificateClient;
6
+import com.unis.qyzg.common.vo.QyzgBazsVO;
7
+import com.unis.qyzg.common.vo.QyzgZgsqVO;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.http.HttpStatus;
12
+import org.springframework.web.bind.annotation.*;
13
+
14
+import java.util.Date;
15
+
16
+@RestController
17
+@Api(value = "备案证书管理", tags = "备案证书管理")
18
+@RequestMapping(value = "/recordCertificate")
19
+public class RecordCertificateController {
20
+
21
+    @Autowired
22
+    private RecordCertificateClient recordCertificateClient;
23
+
24
+    /**
25
+     * 备案证书管理---根据条件分页查询备案单位
26
+     */
27
+    @ApiOperation(value = "根据条件分页查询备案单位")
28
+    @PostMapping(value = "/pageList/{pageNum}/{pageSize}")
29
+    public ResponseWrapper selectRecordCompany(@RequestBody QyzgZgsqVO qyzgZgsqVO,
30
+                                        @PathVariable Integer pageNum,
31
+                                        @PathVariable Integer pageSize){
32
+        return recordCertificateClient.selectRecordCompany(qyzgZgsqVO, pageNum, pageSize);
33
+    }
34
+
35
+    /**
36
+     * 备案证书管理---新增/更新备案证书
37
+     */
38
+    @ApiOperation(value = "新增/更新备案证书")
39
+    @PostMapping(value = "/recordCompany")
40
+    public ResponseWrapper recordCompany(@RequestBody QyzgBazsVO qyzgBazsVO){
41
+//        if (qyzgBazsVO.getDwdm() == null){
42
+//            return ResponseWrapper.error(HttpStatus.BAD_REQUEST.value(), "单位代码(dwdm)不能为空", null);
43
+//        }
44
+        qyzgBazsVO.setCreator(CurrentUtil.getUserName());
45
+        qyzgBazsVO.setCreateDate(new Date());
46
+        qyzgBazsVO.setCreatorCode(CurrentUtil.getUserId());
47
+        qyzgBazsVO.setOrgCode(CurrentUtil.getOrgId());
48
+        return recordCertificateClient.recordCompany(qyzgBazsVO);
49
+    }
50
+
51
+    /**
52
+     * 备案证书管理---根据证书ID查询备案证书详情
53
+     */
54
+    @ApiOperation(value = "根据证书ID查询备案证书详情", notes = "params: 通过ID查询的时候,DWDM为null;通过DWDM查询的时候,ID = 0")
55
+    @GetMapping(value = "/certificateDetail/{id}")
56
+    public ResponseWrapper certificateDetail(@PathVariable(required = false) String id,
57
+                                             @RequestParam(required = false) String dwdm){
58
+        return recordCertificateClient.certificateDetail(id, dwdm);
59
+    }
60
+
61
+    /**
62
+     * 功能描述: 备案证书---列表
63
+     *
64
+     * @Param: [qyzgBazsVO]
65
+     * @Return: com.unis.common.utils.ResponseWrapper
66
+     * @Author: zoujieli
67
+     * @Date: 2020-02-28 14:32
68
+     */
69
+    @ApiOperation(value = "根据企业统一社会信用代码查询备案证书列表")
70
+    @PostMapping(value = "/certificatePageList/{pageNum}/{pageSize}")
71
+    public ResponseWrapper findCertificatePageList(@RequestBody QyzgBazsVO qyzgBazsVO,
72
+                                                   @PathVariable(name = "pageNum") int pageNum,
73
+                                                   @PathVariable(name = "pageSize") int pageSize){
74
+        return recordCertificateClient.findCertificatePageList(qyzgBazsVO, pageNum, pageSize);
75
+    }
76
+}

+ 52 - 0
src/main/resources/bootstrap.yml

@@ -0,0 +1,52 @@
1
+server:
2
+  port: 13102
3
+spring:
4
+  application:
5
+    name: qyzg-app
6
+  #配置中心配置
7
+#  cloud:
8
+#    config:
9
+#      #使用discovery 时需要将eureka 写到该文件中,开发环境使用该方式,推荐使用。
10
+#      discovery:
11
+#        enabled: true
12
+#        service-id: config
13
+#      name: feign
14
+#      profile: dev
15
+#      username: configuser
16
+#      password: configpasd
17
+#      retry:
18
+#        max-attempts: 5
19
+#        max-interval: 2000
20
+#      #如果出现错误立刻停止服务。
21
+#      #fail-fast: true
22
+ribbon:
23
+  eureka:
24
+    enabled: true
25
+  ConnectTimeout: 60000
26
+  ReadTimeout: 60000
27
+  MaxTotalHttpConnections: 60000
28
+  MaxConnectionsPerHost: 60000
29
+hystrix:
30
+  command:
31
+    myusers-service:
32
+      execution:
33
+        isolation:
34
+          thread:
35
+            timeoutInMilliseconds: 60000
36
+#服务注册配置
37
+eureka:
38
+  client:
39
+    service-url:
40
+      defaultZone: http://172.16.0.4:11000/eureka/
41
+  instance:
42
+    prefer-ip-address: true
43
+    status-page-url-path: /swagger-ui.html
44
+#日志配置
45
+logging:
46
+  level:
47
+    com.unis.app: debug
48
+    root: warn
49
+    org.springframework.web: debug
50
+    org.hibernate: error
51
+    com.unis.app.controller: info
52
+  path: ./log/