合并分支 'FOTON' 到 'master'
Foton 查看合并请求 laws-foton-slrs/foton-slrs-system-rest!17
This commit is contained in:
@@ -35,3 +35,5 @@ target
|
||||
*.bpmn/
|
||||
*logs/
|
||||
.metadata
|
||||
|
||||
adc-da-main/src/main/resources/application-zxy.properties
|
||||
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>foton-slrs-system-rest</artifactId>
|
||||
<groupId>com.adc</groupId>
|
||||
<version>3.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>adc-da-activiti</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!-- feign调用 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
|
||||
<version>2.2.0.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
<version>2.2.0.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-loadbalancer</artifactId>
|
||||
<version>2.2.0.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.adc</groupId>
|
||||
<artifactId>adc-da-sys</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.adc</groupId>
|
||||
<artifactId>adc-da-slrs</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.dom4j</groupId>
|
||||
<artifactId>dom4j</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.adc.da.FeignClient;
|
||||
|
||||
import feign.RequestInterceptor;
|
||||
import feign.RequestTemplate;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @Description: TODO
|
||||
* @author: super_liu
|
||||
* @date: 2021年10月11日 13:33
|
||||
*/
|
||||
|
||||
/**
|
||||
* Feign配置
|
||||
* 使用FeignClient进行服务间调用,传递headers信息
|
||||
*/
|
||||
@Configuration
|
||||
public class FeignConfig implements RequestInterceptor {
|
||||
@Override
|
||||
public void apply(RequestTemplate requestTemplate) {
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
|
||||
if(attributes != null){
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
//添加token
|
||||
requestTemplate.header("token", request.getHeader("token"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,476 @@
|
||||
package com.adc.da.FeignClient;
|
||||
|
||||
import com.adc.da.common.*;
|
||||
import com.adc.da.common.Category;
|
||||
import com.adc.da.common.Page;
|
||||
import com.adc.da.workFlow.entity.BusProcessEvaluationHis;
|
||||
import com.adc.da.workFlow.entity.BusProcessModelHis;
|
||||
import com.adc.da.workFlow.entity.ProcessRollBackEO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
//@FeignClient(value = "bat-wkflow-test")
|
||||
@FeignClient(value = "bat-wkflow")
|
||||
//@FeignClient(value = "shan6")
|
||||
public interface workFlowFeignClient {
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/busProcessModel/saveEditFile",method = RequestMethod.GET)
|
||||
BusProcessModelHis saveEditFile(@RequestParam("model") String model);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/busProcessModel/processEditFile",method = RequestMethod.GET)
|
||||
BusProcessModelHis processEditFile(@RequestParam("id") String id);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/busProcessModel/processModelHisOneUpdStatus",method = RequestMethod.GET)
|
||||
BusProcessModelHis processModelHisOneUpdStatus(@RequestParam("pid") String pid, @RequestParam("taskId") String taskId);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/busProcessModel/processModelHisOneCount",method = RequestMethod.GET)
|
||||
BusProcessModelHis processModelHisOneCount(@RequestParam("pid") String pid);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/busProcessModel/processModelHisOne",method = RequestMethod.GET)
|
||||
BusProcessModelHis processModelHisOne(@RequestParam("pid") String pid, @RequestParam("taskId") String taskId);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/busProcessEvaluation/evaluationHisListByOne",method = RequestMethod.GET)
|
||||
BusProcessEvaluationHis evaluationHisListByOne(@RequestParam("pid") String pid,@RequestParam("taskInfo") String taskInfo);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/busProcessEvaluation/evaluationHisListRepSum",method = RequestMethod.GET)
|
||||
Map<String,Integer> evaluationHisListRepSum(@RequestParam("pid") String pid);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/busProcessEvaluation/evaluationHisListRep",method = RequestMethod.GET)
|
||||
List<BusProcessEvaluationHis> evaluationHisListRep(@RequestParam("pid") String pid);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/busProcessEvaluation/evaluationHisList",method = RequestMethod.GET)
|
||||
List<BusProcessEvaluationHis> evaluationHisList(@RequestParam("pid") String pid);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/oaTaskExec/execTask",method = RequestMethod.GET)
|
||||
Map<String,Object> execTask(@RequestParam("todoId") String todoId);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/esPrcRelation/acceptTask",method = RequestMethod.GET)
|
||||
Integer acceptTask(@RequestParam("nowEsId") String nowEsId, @RequestParam("oaFlag") String oaFlag, @RequestParam("taskId") String taskId);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/esPrcRelation/judgeAcceptTask",method = RequestMethod.GET)
|
||||
Boolean judgeAcceptTask(@RequestParam("nowEsId") String nowEsId, @RequestParam("oaFlag") String oaFlag, @RequestParam("prcIdGk") String prcIdGk);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/task/get_verify_by_instance",method = RequestMethod.GET)
|
||||
Map<String,Object> get_verify_by_instance(@RequestParam("taskId") String taskId, @RequestParam("pId") String pId);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/activiti_define_start_user",method = RequestMethod.GET)
|
||||
Wrapper<String> activiti_define_start(@RequestParam("id") String id, @RequestParam("userId") String userId, @RequestParam("bpnId") String bpnId);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/activiti_define_start_user_rollBack",method = RequestMethod.POST)
|
||||
Wrapper<String> activiti_define_start_rollBack(@RequestBody ProcessRollBackEO processRollBackEO);
|
||||
|
||||
/**
|
||||
* 企标复审流程专用
|
||||
* @param id
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/activiti_define_start_user1",method = RequestMethod.GET)
|
||||
Map<String,String> activiti_define_start1(@RequestParam("id") String id, @RequestParam("userId") String userId, @RequestParam("standName") String standName);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/todotask",method = RequestMethod.GET)
|
||||
List<BusProcessNew> todotask(@RequestParam("userId") String userId, @RequestParam("pId") String pId);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/hastodoTasksList",method = RequestMethod.POST)
|
||||
Wrapper<Map<String, Object>> HastodoTasksListByUserId(@RequestBody TaskCommonQuery taskCommonQuery);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/todoTaskList",method = RequestMethod.POST)
|
||||
List<BusProcessName> todoTaskListByUserId(@RequestBody TaskCommonQuery taskCommonQuery);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/todoTaskListNew",method = RequestMethod.POST)
|
||||
List<BusProcessName> todoTaskListByUserIdNew(@RequestBody TaskCommonQuery taskCommonQuery);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/completeTask",method = RequestMethod.POST)
|
||||
Wrapper<String> completeTaskByUserId(@RequestBody BusMes busMes);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/completeTaskNew",method = RequestMethod.POST)
|
||||
Wrapper<String> completeTaskByUserIdNew(@RequestBody BusMesSpecial busMes);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/saveTask",method = RequestMethod.POST)
|
||||
public Wrapper<String> saveTask(@RequestBody BusMes busMes);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/saveTaskForXZYQ",method = RequestMethod.POST)
|
||||
public Wrapper<String> saveTaskForXZYQ(@RequestBody BusMes busMes);
|
||||
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/changeAssigneeNew",method = RequestMethod.GET)
|
||||
public Wrapper<String> run(@RequestParam("taskId") String taskId, @RequestParam("assignee") String assignee,
|
||||
@RequestParam("userId") String userId, @RequestParam("pId") String pId);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/queryDetail",method = RequestMethod.GET)
|
||||
BusProcessNew queryDetail(@RequestParam("taskIds") String taskIds);
|
||||
|
||||
/**
|
||||
* 获取入库流程联络人节点详情信息
|
||||
* @param taskIds
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/inboundLiaisonDetail",method = RequestMethod.GET)
|
||||
BusProcessNew inboundLiaisonDetail(@RequestParam("taskIds") String taskIds, @RequestParam("pId") String pId);
|
||||
|
||||
/**
|
||||
* 国内法规入库评估流程详情
|
||||
* @param taskIds
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/inboundLiaisonDetailForLawsAss",method = RequestMethod.GET)
|
||||
String inboundLiaisonDetailForLawsAss(@RequestParam("taskIds") String taskIds);
|
||||
|
||||
/**
|
||||
* 国内法规入库评估流程详情
|
||||
* @param taskIds
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/nonconformity",method = RequestMethod.GET)
|
||||
String nonconformity(@RequestParam("taskIds") String taskIds);
|
||||
/**
|
||||
* 项目评估流程详情
|
||||
* @param taskIds
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/projectAssessDetail",method = RequestMethod.GET)
|
||||
BusProcessNew projectAssessDetail(@RequestParam("taskIds") String taskIds);
|
||||
|
||||
/**
|
||||
* 企标制修订申请流程详情
|
||||
* @param taskIds
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/qbzxdsqlcDetail",method = RequestMethod.GET)
|
||||
String qbzxdsqlcDetail(@RequestParam("taskIds") String taskIds);
|
||||
/**
|
||||
* 采购申请流程详情
|
||||
* @param taskIds
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/cgsqDetail",method = RequestMethod.GET)
|
||||
String cgsqDetail(@RequestParam("taskIds") String taskIds);
|
||||
|
||||
/**
|
||||
* 复审流程详情
|
||||
* @param taskIds
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/fsDetail",method = RequestMethod.GET)
|
||||
String fsDetail(@RequestParam("taskIds") String taskIds);
|
||||
|
||||
/**
|
||||
* 企标废止流程详情
|
||||
* @param taskIds
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/qbfzlcDetail",method = RequestMethod.GET)
|
||||
String qbfzlcDetail(@RequestParam("taskIds") String taskIds);
|
||||
|
||||
/**
|
||||
* 企标制修订流程详情
|
||||
* @param taskIds
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/qbzxdlcDetail",method = RequestMethod.GET)
|
||||
String qbzxdlcDetail(@RequestParam("taskIds") String taskIds);
|
||||
|
||||
/**
|
||||
* 政策法规入库发起人查看流程详情
|
||||
* @param taskIds
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/zcfgrklcFqrDetail",method = RequestMethod.GET)
|
||||
String zcfgrklcFqrDetail(@RequestParam("taskIds") String taskIds);
|
||||
/**
|
||||
* 政策法规入库流程详情
|
||||
* @param taskIds
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/zcfgrklcDetail",method = RequestMethod.GET)
|
||||
String zcfgrklcDetail(@RequestParam("taskIds") String taskIds);
|
||||
/**
|
||||
* 政策法规入库流程联络人选择FO详情
|
||||
* @param taskIds
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/zcfgrklcLlrDetail",method = RequestMethod.GET)
|
||||
String zcfgrklcLlrDetail(@RequestParam("taskIds") String taskIds);
|
||||
|
||||
/**
|
||||
* 企标制修订评估详情
|
||||
* @param taskIds
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/qbzxdpgDetail",method = RequestMethod.GET)
|
||||
String qbzxdpgDetail(@RequestParam("taskIds") String taskIds);
|
||||
|
||||
/**
|
||||
* 保存标准入库流程
|
||||
* @param busMes
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/saveinboundTask",method = RequestMethod.POST)
|
||||
Wrapper<String> saveinboundTask(@RequestBody BusMes busMes);
|
||||
|
||||
/**
|
||||
* 整改流程保存
|
||||
* @param busMes
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/saveUnqualified",method = RequestMethod.POST)
|
||||
Wrapper<String> saveUnqualified(@RequestBody BusMes busMes);
|
||||
|
||||
/**
|
||||
* 国内法规入库评估流程保存
|
||||
* @param busMes
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/saveInboundLiaisonDetailForLawsAss",method = RequestMethod.POST)
|
||||
Wrapper<String> saveInboundLiaisonDetailForLawsAss(@RequestBody BusMes busMes);
|
||||
|
||||
/**国内法规入库项目评估流程保存
|
||||
* @Author yuzhong
|
||||
* @Param [busMes]
|
||||
* @return com.adc.da.lawss.common.Wrapper<java.lang.String>
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/saveProjectAssessDetail2",method = RequestMethod.POST)
|
||||
Wrapper<String> saveProjectAssessDetail2(@RequestBody BusMes busMes);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/saveZcfgpg",method = RequestMethod.POST)
|
||||
Wrapper<String> saveZcfgpg(@RequestBody BusMes busMes);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/saveProjectAssessDetail3",method = RequestMethod.POST)
|
||||
Wrapper<String> saveProjectAssessDetail3(@RequestBody BusMes busMes);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/saveProjectAssessDetail4",method = RequestMethod.POST)
|
||||
Wrapper<String> saveProjectAssessDetail4(@RequestBody BusMes busMes);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/saveProjectAssessDetail5",method = RequestMethod.POST)
|
||||
Wrapper<String> saveProjectAssessDetail5(@RequestBody BusMes busMes);
|
||||
|
||||
/**
|
||||
* 公共保存
|
||||
* @param busMes
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/saveTaskForPub",method = RequestMethod.POST)
|
||||
Wrapper<String> saveTaskForPub(@RequestBody BusMes busMes);
|
||||
|
||||
/**
|
||||
* 采购申请保存
|
||||
* @param busMes
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/saveCgSq",method = RequestMethod.POST)
|
||||
Wrapper<String> saveCgSq(@RequestBody BusMes busMes);
|
||||
|
||||
/**
|
||||
* 保存任务第一步
|
||||
* @param busMes
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/saveTaskFirst",method = RequestMethod.POST)
|
||||
Wrapper<String> saveTaskFirst(@RequestBody BusMes busMes);
|
||||
|
||||
/**
|
||||
* 查询任务第一步
|
||||
* @param bpnId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/queryTaskFirst",method = RequestMethod.GET)
|
||||
BusProcessName queryTaskFirst(@RequestParam("bpnId") String bpnId);
|
||||
|
||||
/**
|
||||
* 查询指定任务(此接口暂无调用)
|
||||
* @param prcId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/queryTaskIndex",method = RequestMethod.GET)
|
||||
BusProcessNew queryTaskIndex(@RequestParam("prcId") String prcId,@RequestParam("taskIds") String taskIds);
|
||||
/**
|
||||
* 查询草稿
|
||||
* @param taskCommonQuery
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/queryTaskDraft",method = RequestMethod.POST)
|
||||
List<BusProcessName> queryTaskDraft(@RequestBody TaskCommonQuery taskCommonQuery);
|
||||
|
||||
/**
|
||||
* 自动发起流程保存第一步
|
||||
* @param busMes
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/autoSaveFirst",method = RequestMethod.POST)
|
||||
Wrapper<String> autoSaveFirst(@RequestBody BusMes busMes);
|
||||
|
||||
/**
|
||||
* (复审流程专用)自动发起流程保存第一步
|
||||
* @param busMes
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/autoSaveFirst1",method = RequestMethod.POST)
|
||||
Wrapper<String> autoSaveFirst1(@RequestBody BusMes busMes);
|
||||
|
||||
/**
|
||||
* 查询流程是否结束
|
||||
* @param pId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/isEnd",method = RequestMethod.GET)
|
||||
String isEnd(@RequestParam("pId") String pId);
|
||||
|
||||
/**
|
||||
* 删除流程
|
||||
* @param pId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/deleteProcessInstance",method = RequestMethod.GET)
|
||||
Wrapper<String> deleteProcessInstance(@RequestParam("pId") String pId);
|
||||
|
||||
/**
|
||||
* 删除草稿
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/deleteDraft",method = RequestMethod.GET)
|
||||
Wrapper<String> deleteDraft(@RequestParam("id") String id);
|
||||
|
||||
/**
|
||||
* 已发流程
|
||||
* @param taskCommonQuery
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/issuedProcess",method = RequestMethod.POST)
|
||||
Page issuedProcess(@RequestBody TaskCommonQuery taskCommonQuery);
|
||||
|
||||
/**
|
||||
* 已办流程
|
||||
* @param taskCommonQuery
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/doneProcess",method = RequestMethod.POST)
|
||||
Page doneProcess(@RequestBody TaskCommonQuery taskCommonQuery);
|
||||
|
||||
/**
|
||||
* @Author yuzhong
|
||||
* 流程实例明细列表
|
||||
* @Date 2020/12/18
|
||||
* @Param [processInstanceId]
|
||||
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/task/get_list_by_instance",method = RequestMethod.GET)
|
||||
List<Map<String, Object>> get_list_by_instance(@RequestParam("prcNum") String prcNum, @RequestParam(value = "sortWord", required = false) String sortWord, @RequestParam(value = "shunxu", required = false) String shunxu);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/task/get_gather_by_instance",method = RequestMethod.GET)
|
||||
List<Map<String, Object>> get_gather_by_instance(@RequestParam("prcNum") String prcNum, @RequestParam(value = "sortWord", required = false) String sortWord, @RequestParam(value = "shunxu", required = false) String shunxu);
|
||||
|
||||
/**
|
||||
* @Author yuzhong
|
||||
* 获取图片
|
||||
* @Date 2020/12/18
|
||||
* @Param [processInstanceId]
|
||||
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/instance/getImg",method = RequestMethod.GET)
|
||||
byte[] getImg(@RequestParam("prcNum") String prcNum);
|
||||
|
||||
/**
|
||||
* @Author yuzhong
|
||||
* 监控流程列表
|
||||
* @Date 2020/12/18
|
||||
* @Param [userId]
|
||||
* @return java.util.List<com.adc.da.lawss.common.BusProcessName>
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/allProcess",method = RequestMethod.POST)
|
||||
Page allProcess(@RequestBody TaskCommonQuery taskCommonQuery);
|
||||
|
||||
/**
|
||||
* @Author yuzhong
|
||||
* @Date 2020/12/28
|
||||
* @Param [prcNum]
|
||||
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/forceRecall",method = RequestMethod.GET)
|
||||
Wrapper<String> forceRecall(@RequestParam("prcId") String prcId);
|
||||
|
||||
/**
|
||||
* @Author yuzhong
|
||||
* @Date 2020/12/28
|
||||
* @Param [prcNum]
|
||||
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/category/category/list",method = RequestMethod.GET)
|
||||
Wrapper<List<Category>> categoryList();
|
||||
|
||||
/**
|
||||
* @Author yuzhong
|
||||
* @Date 2020/12/28
|
||||
* @Param [prcNum]
|
||||
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/category/category/add",method = RequestMethod.POST)
|
||||
Wrapper<String> addCategory(@RequestBody Category category);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/category/category/delete",method = RequestMethod.GET)
|
||||
Wrapper<String> deleteCategory(@RequestParam("objectId") String objectId);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/category/category/edit",method = RequestMethod.POST)
|
||||
Wrapper<String> editCategory(@RequestBody Category category);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/modelListPage",method = RequestMethod.GET)
|
||||
Wrapper<Map<String, Object>> modelListPage(@RequestParam("name") String name, @RequestParam("category_id") String category_id,
|
||||
@RequestParam("current") int current, @RequestParam("size") int size);
|
||||
|
||||
/**
|
||||
* @Author yuzhong
|
||||
* @Date 2020/12/28
|
||||
* @Param [prcNum]
|
||||
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/zcfgrkpgDetail",method = RequestMethod.GET)
|
||||
List<BusProcessNew> zcfgrkpgDetail(@RequestParam("pId") String pId);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/updatModel",method = RequestMethod.GET)
|
||||
Wrapper<String> updatModel(@RequestParam("modelId") String modelId, @RequestParam("categoryId") String categoryId);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/findPrcNumByPid",method = RequestMethod.GET)
|
||||
Wrapper<String> findPrcNumByPid(@RequestParam("pId") String pId);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/findPrcNameByPrcNum",method = RequestMethod.GET)
|
||||
Wrapper<String> findPrcNameByPrcNum(@RequestParam("prcNum") String prcNum);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/getStandCode",method = RequestMethod.GET)
|
||||
Set<String> getStandCode();
|
||||
|
||||
/**
|
||||
* 行政管理要求评估流程详情
|
||||
* @param taskIds
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/inboundLiaisonDetailForXZYQ",method = RequestMethod.GET)
|
||||
BusProcessNew inboundLiaisonDetailForXZYQ(@RequestParam("taskIds") String taskIds);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/decodeDetail",method = RequestMethod.GET)
|
||||
BusProcessNew decodeDetail(@RequestParam("taskIds") String taskIds, @RequestParam("pId") String pId);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/queryBusProcessNameForEnd",method = RequestMethod.POST)
|
||||
List<BusProcessName> queryBusProcessNameForEnd(@RequestBody String taskId);
|
||||
|
||||
// @RequestMapping(value = "/bat-wkflow/findProcessNameByPrcNum",method = RequestMethod.POST)
|
||||
// List<BusProcessName> findProcessNameByPrcNum(@RequestBody String taskId);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/datas/bus-process-new/everyDayTenOlock",method = RequestMethod.GET)
|
||||
List<BusProcessNew> everyDayTenOlock();
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/datas/bus-process-new/everyDayTenOlockSAM",method = RequestMethod.GET)
|
||||
List<BusProcessNew> everyDayTenOlockSAM();
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/delCG",method = RequestMethod.POST)
|
||||
String delCG(@RequestParam("id") String id);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/esTechRelation/setRelation",method = RequestMethod.POST)
|
||||
void setRelation(@RequestParam("esPlanId")String esPlanId,@RequestParam("prcId") String prcId, @RequestParam("finish") String finish);
|
||||
@RequestMapping(value = "/bat-wkflow/esTechRelation/getEsByWk",method = RequestMethod.GET)
|
||||
String getEsByWk(@RequestParam("prcId")String prcId);
|
||||
}
|
||||
+421
@@ -0,0 +1,421 @@
|
||||
package com.adc.da.FeignClientImpl;
|
||||
|
||||
import com.adc.da.FeignClient.workFlowFeignClient;
|
||||
import com.adc.da.common.Wrapper;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.common.*;
|
||||
import com.adc.da.common.Page;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.sys.service.IUserEOService;
|
||||
import com.adc.da.workFlow.entity.BusProcessEvaluationHis;
|
||||
import com.adc.da.workFlow.entity.BusProcessModelHis;
|
||||
import com.adc.da.workFlow.entity.ProcessRollBackEO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class workFlowFeignClientImpl {
|
||||
|
||||
@Autowired
|
||||
private workFlowFeignClient workFlowFeignClient;
|
||||
|
||||
@Autowired
|
||||
private IUserEOService userEOService;
|
||||
|
||||
public BusProcessModelHis saveEditFile(@RequestParam("model") String model){
|
||||
BusProcessModelHis stringWrapper = workFlowFeignClient.saveEditFile(model);
|
||||
return stringWrapper;
|
||||
}
|
||||
|
||||
public BusProcessModelHis processEditFile(@RequestParam("id") String id){
|
||||
BusProcessModelHis stringWrapper = workFlowFeignClient.processEditFile(id);
|
||||
return stringWrapper;
|
||||
}
|
||||
|
||||
public BusProcessModelHis processModelHisOneUpdStatus(@RequestParam("pid") String pid,@RequestParam("taskId") String taskId){
|
||||
BusProcessModelHis stringWrapper = workFlowFeignClient.processModelHisOneUpdStatus(pid,taskId);
|
||||
return stringWrapper;
|
||||
}
|
||||
|
||||
public BusProcessModelHis processModelHisOneCount(@RequestParam("pid") String pid){
|
||||
BusProcessModelHis stringWrapper = workFlowFeignClient.processModelHisOneCount(pid);
|
||||
return stringWrapper;
|
||||
}
|
||||
|
||||
public BusProcessModelHis processModelHisOne(@RequestParam("pid") String pid,@RequestParam("taskId") String taskId){
|
||||
BusProcessModelHis stringWrapper = workFlowFeignClient.processModelHisOne(pid,taskId);
|
||||
return stringWrapper;
|
||||
}
|
||||
|
||||
public BusProcessEvaluationHis evaluationHisListByOne(@RequestParam("pid") String pid,@RequestParam("taskInfo") String taskInfo){
|
||||
BusProcessEvaluationHis stringWrapper = workFlowFeignClient.evaluationHisListByOne(pid,taskInfo);
|
||||
return stringWrapper;
|
||||
}
|
||||
|
||||
public Map<String,Integer> evaluationHisListRepSum(@RequestParam("pid") String pid){
|
||||
Map<String,Integer> stringWrapper = workFlowFeignClient.evaluationHisListRepSum(pid);
|
||||
return stringWrapper;
|
||||
}
|
||||
|
||||
public List<BusProcessEvaluationHis> evaluationHisListRep(@RequestParam("pid") String pid){
|
||||
List<BusProcessEvaluationHis> stringWrapper = workFlowFeignClient.evaluationHisListRep(pid);
|
||||
return stringWrapper;
|
||||
}
|
||||
|
||||
public List<BusProcessEvaluationHis> evaluationHisList(@RequestParam("pid") String pid){
|
||||
List<BusProcessEvaluationHis> stringWrapper = workFlowFeignClient.evaluationHisList(pid);
|
||||
return stringWrapper;
|
||||
}
|
||||
|
||||
public Map<String,Object> execTask(@RequestParam("todoId") String todoId){
|
||||
Map<String,Object> stringWrapper = workFlowFeignClient.execTask(todoId);
|
||||
return stringWrapper;
|
||||
}
|
||||
|
||||
public Integer acceptTack(@RequestParam("nowEsId") String nowEsId, @RequestParam("oaFlag") String oaFlag, @RequestParam("taskId") String taskId){
|
||||
Integer integerWrapper = workFlowFeignClient.acceptTask(nowEsId,oaFlag,taskId);
|
||||
return integerWrapper;
|
||||
}
|
||||
|
||||
public Boolean judgeAcceptTack(@RequestParam("nowEsId") String nowEsId, @RequestParam("oaFlag") String oaFlag, @RequestParam("prcIdGk") String prcIdGk){
|
||||
Boolean booleanWrapper = workFlowFeignClient.judgeAcceptTask(nowEsId,oaFlag,prcIdGk);
|
||||
return booleanWrapper;
|
||||
}
|
||||
|
||||
public Map<String,Object> get_verify_by_instance(@RequestParam("taskId") String taskId, @RequestParam("pId") String pId){
|
||||
Map<String,Object> stringWrapper = workFlowFeignClient.get_verify_by_instance(taskId,pId);
|
||||
return stringWrapper;
|
||||
}
|
||||
|
||||
public ResponseMessage activiti_define_start(@RequestParam("Id") String Id, @RequestParam("userId") String userId, @RequestParam("bpnId") String bpnId){
|
||||
Wrapper<String> stringWrapper = workFlowFeignClient.activiti_define_start(Id,userId,bpnId);
|
||||
return Result.success(stringWrapper.getResult());
|
||||
}
|
||||
|
||||
public ResponseMessage activiti_define_start_rollBack(@RequestParam("Id") String Id, @RequestParam("userId") String userId, @RequestParam("bpnId") String bpnId,@RequestParam("json")String json){
|
||||
ProcessRollBackEO rollBackEO=new ProcessRollBackEO();
|
||||
rollBackEO.setId(Id);
|
||||
rollBackEO.setBpnId(bpnId);
|
||||
rollBackEO.setJson(json);
|
||||
rollBackEO.setUserId(userId);
|
||||
Wrapper<String> stringWrapper = workFlowFeignClient.activiti_define_start_rollBack(rollBackEO);
|
||||
return Result.success(stringWrapper.getResult());
|
||||
}
|
||||
public Map<String,String> activiti_define_start1(@RequestParam("Id") String Id, @RequestParam("userId") String userId, @RequestParam("standName") String standName){
|
||||
Map<String,String> map = workFlowFeignClient.activiti_define_start1(Id,userId,standName);
|
||||
return map;
|
||||
}
|
||||
|
||||
public List<BusProcessNew> todotask(@RequestParam("userId") String userId, @RequestParam("pId") String pId){
|
||||
List<BusProcessNew> todotask = workFlowFeignClient.todotask(userId, pId);
|
||||
|
||||
for (BusProcessNew busProcessNew : todotask) {
|
||||
UserEO userEO = userEOService.selectByPrimaryKey(busProcessNew.getUserId());
|
||||
busProcessNew.setUsername(userEO.getUname());
|
||||
}
|
||||
return todotask;
|
||||
}
|
||||
|
||||
public Wrapper<Map<String, Object>> HastodoTasksListByUserId(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
Wrapper<Map<String, Object>> mapWrapper = workFlowFeignClient.HastodoTasksListByUserId(taskCommonQuery);
|
||||
return mapWrapper;
|
||||
}
|
||||
|
||||
public List<BusProcessName> todoTaskListByUserId(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
List<BusProcessName> mapWrapper = workFlowFeignClient.todoTaskListByUserId(taskCommonQuery);
|
||||
return mapWrapper;
|
||||
}
|
||||
|
||||
public List<BusProcessName> todoTaskListByUserIdNew(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
List<BusProcessName> mapWrapper = workFlowFeignClient.todoTaskListByUserId(taskCommonQuery);
|
||||
return mapWrapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始分页
|
||||
* @param list
|
||||
* @param pageNum 页码
|
||||
* @param pageSize 每页多少条数据
|
||||
* @return
|
||||
*/
|
||||
public static List startPage(List list, Integer pageNum,
|
||||
Integer pageSize) {
|
||||
if (list == null) {
|
||||
return null;
|
||||
}
|
||||
if (list.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Integer count = list.size(); // 记录总数
|
||||
Integer pageCount = 0; // 页数
|
||||
if (count % pageSize == 0) {
|
||||
pageCount = count / pageSize;
|
||||
} else {
|
||||
pageCount = count / pageSize + 1;
|
||||
}
|
||||
|
||||
int fromIndex = 0; // 开始索引
|
||||
int toIndex = 0; // 结束索引
|
||||
|
||||
if (pageNum != pageCount) {
|
||||
fromIndex = (pageNum - 1) * pageSize;
|
||||
toIndex = fromIndex + pageSize;
|
||||
} else {
|
||||
fromIndex = (pageNum - 1) * pageSize;
|
||||
toIndex = count;
|
||||
}
|
||||
|
||||
List pageList = list.subList(fromIndex, toIndex);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
|
||||
public Wrapper<String> completeTaskByUserId( BusMes busMes){
|
||||
Wrapper<String> stringWrapper = workFlowFeignClient.completeTaskByUserId(busMes);
|
||||
return stringWrapper;
|
||||
}
|
||||
|
||||
public Wrapper<String> completeTaskByUserIdNew( BusMesSpecial busMes){
|
||||
Wrapper<String> stringWrapper = workFlowFeignClient.completeTaskByUserIdNew(busMes);
|
||||
return stringWrapper;
|
||||
}
|
||||
|
||||
public Wrapper<String> saveTask(@RequestBody BusMes busMes){
|
||||
Wrapper<String> stringWrapper = workFlowFeignClient.saveTask(busMes);
|
||||
return stringWrapper;
|
||||
}
|
||||
|
||||
public Wrapper<String> saveTaskForXZYQ(@RequestBody BusMes busMes){
|
||||
Wrapper<String> stringWrapper = workFlowFeignClient.saveTaskForXZYQ(busMes);
|
||||
return stringWrapper;
|
||||
}
|
||||
|
||||
public Wrapper<String> run(@RequestParam("taskId")String taskId, @RequestParam("assignee") String assignee,
|
||||
@RequestParam("userId")String userId, @RequestParam("pId") String pId){
|
||||
Wrapper<String> run = workFlowFeignClient.run(taskId, assignee,userId,pId);
|
||||
return run;
|
||||
}
|
||||
|
||||
|
||||
public BusProcessNew queryDetail(@RequestParam("taskIds") String taskIds){
|
||||
return workFlowFeignClient.queryDetail(taskIds);
|
||||
}
|
||||
|
||||
public BusProcessNew inboundLiaisonDetail(@RequestParam("taskIds") String taskIds, @RequestParam("pId") String pId){
|
||||
return workFlowFeignClient.inboundLiaisonDetail(taskIds,pId);
|
||||
}
|
||||
|
||||
public String inboundLiaisonDetailForLawsAss(@RequestParam("taskIds") String taskIds){
|
||||
return workFlowFeignClient.inboundLiaisonDetailForLawsAss(taskIds);
|
||||
}
|
||||
|
||||
public String nonconformity(@RequestParam("taskIds") String taskIds){
|
||||
return workFlowFeignClient.nonconformity(taskIds);
|
||||
}
|
||||
|
||||
public BusProcessNew projectAssessDetail(@RequestParam("taskIds") String taskIds){
|
||||
return workFlowFeignClient.projectAssessDetail(taskIds);
|
||||
}
|
||||
|
||||
public String qbzxdsqlcDetail(@RequestParam("taskIds") String taskIds){
|
||||
return workFlowFeignClient.qbzxdsqlcDetail(taskIds);
|
||||
}
|
||||
public String cgsqDetail(@RequestParam("taskIds") String taskIds){
|
||||
return workFlowFeignClient.cgsqDetail(taskIds);
|
||||
}
|
||||
|
||||
public String fsDetail(@RequestParam("taskIds") String taskIds){
|
||||
return workFlowFeignClient.fsDetail(taskIds);
|
||||
}
|
||||
|
||||
public String qbfzDetail(@RequestParam("taskIds") String taskIds){
|
||||
return workFlowFeignClient.qbfzlcDetail(taskIds);
|
||||
}
|
||||
|
||||
public String qbzxdDetail(@RequestParam("taskIds") String taskIds){
|
||||
return workFlowFeignClient.qbzxdlcDetail(taskIds);
|
||||
}
|
||||
|
||||
public String zcfgrklcFqrDetail(@RequestParam("taskIds") String taskIds){
|
||||
return workFlowFeignClient.zcfgrklcFqrDetail(taskIds);
|
||||
}
|
||||
public String zcfgrklcDetail(@RequestParam("taskIds") String taskIds){
|
||||
return workFlowFeignClient.zcfgrklcDetail(taskIds);
|
||||
}
|
||||
|
||||
public String zcfgrklcLlrDetail(@RequestParam("taskIds") String taskIds){
|
||||
return workFlowFeignClient.zcfgrklcLlrDetail(taskIds);
|
||||
}
|
||||
|
||||
public String qbzxdpgDetail(@RequestParam("taskIds")String taskIds){
|
||||
return workFlowFeignClient.qbzxdpgDetail(taskIds);
|
||||
}
|
||||
|
||||
public Wrapper<String> saveinboundTask(BusMes busMes){
|
||||
return workFlowFeignClient.saveinboundTask(busMes);
|
||||
}
|
||||
|
||||
public Wrapper<String> saveUnqualified(BusMes busMes){
|
||||
return workFlowFeignClient.saveUnqualified(busMes);
|
||||
}
|
||||
|
||||
public Wrapper<String> saveInboundLiaisonDetailForLawsAss(@RequestBody BusMes busMes){
|
||||
return workFlowFeignClient.saveInboundLiaisonDetailForLawsAss(busMes);
|
||||
}
|
||||
|
||||
public Wrapper<String> saveProjectAssessDetail2(@RequestBody BusMes busMes){
|
||||
return workFlowFeignClient.saveProjectAssessDetail2(busMes);
|
||||
}
|
||||
|
||||
public Wrapper<String> saveProjectAssessDetail3(@RequestBody BusMes busMes){
|
||||
return workFlowFeignClient.saveProjectAssessDetail3(busMes);
|
||||
}
|
||||
|
||||
public Wrapper<String> saveProjectAssessDetail4(@RequestBody BusMes busMes){
|
||||
return workFlowFeignClient.saveProjectAssessDetail4(busMes);
|
||||
}
|
||||
|
||||
public Wrapper<String> saveProjectAssessDetail5(@RequestBody BusMes busMes){
|
||||
return workFlowFeignClient.saveProjectAssessDetail5(busMes);
|
||||
}
|
||||
|
||||
public Wrapper<String> saveZcfgpg(@RequestBody BusMes busMes){
|
||||
return workFlowFeignClient.saveZcfgpg(busMes);
|
||||
}
|
||||
|
||||
public Wrapper<String> saveTaskFirst(BusMes busMes){
|
||||
return workFlowFeignClient.saveTaskFirst(busMes);
|
||||
}
|
||||
|
||||
public Wrapper<String> saveTaskForPub(BusMes busMes){
|
||||
return workFlowFeignClient.saveTaskForPub(busMes);
|
||||
}
|
||||
|
||||
public BusProcessName queryTaskFirst(@RequestParam("bpnId")String bpnId){
|
||||
return workFlowFeignClient.queryTaskFirst(bpnId);
|
||||
}
|
||||
public BusProcessNew queryTaskIndex(@RequestParam("prcId") String prcId,@RequestParam("taskIds") String taskIds){
|
||||
return workFlowFeignClient.queryTaskIndex(prcId,taskIds);
|
||||
}
|
||||
|
||||
public List<BusProcessName> queryTaskDraft(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
List<BusProcessName> busProcessNames = workFlowFeignClient.queryTaskDraft(taskCommonQuery);
|
||||
return busProcessNames;
|
||||
}
|
||||
|
||||
public Wrapper<String> autoSaveFirst(@RequestBody BusMes busMes){
|
||||
return workFlowFeignClient.autoSaveFirst(busMes);
|
||||
}
|
||||
public Wrapper<String> autoSaveFirst1(@RequestBody BusMes busMes){
|
||||
return workFlowFeignClient.autoSaveFirst(busMes);
|
||||
}
|
||||
|
||||
public String isEnd(@RequestParam("pId")String pId){
|
||||
return workFlowFeignClient.isEnd(pId);
|
||||
}
|
||||
|
||||
public Wrapper<String> deleteProcessInstance(@RequestParam("pId")String pId){
|
||||
return workFlowFeignClient.deleteProcessInstance(pId);
|
||||
}
|
||||
|
||||
public Wrapper<String> deleteDraft(@RequestParam("id")String id){
|
||||
return workFlowFeignClient.deleteDraft(id);
|
||||
}
|
||||
|
||||
public Page issuedProcess(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
Page busProcessNames = workFlowFeignClient.issuedProcess(taskCommonQuery);
|
||||
return busProcessNames;
|
||||
}
|
||||
|
||||
public Page doneProcess(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
Page busProcessNames = workFlowFeignClient.doneProcess(taskCommonQuery);
|
||||
return busProcessNames;
|
||||
}
|
||||
public List<Map<String, Object>> get_list_by_instance(@RequestParam("prcNum") String prcNum, @RequestParam(value="sortWord",required = false)String sortWord, @RequestParam(value="shunxu",required = false) String shunxu){
|
||||
return workFlowFeignClient.get_list_by_instance(prcNum,sortWord,shunxu);
|
||||
}
|
||||
public List<Map<String, Object>> get_gather_by_instance(@RequestParam("prcNum") String prcNum, @RequestParam(value="sortWord",required = false)String sortWord, @RequestParam(value="shunxu",required = false) String shunxu){
|
||||
return workFlowFeignClient.get_gather_by_instance(prcNum,sortWord,shunxu);
|
||||
}
|
||||
public byte[] getImg(@RequestParam("prcNum")String prcNum){
|
||||
return workFlowFeignClient.getImg(prcNum);
|
||||
}
|
||||
|
||||
public Page allProcess(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
return workFlowFeignClient.allProcess(taskCommonQuery);
|
||||
}
|
||||
|
||||
public Wrapper<String> forceRecall(@RequestParam("prcId") String prcId){
|
||||
return workFlowFeignClient.forceRecall(prcId);
|
||||
}
|
||||
|
||||
public Wrapper<List<Category>> categoryList(){
|
||||
return workFlowFeignClient.categoryList();
|
||||
}
|
||||
|
||||
public Wrapper<String> addCategory(@RequestBody Category category){
|
||||
return workFlowFeignClient.addCategory(category);
|
||||
}
|
||||
|
||||
public Wrapper<String> deleteCategory(@RequestParam("objectId") String objectId){
|
||||
return workFlowFeignClient.deleteCategory(objectId);
|
||||
}
|
||||
|
||||
public Wrapper<String> editCategory(@RequestBody Category category){
|
||||
return workFlowFeignClient.editCategory(category);
|
||||
}
|
||||
|
||||
public Wrapper<Map<String, Object>> modelListPage(@RequestParam("name")String name, @RequestParam("category_id")String category_id,
|
||||
@RequestParam("current")int current, @RequestParam("size")int size){
|
||||
return workFlowFeignClient.modelListPage(name,category_id,current,size);
|
||||
}
|
||||
|
||||
public List<BusProcessNew> zcfgrkpgDetail(@RequestParam("pId") String pId){
|
||||
return workFlowFeignClient.zcfgrkpgDetail(pId);
|
||||
}
|
||||
|
||||
public Wrapper<String> updatModel(@RequestParam("modelId")String modelId, @RequestParam("categoryId")String categoryId){
|
||||
return workFlowFeignClient.updatModel(modelId,categoryId);
|
||||
}
|
||||
|
||||
public Wrapper<String> findPrcNumByPid(@RequestParam("pId")String pId){
|
||||
return workFlowFeignClient.findPrcNumByPid(pId);
|
||||
}
|
||||
|
||||
public Wrapper<String> findPrcNameByPrcNum(@RequestParam("prcNum")String prcNum){
|
||||
return workFlowFeignClient.findPrcNameByPrcNum(prcNum);
|
||||
}
|
||||
|
||||
public BusProcessNew inboundLiaisonDetailForXZYQ(@RequestParam("taskIds") String taskIds){
|
||||
return workFlowFeignClient.inboundLiaisonDetailForXZYQ(taskIds);
|
||||
}
|
||||
public BusProcessNew decodeDetail(@RequestParam("taskIds") String taskIds,@RequestParam("pId")String pId){
|
||||
return workFlowFeignClient.decodeDetail(taskIds,pId);
|
||||
}
|
||||
public List<BusProcessName> queryBusProcessNameForEnd(@RequestBody String prcNum){
|
||||
return workFlowFeignClient.queryBusProcessNameForEnd(prcNum);
|
||||
}
|
||||
|
||||
public String delCG(@RequestParam("id") String id){
|
||||
return workFlowFeignClient.delCG(id);
|
||||
}
|
||||
|
||||
public void setRelation(@RequestParam("esPlanId")String esPlanId,@RequestParam("prcId") String prcId, @RequestParam("finish") String finish){
|
||||
workFlowFeignClient.setRelation(esPlanId,prcId,finish);
|
||||
}
|
||||
|
||||
public String getEsByWk(@RequestParam("prcId")String prcId) {
|
||||
return workFlowFeignClient.getEsByWk(prcId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,238 @@
|
||||
package com.adc.da.Timer;
|
||||
|
||||
import com.adc.da.FeignClient.workFlowFeignClient;
|
||||
import com.adc.da.common.BusMes;
|
||||
import com.adc.da.common.BusProcessName;
|
||||
import com.adc.da.common.BusProcessNew;
|
||||
import com.adc.da.common.Wrapper;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.sys.common.EmailUtils;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.sys.service.IUserEOService;
|
||||
import com.adc.da.workFlow.controller.WorkFlowController;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 流程相关定时任务
|
||||
* @Author: yangxuenan
|
||||
* date: 2020/12/11 10:18
|
||||
*/
|
||||
@Component
|
||||
@EnableScheduling
|
||||
@Slf4j
|
||||
public class ProcessTimer {
|
||||
|
||||
@Autowired
|
||||
private workFlowFeignClient workFlowFeignClient;
|
||||
|
||||
@Autowired
|
||||
private EmailUtils mailUtil;
|
||||
|
||||
@Autowired
|
||||
private IUserEOService userEOService;
|
||||
|
||||
@Autowired
|
||||
private WorkFlowController workFlowController;
|
||||
|
||||
/**
|
||||
* 根据配置文件设置是否开启定时器
|
||||
*/
|
||||
|
||||
@Value("${isNotScheduled}")
|
||||
private boolean isNotScheduled; //是否开启定时器
|
||||
|
||||
/***
|
||||
* @Description: 自动催办,任务截至时间前3天开始每天催办
|
||||
* @Author: yangxuenan
|
||||
* @Date: 2020/12/11 10:29
|
||||
* @Param: []
|
||||
* @Return: void
|
||||
*/
|
||||
@Scheduled(cron = "0 30-30 0 * * ? ")//每天凌晨半点执行
|
||||
// @Scheduled(cron = "*/5 * * * * ?")//每5秒执行一次
|
||||
// @Scheduled(cron = "0/20 * * * * ?")
|
||||
public void urging() {
|
||||
if(isNotScheduled){
|
||||
log.info("=================================自动催办定时任务启动=====================================");
|
||||
// List<BusProcessName> busProcessNames = workFlowFeignClient.queryBusProcessNameForEnd(null);
|
||||
// if (null != busProcessNames && 0 < busProcessNames.size()) {
|
||||
// for (BusProcessName busProcessName : busProcessNames) {
|
||||
// String type = busProcessName.getPrcType();
|
||||
// Integer typeInt = 99;
|
||||
// if (StringUtils.isNotEmpty(type)) {
|
||||
// typeInt = Integer.valueOf(type);
|
||||
// }
|
||||
// type = chooseType(typeInt, type);
|
||||
//
|
||||
// UserEO userEO = userEOService.selectByPrimaryKey(busProcessName.getCreatUserName());
|
||||
// String[] array = userEO.getEmail().split(",");
|
||||
// String overTime = busProcessName.getOverTime();
|
||||
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
// Date dateTime = null;
|
||||
// Integer num = 3;
|
||||
// try {
|
||||
// dateTime = simpleDateFormat.parse(overTime);
|
||||
// Date now = new Date();
|
||||
// long daysBetween = (dateTime.getTime() - now.getTime() + 1000000) / (60 * 60 * 24 * 1000);
|
||||
// num = Integer.valueOf(String.valueOf(daysBetween));
|
||||
// } catch (ParseException e) {
|
||||
// SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'");
|
||||
// try {
|
||||
// dateTime = simpleDateFormat1.parse(overTime);
|
||||
// Date now = new Date();
|
||||
// long daysBetween = (dateTime.getTime() - now.getTime() + 1000000) / (60 * 60 * 24 * 1000);
|
||||
// num = Integer.valueOf(String.valueOf(daysBetween));
|
||||
// } catch (ParseException e1) {
|
||||
// e.getMessage();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// String msg = "您好,[" + busProcessName.getPrcNum() + "]-[" + busProcessName.getPrcName() + "] 您有待办任务未及时办理,距离截至日期还有[" + String.valueOf(num) + "]天 请及时办理,请登录全球标准法规管理系统 ( http://39.98.140.126:10005/#/login ) 办理:链接 ( http://39.98.140.126:10005/#/processCenter?tabsName=ProcessCenter ) 。\n" +
|
||||
// " ——来自 全球标准法规管理系统";
|
||||
// String title = "GSRM——【待办任务】[" + type + "] 您有未完成的待办任务";
|
||||
// mailUtil.sendMsgFeign(array, title, msg);
|
||||
// }
|
||||
// }
|
||||
log.info("=================================自动催办定时任务结束=====================================");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public String chooseType(Integer typeInt, String type) {
|
||||
switch (typeInt) {
|
||||
case 1:
|
||||
type = "法规入库及评估流程";
|
||||
break;
|
||||
case 2:
|
||||
type = "标准法规技术储备评估流程";
|
||||
break;
|
||||
case 3:
|
||||
type = "项目评估流程";
|
||||
break;
|
||||
case 4:
|
||||
type = "企标制修订流程";
|
||||
break;
|
||||
case 5:
|
||||
type = "未符合项跟踪流程";
|
||||
break;
|
||||
case 6:
|
||||
type = "企标制修订申请流程";
|
||||
break;
|
||||
case 7:
|
||||
type = "企标废止流程";
|
||||
break;
|
||||
case 8:
|
||||
type = "企标延期制修订申请流程";
|
||||
break;
|
||||
case 9:
|
||||
type = "标准采购流程";
|
||||
break;
|
||||
case 10:
|
||||
type = "工作组会前申请流程";
|
||||
break;
|
||||
case 11:
|
||||
type = "企标制修订评估流程";
|
||||
break;
|
||||
case 12:
|
||||
type = "企标勘误流程";
|
||||
break;
|
||||
case 13:
|
||||
type = "行政管理要求评估流程";
|
||||
break;
|
||||
case 14:
|
||||
type = "政策入库及评估流程";
|
||||
break;
|
||||
case 15:
|
||||
type = "标准翻译申请流程";
|
||||
break;
|
||||
case 16:
|
||||
type = "工作组会后管理流程";
|
||||
break;
|
||||
case 17:
|
||||
type = "企标备案流程";
|
||||
break;
|
||||
case 18:
|
||||
type = "标准法规清单发布/更新流程";
|
||||
break;
|
||||
case 19:
|
||||
type = "企标复审流程";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
@Scheduled(cron = "0 0 10 * * ? ")//每天十点执行
|
||||
// @Scheduled(cron = "*/20 * * * * ? ")//每天十点执行
|
||||
public void everyDayTenOlockScan() {
|
||||
if(isNotScheduled){
|
||||
log.info("=================================政策课题组会后流程定时任务启动=====================================");
|
||||
List<BusProcessNew> busProcessNews=new ArrayList<>();
|
||||
busProcessNews=workFlowFeignClient.everyDayTenOlock();
|
||||
if (!busProcessNews.isEmpty()){
|
||||
for (BusProcessNew bus:busProcessNews) {
|
||||
JSONObject jsonObject= JSON.parseObject(bus.getMesg());
|
||||
jsonObject.put("auto","1");
|
||||
ResponseMessage responseMessage = workFlowController.startProcessNew("19",jsonObject.getString("revisionId"),null);
|
||||
BusMes busMes=new BusMes();
|
||||
busMes.setTaskIds(String.valueOf(responseMessage.getData()));
|
||||
busMes.setJson(jsonObject.toJSONString());
|
||||
busMes.setUserId(jsonObject.getString("revisionId"));
|
||||
Wrapper<String> wrapper=workFlowFeignClient.completeTaskByUserId(busMes);
|
||||
log.info("政策课题组会后流程已发起");
|
||||
}
|
||||
}
|
||||
log.info("=================================政策课题组会后流程定时任务启动=====================================");
|
||||
}
|
||||
}
|
||||
|
||||
@Scheduled(cron = "0 0 10 * * ? ")//每天十点执行
|
||||
// @Scheduled(cron = "0 0 0/1 * * ? ")//每天十点执行
|
||||
// @Scheduled(cron = "*/40 * * * * ? ")//20s
|
||||
public void everyDayTenOlockScanSAM() {
|
||||
if(isNotScheduled){
|
||||
log.info("=================================标准化活动参会流程定时任务启动=====================================");
|
||||
List<BusProcessNew> busProcessNews=new ArrayList<>();
|
||||
busProcessNews=workFlowFeignClient.everyDayTenOlockSAM();
|
||||
if (!busProcessNews.isEmpty()){
|
||||
for (BusProcessNew bus:busProcessNews) {
|
||||
JSONObject jsonObject= JSON.parseObject(bus.getMesg());
|
||||
String taskInfo = bus.getTaskInfo();
|
||||
String result = jsonObject.getJSONObject("roleList").getString("dockUser");
|
||||
result = result.split(",")[0];
|
||||
jsonObject.put("member",result);
|
||||
if(taskInfo.equals("标准化活动参会流程-流程结束")){
|
||||
jsonObject.put("auto","1");
|
||||
ResponseMessage responseMessage = workFlowController.startProcessNew("22",result,null);
|
||||
BusMes busMes=new BusMes();
|
||||
busMes.setTaskIds(String.valueOf(responseMessage.getData()));
|
||||
busMes.setJson(jsonObject.toJSONString());
|
||||
busMes.setUserId(result);
|
||||
|
||||
Wrapper<String> wrapper=workFlowFeignClient.completeTaskByUserId(busMes);
|
||||
System.out.println("标准化活动会后流程自动发起");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
log.info("=================================标准化活动参会流程定时任务启动=====================================");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
/**
|
||||
* @Description: TODO
|
||||
* @author: super_liu
|
||||
* @date: 2021年06月09日 17:18
|
||||
*/
|
||||
public class ActDefineStartMap {
|
||||
|
||||
// map 添加 新的流程实例
|
||||
public static String actDefineStartMap(String type){
|
||||
|
||||
Map<String,String> map = new TreeMap<>();
|
||||
map.put("1","standardLibraryWkflow");
|
||||
map.put("2","standardSurveyWorkFlow");
|
||||
map.put("3","StandAskForOpinion");
|
||||
map.put("4","standardregulatoryinventory");
|
||||
map.put("5","projectEvaluationNewProcess");
|
||||
map.put("6","xmhgpgXM");
|
||||
|
||||
|
||||
map.put("8","nonConformanceRectificationKey");
|
||||
map.put("9","standardReadWkflow");
|
||||
map.put("10","itemlistvalidationprocessKey");
|
||||
|
||||
// 政策入库
|
||||
map.put("laws1","lawsLibraryWkflow");
|
||||
//政策征求意见, 认证重点法规/政策 流程
|
||||
map.put("laws2","PolicyCommentProcessWorkFlow");
|
||||
map.put("laws3","KCSTPReviewProcessWorkFlow");
|
||||
|
||||
// 企标制修订流程及企业标准库流程
|
||||
map.put("buss1","bussLibraryWkflow");
|
||||
// 企标制修订-产品标准
|
||||
map.put("buss2","bussLibraryProductWkflow");
|
||||
|
||||
map.put("buss3","bussFsWkflow");
|
||||
|
||||
//张超然
|
||||
map.put("20","StandardApplyMeetProcess");
|
||||
map.put("21","StandardMeetProcess");
|
||||
map.put("22","StandardAfterMeetProcess");
|
||||
|
||||
//李奥
|
||||
map.put("14","ParticipateRevisionFiling");
|
||||
map.put("15","JoinStandardFiling");
|
||||
map.put("16","RecommendedApprovalleo");
|
||||
//孔维一
|
||||
map.put("17","policyResearchGroupEnrollment");
|
||||
map.put("18","policyResearchGroupAttendMeeting");
|
||||
map.put("19","policyResearchGroupAfterMeeting");
|
||||
|
||||
//企标复审流程
|
||||
map.put("23","enterpriseBidReviewProcess");
|
||||
map.put("24","Aboliish");
|
||||
map.put("25","enterpriseStandardSystemRevisionPlan");
|
||||
|
||||
map.put("26","qbzxdlxjh");
|
||||
|
||||
return map.get(type);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
public class BusMes {
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(value = "任务id")
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty(value = "json")
|
||||
private String json;
|
||||
|
||||
@ApiModelProperty(value = "任务ids")
|
||||
private String taskIds;
|
||||
|
||||
private String pId;
|
||||
|
||||
private String prcType;
|
||||
|
||||
private String createUser;
|
||||
|
||||
private String createUserName;
|
||||
|
||||
private String userName;
|
||||
|
||||
private int size;
|
||||
|
||||
private int current;
|
||||
|
||||
private String id;
|
||||
|
||||
private String nowStateType;
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getTaskId() {
|
||||
return taskId;
|
||||
}
|
||||
|
||||
public void setTaskId(String taskId) {
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public String getJson() {
|
||||
return json;
|
||||
}
|
||||
|
||||
public void setJson(String json) {
|
||||
this.json = json;
|
||||
}
|
||||
|
||||
public String getTaskIds() {
|
||||
return taskIds;
|
||||
}
|
||||
|
||||
public void setTaskIds(String taskIds) {
|
||||
this.taskIds = taskIds;
|
||||
}
|
||||
|
||||
public String getpId() {
|
||||
return pId;
|
||||
}
|
||||
|
||||
public void setpId(String pId) {
|
||||
this.pId = pId;
|
||||
}
|
||||
|
||||
|
||||
public String getCreateUser() {
|
||||
return createUser;
|
||||
}
|
||||
|
||||
public void setCreateUser(String createUser) {
|
||||
this.createUser = createUser;
|
||||
}
|
||||
|
||||
public String getPrcType() {
|
||||
return prcType;
|
||||
}
|
||||
|
||||
public void setPrcType(String prcType) {
|
||||
this.prcType = prcType;
|
||||
}
|
||||
|
||||
public String getCreateUserName() {
|
||||
return createUserName;
|
||||
}
|
||||
|
||||
public void setCreateUserName(String createUserName) {
|
||||
this.createUserName = createUserName;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public int getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setSize(int size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
public int getCurrent() {
|
||||
return current;
|
||||
}
|
||||
|
||||
public void setCurrent(int current) {
|
||||
this.current = current;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getNowStateType() { return nowStateType; }
|
||||
|
||||
public void setNowStateType(String nowStateType) { this.nowStateType = nowStateType; }
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BusMesSpecial {
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(value = "任务id")
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty(value = "json")
|
||||
private String json;
|
||||
|
||||
@ApiModelProperty(value = "json")
|
||||
private String specialJson;
|
||||
|
||||
@ApiModelProperty(value = "任务ids")
|
||||
private String taskIds;
|
||||
|
||||
private String pId;
|
||||
|
||||
private String prcType;
|
||||
|
||||
private String createUser;
|
||||
|
||||
private String createUserName;
|
||||
|
||||
private String userName;
|
||||
|
||||
private int size;
|
||||
|
||||
private int current;
|
||||
|
||||
private String id;
|
||||
|
||||
private String nowStateType;
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getTaskId() {
|
||||
return taskId;
|
||||
}
|
||||
|
||||
public void setTaskId(String taskId) {
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public String getJson() {
|
||||
return json;
|
||||
}
|
||||
|
||||
public void setJson(String json) {
|
||||
this.json = json;
|
||||
}
|
||||
|
||||
public String getTaskIds() {
|
||||
return taskIds;
|
||||
}
|
||||
|
||||
public void setTaskIds(String taskIds) {
|
||||
this.taskIds = taskIds;
|
||||
}
|
||||
|
||||
public String getpId() {
|
||||
return pId;
|
||||
}
|
||||
|
||||
public void setpId(String pId) {
|
||||
this.pId = pId;
|
||||
}
|
||||
|
||||
|
||||
public String getCreateUser() {
|
||||
return createUser;
|
||||
}
|
||||
|
||||
public void setCreateUser(String createUser) {
|
||||
this.createUser = createUser;
|
||||
}
|
||||
|
||||
public String getPrcType() {
|
||||
return prcType;
|
||||
}
|
||||
|
||||
public void setPrcType(String prcType) {
|
||||
this.prcType = prcType;
|
||||
}
|
||||
|
||||
public String getCreateUserName() {
|
||||
return createUserName;
|
||||
}
|
||||
|
||||
public void setCreateUserName(String createUserName) {
|
||||
this.createUserName = createUserName;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public int getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setSize(int size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
public int getCurrent() {
|
||||
return current;
|
||||
}
|
||||
|
||||
public void setCurrent(int current) {
|
||||
this.current = current;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getNowStateType() { return nowStateType; }
|
||||
|
||||
public void setNowStateType(String nowStateType) { this.nowStateType = nowStateType; }
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 冯晓东
|
||||
* @since 2020-11-11
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="BusProcessName对象", description="")
|
||||
public class BusProcessName implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String id;
|
||||
|
||||
private String prcName;
|
||||
|
||||
private String prcId;
|
||||
|
||||
private String prcMes;
|
||||
|
||||
private String overTime;
|
||||
|
||||
private String prcNum;
|
||||
|
||||
private String creatTime;
|
||||
|
||||
private String creatUser;
|
||||
|
||||
private String prcType;
|
||||
|
||||
private String taskIds;
|
||||
|
||||
private String taskInfo;
|
||||
|
||||
private String creatUserName;
|
||||
|
||||
private String mes;
|
||||
|
||||
private String endTime;
|
||||
|
||||
private String taskAssignee;
|
||||
|
||||
private String isEnd;
|
||||
|
||||
private String taskBackAssignee;
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 冯晓东
|
||||
* @since 2020-11-10
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="BusProcessNew对象", description="")
|
||||
public class BusProcessNew {
|
||||
|
||||
|
||||
private String id;
|
||||
|
||||
private String msgType;
|
||||
|
||||
private String standId;
|
||||
|
||||
private String clauseId;
|
||||
|
||||
private String userId;
|
||||
|
||||
private String username;
|
||||
|
||||
private String mesg;
|
||||
|
||||
private String taskInfo;
|
||||
|
||||
private String parentId;
|
||||
|
||||
private String taskId;
|
||||
|
||||
private String pId;
|
||||
|
||||
private String finishFlag;
|
||||
|
||||
@ApiModelProperty(value = "审批意见")
|
||||
@TableField("COMMIT_FLAG")
|
||||
private String commitFlag;
|
||||
|
||||
@ApiModelProperty(value = "审批意见")
|
||||
@TableField("COMMIT_TEXT")
|
||||
private String commitText;
|
||||
|
||||
@ApiModelProperty(value = "子流程ID")
|
||||
@TableField("SUB_ID")
|
||||
private String subId;
|
||||
|
||||
@ApiModelProperty(value = "流程名称")
|
||||
@TableField("PRC_NAME")
|
||||
private String prcName;
|
||||
|
||||
@TableField("CREATE_TIME")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@TableField("UPDATE_TIME")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@TableField( exist = false)
|
||||
@ApiModelProperty(value = "OA link")
|
||||
private String link;
|
||||
|
||||
@TableField( exist = false)
|
||||
@ApiModelProperty(value = "干活任务截止时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private String endTime;
|
||||
|
||||
@TableField( exist = false)
|
||||
@ApiModelProperty(value = "任务状态 0 默认 1 审批任务 2 干活任务")
|
||||
private int taskStatus;
|
||||
|
||||
private long commitStatus;
|
||||
|
||||
@TableField( exist = false)
|
||||
@ApiModelProperty(value = "当前节点信息")
|
||||
private String nowTaskInfo;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
public enum BussEnum {
|
||||
|
||||
BUSS_XD("tz4lqchzuy","修订","1"),
|
||||
BUSS_FZ("3lqnlgmgcn","作废","2"),
|
||||
BUSS_YX("9z741h2m3j","有效","3");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
private String state;
|
||||
|
||||
private BussEnum(String value, String lable,String state) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
this.state = state;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class Category {
|
||||
|
||||
private String objectId;
|
||||
|
||||
private int isDeleted;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private String code;
|
||||
|
||||
private String type;
|
||||
|
||||
public String getObjectId() {
|
||||
return objectId;
|
||||
}
|
||||
|
||||
public void setObjectId(String objectId) {
|
||||
this.objectId = objectId;
|
||||
}
|
||||
|
||||
public int getIsDeleted() {
|
||||
return isDeleted;
|
||||
}
|
||||
|
||||
public void setIsDeleted(int isDeleted) {
|
||||
this.isDeleted = isDeleted;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,283 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.apache.poi.hssf.usermodel.*;
|
||||
import org.apache.poi.hssf.util.HSSFColor;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.Element;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: yangxuenan
|
||||
* date: 2020/2/26 10:10
|
||||
*/
|
||||
public class ConvertHtml2Excel {
|
||||
/**
|
||||
* html表格转excel
|
||||
*/
|
||||
public static HSSFWorkbook table2Excel(String tableHtml, HSSFWorkbook wb, String sheetName) throws Exception {
|
||||
// HSSFWorkbook wb = new HSSFWorkbook();
|
||||
HSSFSheet sheet = wb.createSheet(sheetName);
|
||||
List<Integer> moneyCols =new ArrayList<>();
|
||||
moneyCols.add(1);
|
||||
int headEndRow = 1;
|
||||
List<CrossRangeCellMeta> crossRowEleMetaLs = new ArrayList<CrossRangeCellMeta>();
|
||||
int rowIndex = 0;
|
||||
try {
|
||||
Document data = DocumentHelper.parseText(tableHtml);
|
||||
HSSFCellStyle contentStyle = getContentStyle(wb);
|
||||
// 生成表头
|
||||
Element thead = data.getRootElement().element("thead");
|
||||
HSSFCellStyle titleStyle = getTitleStyle(wb);
|
||||
int ls = 0;//列数
|
||||
if (thead != null) {
|
||||
List<Element> trLs = thead.elements("tr");
|
||||
for (Element trEle : trLs) {
|
||||
HSSFCellStyle style = rowIndex<=headEndRow?titleStyle:contentStyle;
|
||||
style.setWrapText(true);
|
||||
HSSFRow row = sheet.createRow(rowIndex);
|
||||
List<Element> thLs = trEle.elements("th");
|
||||
if(ls<thLs.size())
|
||||
ls = thLs.size();
|
||||
int cellIndex = makeRowCell(thLs, rowIndex, row, 0, style, crossRowEleMetaLs, true,moneyCols);
|
||||
List<Element> tdLs = trEle.elements("td");
|
||||
if(ls<ls+tdLs.size())
|
||||
ls = ls + tdLs.size();
|
||||
makeRowCell(tdLs, rowIndex, row, cellIndex, style, crossRowEleMetaLs, true,moneyCols);
|
||||
rowIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
// 生成表体
|
||||
Element tbody = data.getRootElement().element("tbody");
|
||||
if (tbody != null) {
|
||||
List<Element> trBody = tbody.elements("tr");
|
||||
for (Element trEle : trBody) {
|
||||
HSSFCellStyle style = rowIndex<=headEndRow?titleStyle:contentStyle;
|
||||
style.setWrapText(true);
|
||||
HSSFRow row = sheet.createRow(rowIndex);
|
||||
List<Element> thLs = trEle.elements("th");
|
||||
if(ls<thLs.size())
|
||||
ls = thLs.size();
|
||||
int cellIndex = makeRowCell(thLs, rowIndex, row, 0, style, crossRowEleMetaLs, false,moneyCols);
|
||||
List<Element> tdLs = trEle.elements("td");
|
||||
if(ls<ls+tdLs.size())
|
||||
ls = ls + tdLs.size();
|
||||
makeRowCell(tdLs, rowIndex, row, cellIndex, style, crossRowEleMetaLs, false,moneyCols);
|
||||
rowIndex++;
|
||||
}
|
||||
}
|
||||
// 生成表体
|
||||
Element tfoot = data.getRootElement().element("tfoot");
|
||||
if (tfoot != null) {
|
||||
List<Element> trFoot = tfoot.elements("tr");
|
||||
for (Element trEle : trFoot) {
|
||||
HSSFCellStyle style = rowIndex<=headEndRow?titleStyle:contentStyle;
|
||||
style.setWrapText(true);
|
||||
HSSFRow row = sheet.createRow(rowIndex);
|
||||
List<Element> thLs = trEle.elements("th");
|
||||
if(ls<thLs.size())
|
||||
ls = thLs.size();
|
||||
int cellIndex = makeRowCell(thLs, rowIndex, row, 0, style, crossRowEleMetaLs, false,moneyCols);
|
||||
List<Element> tdLs = trEle.elements("td");
|
||||
if(ls<ls+tdLs.size())
|
||||
ls = ls + tdLs.size();
|
||||
makeRowCell(tdLs, rowIndex, row, cellIndex, style, crossRowEleMetaLs, false,moneyCols);
|
||||
rowIndex++;
|
||||
}
|
||||
}
|
||||
// 合并表头
|
||||
for (CrossRangeCellMeta crcm : crossRowEleMetaLs) {
|
||||
sheet.addMergedRegion(new CellRangeAddress(crcm.getFirstRow(), crcm.getLastRow(), crcm.getFirstCol(), crcm.getLastCol()));
|
||||
HSSFCellStyle mergeStyle;
|
||||
if (crcm.isInHead()) {
|
||||
mergeStyle = titleStyle;
|
||||
} else {
|
||||
mergeStyle = contentStyle;
|
||||
}
|
||||
mergeStyle.setWrapText(true);
|
||||
setRegionStyle(sheet, new CellRangeAddress(crcm.getFirstRow(), crcm.getLastRow(), crcm.getFirstCol(), crcm.getLastCol()), mergeStyle);
|
||||
}
|
||||
for (int i = 0; i < ls; i++) {
|
||||
sheet.autoSizeColumn(i, true);//设置列宽
|
||||
sheet.setColumnWidth(i,30*256);
|
||||
// sheet.setColumnWidth(i,sheet.getColumnWidth(i)*15/10);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return wb;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生产行内容
|
||||
*
|
||||
* @return 最后一列的cell index
|
||||
*/
|
||||
/**
|
||||
* @param tdLs th或者td集合
|
||||
* @param rowIndex 行号
|
||||
* @param row POI行对象
|
||||
* @param startCellIndex
|
||||
* @param cellStyle 样式
|
||||
* @param crossRowEleMetaLs 跨行元数据集合
|
||||
* @return
|
||||
*/
|
||||
private static int makeRowCell(List<Element> tdLs, int rowIndex, HSSFRow row, int startCellIndex, HSSFCellStyle cellStyle,
|
||||
List<CrossRangeCellMeta> crossRowEleMetaLs, boolean inHead, List<Integer> moneyCols) {
|
||||
int i = startCellIndex;
|
||||
for (int eleIndex = 0; eleIndex < tdLs.size(); i++, eleIndex++) {
|
||||
int captureCellSize = getCaptureCellSize(rowIndex, i, crossRowEleMetaLs);
|
||||
while (captureCellSize > 0) {
|
||||
for (int j = 0; j < captureCellSize; j++) {// 当前行跨列处理(补单元格)
|
||||
row.createCell(i);
|
||||
i++;
|
||||
}
|
||||
captureCellSize = getCaptureCellSize(rowIndex, i, crossRowEleMetaLs);
|
||||
}
|
||||
Element thEle = tdLs.get(eleIndex);
|
||||
String val = thEle.getText();
|
||||
if (StringUtils.isEmpty(val)) {
|
||||
Element e = thEle.element("a");
|
||||
if (e != null) {
|
||||
val = e.getText();
|
||||
}
|
||||
}
|
||||
HSSFCell c = row.createCell(i);
|
||||
if (NumberUtils.isNumber(val)) {
|
||||
if (moneyCols != null && moneyCols.contains(i)) {
|
||||
c.setCellType(CellType.STRING);
|
||||
c.setCellValue(val);
|
||||
} else {
|
||||
c.setCellValue(Double.parseDouble(val));
|
||||
c.setCellType(CellType.STRING);
|
||||
}
|
||||
|
||||
} else {
|
||||
c.setCellType(CellType.STRING);
|
||||
c.setCellValue(new HSSFRichTextString(val));
|
||||
}
|
||||
int rowSpan = NumberUtils.toInt(thEle.attributeValue("rowspan"), 1);
|
||||
int colSpan = NumberUtils.toInt(thEle.attributeValue("colspan"), 1);
|
||||
c.setCellStyle(cellStyle);
|
||||
if (rowSpan > 1 || colSpan > 1) { // 存在跨行或跨列
|
||||
crossRowEleMetaLs.add(new CrossRangeCellMeta(rowIndex, i, rowSpan, colSpan, inHead));
|
||||
}
|
||||
if (colSpan > 1) {// 当前行跨列处理(补单元格)
|
||||
for (int j = 1; j < colSpan; j++) {
|
||||
i++;
|
||||
row.createCell(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置合并单元格的边框样式
|
||||
*
|
||||
* @param sheet
|
||||
* @param region
|
||||
* @param cs
|
||||
*/
|
||||
public static void setRegionStyle(HSSFSheet sheet, CellRangeAddress region, HSSFCellStyle cs) {
|
||||
for (int i = region.getFirstRow(); i <= region.getLastRow(); i++) {
|
||||
HSSFRow row = sheet.getRow(i);
|
||||
for (int j = region.getFirstColumn(); j <= region.getLastColumn(); j++) {
|
||||
HSSFCell cell = row.getCell(j);
|
||||
cell.setCellStyle(cs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得因rowSpan占据的单元格
|
||||
*
|
||||
* @param rowIndex 行号
|
||||
* @param colIndex 列号
|
||||
* @param crossRowEleMetaLs 跨行列元数据
|
||||
* @return 当前行在某列需要占据单元格
|
||||
*/
|
||||
private static int getCaptureCellSize(int rowIndex, int colIndex, List<CrossRangeCellMeta> crossRowEleMetaLs) {
|
||||
int captureCellSize = 0;
|
||||
for (CrossRangeCellMeta crossRangeCellMeta : crossRowEleMetaLs) {
|
||||
if (crossRangeCellMeta.getFirstRow() < rowIndex && crossRangeCellMeta.getLastRow() >= rowIndex) {
|
||||
if (crossRangeCellMeta.getFirstCol() <= colIndex && crossRangeCellMeta.getLastCol() >= colIndex) {
|
||||
captureCellSize = crossRangeCellMeta.getLastCol() - colIndex + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return captureCellSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得标题样式
|
||||
*
|
||||
* @param workbook
|
||||
* @return
|
||||
*/
|
||||
private static HSSFCellStyle getTitleStyle(HSSFWorkbook workbook) {
|
||||
short titlebackgroundcolor = HSSFColor.HSSFColorPredefined.WHITE.getIndex();
|
||||
short fontSize = 11;
|
||||
String fontName = "宋体";
|
||||
HSSFCellStyle style = workbook.createCellStyle();
|
||||
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
style.setAlignment(HorizontalAlignment.CENTER);
|
||||
style.setBorderBottom(BorderStyle.THIN); //下边框
|
||||
style.setBorderLeft(BorderStyle.THIN);//左边框
|
||||
style.setBorderTop(BorderStyle.THIN);//上边框
|
||||
style.setBorderRight(BorderStyle.THIN);//右边框
|
||||
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
||||
style.setFillForegroundColor(titlebackgroundcolor);// 背景色
|
||||
style.setWrapText(true);
|
||||
HSSFFont font = workbook.createFont();
|
||||
// font.setFontName(fontName);
|
||||
font.setFontHeightInPoints(fontSize);
|
||||
// font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
|
||||
style.setFont(font);
|
||||
return style;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得内容样式
|
||||
*
|
||||
* @param wb
|
||||
* @return
|
||||
*/
|
||||
private static HSSFCellStyle getContentStyle(HSSFWorkbook wb) {
|
||||
short fontSize = 11;
|
||||
// String fontName = "宋体";
|
||||
HSSFCellStyle style = wb.createCellStyle();
|
||||
style.setBorderBottom(BorderStyle.THIN);
|
||||
style.setBorderTop(BorderStyle.THIN);
|
||||
style.setBorderLeft(BorderStyle.THIN);
|
||||
style.setBorderRight(BorderStyle.THIN);
|
||||
HSSFFont font = wb.createFont();
|
||||
// font.setFontName(fontName);
|
||||
font.setFontHeightInPoints(fontSize);
|
||||
style.setFont(font);
|
||||
style.setAlignment(HorizontalAlignment.CENTER);//水平居中
|
||||
style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
|
||||
style.setWrapText(true);
|
||||
return style;
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
String cnt = "\n";
|
||||
List<Integer> c =new ArrayList<>();
|
||||
c.add(1);
|
||||
String tableHtml = "<table><tbody><tr><td colspan='2'>11111111</td><td rowspan='3'>3333333333</td><td>444444444</td></tr><tr><td>5555555</td><td>66666</td><td></td></tr><tr><td></td><td>324234</td><td></td></tr></tbody></table>";
|
||||
tableHtml = tableHtml.replaceAll("<[\\s]*?br[^>]*?>|<[\\s]*?\\/[\\s]*?br[\\s]*?>", cnt);
|
||||
// HSSFWorkbook hssfWorkbook = ConvertHtml2Excel.table2Excel(tableHtml,c,1);
|
||||
// hssfWorkbook.write(FileUtils.openOutputStream(new File("D:\\test\\test1.xls")));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <b>功能:</b>OT_CONVERT_MQ OtConvertMqEOEntity<br>
|
||||
* <b>作者:</b>code generator<br>
|
||||
* <b>日期:</b> 2018-09-25 <br>
|
||||
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
|
||||
*/
|
||||
public class ConvertMqEO extends BaseEntity {
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date modifyTime;
|
||||
@org.springframework.format.annotation.DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date creationTime;
|
||||
private Integer validFlag;
|
||||
private String attId;
|
||||
private String filePath;
|
||||
private String fileOriginPath;
|
||||
private String userId;
|
||||
private Integer mqState;
|
||||
private String mqCode;
|
||||
private String id;
|
||||
private String addOrUp;
|
||||
|
||||
//向文件表添加信息
|
||||
private String lawsId;
|
||||
private String resId;
|
||||
private String convertType;
|
||||
private String pdfPath;
|
||||
private String pdfId;
|
||||
private String fileSuffix;
|
||||
private String standFileClassify;
|
||||
private String oriAttId;
|
||||
|
||||
private int againNum;
|
||||
/** **/
|
||||
public Integer getValidFlag() {
|
||||
return this.validFlag;
|
||||
}
|
||||
|
||||
/** **/
|
||||
public void setValidFlag(Integer validFlag) {
|
||||
this.validFlag = validFlag;
|
||||
}
|
||||
|
||||
/** **/
|
||||
public String getAttId() {
|
||||
return this.attId;
|
||||
}
|
||||
|
||||
/** **/
|
||||
public void setAttId(String attId) {
|
||||
this.attId = attId;
|
||||
}
|
||||
|
||||
/** **/
|
||||
public String getFilePath() {
|
||||
return this.filePath;
|
||||
}
|
||||
|
||||
/** **/
|
||||
public void setFilePath(String filePath) {
|
||||
this.filePath = filePath;
|
||||
}
|
||||
|
||||
/** **/
|
||||
public String getUserId() {
|
||||
return this.userId;
|
||||
}
|
||||
|
||||
/** **/
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
/** **/
|
||||
public Integer getMqState() {
|
||||
return this.mqState;
|
||||
}
|
||||
|
||||
/** **/
|
||||
public void setMqState(Integer mqState) {
|
||||
this.mqState = mqState;
|
||||
}
|
||||
|
||||
/** **/
|
||||
public String getMqCode() {
|
||||
return this.mqCode;
|
||||
}
|
||||
|
||||
/** **/
|
||||
public void setMqCode(String mqCode) {
|
||||
this.mqCode = mqCode;
|
||||
}
|
||||
|
||||
/** **/
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/** **/
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getFileOriginPath() {
|
||||
return fileOriginPath;
|
||||
}
|
||||
|
||||
public void setFileOriginPath(String fileOriginPath) {
|
||||
this.fileOriginPath = fileOriginPath;
|
||||
}
|
||||
|
||||
public String getLawsId() {
|
||||
return lawsId;
|
||||
}
|
||||
|
||||
public void setLawsId(String lawsId) {
|
||||
this.lawsId = lawsId;
|
||||
}
|
||||
|
||||
public String getResId() {
|
||||
return resId;
|
||||
}
|
||||
|
||||
public void setResId(String resId) {
|
||||
this.resId = resId;
|
||||
}
|
||||
|
||||
public String getConvertType() {
|
||||
return convertType;
|
||||
}
|
||||
|
||||
public void setConvertType(String convertType) {
|
||||
this.convertType = convertType;
|
||||
}
|
||||
|
||||
public String getPdfPath() {
|
||||
return pdfPath;
|
||||
}
|
||||
|
||||
public void setPdfPath(String pdfPath) {
|
||||
this.pdfPath = pdfPath;
|
||||
}
|
||||
|
||||
public String getAddOrUp() {
|
||||
return addOrUp;
|
||||
}
|
||||
|
||||
public void setAddOrUp(String addOrUp) {
|
||||
this.addOrUp = addOrUp;
|
||||
}
|
||||
|
||||
public String getPdfId() {
|
||||
return pdfId;
|
||||
}
|
||||
|
||||
public void setPdfId(String pdfId) {
|
||||
this.pdfId = pdfId;
|
||||
}
|
||||
|
||||
public Date getModifyTime() {
|
||||
return modifyTime;
|
||||
}
|
||||
|
||||
public void setModifyTime(Date modifyTime) {
|
||||
this.modifyTime = modifyTime;
|
||||
}
|
||||
|
||||
public Date getCreationTime() {
|
||||
return creationTime;
|
||||
}
|
||||
|
||||
public void setCreationTime(Date creationTime) {
|
||||
this.creationTime = creationTime;
|
||||
}
|
||||
|
||||
public String getFileSuffix() {
|
||||
return fileSuffix;
|
||||
}
|
||||
|
||||
public void setFileSuffix(String fileSuffix) {
|
||||
this.fileSuffix = fileSuffix;
|
||||
}
|
||||
|
||||
public String getStandFileClassify() {
|
||||
return standFileClassify;
|
||||
}
|
||||
|
||||
public void setStandFileClassify(String standFileClassify) {
|
||||
this.standFileClassify = standFileClassify;
|
||||
}
|
||||
|
||||
public String getOriAttId() {
|
||||
return oriAttId;
|
||||
}
|
||||
|
||||
public void setOriAttId(String oriAttId) {
|
||||
this.oriAttId = oriAttId;
|
||||
}
|
||||
|
||||
public int getAgainNum() {
|
||||
return againNum;
|
||||
}
|
||||
|
||||
public void setAgainNum(int againNum) {
|
||||
this.againNum = againNum;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description: table转excel 跨行元素元数据
|
||||
* @Author: yangxuenan
|
||||
* date: 2020/2/26 10:14
|
||||
*/
|
||||
public class CrossRangeCellMeta {
|
||||
|
||||
public CrossRangeCellMeta(int firstRowIndex, int firstColIndex, int rowSpan, int colSpan, boolean inHead) {
|
||||
super();
|
||||
this.firstRowIndex = firstRowIndex;
|
||||
this.firstColIndex = firstColIndex;
|
||||
this.rowSpan = rowSpan;
|
||||
this.colSpan = colSpan;
|
||||
this.inHead = inHead;
|
||||
}
|
||||
|
||||
private int firstRowIndex;
|
||||
private int firstColIndex;
|
||||
private int rowSpan;// 跨越行数
|
||||
private int colSpan;// 跨越列数
|
||||
private boolean inHead;
|
||||
|
||||
public boolean isInHead() {
|
||||
return inHead;
|
||||
}
|
||||
|
||||
public CrossRangeCellMeta setInHead(boolean inHead) {
|
||||
this.inHead = inHead;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getFirstRow() {
|
||||
return firstRowIndex;
|
||||
}
|
||||
|
||||
public int getLastRow() {
|
||||
return firstRowIndex + rowSpan - 1;
|
||||
}
|
||||
|
||||
public int getFirstCol() {
|
||||
return firstColIndex;
|
||||
}
|
||||
|
||||
public int getLastCol() {
|
||||
return firstColIndex + colSpan - 1;
|
||||
}
|
||||
|
||||
public int getColSpan() {
|
||||
return colSpan;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
public class ExcelToTable {
|
||||
/**
|
||||
* 将excel转换成表格 table
|
||||
* @return table 的字符串
|
||||
*/
|
||||
public String toTable(Sheet sheet) {
|
||||
StringBuilder table = new StringBuilder();
|
||||
table.append("<table cellspacing='0' border='1'>");
|
||||
if (sheet != null) {
|
||||
Iterator<Row> rowIterator = sheet.rowIterator();
|
||||
|
||||
while (rowIterator.hasNext()) {
|
||||
table.append("<tr");
|
||||
Row row = rowIterator.next();
|
||||
|
||||
table.append(">");
|
||||
Iterator<Cell> cellIterator = row.cellIterator();
|
||||
// 遇到合并列时进行计数
|
||||
int colCount = 0;
|
||||
while (cellIterator.hasNext()) {
|
||||
Cell cell = cellIterator.next();
|
||||
|
||||
// 判断是否为合并单元格
|
||||
Map<String, Integer> map = getMergedRegionInfo(sheet, cell);
|
||||
|
||||
// 如果有合并列
|
||||
// 如果这一列有colspan属性(是一个合并列),并且是第一次被获取到,
|
||||
// 那么进行计数器的增加,防止第二次获取到同一个合并单元格时,进行单元格的重复添加
|
||||
if (map.get("colspan") != null) {
|
||||
if (colCount++ == 0) {
|
||||
table.append("<td ");
|
||||
table.append("colspan=" + map.get("colspan"));
|
||||
table.append(">");
|
||||
table.append(cell.getStringCellValue());
|
||||
table.append("</td>");
|
||||
}
|
||||
} else if (map.get("rowspan") != null) {// 如果有合并行
|
||||
// 如果这一列的当前行就是这个合并单元格的第一行,那么我们创建这个单元格,并合并对应的行数
|
||||
int rowIndex = cell.getRowIndex();
|
||||
if (rowIndex++ == map.get("firstR")) {
|
||||
table.append("<td ");
|
||||
table.append("rowspan=" + map.get("rowspan"));
|
||||
table.append(">");
|
||||
table.append(cell.getStringCellValue());
|
||||
table.append("</td>");
|
||||
}
|
||||
} else {
|
||||
// 如果没有合并列
|
||||
table.append("<td>");
|
||||
table.append(cell.getStringCellValue());
|
||||
table.append("</td>");
|
||||
}
|
||||
}
|
||||
table.append("</tr>");
|
||||
}
|
||||
table.append("</table>");
|
||||
|
||||
return table.toString();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 读取合并的单元格信息
|
||||
* @param sheet
|
||||
* @param cell
|
||||
* @return
|
||||
*/
|
||||
private Map<String, Integer> getMergedRegionInfo(Sheet sheet, Cell cell) {
|
||||
int firstC;
|
||||
int lastC;
|
||||
int firstR;
|
||||
int lastR;
|
||||
Map<String, Integer> map = new HashMap<>();
|
||||
for (int cellNum = 0; cellNum < sheet.getNumMergedRegions(); cellNum++) {
|
||||
CellRangeAddress mergedRegion = sheet.getMergedRegion(cellNum);
|
||||
firstC = mergedRegion.getFirstColumn();
|
||||
lastC = mergedRegion.getLastColumn();
|
||||
firstR = mergedRegion.getFirstRow();
|
||||
lastR = mergedRegion.getLastRow();
|
||||
|
||||
// 如果这个单元格在这个 合并区域的范围内,那么它就是这个单元格
|
||||
if (cell.getRowIndex() >= firstR && cell.getRowIndex() <= lastR) {
|
||||
if (cell.getColumnIndex() >= firstC && cell.getColumnIndex() <= lastC) {
|
||||
// 合并的合数和列数,以及合并单元格的第一行索引
|
||||
int rowspan = lastR-firstR;
|
||||
int colspan = lastC-firstC;
|
||||
if (rowspan > 0)
|
||||
map.put("rowspan", rowspan+1);
|
||||
map.put("firstR", firstR);
|
||||
if (colspan > 0)
|
||||
map.put("colspan", colspan+1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
|
||||
public class ExportPlanStyle {
|
||||
|
||||
public static String[] getTableHeaders() {
|
||||
String[] header = new String[14];
|
||||
header[0] = "截止日期提交/发布情况";
|
||||
header[1] = "动力";
|
||||
header[2] = "整车";
|
||||
header[3] = "新能源";
|
||||
header[4] = "底盘";
|
||||
header[5] = "工艺";
|
||||
header[6] = "网联";
|
||||
header[7] = "车身";
|
||||
header[8] = "试验";
|
||||
header[9] = "NVH";
|
||||
header[10] = "碰撞";
|
||||
header[11] = "质量";
|
||||
header[12] = "造型";
|
||||
header[13] = "合计";
|
||||
return header;
|
||||
}
|
||||
public static void setTableHeader(Sheet sheet, String[] headers){
|
||||
//设置列宽
|
||||
int minBytes = 17;//至少字节数
|
||||
Row headerRow = sheet.createRow(1); //列头
|
||||
//设置表头
|
||||
for(int i=0;i<headers.length;i++){
|
||||
String fieldName = headers[i];
|
||||
int bytes = fieldName.getBytes().length;
|
||||
bytes = bytes < minBytes ? minBytes : bytes;
|
||||
sheet.setColumnWidth(i, bytes*128);
|
||||
headerRow.createCell(i).setCellValue(fieldName);
|
||||
}
|
||||
sheet.setColumnWidth(0, 300);
|
||||
}
|
||||
|
||||
|
||||
public static String[] getSecondTableHeaders() {
|
||||
String[] header = new String[18];
|
||||
header[0] = "序号";
|
||||
header[1] = "标准名称";
|
||||
header[2] = "制修订类别";
|
||||
header[3] = "代替标准代号";
|
||||
header[4] = "编制部门";
|
||||
header[5] = "评审级别";
|
||||
header[6] = "主要编制者";
|
||||
header[7] = "完成部门评审提交质量部时间";
|
||||
header[8] = "评审稿提交日期[填写]";
|
||||
header[9] = "评审会日期[填写]";
|
||||
header[10] = "评审后修改稿提交日期[填写]";
|
||||
header[11] = "开始流程日期[填写]";
|
||||
header[12] = "报批稿完成时间";
|
||||
header[13] = "距评审稿提交(天)";
|
||||
header[14] = "提交延迟天数(天)";
|
||||
header[15] = "距计划发布(天)";
|
||||
header[16] = "发布延迟天数(天)";
|
||||
header[17] = "当前日期";
|
||||
return header;
|
||||
}
|
||||
|
||||
public static void setSecondTableHeader(Sheet sheet, String[] headers){
|
||||
//设置列宽
|
||||
int minBytes = 17;//至少字节数
|
||||
Row headerRow = sheet.createRow(6); //列头
|
||||
//设置表头
|
||||
for(int i=0;i<headers.length;i++){
|
||||
String fieldName = headers[i];
|
||||
int bytes = fieldName.getBytes().length;
|
||||
bytes = bytes < minBytes ? minBytes : bytes;
|
||||
//sheet.setColumnWidth(i, bytes*128);
|
||||
headerRow.createCell(i).setCellValue(fieldName);
|
||||
}
|
||||
sheet.setColumnWidth(0, 300);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import sun.misc.BASE64Encoder;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
public class HandleFileIOMsg {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(HandleFileIOMsg.class);
|
||||
|
||||
/**
|
||||
* @Description: 根据文件地址转换为base64编码字符串
|
||||
*/
|
||||
public String getFileBase64Str(String filePath) throws Exception {
|
||||
byte[] data = null;
|
||||
try (InputStream inputStream = new FileInputStream(filePath)){
|
||||
File file = new File(filePath);
|
||||
data = new byte[(int) file.length()];
|
||||
inputStream.read(data);
|
||||
inputStream.close();
|
||||
} catch (IOException e) {
|
||||
logger.info(e.getMessage(),e);
|
||||
}
|
||||
// 加密
|
||||
BASE64Encoder encoder = new BASE64Encoder();
|
||||
String codeStr = "";
|
||||
if(data != null){
|
||||
codeStr = encoder.encode(data);
|
||||
codeStr = codeStr.replaceAll("\r|\n", "");
|
||||
}
|
||||
return codeStr;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import cn.afterturn.easypoi.handler.impl.ExcelDataHandlerDefaultImpl;
|
||||
import cn.afterturn.easypoi.util.PoiPublicUtil;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class MapImportHandler extends ExcelDataHandlerDefaultImpl<Map<String, Object>> {
|
||||
|
||||
@Override
|
||||
public void setMapValue(Map<String, Object> map, String originKey, Object value) {
|
||||
if (value instanceof Double) {
|
||||
map.put(originKey, PoiPublicUtil.doubleToString((Double) value));
|
||||
} else {
|
||||
map.put(originKey, value != null ? value.toString() : null);
|
||||
}
|
||||
}
|
||||
|
||||
private String getRealKey(String originKey) {
|
||||
if (originKey.equals("交易账户")) {
|
||||
return "accountNo";
|
||||
}
|
||||
if (originKey.equals("姓名")) {
|
||||
return "name";
|
||||
}
|
||||
if (originKey.equals("客户类型")) {
|
||||
return "type";
|
||||
}
|
||||
return originKey;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Page {
|
||||
private Integer pageNo;
|
||||
private Integer pageSize;
|
||||
private Long count;
|
||||
private List<BusProcessName> list;
|
||||
|
||||
public Integer getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public Long getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(Long count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public List<BusProcessName> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<BusProcessName> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public Integer getPageNo() {
|
||||
return pageNo;
|
||||
}
|
||||
|
||||
public void setPageNo(Integer pageNo) {
|
||||
this.pageNo = pageNo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description: 项目库标准符合性枚举类
|
||||
* @Author: yangxuenan
|
||||
* date: 2020/11/5 14:14
|
||||
*/
|
||||
public enum ProcessConformStateEnum {
|
||||
|
||||
CHECK("3","待验证"),FIT("1","符合"),
|
||||
UNFIT("2","不符合"),
|
||||
NOT_INVOLVE("4","不涉及");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private ProcessConformStateEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* 标准库参数类型枚举设置
|
||||
* @author gaoyan
|
||||
* date 2018/09/03
|
||||
*/
|
||||
public enum PropertyTypeEnum {
|
||||
|
||||
PROVETYPE("PROVETYPE","适用车型"),APPLY_ARCTIC("APPLY_ARCTIC","适用车型"),
|
||||
ENERGY_KIND("ENERGY_KIND","能源种类"),APPLY_AUTH("APPLY_AUTH","适用认证"),
|
||||
CAR_MODEL("CAR_MODEL","公告车型号"),
|
||||
CATEGORY("CATEGORY","所属专业领域"),PRODUCT_TYPE("PRODUCT_TYPE","产品类别");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private PropertyTypeEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
/**
|
||||
* @des : excel信息读取
|
||||
* @author: duyunbao
|
||||
* @email: 1114808306@qq.com
|
||||
* @date 2017/10/27 17:06
|
||||
**/
|
||||
public class ReadExcel {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ReadExcel.class);
|
||||
|
||||
/**
|
||||
* 总行数
|
||||
*/
|
||||
private int totalRows = 0;
|
||||
/**
|
||||
* 总条数
|
||||
*/
|
||||
private int totalCells = 0;
|
||||
/**
|
||||
* 错误信息接收器
|
||||
*/
|
||||
private String errorMsg;
|
||||
|
||||
public ReadExcel() {
|
||||
// 不做操作
|
||||
}
|
||||
|
||||
public int getTotalRows() {
|
||||
return totalRows;
|
||||
}
|
||||
|
||||
public int getTotalCells() {
|
||||
return totalCells;
|
||||
}
|
||||
|
||||
public String getErrorInfo() {//获取错误信息
|
||||
return errorMsg;
|
||||
}
|
||||
|
||||
/**
|
||||
* @method_name: validateExcel
|
||||
* @des : 验证excel格式
|
||||
* @author: duyunbao
|
||||
* @param: [filePath]
|
||||
* @return: boolean
|
||||
* @date: 2017/10/27 17:07
|
||||
**/
|
||||
public boolean validateExcel(String filePath) {
|
||||
if (filePath == null || !(WDWUtil.isExcel2003(filePath) || WDWUtil.isExcel2007(filePath))) {
|
||||
errorMsg = "文件名不是excel格式";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @method_name: getExcelInfo
|
||||
* @des : 读EXCEL文件,获取信息集合
|
||||
* @author: duyunbao
|
||||
* @param: [fileName, Mfile]
|
||||
* @return: org.apache.poi.ss.usermodel.Workbook
|
||||
* @date: 2017/10/27 17:08
|
||||
**/
|
||||
public Workbook getExcelInfo(String fileName, MultipartFile Mfile) {
|
||||
Workbook wb = null;
|
||||
//把spring文件上传的MultipartFile转换成CommonsMultipartFile类型
|
||||
CommonsMultipartFile cf = (CommonsMultipartFile) Mfile; //获取本地存储路径
|
||||
//初始化输入流
|
||||
InputStream is = null;
|
||||
try {
|
||||
//根据文件名判断文件是2003版本还是2007版本
|
||||
boolean isExcel2003 = true;
|
||||
if (WDWUtil.isExcel2007(fileName)) {
|
||||
isExcel2003 = false;
|
||||
}
|
||||
is = cf.getInputStream();
|
||||
//根据excel里面的内容读取客户信息
|
||||
wb = getExcelInfo(is, isExcel2003, wb);
|
||||
is.close();
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(),e);
|
||||
} finally {
|
||||
if (is != null) {
|
||||
try {
|
||||
is.close();
|
||||
} catch (IOException e) {
|
||||
is = null;
|
||||
logger.error(e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return wb;
|
||||
}
|
||||
|
||||
/***
|
||||
* @method_name: getExcelInfo
|
||||
* @des : 判断excel版本
|
||||
* @author: duyunbao
|
||||
* @param: [is, isExcel2003, wb]
|
||||
* @return: org.apache.poi.ss.usermodel.Workbook
|
||||
* @date: 2017/10/27 17:08
|
||||
**/
|
||||
private Workbook getExcelInfo(InputStream is, boolean isExcel2003, Workbook wb) {
|
||||
Workbook workbook =wb;
|
||||
try {
|
||||
/** 根据版本选择创建Workbook的方式 */
|
||||
//当excel是2003时
|
||||
if (isExcel2003) {
|
||||
workbook = new HSSFWorkbook(is);
|
||||
} else {//当excel是2007时
|
||||
workbook = new XSSFWorkbook(is);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logger.error(e.getMessage(),e);
|
||||
}
|
||||
return workbook;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取sheet的名称
|
||||
* @MethodName:getSheetName
|
||||
* @author: 马晓晨
|
||||
* @email: 747052172@qq.com
|
||||
* @date 2017年11月24日 上午9:49:22
|
||||
* @version V1.0
|
||||
* @param filename
|
||||
* @param file
|
||||
* @param sheetIndex
|
||||
* @return
|
||||
*/
|
||||
public String getSheetName(String filename, MultipartFile file, Integer sheetIndex) {
|
||||
Workbook wb = getExcelInfo(filename, file);
|
||||
return wb.getSheetName(sheetIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @Title: encodeFileName
|
||||
* @Description: 导出文件转换文件名称编码
|
||||
* @param @param fileNames
|
||||
* @param @param request
|
||||
* @param @return 设定文件
|
||||
* @return String 返回类型
|
||||
* @throws
|
||||
*/
|
||||
public static String encodeFileName(String fileNames , HttpServletRequest request) {
|
||||
try {
|
||||
String agent = request.getHeader("User-Agent");
|
||||
if (agent.contains("Firefox")) {
|
||||
fileNames = new String(fileNames.getBytes("UTF-8"), "ISO8859-1"); // firefox浏览器
|
||||
} else {
|
||||
fileNames = URLEncoder.encode(fileNames, "utf-8");
|
||||
//谷歌中空格变为+问题
|
||||
fileNames = fileNames.replaceAll("\\+","%20");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(),e);
|
||||
}
|
||||
return fileNames ;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,236 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFTable;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFTableCell;
|
||||
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDecimalNumber;
|
||||
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTcPr;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.math.BigInteger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: yangxuenan
|
||||
* date: 2020/2/25 16:58
|
||||
*/
|
||||
public class ReadWordTable {
|
||||
|
||||
|
||||
/**
|
||||
* 保存生成HTML时需要被忽略的单元格
|
||||
*/
|
||||
private List<String> omitCellsList = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 生成忽略的单元格列表中的格式
|
||||
*
|
||||
* @param row
|
||||
* @param col
|
||||
* @return
|
||||
*/
|
||||
public String generateOmitCellStr(int row, int col) {
|
||||
return row + ":" + col;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前单元格的colspan(列合并)的列数
|
||||
*
|
||||
* @param tcPr 单元格属性
|
||||
* @return
|
||||
*/
|
||||
public int getColspan(CTTcPr tcPr) {
|
||||
// 判断是否存在列合并
|
||||
CTDecimalNumber gridSpan = null;
|
||||
if ((gridSpan = tcPr.getGridSpan()) != null) { // 合并的起始列
|
||||
// 获取合并的列数
|
||||
BigInteger num = gridSpan.getVal();
|
||||
return num.intValue();
|
||||
} else { // 其他被合并的列或正常列
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前单元格的rowspan(行合并)的行数
|
||||
*
|
||||
* @param table 表格
|
||||
* @param row 行值
|
||||
* @param col 列值
|
||||
* @return
|
||||
*/
|
||||
public int getRowspan(XWPFTable table, int row, int col) {
|
||||
|
||||
XWPFTableCell cell = table.getRow(row).getCell(col);
|
||||
// 正常独立单元格
|
||||
if (!isContinueRow(cell) && !isRestartRow(cell)) {
|
||||
return 1;
|
||||
}
|
||||
// 当前单元格的宽度
|
||||
int cellWidth = getCellWidth(table, row, col);
|
||||
// 当前单元格距离左侧边框的距离
|
||||
int leftWidth = getLeftWidth(table, row, col);
|
||||
|
||||
// 用户保存当前单元格行合并的单元格数-1(因为不包含自身)
|
||||
List<Boolean> list = new ArrayList<>();
|
||||
getRowspan(table, row, cellWidth, leftWidth, list);
|
||||
|
||||
return list.size() + 1;
|
||||
}
|
||||
|
||||
private void getRowspan(XWPFTable table, int row, int cellWidth, int leftWidth,
|
||||
List<Boolean> list) {
|
||||
// 已达到最后一行
|
||||
if (row + 1 >= table.getNumberOfRows()) {
|
||||
return;
|
||||
}
|
||||
row = row + 1;
|
||||
int colsNum = table.getRow(row).getTableCells().size();
|
||||
// 因为列合并单元格可能导致行合并的单元格并不在同一列,所以从头遍历列,通过属性、宽度以及距离左边框间距来判断是否是行合并
|
||||
for (int i = 0; i < colsNum; i++) {
|
||||
XWPFTableCell testTable = table.getRow(row).getCell(i);
|
||||
// 是否为合并单元格的中间行(包括结尾行)
|
||||
if (isContinueRow(testTable)) {
|
||||
// 是被上一行单元格合并的单元格
|
||||
if (getCellWidth(table, row, i) == cellWidth
|
||||
&& getLeftWidth(table, row, i) == leftWidth) {
|
||||
list.add(true);
|
||||
// 被合并的单元格在生成html时需要忽略
|
||||
addOmitCell(row, i);
|
||||
// 去下一行继续查找
|
||||
getRowspan(table, row, cellWidth, leftWidth, list);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是合并行的起始行单元格
|
||||
*
|
||||
* @param tableCell
|
||||
* @return
|
||||
*/
|
||||
public boolean isRestartRow(XWPFTableCell tableCell) {
|
||||
CTTcPr tcPr = tableCell.getCTTc().getTcPr();
|
||||
if (tcPr.getVMerge() == null) {
|
||||
return false;
|
||||
}
|
||||
if (tcPr.getVMerge().getVal() == null) {
|
||||
return false;
|
||||
}
|
||||
if (tcPr.getVMerge().getVal().toString().equalsIgnoreCase("restart")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是合并行的中间行单元格(包括结尾的最后一行的单元格)
|
||||
*
|
||||
* @param tableCell
|
||||
* @return
|
||||
*/
|
||||
public boolean isContinueRow(XWPFTableCell tableCell) {
|
||||
CTTcPr tcPr = tableCell.getCTTc().getTcPr();
|
||||
if (tcPr.getVMerge() == null) {
|
||||
return false;
|
||||
}
|
||||
if (tcPr.getVMerge().getVal() == null) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getLeftWidth(XWPFTable table, int row, int col) {
|
||||
int leftWidth = 0;
|
||||
for (int i = 0; i < col; i++) {
|
||||
leftWidth += getCellWidth(table, row, i);
|
||||
}
|
||||
return leftWidth;
|
||||
}
|
||||
|
||||
public int getCellWidth(XWPFTable table, int row, int col) {
|
||||
BigInteger width = table.getRow(row).getCell(col).getCTTc().getTcPr().getTcW().getW();
|
||||
return width.intValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加忽略的单元格(被行合并的单元格,生成HTML时需要忽略)
|
||||
*
|
||||
* @param row
|
||||
* @param col
|
||||
*/
|
||||
public void addOmitCell(int row, int col) {
|
||||
String omitCellStr = generateOmitCellStr(row, col);
|
||||
omitCellsList.add(omitCellStr);
|
||||
}
|
||||
|
||||
public boolean isOmitCell(int row, int col) {
|
||||
String cellStr = generateOmitCellStr(row, col);
|
||||
return omitCellsList.contains(cellStr);
|
||||
}
|
||||
|
||||
public String readTable(XWPFTable table) throws IOException {
|
||||
// 表格行数
|
||||
int tableRowsSize = table.getRows().size();
|
||||
StringBuilder tableToHtmlStr = new StringBuilder("<table>");
|
||||
|
||||
for (int i = 0; i < tableRowsSize; i++) {
|
||||
tableToHtmlStr.append("<tr>");
|
||||
int tableCellsSize = table.getRow(i).getTableCells().size();
|
||||
for (int j = 0; j < tableCellsSize; j++) {
|
||||
if (isOmitCell(i, j)) {
|
||||
continue;
|
||||
}
|
||||
XWPFTableCell tableCell = table.getRow(i).getCell(j);
|
||||
// 获取单元格的属性
|
||||
CTTcPr tcPr = tableCell.getCTTc().getTcPr();
|
||||
int colspan = getColspan(tcPr);
|
||||
if (colspan > 1) { // 合并的列
|
||||
tableToHtmlStr.append("<td colspan='" + colspan + "'");
|
||||
} else { // 正常列
|
||||
tableToHtmlStr.append("<td");
|
||||
}
|
||||
|
||||
int rowspan = getRowspan(table, i, j);
|
||||
if (rowspan > 1) { // 合并的行
|
||||
tableToHtmlStr.append(" rowspan='" + rowspan + "'>");
|
||||
} else {
|
||||
tableToHtmlStr.append(">");
|
||||
}
|
||||
String text = tableCell.getText();
|
||||
tableToHtmlStr.append(text + "</td>");
|
||||
|
||||
}
|
||||
tableToHtmlStr.append("</tr>");
|
||||
}
|
||||
tableToHtmlStr.append("</table>");
|
||||
|
||||
clearTableInfo();
|
||||
|
||||
return tableToHtmlStr.toString();
|
||||
}
|
||||
|
||||
public void clearTableInfo() {
|
||||
// System.out.println(omitCellsList);
|
||||
omitCellsList.clear();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
ReadWordTable readWordTable = new ReadWordTable();
|
||||
|
||||
try (FileInputStream fileInputStream = new FileInputStream("E:\\下载\\table1.docx");
|
||||
XWPFDocument document = new XWPFDocument(fileInputStream);) {
|
||||
List<XWPFTable> tables = document.getTables();
|
||||
for (XWPFTable table : tables) {
|
||||
System.out.println(readWordTable.readTable(table));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
public enum SarAskNatureEnum {
|
||||
ZR("ZR","准入"),ZRYY("ZRYY","准入引用"),
|
||||
UNFIT("ZRWG","准入无关");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private SarAskNatureEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description: 自定义属性字段
|
||||
* date: 2020/11/5 14:14
|
||||
*/
|
||||
public enum SarAttrFieldEnum {
|
||||
|
||||
FO("FO","FO"),YQLX("YQLX","要求类型"),
|
||||
ZRBM("ZRBM","责任部门"),XMPGJS("XMPGJS","项目评估角色");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private SarAttrFieldEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @program: LAWSSystem
|
||||
* @description:
|
||||
* @version: 1.0
|
||||
* @author: LiuJiaQi
|
||||
* @create: 2020-11-03 15:09
|
||||
**/
|
||||
public class SarBussStandStatus {
|
||||
private Map<String,String> planStatusMap = new HashMap<String,String>();
|
||||
private Map<String,String> planTypeMap =new HashMap<String,String>();
|
||||
private Map<String,String> planStatusMapExport =new HashMap<String,String>();
|
||||
private Map<String,String> planTypeMapExport =new HashMap<String,String>();
|
||||
|
||||
public SarBussStandStatus() {
|
||||
planStatusMap.put("制定中", "1");
|
||||
planStatusMap.put("修订中", "2");
|
||||
planStatusMap.put("已发布", "3");
|
||||
planStatusMap.put("计划已确认", "4");
|
||||
planTypeMap.put("制定", "1");
|
||||
planTypeMap.put("修订", "2");
|
||||
//用于导出
|
||||
planStatusMapExport.put("1", "制定中");
|
||||
planStatusMapExport.put("2", "修订中");
|
||||
planStatusMapExport.put("3", "已发布");
|
||||
planStatusMapExport.put("4", "计划已确认");
|
||||
planTypeMapExport.put("1", "制定");
|
||||
planTypeMapExport.put("2", "修订");
|
||||
}
|
||||
|
||||
public Map<String, String> getPlanStatusMap() {
|
||||
return planStatusMap;
|
||||
}
|
||||
|
||||
public void setPlanStatusMap(Map<String, String> planStatusMap) {
|
||||
this.planStatusMap = planStatusMap;
|
||||
}
|
||||
|
||||
public Map<String, String> getPlanTypeMap() {
|
||||
return planTypeMap;
|
||||
}
|
||||
|
||||
public void setPlanTypeMap(Map<String, String> planTypeMap) {
|
||||
this.planTypeMap = planTypeMap;
|
||||
}
|
||||
|
||||
public Map<String, String> getPlanStatusMapExport() {
|
||||
return planStatusMapExport;
|
||||
}
|
||||
|
||||
public void setPlanStatusMapExport(Map<String, String> planStatusMapExport) {
|
||||
this.planStatusMapExport = planStatusMapExport;
|
||||
}
|
||||
|
||||
public Map<String, String> getPlanTypeMapExport() {
|
||||
return planTypeMapExport;
|
||||
}
|
||||
|
||||
public void setPlanTypeMapExport(Map<String, String> planTypeMapExport) {
|
||||
this.planTypeMapExport = planTypeMapExport;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description: 项目库标准符合性枚举类
|
||||
* @Author: yangxuenan
|
||||
* date: 2020/11/5 14:14
|
||||
*/
|
||||
public enum SarConformStateEnum {
|
||||
|
||||
CHECK(1,"待验证"),FIT(2,"符合"),
|
||||
UNFIT(3,"不符合"),PART_FIT(4,"部分符合"),
|
||||
NOT_INVOLVE(5,"不涉及"),ASSESS(6,"评估中"),
|
||||
RESET(7,"整改中"),NOT_EVAL(8,"未评估");
|
||||
|
||||
private Integer value;
|
||||
private String lable;
|
||||
|
||||
private SarConformStateEnum(Integer value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* 编号类型分类
|
||||
* @author gaoyan
|
||||
* date 2018/09/19
|
||||
*/
|
||||
public enum SarNumberTypeEnum {
|
||||
|
||||
STAND_NUMBER("STAND_NUMBER","标准编号"),LAWS_NUMBER("LAWS_NUMBER","文件号"),
|
||||
STAND_REPLACE_NUMBER("STAND_REPLACE_NUMBER","代替标准号"),LAWS_REPLACE_NUMBER("LAWS_REPLACE_NUMBER","代替文件号");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private SarNumberTypeEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description: 预警实施日期种类
|
||||
* @Author: yangxuenan
|
||||
* date: 2020/10/19 15:59
|
||||
*/
|
||||
public enum SarPutTimeEnum {
|
||||
XDXCSSRQ("XDXCSSRQ","新定型车实施日期"),ZCCSSRQ("ZCCSSRQ","在产车实施日期"),
|
||||
XSCCSSRQ("XSCCSSRQ","新生产车实施日期");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private SarPutTimeEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: yangxuenan
|
||||
* date: 2020/12/18 13:51
|
||||
*/
|
||||
public enum SarStandStateEnum {
|
||||
|
||||
DRAFT("DRAFT","草稿"),ADVICE("ADVICE","征求意见稿"),
|
||||
SUBMIT("SUBMIT","送审稿"),RADYSUBMIT("RADYSUBMIT","报批稿"),
|
||||
FJNVYX9Q7J("FJNVYX9Q7J","发布稿"),ZTXXYX("ZTXXYX","计划修订"),
|
||||
ZTJJSS("ZTJJSS","修订中"),TOVOID("TOVOID","已作废"),
|
||||
N5KLTFLNRC("N5KLTFLNRC","已修订"),QBXDZ("XB2USRPXY5","企标修订中"),
|
||||
QBYZF("AY9L9FMSEW","企标已作废"),QBYXD("7ZT7YWXFPK","企标已修订"),
|
||||
QBJHYQR("4VKQX3V2QU","企标计划已确认"),QBYFB("N75QKJ5MWB","企标已发布");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private SarStandStateEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
|
||||
public static String getLableByVal(String val){
|
||||
for (SarStandStateEnum stateEnum : SarStandStateEnum.values()) {
|
||||
if (stateEnum.getValue() == val) {
|
||||
return stateEnum.getLable();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description: 合规性分级颜色枚举
|
||||
* @Author: yangxuenan
|
||||
* date: 2021/3/10 15:45
|
||||
*/
|
||||
public enum SarStateColorEnum {
|
||||
|
||||
GREEN("green","绿色"),RED("red","红色"),BLUE("blue","蓝色"),
|
||||
YELLOW("yellow","黄色"),NA("grey","灰色"),NOT("notSure","未反馈");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private SarStateColorEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
public class SarSychronEO {
|
||||
|
||||
private String sychronId;
|
||||
|
||||
private String sarId;
|
||||
|
||||
private String sarNumber;
|
||||
|
||||
private String conflictType;
|
||||
|
||||
private String standName;
|
||||
|
||||
public String getSychronId() {
|
||||
return sychronId;
|
||||
}
|
||||
|
||||
public void setSychronId(String sychronId) {
|
||||
this.sychronId = sychronId;
|
||||
}
|
||||
|
||||
public String getSarId() {
|
||||
return sarId;
|
||||
}
|
||||
|
||||
public void setSarId(String sarId) {
|
||||
this.sarId = sarId;
|
||||
}
|
||||
|
||||
public String getSarNumber() {
|
||||
return sarNumber;
|
||||
}
|
||||
|
||||
public void setSarNumber(String sarNumber) {
|
||||
this.sarNumber = sarNumber;
|
||||
}
|
||||
|
||||
public String getConflictType() {
|
||||
return conflictType;
|
||||
}
|
||||
|
||||
public void setConflictType(String conflictType) {
|
||||
this.conflictType = conflictType;
|
||||
}
|
||||
|
||||
public String getStandName() {
|
||||
return standName;
|
||||
}
|
||||
|
||||
public void setStandName(String standName) {
|
||||
this.standName = standName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class SarSynInputEO {
|
||||
private String id;
|
||||
private String standSort;
|
||||
private String standNumber;
|
||||
private String standYear;
|
||||
private String standType;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date modifyTime;
|
||||
private String standName;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getStandSort() {
|
||||
return standSort;
|
||||
}
|
||||
|
||||
public void setStandSort(String standSort) {
|
||||
this.standSort = standSort;
|
||||
}
|
||||
|
||||
public String getStandNumber() {
|
||||
return standNumber;
|
||||
}
|
||||
|
||||
public void setStandNumber(String standNumber) {
|
||||
this.standNumber = standNumber;
|
||||
}
|
||||
|
||||
public String getStandYear() {
|
||||
return standYear;
|
||||
}
|
||||
|
||||
public void setStandYear(String standYear) {
|
||||
this.standYear = standYear;
|
||||
}
|
||||
|
||||
public String getStandType() {
|
||||
return standType;
|
||||
}
|
||||
|
||||
public void setStandType(String standType) {
|
||||
this.standType = standType;
|
||||
}
|
||||
|
||||
public Date getModifyTime() {
|
||||
return modifyTime;
|
||||
}
|
||||
|
||||
public void setModifyTime(Date modifyTime) {
|
||||
this.modifyTime = modifyTime;
|
||||
}
|
||||
|
||||
public String getStandName() {
|
||||
return standName;
|
||||
}
|
||||
|
||||
public void setStandName(String standName) {
|
||||
this.standName = standName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* 标准法规分类
|
||||
* @author gaoyan
|
||||
* date 2018/09/19
|
||||
*/
|
||||
public enum SarTypeEnum {
|
||||
|
||||
INLAND_STAND("INLAND_STAND","国内标准法规"),INLAND_LAWS("INLAND_LAWS","国内政策"),
|
||||
FOREIGN_STAND("FOREIGN_STAND","国外标准法规"),FOREIGN_LAWS("FOREIGN_LAWS","国外政策"),
|
||||
STAND("STAND","国内外标准法规"),
|
||||
LAWS("LAWS","国内外政策"),
|
||||
BUSINESS("BUSINESS","企业标准"),
|
||||
BUSS("BUSS","企业标准"),
|
||||
SPLIT("SPLIT","标准拆分"),
|
||||
ACCESS("ACCESS","标准法规清单"),
|
||||
// 增加清单临时分类代码 后续通过同步按钮同步时切换类型
|
||||
INLAND_STAND_ACCESS("INLAND_STAND_ACCESS","国内标准法规清单"),
|
||||
FOREIGN_STAND_ACCESS("FOREIGN_STAND_ACCESS","国外标准法规清单"),
|
||||
FOREIGN_LAWS_ACCESS("FOREIGN_LAWS_ACCESS","国内外政策清单"),
|
||||
BUSS_ACCESS("BUSS","企业标准清单"),
|
||||
PRODUCT("PRODUCT","车型/项目库"),
|
||||
RECORDS("RECORDS","企标备案库");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private SarTypeEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: yangxuenan
|
||||
* date: 2020/12/17 11:23
|
||||
*/
|
||||
public enum SelectionTypeEnum {
|
||||
|
||||
ORGLIST("ORGLIST","组织机构"),USERLIST("USERLIST","用户"),
|
||||
ROLELIST("ROLELIST","角色"),SVPPS("SVPPS","SVPPS"),GZZXX("GZZXX","工作组信息");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private SelectionTypeEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* 标准法规分类
|
||||
* @author gaoyan
|
||||
* date 2018/09/19
|
||||
*/
|
||||
public enum SorDivideEnum {
|
||||
|
||||
INLAND_STAND("INLAND_STAND","国内标准法规"),INLAND_LAWS("INLAND_LAWS","国内政策"),
|
||||
FOREIGN_STAND("FOREIGN_STAND","国外标准法规"),FOREIGN_LAWS("FOREIGN_LAWS","国外政策"),
|
||||
BUSINESS_STAND("BUSINESS_STAND","企业标准") ;
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private SorDivideEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* 标准库参数类型枚举设置
|
||||
* @author gaoyan
|
||||
* date 2018/09/03
|
||||
*/
|
||||
public enum SplitFilePragraTypeEnum {
|
||||
|
||||
TEXT("TEXT","文字"),IMG("IMG","图片"),TABLE("TABLE","表格");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private SplitFilePragraTypeEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: yangxuenan
|
||||
* date: 2020/5/11 10:29
|
||||
*/
|
||||
public class SplitTableInfo {
|
||||
private String tableName;
|
||||
|
||||
private String tableHtml;
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public String getTableHtml() {
|
||||
return tableHtml;
|
||||
}
|
||||
|
||||
public void setTableHtml(String tableHtml) {
|
||||
this.tableHtml = tableHtml;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description: 属性类型枚举类
|
||||
* @Author: yangxuenan
|
||||
* date: 2020/8/17 17:02
|
||||
*/
|
||||
public enum StandAttrTypeEnum {
|
||||
|
||||
INPUT_STR("INPUT_STR","输入框(字符串)"),INPUT_NUM("INPUT_NUM","输入框(数字)"),
|
||||
SELECT_OPTION("SEL_OPTION","单选下拉框"),SEL_OPTS("SEL_OPTS","多选下拉框"),DATE_PICKER("DATE_PICKER","日期选择"),
|
||||
DATE_PIC_OPTS("DATE_PIC_OPTS","多日期选择"),FILE("FILE","文件"),
|
||||
TEXTAREA("TEXTAREA","文本框") ;
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private StandAttrTypeEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* 资源库文件分类枚举设置
|
||||
* @author gaoyan
|
||||
* date 2018/09/03
|
||||
*/
|
||||
public enum StandFileClassifyEnum {
|
||||
|
||||
STAND_FILE("STAND_FILE","标准文本/法规文件"),STAND_MODIFY_FILE("STAND_MODIFY_FILE","标准修改单"),
|
||||
DRAFT_FILE("DRAFT_FILE","草案文件"),OPINION_FILE("OPINION_FILE","征求意见稿"),
|
||||
SENT_SCREEN_FILE("SENT_SCREEN_FILE","送审稿"),APPROVAL_FILE("APPROVAL_FILE","报批稿"),
|
||||
RELEVANCE_FILE("RELEVANCE_FILE","关联文件"),LAWS_FILE("LAWS_FILE","法规文件") ;
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private StandFileClassifyEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
public class StandPlanSchedule {
|
||||
|
||||
private String value;
|
||||
|
||||
private int countPlanSubmit = 0;
|
||||
|
||||
private int countRealSubmit = 0;
|
||||
|
||||
private int countPlanRelease = 0;
|
||||
|
||||
private int countRealRelease = 0;
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int getCountPlanSubmit() {
|
||||
return countPlanSubmit;
|
||||
}
|
||||
|
||||
public void setCountPlanSubmit(int countPlanSubmit) {
|
||||
this.countPlanSubmit = countPlanSubmit;
|
||||
}
|
||||
|
||||
public int getCountRealSubmit() {
|
||||
return countRealSubmit;
|
||||
}
|
||||
|
||||
public void setCountRealSubmit(int countRealSubmit) {
|
||||
this.countRealSubmit = countRealSubmit;
|
||||
}
|
||||
|
||||
public int getCountPlanRelease() {
|
||||
return countPlanRelease;
|
||||
}
|
||||
|
||||
public void setCountPlanRelease(int countPlanRelease) {
|
||||
this.countPlanRelease = countPlanRelease;
|
||||
}
|
||||
|
||||
public int getCountRealRelease() {
|
||||
return countRealRelease;
|
||||
}
|
||||
|
||||
public void setCountRealRelease(int countRealRelease) {
|
||||
this.countRealRelease = countRealRelease;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import com.adc.da.utils.removeHtml.RemoveHtml;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class TableToExcel {
|
||||
|
||||
public static <T extends Object> Workbook createExcel(Map<String,String> columnMap, List<T> dataList, String sheelName, String fileName) {
|
||||
|
||||
if(sheelName==null)sheelName="sheet1";
|
||||
columnMap.put("a","序号");
|
||||
int sheetRow=500;
|
||||
sheetRow=sheetRow<0?200:sheetRow;
|
||||
//第一步,创建一个webbook,对应一个excel文件,内存中sheetRow条记录后提交。
|
||||
Workbook wb=new SXSSFWorkbook(sheetRow);
|
||||
if(columnMap!=null&&dataList!=null) {
|
||||
//获取需要生成的sheet数,以防数据量过大报错
|
||||
int sheetCount=getSheetCount(sheetRow,dataList.size());
|
||||
//循环生成sheet
|
||||
for(int i=0;i<sheetCount;i++) {
|
||||
//第二步,在webbook中添加一个sheet,对应Excel文件中的sheet
|
||||
Sheet sheet=wb.createSheet(sheelName);
|
||||
//第三步,在sheet中添加表头第0行,注意老版本poi对Excel的行数有限制short
|
||||
Row titleRow=sheet.createRow(0);
|
||||
|
||||
Set<String> keys=columnMap.keySet();
|
||||
//第一行(标题行)合并并设置标题
|
||||
//创建表头行(合并单元格)
|
||||
Row headRow = sheet.createRow(0);
|
||||
Row neckRow = sheet.createRow(1);
|
||||
sheet.addMergedRegion(new CellRangeAddress(0,1,0,0));
|
||||
sheet.addMergedRegion(new CellRangeAddress(0,1,1,1));
|
||||
sheet.addMergedRegion(new CellRangeAddress(0,1,2,2));
|
||||
sheet.addMergedRegion(new CellRangeAddress(0,0,3,5));
|
||||
sheet.addMergedRegion(new CellRangeAddress(0,1,6,6));
|
||||
sheet.addMergedRegion(new CellRangeAddress(0,1,9,9));
|
||||
sheet.addMergedRegion(new CellRangeAddress(0,1,7,7));
|
||||
sheet.addMergedRegion(new CellRangeAddress(0,1,8,8));
|
||||
//生成表头行
|
||||
int j=0;
|
||||
|
||||
for(String key:keys) {
|
||||
Cell hCell=headRow.createCell(j++);
|
||||
if (j<4)
|
||||
hCell.setCellValue(columnMap.get(key));
|
||||
}
|
||||
if (null!=columnMap.get("commentText")) {
|
||||
Cell hCellh = headRow.createCell(3);
|
||||
hCellh.setCellValue("修改意见内容");
|
||||
}
|
||||
if (null!=columnMap.get("a")) {
|
||||
Cell hCellh = headRow.createCell(0);
|
||||
hCellh.setCellValue("序号");
|
||||
}
|
||||
if (null!=columnMap.get("chapterNumber")) {
|
||||
Cell hCellh = headRow.createCell(1);
|
||||
hCellh.setCellValue("章条编号");
|
||||
}
|
||||
if (null!=columnMap.get("chapterName")) {
|
||||
Cell hCellh = headRow.createCell(2);
|
||||
hCellh.setCellValue("章节名称");
|
||||
}
|
||||
if (null!=columnMap.get("department")) {
|
||||
Cell hCell = headRow.createCell(6);
|
||||
hCell.setCellValue("提出部门");
|
||||
}
|
||||
if (null!=columnMap.get("responUserName")) {
|
||||
Cell hCell1 = headRow.createCell(7);
|
||||
hCell1.setCellValue("提出人");
|
||||
}
|
||||
if (null!=columnMap.get("stateText")) {
|
||||
Cell hCell2 = headRow.createCell(8);
|
||||
hCell2.setCellValue("处理意见");
|
||||
}
|
||||
if (null!=columnMap.get("oldText")) {
|
||||
Cell nCell = neckRow.createCell(3);
|
||||
nCell.setCellValue("修改前");
|
||||
}
|
||||
if (null!=columnMap.get("newText")) {
|
||||
Cell nCell1 = neckRow.createCell(4);
|
||||
nCell1.setCellValue("修改后");
|
||||
}
|
||||
if (null!=columnMap.get("reason")) {
|
||||
Cell nCell1 = neckRow.createCell(5);
|
||||
nCell1.setCellValue("修改理由");
|
||||
}
|
||||
if (null!=columnMap.get("cause")) {
|
||||
Cell nCell1 = headRow.createCell(9);
|
||||
nCell1.setCellValue("原因");
|
||||
}
|
||||
|
||||
|
||||
//从第三行开始填充数据
|
||||
int c=2;
|
||||
for(int k=i*sheetRow;k<dataList.size()&&k<(i+1)*sheetRow;k++) {
|
||||
T t=dataList.get(k);
|
||||
Row dataRow=sheet.createRow(c++);
|
||||
//循环取值进行数据填充
|
||||
int v=1;
|
||||
dataRow.createCell(0).setCellValue(k+1);
|
||||
for(String key:keys) {
|
||||
if (!"commentText".equals(key)) {
|
||||
try {
|
||||
Object val = BeanUtils.getProperty(t, key);
|
||||
val= RemoveHtml.getResultsFromHtml(String.valueOf(val));
|
||||
if ("null".equals(val)){
|
||||
val="";
|
||||
}
|
||||
if (val instanceof Long) {
|
||||
dataRow.createCell(v++).setCellValue((Long) val);
|
||||
} else if (val instanceof Double) {
|
||||
dataRow.createCell(v++).setCellValue((Double) val);
|
||||
} else if (val instanceof Date) {
|
||||
dataRow.createCell(v++).setCellValue((Date) val);
|
||||
} else if (val instanceof Calendar) {
|
||||
dataRow.createCell(v++).setCellValue((Calendar) val);
|
||||
} else if (val instanceof Boolean) {
|
||||
dataRow.createCell(v++).setCellValue((Boolean) val);
|
||||
} else if (val == null) {
|
||||
dataRow.createCell(v++).setCellValue("");
|
||||
} else {
|
||||
dataRow.createCell(v++).setCellValue((String) val);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println("导出Excel-表格赋值异常");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//设置列宽
|
||||
// setColumnWidth(sheet,columnMap);
|
||||
}
|
||||
}
|
||||
return wb;
|
||||
}
|
||||
public static void setColumnWidth(Sheet sheet, Map<String,String> columnMap) {
|
||||
if(sheet!=null&&columnMap!=null) {
|
||||
List<String> list=new ArrayList<String>(columnMap.keySet());
|
||||
for(int i=0;i<list.size();i++) {
|
||||
sheet.autoSizeColumn(i,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
public static int getSheetCount(int sheelRow,int total) {
|
||||
if(total==0||total<sheelRow)return 1;
|
||||
return total%sheelRow>0?total/sheelRow+1:total/sheelRow;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class TaskCommonQuery {
|
||||
|
||||
@ApiModelProperty(value = "当前页")
|
||||
private int current;
|
||||
@ApiModelProperty(value = "数量")
|
||||
private int size;
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "开始时间从")
|
||||
private String startTime;
|
||||
@ApiModelProperty(value = "到")
|
||||
private String endTime;
|
||||
@ApiModelProperty(value = "结束时间从")
|
||||
private String finishStartTime;
|
||||
@ApiModelProperty(value = "到")
|
||||
private String finishEndTime;
|
||||
@ApiModelProperty(value = "流程分类")
|
||||
private String category_id;
|
||||
|
||||
@ApiModelProperty(value = "用户Id")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(value = "流程名称")
|
||||
private String prcName;
|
||||
|
||||
@ApiModelProperty(value = "流程编号")
|
||||
private String prcNum;
|
||||
|
||||
@ApiModelProperty(value = "流程类型")
|
||||
private String prcType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: yangxuenan
|
||||
* date: 2020/2/21 16:34
|
||||
*/
|
||||
public class TemplateOriData {
|
||||
private String preMsg = "<p>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX。</p><p>本标准由广州汽车集团股份有限公司汽车工程研究院XXX提出。</p><p>本标准由广州汽车集团股份有限公司汽车工程研究院质量管理部归口。</p><p>本标准由广州汽车集团股份有限公司汽车工程研究院XXXX起草。</p><p>本标准由广州汽车集团股份有限公司汽车工程研究院XXXX解释。</p><p>本标准主要起草人:XXX、XXX、XXX。</p><p>本标准于20XX年XX月首次发布。</p><p>本标准于20XX年XX月进行第X次修订,标准修订人:XXX。</p><p>本次主要修订内容如下:</p><p>a) 增加内容的表述</p><p>——增加第X.X条XXXX的要求。</p><p>b)修改内容的表述</p><p>——第X.X条XXXX的要求由“XXX”改为“XXX”。</p><p>c)删除内容的表述</p><p>——删除原标准第X.X条XXXX的要求。</p><p>本标准所替代标准的历次版本发布情况为:</p><p>——QJ/GAC XXXX.XXX-XXXX。</p><p><br/></p>";
|
||||
private String titleOne = "<p> 本标准规定了XXXX的术语和定义、技术要求、试验方法、检验规则和标志、包装、运输及贮存。</p><p> 本标准适用于广汽研究院开发的乘用车用的XXXX。</p><p><br/></p>";
|
||||
private String titleTwo = "<p> 下列文件对于本文件的应用是必不可少的。凡是注日期的引用文件,仅所注日期的版本适用于本文件。凡是不注日期的引用文件,其最新版本(包括所有的修改单)适用于本文件。</p><p> [国家标准]</p><p> [行业标准]</p><p> [地方标准]</p><p> [法规、规程、规范和其它有关文件]</p><p> [ISO标准]</p><p> [IEC标准]</p><p> [ISO、IEC有关文件]</p><p> [其它国际标准]</p><p> [其它国际有关文件]</p><p> [本企业已发布的院级标准]</p><p><br/></p>";
|
||||
private String titleThree = "<p> 下列术语和定义适用于本标准。</p><p><br/></p>";
|
||||
|
||||
public String getPreMsg() {
|
||||
return preMsg;
|
||||
}
|
||||
|
||||
public void setPreMsg(String preMsg) {
|
||||
this.preMsg = preMsg;
|
||||
}
|
||||
|
||||
public String getTitleOne() {
|
||||
return titleOne;
|
||||
}
|
||||
|
||||
public void setTitleOne(String titleOne) {
|
||||
this.titleOne = titleOne;
|
||||
}
|
||||
|
||||
public String getTitleTwo() {
|
||||
return titleTwo;
|
||||
}
|
||||
|
||||
public void setTitleTwo(String titleTwo) {
|
||||
this.titleTwo = titleTwo;
|
||||
}
|
||||
|
||||
public String getTitleThree() {
|
||||
return titleThree;
|
||||
}
|
||||
|
||||
public void setTitleThree(String titleThree) {
|
||||
this.titleThree = titleThree;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: yangxuenan
|
||||
* date: 2019/12/5 13:50
|
||||
*/
|
||||
public class TextCompare {
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
public class UploadFile {
|
||||
|
||||
private String id;
|
||||
|
||||
private String fileName;
|
||||
|
||||
private String oldFileName;
|
||||
|
||||
private String fileSuffix;
|
||||
|
||||
private String filePath;
|
||||
|
||||
private String attId;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public String getOldFileName() {
|
||||
return oldFileName;
|
||||
}
|
||||
|
||||
public void setOldFileName(String oldFileName) {
|
||||
this.oldFileName = oldFileName;
|
||||
}
|
||||
|
||||
public String getFileSuffix() {
|
||||
return fileSuffix;
|
||||
}
|
||||
|
||||
public void setFileSuffix(String fileSuffix) {
|
||||
this.fileSuffix = fileSuffix;
|
||||
}
|
||||
|
||||
public String getFilePath() {
|
||||
return filePath;
|
||||
}
|
||||
|
||||
public void setFilePath(String filePath) {
|
||||
this.filePath = filePath;
|
||||
}
|
||||
|
||||
public String getAttId() {
|
||||
return attId;
|
||||
}
|
||||
|
||||
public void setAttId(String attId) {
|
||||
this.attId = attId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: yangxuenan
|
||||
* date: 2020/1/9 18:59
|
||||
*/
|
||||
public class UploadFileInfo {
|
||||
private String id;
|
||||
private String filePath;
|
||||
private String name;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getFilePath() {
|
||||
return filePath;
|
||||
}
|
||||
|
||||
public void setFilePath(String filePath) {
|
||||
this.filePath = filePath;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* 标准库参数类型枚举设置
|
||||
* @author gaoyan
|
||||
* date 2018/09/03
|
||||
*/
|
||||
public enum UseModuleEnum {
|
||||
|
||||
SOURCE_FILE("SOURCE_FILE","源文件"),WEB_FILE("WEB_FILE","PC预览文件"),MOBLE_FILE("MOBLE_FILE","手机预览文件");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private UseModuleEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @des : excel版本判断类
|
||||
* @author: duyunbao
|
||||
* @email: 1114808306@qq.com
|
||||
* @date 2017/10/27 16:59
|
||||
**/
|
||||
public class WDWUtil {
|
||||
|
||||
/**
|
||||
* @method_name: isExcel2003
|
||||
* @des :是否是2003的excel,返回true是2003
|
||||
* @author: duyunbao
|
||||
* @param: [filePath]
|
||||
* @return: boolean
|
||||
* @date: 2017/10/27 16:57
|
||||
**/
|
||||
public static boolean isExcel2003(String filePath) {
|
||||
return filePath.matches("^.+\\.(?i)(xls)$");
|
||||
}
|
||||
|
||||
/**
|
||||
* @method_name: isExcel2007
|
||||
* @des : 是否是2007的excel,返回true是2007
|
||||
* @author: duyunbao
|
||||
* @param: [filePath]
|
||||
* @return: boolean
|
||||
* @date: 2017/10/27 16:57
|
||||
**/
|
||||
public static boolean isExcel2007(String filePath) {
|
||||
return filePath.matches("^.+\\.(?i)(xlsx)$");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断字符串是否是整数
|
||||
* @MethodName:isInteger
|
||||
* @author: DuYunbao
|
||||
* @date: 2018/5/22 18:00
|
||||
*/
|
||||
public static boolean isNumeric(String str){
|
||||
for (int i = str.length();--i>=0;){
|
||||
if (!Character.isDigit(str.charAt(i))){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**方法二:推荐,速度最快
|
||||
* 判断是否为整数
|
||||
* @param str 传入的字符串
|
||||
* @return 是整数返回true,否则返回false
|
||||
*/
|
||||
public static boolean isInteger(String str) {
|
||||
Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
|
||||
return pattern.matcher(str).matches();
|
||||
}
|
||||
|
||||
/**
|
||||
* 字母或数字
|
||||
*
|
||||
* @MethodName:isLetterDigitOrChinese
|
||||
* @author: DuYunbao
|
||||
* @date: 2018/5/30 15:26
|
||||
*/
|
||||
public static boolean isLetterOrNumber(String str) {
|
||||
String regex = "^(\\d|[a-zA-Z])+$";
|
||||
return !str.matches(regex);
|
||||
}
|
||||
|
||||
/**
|
||||
* 汉字、字母、()
|
||||
*
|
||||
* @MethodName:isLetterOrChineseOrChar1
|
||||
* @author: DuYunbao
|
||||
* @date: 2018/5/30 15:53
|
||||
*/
|
||||
public static boolean isLetterOrChineseOrChar1(String str) {
|
||||
String regex = "[^\\a-\\z\\A-\\Z\\u4E00-\\u9FA5\\()\\()]";
|
||||
return str.matches(regex);
|
||||
}
|
||||
|
||||
/**
|
||||
* 汉字、字母、数字
|
||||
*
|
||||
* @MethodName:isLetterOrChineseOrNumber
|
||||
* @author: DuYunbao
|
||||
* @date: 2018/5/30 15:56
|
||||
*/
|
||||
public static boolean isLetterOrChineseOrNumber(String str) {
|
||||
String regex = "^[\\u4E00-\\u9FA5A-Za-z0-9]+$";
|
||||
return !str.matches(regex);
|
||||
}
|
||||
|
||||
/**
|
||||
* 汉字、字母、()、-、下划线
|
||||
*
|
||||
* @MethodName:isChineseOrLetterOrUnderlineOrChar1
|
||||
* @author: DuYunbao
|
||||
* @date: 2018/5/30 16:03
|
||||
*/
|
||||
public static boolean isChineseOrLetterOrUnderlineOrChar1(String str) {
|
||||
String regex = "^[\\u4E00-\\u9FA5A-Za-z_\\-\\()\\()]+$";
|
||||
return !str.matches(regex);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数字
|
||||
*
|
||||
* @MethodName:isNumbee
|
||||
* @author: DuYunbao
|
||||
* @date: 2018/5/30 16:09
|
||||
*/
|
||||
public static boolean isNumber(String str) {
|
||||
String regex = "\\D";
|
||||
return str.matches(regex);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数字、大写字母、-
|
||||
*
|
||||
* @MethodName:isNumberOrLowerLetterOrChar1
|
||||
* @author: DuYunbao
|
||||
* @date: 2018/5/30 16:41
|
||||
*/
|
||||
public static boolean isNumberOrLowerLetterOrChar1(String str) {
|
||||
String regex = "^[A-Z0-9\\-]+$";
|
||||
return !str.matches(regex);
|
||||
}
|
||||
|
||||
/**
|
||||
* 汉字、数字、字母、()、-、下划线
|
||||
*
|
||||
* @MethodName:isChineseOrNumberOrLetterOrUnderlineOrChar
|
||||
* @author: DuYunbao
|
||||
* @date: 2018/5/30 16:45
|
||||
*/
|
||||
public static boolean isChineseOrNumberOrLetterOrUnderlineOrChar(String str) {
|
||||
String regex = "^[\\u4E00-\\u9FA5A-Za-z0-9_\\-\\()\\()]+$";
|
||||
return !str.matches(regex);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 去除整数含有小数点
|
||||
* @MethodName:subStr
|
||||
* @author: DuYunbao
|
||||
* @date: 2018/5/31 11:19
|
||||
*/
|
||||
public static String subStr(String text) {
|
||||
if (StringUtils.isNotEmpty(text)) {
|
||||
if(text.contains(".0") && text.substring(text.length()-2,text.length()).equals(".0")) {
|
||||
text = text.substring(0,text.length()-2);
|
||||
}
|
||||
}
|
||||
return text;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* 标准法规分类
|
||||
* @author gaoyan
|
||||
* date 2018/09/19
|
||||
*/
|
||||
public enum WarnPutTypeEnum {
|
||||
|
||||
NEWCAR("NEWCAR","新定车型"),NEWPRODUCT("NEWPRODUCT","新生产车型"),
|
||||
PRODUCT("PRODUCT","在产车型");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private WarnPutTypeEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* 预警时间间隔
|
||||
* @author syt
|
||||
* date 2018/09/19
|
||||
*/
|
||||
public enum WarnTimeEnum {
|
||||
|
||||
THREEMONTH("THREEMONTH","三个月",3),SIXMONTH("SIXMONTH","六个月",6),
|
||||
ONEYEAR("ONEYEAR","一年",12),TWOYEAR("TWOYEAR","两年",24);
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
private int month;
|
||||
|
||||
private WarnTimeEnum(String value, String lable,int month) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
this.month = month;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
|
||||
|
||||
public int getMonth() {
|
||||
return month;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Wrapper<T> implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public static final int SUCCESS_CODE = 200;
|
||||
public static final String SUCCESS_MESSAGE = "操作成功";
|
||||
public static final int ERROR_CODE = 500;
|
||||
public static final String ERROR_MESSAGE = "内部异常";
|
||||
public static final int ILLEGAL_ARGUMENT_CODE_ = 100;
|
||||
public static final String ILLEGAL_ARGUMENT_MESSAGE = "参数非法";
|
||||
private boolean success;
|
||||
private int code;
|
||||
private String message;
|
||||
private T result;
|
||||
|
||||
Wrapper() {
|
||||
this(200, "操作成功");
|
||||
}
|
||||
|
||||
Wrapper(int code, String message) {
|
||||
this(code, message, (T) null);
|
||||
}
|
||||
|
||||
Wrapper(int code, String message, T result) {
|
||||
this.success = true;
|
||||
this.code(code).message(message).result(result);
|
||||
}
|
||||
|
||||
private Wrapper<T> code(int code) {
|
||||
this.setCode(code);
|
||||
return this;
|
||||
}
|
||||
|
||||
private Wrapper<T> message(String message) {
|
||||
this.setMessage(message);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Wrapper<T> result(T result) {
|
||||
this.setResult(result);
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean success() {
|
||||
return 200 == this.code;
|
||||
}
|
||||
|
||||
public boolean error() {
|
||||
return !this.success();
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return this.success;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return this.message;
|
||||
}
|
||||
|
||||
public T getResult() {
|
||||
return this.result;
|
||||
}
|
||||
|
||||
public void setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public void setResult(T result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
protected boolean canEqual(Object other) {
|
||||
return other instanceof Wrapper;
|
||||
}
|
||||
|
||||
|
||||
public String toString() {
|
||||
return "Wrapper(success=" + this.isSuccess() + ", code=" + this.getCode() + ", message=" + this.getMessage() + ", result=" + this.getResult() + ")";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.adc.da.workFlow.common;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import sun.awt.SunHints;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ExportExcel<T> {
|
||||
|
||||
private String header;
|
||||
|
||||
private static String[] property;
|
||||
Workbook workbook=new XSSFWorkbook();
|
||||
|
||||
public void setProperty(String property){
|
||||
this.property=property.split(",");
|
||||
}
|
||||
|
||||
public void setHeader(String header){
|
||||
this.header=header;
|
||||
}
|
||||
|
||||
public Workbook getWorkBook(T dataJson) throws Exception {
|
||||
JSONArray dataArray = JSONObject.parseArray(dataJson.toString());
|
||||
|
||||
CellStyle cellStyle = workbook.createCellStyle();//初始化单元格格式对象
|
||||
cellStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
|
||||
|
||||
Sheet sheet = workbook.createSheet();
|
||||
sheet.setDefaultColumnWidth(25);
|
||||
|
||||
createHeader(sheet,header);
|
||||
|
||||
createData(sheet,dataArray);
|
||||
|
||||
return workbook;
|
||||
}
|
||||
|
||||
|
||||
public static void createHeader(Sheet sheet, String header){
|
||||
|
||||
Row rowHeader = sheet.createRow(0);//开始创建标题行
|
||||
if (StringUtils.isNotBlank(header)) {
|
||||
String[] headerArr = header.split(",");
|
||||
for (int i=0;i < headerArr.length; i++) {
|
||||
|
||||
rowHeader.createCell(i).setCellValue(headerArr[i]);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void createData(Sheet sheet, List<?> data) throws Exception{
|
||||
|
||||
if (data != null && !data.isEmpty()) {
|
||||
for (int i=0;i < data.size(); i++) {
|
||||
|
||||
Row row = sheet.createRow(i+1);
|
||||
|
||||
int sheetNum = 0;
|
||||
|
||||
JSONObject datumJson =(JSONObject)data.get(i);
|
||||
/**
|
||||
* 遍历jsonObject值填入一行的单元格中
|
||||
*/
|
||||
for (String s : property) {
|
||||
String value = datumJson.getString(s);
|
||||
row.createCell(sheetNum).setCellValue(value);
|
||||
sheetNum++;
|
||||
}
|
||||
// Class cls = importDto.getClass();
|
||||
// Field[] fields = cls.getDeclaredFields();
|
||||
// for (Field field : fields) {
|
||||
// field.setAccessible(true);
|
||||
// if (field.get(importDto)!=null){
|
||||
// String value = field.get(importDto).toString();
|
||||
// row.createCell(sheetNum).setCellValue(value);
|
||||
// }else {
|
||||
// row.createCell(sheetNum).setCellValue("");
|
||||
// }
|
||||
// sheetNum++;
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+124
@@ -0,0 +1,124 @@
|
||||
package com.adc.da.workFlow.controller;
|
||||
|
||||
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.ActSarItemsEO;
|
||||
import com.adc.da.workFlow.entity.GetQBZXDExcelDto;
|
||||
import com.adc.da.workFlow.service.ActSarItemsBussEOService;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.google.common.collect.Lists;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/lawss/actSarItemsBuss")
|
||||
@Api(description = "|ActSarItemsBuss|")
|
||||
public class ActSarItemsBussEOController extends BaseController<ActSarItemsEO> {
|
||||
|
||||
@Autowired
|
||||
private ActSarItemsBussEOService actSarItemsEOService;
|
||||
|
||||
// private static final Logger logger = LoggerFactory.getLogger(AttFileEOController.class);
|
||||
|
||||
@ApiOperation(value = "|SarBussionessStand|企标复审入库流程")
|
||||
@PostMapping("/processCreateFsBuss")
|
||||
public ResponseMessage processCreateFsBuss(String infoJson) throws Exception {
|
||||
if (StringUtils.isNotBlank(infoJson)) {
|
||||
actSarItemsEOService.processCreateFsBuss(infoJson);
|
||||
return Result.success("入库成功");
|
||||
} else {
|
||||
return Result.error("传入数据json不能为空");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|SarBussionessStand|企标入库流程")
|
||||
@PostMapping("/processCreateBuss")
|
||||
public ResponseMessage processCreateBuss(String infoJson) throws Exception {
|
||||
if (StringUtils.isNotBlank(infoJson)) {
|
||||
String bussId = actSarItemsEOService.processCreateBuss(infoJson);
|
||||
return Result.success(bussId);
|
||||
} else {
|
||||
return Result.error("传入数据json不能为空");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "手动更新")
|
||||
@GetMapping("/autoUpdIndex")
|
||||
public void autoUpdIndex(@RequestParam("pid") String pid,@RequestParam("bussId") String bussId) {
|
||||
actSarItemsEOService.autoUpdIndex(pid,bussId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导出全部意见-企标制修订-技术标准-起草单位高级经理审核节点")
|
||||
@PostMapping("/exportAllBZZXDJSBZ")
|
||||
public void getAllStandYJCL(HttpServletResponse response, @RequestBody Map<String, String> params){
|
||||
try {
|
||||
net.sf.json.JSONArray jsonArray = net.sf.json.JSONArray.fromObject(params.get("json"));
|
||||
List<Map<String, String>> data = (List<Map<String, String>>) jsonArray;
|
||||
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
String textName="意见信息";
|
||||
|
||||
Map<String,String> map=new HashMap<>();
|
||||
map.put("1","采纳");
|
||||
map.put("2","部分采纳");
|
||||
map.put("3","不采纳");
|
||||
String fileName = URLEncoder.encode(textName, "UTF-8").replaceAll("\\+", "%20");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
|
||||
data = data.stream().sorted(Comparator.comparing(m->m.get("modelNum"))).collect(Collectors.toList());
|
||||
List<GetQBZXDExcelDto> standExcel=new ArrayList<>();
|
||||
int i=0;
|
||||
for (Map<String, String> idea : data){
|
||||
i++;
|
||||
GetQBZXDExcelDto getExcelDto = GetQBZXDExcelDto.builder()
|
||||
.partCode(idea.get("modelNum"))
|
||||
.oldText(idea.get("modelUpdBefore"))
|
||||
.newText(idea.get("modelUpdAfter"))
|
||||
.reason(idea.get("modelContent"))
|
||||
.userName(idea.get("zrUserIdName"))
|
||||
.deptName(idea.get("zrDeptIdName"))
|
||||
.state(map.get(idea.get("opinionsAdopted")))
|
||||
.cause(idea.get("opinionsAdoptedCont"))
|
||||
.num(String.valueOf(i))
|
||||
.build();
|
||||
standExcel.add(getExcelDto);
|
||||
}
|
||||
|
||||
List<List<String>> headList=new ArrayList<List<String>>();
|
||||
headList.add(Lists.newArrayList("序号"));
|
||||
headList.add(Lists.newArrayList("条款号"));
|
||||
headList.add(Lists.newArrayList("修改前"));
|
||||
headList.add(Lists.newArrayList("修改后"));
|
||||
headList.add(Lists.newArrayList("修改理由"));
|
||||
headList.add(Lists.newArrayList("提出部门"));
|
||||
headList.add(Lists.newArrayList("责任人"));
|
||||
headList.add(Lists.newArrayList("意见是否采纳"));
|
||||
headList.add(Lists.newArrayList("采纳原因"));
|
||||
EasyExcel.write(response.getOutputStream(), GetQBZXDExcelDto.class).head(headList).autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
||||
.doWrite(standExcel);
|
||||
|
||||
} catch (Exception e) {
|
||||
response.reset();
|
||||
response.setContentType("application/json");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
try {
|
||||
response.getWriter().println(JSON.toJSONString(Result.error()));
|
||||
} catch (IOException ioException) {
|
||||
ioException.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.adc.da.workFlow.controller;
|
||||
|
||||
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.ActSarItemsEO;
|
||||
import com.adc.da.workFlow.service.ActSarItemsEOService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/lawss/actSarItems")
|
||||
@Api(description = "|ActSarItemsEO|")
|
||||
public class ActSarItemsEOController extends BaseController<ActSarItemsEO> {
|
||||
|
||||
@Autowired
|
||||
private ActSarItemsEOService actSarItemsEOService;
|
||||
|
||||
// private static final Logger logger = LoggerFactory.getLogger(AttFileEOController.class);
|
||||
|
||||
@Value("${file.path}")
|
||||
private String filePath;//文件存储路径
|
||||
|
||||
@ApiOperation(value = "|SarStandardsInfoEO|标准入库流程标准入库")
|
||||
@PostMapping("/processCreateStand")
|
||||
public ResponseMessage processCreateStand(String infoJson) throws Exception {
|
||||
if (StringUtils.isNotBlank(infoJson)) {
|
||||
actSarItemsEOService.processCreateStand(infoJson);
|
||||
return Result.success("入库成功");
|
||||
} else {
|
||||
return Result.error("传入数据json不能为空");
|
||||
}
|
||||
}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.adc.da.workFlow.controller;
|
||||
|
||||
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.ActSarItemsEO;
|
||||
import com.adc.da.workFlow.service.ActSarItemsEOService;
|
||||
import com.adc.da.workFlow.service.ActSarItemsLawsEOService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/lawss/actSarItemsLaws")
|
||||
@Api(description = "|ActSarItemsEO|")
|
||||
public class ActSarItemsLawsEOController extends BaseController<ActSarItemsEO> {
|
||||
|
||||
@Autowired
|
||||
private ActSarItemsLawsEOService actSarItemsEOService;
|
||||
|
||||
// private static final Logger logger = LoggerFactory.getLogger(AttFileEOController.class);
|
||||
|
||||
@ApiOperation(value = "|SarLawsStandInfo|政策入库流程")
|
||||
@PostMapping("/processCreateLaws")
|
||||
public ResponseMessage processCreateLaws(String infoJson) throws Exception {
|
||||
if (StringUtils.isNotBlank(infoJson)) {
|
||||
actSarItemsEOService.processCreateLaws(infoJson);
|
||||
return Result.success("入库成功");
|
||||
} else {
|
||||
return Result.error("传入数据json不能为空");
|
||||
}
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.adc.da.workFlow.controller;
|
||||
|
||||
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.ActSarItemsEO;
|
||||
import com.adc.da.workFlow.service.ActSarItemsEOService;
|
||||
import com.adc.da.workFlow.service.ActSarItemsPlanService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/lawss/actSarItemsPlan")
|
||||
@Api(tags = "业务系统立项流程入库")
|
||||
public class ActSarItemsPlanController {
|
||||
|
||||
@Autowired
|
||||
private ActSarItemsPlanService actSarItemsEOService;
|
||||
|
||||
// private static final Logger logger = LoggerFactory.getLogger(AttFileEOController.class);
|
||||
|
||||
@Value("${file.path}")
|
||||
private String filePath;//文件存储路径
|
||||
|
||||
@ApiOperation(value = "立项入库流程入库")
|
||||
@PostMapping("/processCreatePlan")
|
||||
public ResponseMessage processCreatePlan(String infoJson) throws Exception {
|
||||
if (StringUtils.isNotBlank(infoJson)) {
|
||||
return Result.success("200","入库成功",actSarItemsEOService.processCreatePlan(infoJson));
|
||||
} else {
|
||||
return Result.error("传入数据json不能为空");
|
||||
}
|
||||
}
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package com.adc.da.workFlow.controller;
|
||||
|
||||
import com.adc.da.common.ReadExcel;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.workFlow.common.ExportExcel;
|
||||
import com.adc.da.workFlow.service.PolicyWorkFlowService;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/policy/activiti")
|
||||
@Api(tags = "政策征求意见和重点法规或政策认证流程")
|
||||
public class PolicyWorkFlowController {
|
||||
|
||||
|
||||
/**
|
||||
* 政策征求意见导出
|
||||
*/
|
||||
@PostMapping("/exportExcel")
|
||||
@ApiOperation("导出政策征求意见为excel")
|
||||
public void exportExcel(@RequestBody String dataJson, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||
JSONObject data = JSONObject.parseObject(dataJson);
|
||||
JSONArray info = data.getJSONArray("dataList");
|
||||
|
||||
|
||||
ExportExcel exportExcel = new ExportExcel();
|
||||
exportExcel.setHeader("章节编号,章节名称,修改前,修改后,修改理由,原因,提出部门,提出人");
|
||||
exportExcel.setProperty("chapterNumber,chapterName,oldText,newText,changeReason,reason,department,responUserName");
|
||||
Workbook workbook=exportExcel.getWorkBook(info);
|
||||
|
||||
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment; filename=" + ReadExcel.encodeFileName("政策征求意见"+".xlsx",request));
|
||||
// response.setContentType("application/force-download");
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
workbook.write(outputStream);
|
||||
outputStream.flush();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
private PolicyWorkFlowService policyWorkFlowService;
|
||||
|
||||
/**
|
||||
* 纳入重点问题管控
|
||||
*/
|
||||
@PostMapping("/enterIssue")
|
||||
@ApiOperation("纳入重点问题管控")
|
||||
public ResponseMessage enterIssue(@RequestBody String json){
|
||||
boolean result = policyWorkFlowService.enterIssue(json);
|
||||
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,956 @@
|
||||
package com.adc.da.workFlow.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.hutool.core.lang.UUID;
|
||||
import com.adc.da.FeignClientImpl.workFlowFeignClientImpl;
|
||||
import com.adc.da.Timer.ProcessTimer;
|
||||
import com.adc.da.common.*;
|
||||
import com.adc.da.exception.AdcDaBaseException;
|
||||
import com.adc.da.http.PageInfo;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.common.Page;
|
||||
import com.adc.da.login.util.JwtUtils;
|
||||
import com.adc.da.slrs.esRevisePlan.dao.EsRevisePlanDao;
|
||||
import com.adc.da.slrs.esRevisePlan.entity.EsRevisePlan;
|
||||
import com.adc.da.slrs.esRevisePlan.service.IEsRevisePlanLogService;
|
||||
import com.adc.da.slrs.esRevisePlan.service.IEsRevisePlanService;
|
||||
import com.adc.da.slrs.sarUser.entity.TsUser;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.adc.da.sys.common.EmailUtils;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.sys.service.IUserEOService;
|
||||
import com.adc.da.util.LoginUserUtil;
|
||||
import com.adc.da.workFlow.dao.ExportExcelMapper;
|
||||
import com.adc.da.workFlow.entity.*;
|
||||
import com.adc.da.workFlow.service.WorkFlowService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import sun.misc.BASE64Encoder;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/lawss/activiti")
|
||||
@Api(tags = "福田标准法规-工作流管理")
|
||||
public class WorkFlowController {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(WorkFlowController.class);
|
||||
|
||||
@Autowired
|
||||
private workFlowFeignClientImpl workFlowFeignClient;
|
||||
|
||||
@Value("${stand.edit.file.path}")
|
||||
private String standEditFilePath;
|
||||
|
||||
/**
|
||||
* 文件下载路径
|
||||
*/
|
||||
@Value("${file.downloadUrl}")
|
||||
private String downloadUrl;
|
||||
|
||||
@Autowired
|
||||
private JwtUtils jwtUtils;
|
||||
|
||||
@Autowired
|
||||
private ITsUserService userService;
|
||||
|
||||
@Autowired
|
||||
private IEsRevisePlanService iEsRevisePlanService;
|
||||
|
||||
@Autowired
|
||||
private EsRevisePlanDao esRevisePlanDao;
|
||||
|
||||
@Autowired
|
||||
private IEsRevisePlanLogService esRevisePlanLogService;
|
||||
|
||||
// @Autowired
|
||||
// private ExportExcelMapper exportExcelMapper;
|
||||
|
||||
@ApiOperation(value = "|File|下载文件")
|
||||
@GetMapping("/downloadFileForSar")
|
||||
// @RequiresPermissions("sys:file:downloadFileForSar")
|
||||
public void downloadFileForSar(String fileId, String oldFileName, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||
BusProcessModelHis modelHisOne = workFlowFeignClient.processEditFile(fileId);
|
||||
OutputStream os = null;
|
||||
// fileUrl为http或https链接
|
||||
InputStream inputStream = null;
|
||||
HttpURLConnection conn = null;
|
||||
response.reset();
|
||||
File file = new File(downloadUrl+modelHisOne.getEditFilePath());
|
||||
|
||||
if(file.exists()){
|
||||
try {
|
||||
String fileOldName = fileNameEncoding(oldFileName,request);
|
||||
response.setHeader("Content-Disposition", "attachment;filename=\""+fileOldName+"\"");
|
||||
response.setContentType("application/octet-stream");
|
||||
inputStream = new FileInputStream(file);
|
||||
os = response.getOutputStream();
|
||||
org.apache.commons.io.IOUtils.copy(inputStream, os);
|
||||
os.flush();
|
||||
} catch (IOException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
} finally {
|
||||
org.apache.commons.io.IOUtils.closeQuietly(inputStream);
|
||||
org.apache.commons.io.IOUtils.closeQuietly(os);
|
||||
}
|
||||
}else {
|
||||
URL url;
|
||||
try {
|
||||
String fileOldName = fileNameEncoding(oldFileName,request);
|
||||
response.setHeader("Content-Disposition", "attachment;filename=\""+fileOldName+"\"");
|
||||
response.setContentType("application/octet-stream");
|
||||
url = new URL(downloadUrl+modelHisOne.getEditFilePath());
|
||||
conn = (HttpURLConnection) url.openConnection();
|
||||
// 设置超时间为5秒
|
||||
conn.setConnectTimeout(3 * 1000);
|
||||
// 得到输入流
|
||||
inputStream = conn.getInputStream();
|
||||
os = response.getOutputStream();
|
||||
IOUtils.copy(inputStream, os);
|
||||
os.flush();
|
||||
//生成本地文件之类的省略了
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
} finally {
|
||||
if (conn != null) {
|
||||
conn.disconnect();
|
||||
}
|
||||
try {
|
||||
if (inputStream != null) {
|
||||
inputStream.close();
|
||||
}
|
||||
IOUtils.closeQuietly(os);
|
||||
} catch (IOException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author super_liu
|
||||
* @Description 根据不同浏览器定义下载文件编码
|
||||
* Date 2018/10/11 10:40
|
||||
* @Param [fileName, request]
|
||||
* @return java.lang.String
|
||||
**/
|
||||
public String fileNameEncoding(String fileName, HttpServletRequest request) throws IOException {
|
||||
String agent = request.getHeader("User-Agent");
|
||||
if (agent.contains("Firefox")) {
|
||||
/*BASE64Encoder base64Encoder = new BASE64Encoder();
|
||||
fileName = "=?utf-8?B?"
|
||||
+ base64Encoder.encode(fileName.getBytes("utf-8")) + "?=";*/
|
||||
fileName = new String(fileName.getBytes("UTF-8"), "ISO8859-1"); // firefox浏览器
|
||||
} else {
|
||||
fileName = URLEncoder.encode(fileName, "utf-8");
|
||||
//谷歌中空格变为+问题
|
||||
fileName = fileName.replaceAll("\\+","%20");
|
||||
}
|
||||
return fileName;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "存储在线编辑文件")
|
||||
@GetMapping("/saveEditFile")
|
||||
public BusProcessModelHis saveEditFile(String model){
|
||||
return workFlowFeignClient.saveEditFile(model);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询在线编辑流程汇总文件编辑对象")
|
||||
@GetMapping("/processEditFile")
|
||||
public BusProcessModelHis processEditFile(@RequestParam("id") String id){
|
||||
return workFlowFeignClient.processEditFile(id);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "手机获取token")
|
||||
@PostMapping(value = "/loginMobile")
|
||||
@ResponseBody
|
||||
public ResponseMessage<String> loginMobile(String taskIds, String pId) throws UnsupportedEncodingException {
|
||||
BusProcessNew busProcessNew = workFlowFeignClient.queryDetail(taskIds);
|
||||
if(busProcessNew == null || StringUtils.isBlank(busProcessNew.getUserId())){
|
||||
return Result.error("r0011", "用户不存在");
|
||||
}
|
||||
TsUser userEO = userService.getById(busProcessNew.getUserId());
|
||||
if (null == userEO) {
|
||||
return Result.error("r0011", "用户不存在");
|
||||
}
|
||||
if(userEO.getDisableFlag().equals("1")){
|
||||
return Result.error("r0011", "帐号已禁用");
|
||||
}
|
||||
String token = jwtUtils.generateToken(userEO.getUserId());
|
||||
userEO.setToken(token);
|
||||
// 加密重要信息
|
||||
BASE64Encoder encoder = new BASE64Encoder();
|
||||
String userStr = JSON.toJSONString(userEO);
|
||||
String userStr2 = URLEncoder.encode(userStr,"UTF-8");
|
||||
userStr = encoder.encode(userStr2.getBytes());
|
||||
return Result.success(userStr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value = "查询在线编辑流程汇总文件编辑对象")
|
||||
@GetMapping("/processModelHisOneCount")
|
||||
public BusProcessModelHis processModelHisOneCount(@RequestParam("pid") String pid){
|
||||
return workFlowFeignClient.processModelHisOneCount(pid);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "更新在线编辑流程当前节点编辑状态")
|
||||
@GetMapping("/processModelHisOneUpd")
|
||||
public BusProcessModelHis processModelHisOneUpd(@RequestParam("pid") String pid,@RequestParam("taskId") String taskId){
|
||||
return workFlowFeignClient.processModelHisOneUpdStatus(pid,taskId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询在线编辑流程当前节点编辑对象")
|
||||
@GetMapping("/processModelHisOne")
|
||||
public BusProcessModelHis processModelHisOne(@RequestParam("pid") String pid,@RequestParam("taskId") String taskId){
|
||||
return workFlowFeignClient.processModelHisOne(pid,taskId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据pid 节点信息查询")
|
||||
@GetMapping("/evaluationHisListByOne")
|
||||
public BusProcessEvaluationHis evaluationHisListByOne(@RequestParam("pid") String pid,@RequestParam("taskInfo") String taskInfo){
|
||||
return workFlowFeignClient.evaluationHisListByOne(pid,taskInfo);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询流程父节点所有评分(去重)返回节点评分总数")
|
||||
@GetMapping("/evaluationHisListRepSum")
|
||||
public Map<String,Integer> evaluationHisListRepSum(@RequestParam("pid") String pid){
|
||||
return workFlowFeignClient.evaluationHisListRepSum(pid);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询流程父节点所有评分(去重)")
|
||||
@GetMapping("/evaluationHisListRep")
|
||||
public List<BusProcessEvaluationHis> evaluationHisListRep(@RequestParam("pid") String pid){
|
||||
return workFlowFeignClient.evaluationHisListRep(pid);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询流程父节点所有评分")
|
||||
@GetMapping("/evaluationHisList")
|
||||
public List<BusProcessEvaluationHis> evaluationHisList(@RequestParam("pid") String pid){
|
||||
return workFlowFeignClient.evaluationHisList(pid);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "干活流程接收待办")
|
||||
@GetMapping("/execTask")
|
||||
public Map<String,Object> execTask(@RequestParam("todoId") String todoId){
|
||||
return workFlowFeignClient.execTask(todoId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "管控流程接收任务")
|
||||
@GetMapping("/acceptTack")
|
||||
public Integer acceptTack(@RequestParam("nowEsId") String nowEsId, @RequestParam("oaFlag") String oaFlag, @RequestParam("taskId") String taskId) {
|
||||
return workFlowFeignClient.acceptTack(nowEsId,oaFlag,taskId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "管控流程判断接收任务")
|
||||
@GetMapping("/judgeAcceptTack")
|
||||
public ResponseMessage<Boolean> judgeAcceptTack(@RequestParam("nowEsId") String nowEsId, @RequestParam("oaFlag") String oaFlag, @RequestParam("prcIdGk") String prcIdGk) {
|
||||
return Result.success(workFlowFeignClient.judgeAcceptTack(nowEsId,oaFlag,prcIdGk));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "流程实例明细验证是否完成")
|
||||
@GetMapping("/get_verify_by_instance")
|
||||
public Map<String,Object> activiti_define_start1(@RequestParam("taskId") String taskId, @RequestParam("pId") String pId){
|
||||
return workFlowFeignClient.get_verify_by_instance(taskId,pId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导出excel")
|
||||
@PostMapping("/export_excel")
|
||||
public void exportExcel(@RequestBody ExportExcelEO exportExcelEO, HttpServletResponse response, HttpServletRequest request) throws IOException {
|
||||
|
||||
// ExportExcel exportExcel = exportExcelMapper.selectById(id);
|
||||
// if(exportExcel==null||exportExcel.getJson()==null)return;
|
||||
// ExportExcelEO exportExcelEO=JSON.parseObject(exportExcel.getJson(),ExportExcelEO.class);
|
||||
|
||||
if(exportExcelEO.getFileName()==null||exportExcelEO.getFileName().trim().length()==0){
|
||||
exportExcelEO.setFileName(UUID.fastUUID().toString(true));
|
||||
}
|
||||
List<Map<String, Object>> dataList = exportExcelEO.getDataList().stream()
|
||||
.sorted(Comparator.comparing(a -> String.valueOf(a.get("chapterNumber").toString())))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
Workbook excel = TableToExcel.createExcel(exportExcelEO.getColumnName(), dataList, null, exportExcelEO.getFileName());
|
||||
|
||||
response.reset();
|
||||
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
|
||||
response.setHeader("Content-disposition", "attachment; filename=" + exportExcelEO.getFileName() + ".xls");
|
||||
OutputStream outputStream = response.getOutputStream();
|
||||
|
||||
excel.write(outputStream);
|
||||
outputStream.flush();
|
||||
outputStream.close();
|
||||
}
|
||||
|
||||
// @ApiOperation(value = "导出excel数据暂留")
|
||||
// @PostMapping("/save_excel")
|
||||
// public ResponseMessage saveExcel(@RequestBody ExportExcel exportExcel){
|
||||
//
|
||||
// exportExcelMapper.insert(exportExcel);
|
||||
// return Result.success(exportExcel);
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value = "启动流程-以流程定义id")
|
||||
@GetMapping("/activiti_define_start")
|
||||
public ResponseMessage activiti_define_start(@RequestParam("id") String id, @RequestParam("userId") String userId, @RequestParam(value = "bpnId",required = false) String bpnId){
|
||||
return workFlowFeignClient.activiti_define_start(id,userId,bpnId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "启动流程-以流程定义id")
|
||||
@GetMapping("/activiti_define_start_rollBack")
|
||||
public ResponseMessage activiti_define_start_rollBack(@RequestParam("id") String id, @RequestParam("userId") String userId,
|
||||
@RequestParam(value = "bpnId",required = false) String bpnId,@RequestParam(value = "json",required = false)String json){
|
||||
return workFlowFeignClient.activiti_define_start_rollBack(id,userId,bpnId,json);
|
||||
}
|
||||
@ApiOperation(value = "启动流程-以流程定义id")
|
||||
@GetMapping("/activiti_define_start1")
|
||||
public Map<String,String> activiti_define_start1(@RequestParam("id") String id, @RequestParam("userId") String userId, @RequestParam("standName") String standName){
|
||||
return workFlowFeignClient.activiti_define_start1(id,userId,standName);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "启动流程-以流程定义id")
|
||||
@GetMapping("/startProcess")
|
||||
public ResponseMessage startProcess(@RequestParam("type") String type, @RequestParam(value="id",required = false) String id){
|
||||
if(StringUtils.isNotBlank(type)){
|
||||
return this.activiti_define_start(ActDefineStartMap.actDefineStartMap(type), LoginUserUtil.getUserId(),id);
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "启动流程-以流程定义id-加上草稿内容(为了实现撤回)")
|
||||
@PostMapping("/startProcessRollBack")
|
||||
public ResponseMessage startProcessRollBack(ProcessRollBackEO processRollBackEO){
|
||||
if(StringUtils.isNotBlank(processRollBackEO.getType())){
|
||||
return this.activiti_define_start_rollBack(ActDefineStartMap.actDefineStartMap(processRollBackEO.getType()), LoginUserUtil.getUserId(),processRollBackEO.getId(),processRollBackEO.getJson());
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "定时任务启动流程-以流程定义id")
|
||||
@GetMapping("/startProcessNew")
|
||||
public ResponseMessage startProcessNew(@RequestParam("type") String type, @RequestParam(value="userId",required = false) String userId, @RequestParam(value="id",required = false) String id){
|
||||
if(StringUtils.isNotBlank(type)){
|
||||
return this.activiti_define_start(ActDefineStartMap.actDefineStartMap(type), userId,id);
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "待办任务详情")
|
||||
@GetMapping("/todotask")
|
||||
public PageInfo<BusProcessNew> todotask(@RequestParam("userId") String userId, @RequestParam("pId") String pId){
|
||||
workFlowFeignClient.todotask(userId, pId);
|
||||
return null;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "详情")
|
||||
@GetMapping("/queryDetail")
|
||||
public BusProcessNew queryDetail(@RequestParam("taskIds") String taskIds){
|
||||
return workFlowFeignClient.queryDetail(taskIds);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "入库联络人详情")
|
||||
@GetMapping("/inboundLiaisonDetail")
|
||||
public BusProcessNew inboundLiaisonDetail(@RequestParam("taskIds") String taskIds, @RequestParam("pId") String pId) {
|
||||
return workFlowFeignClient.inboundLiaisonDetail(taskIds,pId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "入库联络人详情")
|
||||
@GetMapping("/nonconformity")
|
||||
public String nonconformity(@RequestParam("taskIds") String taskIds){
|
||||
return workFlowFeignClient.nonconformity(taskIds);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "国内法规入库评估流程详情")
|
||||
@GetMapping("/inboundLiaisonDetailForLawsAss")
|
||||
public String inboundLiaisonDetailForLawsAss(@RequestParam("taskIds") String taskIds) {
|
||||
return workFlowFeignClient.inboundLiaisonDetailForLawsAss(taskIds);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "项目评估流程详情")
|
||||
@GetMapping("/projectAssessDetail")
|
||||
public BusProcessNew projectAssessDetail(@RequestParam("taskIds") String taskIds) {
|
||||
return workFlowFeignClient.projectAssessDetail(taskIds);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "企标制修订申请流程详情")
|
||||
@GetMapping("/qbzxdsqlcDetail")
|
||||
public String qbzxdsqlcDetail(@RequestParam("taskIds") String taskIds) {
|
||||
return workFlowFeignClient.qbzxdsqlcDetail(taskIds);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "企标废止流程详情")
|
||||
@GetMapping("/qbfzlcDetail")
|
||||
public String qbfzlcDetail(@RequestParam("taskIds") String taskIds) {
|
||||
return workFlowFeignClient.qbfzDetail(taskIds);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "企标制修订流程详情")
|
||||
@GetMapping("/qbzxdlcDetail")
|
||||
public String qbzxdlcDetail(@RequestParam("taskIds") String taskIds) {
|
||||
return workFlowFeignClient.qbzxdDetail(taskIds);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "政策法规入库发起人查看流程详情")
|
||||
@GetMapping("/zcfgrklcFqrDetail")
|
||||
public String zcfgrklcFqrDetail(@RequestParam("taskIds") String taskIds) {
|
||||
return workFlowFeignClient.zcfgrklcFqrDetail(taskIds);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "政策法规入库流程详情")
|
||||
@GetMapping("/zcfgrklcDetail")
|
||||
public String zcfgrklcDetail(@RequestParam("taskIds") String taskIds) {
|
||||
return workFlowFeignClient.zcfgrklcDetail(taskIds);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "政策法规入库流程联络人选择FO详情")
|
||||
@GetMapping("/zcfgrklcLlrDetail")
|
||||
public String zcfgrklcLlrDetail(@RequestParam("taskIds") String taskIds) {
|
||||
return workFlowFeignClient.zcfgrklcLlrDetail(taskIds);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "企标制修订评估详情")
|
||||
@GetMapping("/qbzxdpgDetail")
|
||||
public String qbzxdpgDetail(@RequestParam("taskIds")String taskIds){
|
||||
return workFlowFeignClient.qbzxdpgDetail(taskIds);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "采购申请流程详情")
|
||||
@GetMapping("/cgsqDetail")
|
||||
public String cgsqDetail(@RequestParam("taskIds") String taskIds) {
|
||||
return workFlowFeignClient.cgsqDetail(taskIds);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "复审流程详情")
|
||||
@GetMapping("/fsDetail")
|
||||
public String fsDetail(@RequestParam("taskIds") String taskIds) {
|
||||
return workFlowFeignClient.fsDetail(taskIds);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "保存任务")
|
||||
@PostMapping("/saveTask")
|
||||
public Wrapper<String> saveTask(@RequestBody BusMes busMes){
|
||||
return workFlowFeignClient.saveTask(busMes);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "行政管理要求评估流程保存")
|
||||
@PostMapping("/saveTaskForXZYQ")
|
||||
public Wrapper<String> saveTaskForXZYQ(BusMes busMes){
|
||||
return workFlowFeignClient.saveTaskForXZYQ(busMes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复审流程使用
|
||||
* @param busMes
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "保存到代办")
|
||||
@PostMapping("/autoSaveFirst1")
|
||||
public Wrapper<String> autoSaveFirst1(@RequestBody BusMes busMes){
|
||||
return workFlowFeignClient.autoSaveFirst1(busMes);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "改派")
|
||||
@GetMapping("/changeAssigneeNew")
|
||||
public Wrapper<String> run(@RequestParam("taskId")String taskId, @RequestParam("assignee") String assignee,
|
||||
@RequestParam("userId")String userId, @RequestParam("pId") String pId) {
|
||||
return workFlowFeignClient.run(taskId,assignee,userId,pId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "我的已办任务列表")
|
||||
@PostMapping("/hastodoTasksList")
|
||||
public Wrapper<Map<String, Object>> HastodoTasksListByUserId(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
return workFlowFeignClient.HastodoTasksListByUserId(taskCommonQuery);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "我的待办任务列表")
|
||||
@PostMapping("/todoTaskList")
|
||||
public PageInfo<BusProcessName> todoTaskListByUserId(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
List<BusProcessName> busProcessNames = workFlowFeignClient.todoTaskListByUserId(taskCommonQuery);
|
||||
List list1 = this.startPage(busProcessNames, taskCommonQuery.getCurrent(), taskCommonQuery.getSize());
|
||||
PageInfo<BusProcessName> pageInfo= new PageInfo<BusProcessName>();
|
||||
if(busProcessNames!=null){
|
||||
pageInfo.setList(list1);
|
||||
pageInfo.setPageNo(taskCommonQuery.getCurrent());
|
||||
pageInfo.setCount(Long.valueOf(busProcessNames.size()));
|
||||
pageInfo.setPageSize(taskCommonQuery.getSize());
|
||||
}else{
|
||||
List<BusProcessName> list = new ArrayList<>();
|
||||
pageInfo.setList(list);
|
||||
pageInfo.setPageNo(taskCommonQuery.getCurrent());
|
||||
pageInfo.setCount(Long.valueOf(0));
|
||||
pageInfo.setPageSize(taskCommonQuery.getSize());
|
||||
}
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "我的待办任务列表")
|
||||
@PostMapping("/todoTaskListNew")
|
||||
public PageInfo<BusProcessName> todoTaskListNew(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
List<BusProcessName> busProcessNames = workFlowFeignClient.todoTaskListByUserId(taskCommonQuery);
|
||||
List list1 = this.startPage(busProcessNames, taskCommonQuery.getCurrent(), taskCommonQuery.getSize());
|
||||
PageInfo<BusProcessName> pageInfo= new PageInfo<BusProcessName>();
|
||||
if(busProcessNames!=null){
|
||||
pageInfo.setList(list1);
|
||||
pageInfo.setPageNo(taskCommonQuery.getCurrent());
|
||||
pageInfo.setCount(Long.valueOf(busProcessNames.size()));
|
||||
pageInfo.setPageSize(taskCommonQuery.getSize());
|
||||
}else{
|
||||
List<BusProcessName> list = new ArrayList<>();
|
||||
pageInfo.setList(list);
|
||||
pageInfo.setPageNo(taskCommonQuery.getCurrent());
|
||||
pageInfo.setCount(Long.valueOf(0));
|
||||
pageInfo.setPageSize(taskCommonQuery.getSize());
|
||||
}
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "完成任务")
|
||||
@PostMapping("/completeTask")
|
||||
public Wrapper<String> completeTaskByUserId( BusMes busMes){
|
||||
Wrapper<String> str = workFlowFeignClient.completeTaskByUserId(busMes);
|
||||
if(str.getCode() == 500){
|
||||
str.setSuccess(false);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "特殊完成任务节点 会更·改草稿")
|
||||
@PostMapping("/completeTaskNew")
|
||||
public Wrapper<String> completeTaskByUserIdNew( BusMesSpecial busMes){
|
||||
Wrapper<String> str = workFlowFeignClient.completeTaskByUserIdNew(busMes);
|
||||
if(str.getCode() == 500){
|
||||
str.setSuccess(false);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "保存标准入库流程")
|
||||
@PostMapping("/saveinboundTask")
|
||||
public Wrapper<String> saveinboundTask(BusMes busMes){
|
||||
return workFlowFeignClient.saveinboundTask(busMes);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "整改流程保存")
|
||||
@PostMapping("/saveUnqualified")
|
||||
public Wrapper<String> saveUnqualified(BusMes busMes){
|
||||
return workFlowFeignClient.saveUnqualified(busMes);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "国内法规入库技术评估流程保存")
|
||||
@PostMapping("/saveInboundLiaisonDetailForLawsAss")
|
||||
public Wrapper<String> saveInboundLiaisonDetailForLawsAss(BusMes busMes){
|
||||
return workFlowFeignClient.saveInboundLiaisonDetailForLawsAss(busMes);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "国内法规入库项目评估流程保存")
|
||||
@PostMapping("/saveProjectAssessDetail2")
|
||||
public Wrapper<String> saveProjectAssessDetail2(BusMes busMes){
|
||||
return workFlowFeignClient.saveProjectAssessDetail2(busMes);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "国内法规入库项目评估流程保存")
|
||||
@PostMapping("/saveProjectAssessDetail3")
|
||||
public Wrapper<String> saveProjectAssessDetail3(BusMes busMes){
|
||||
return workFlowFeignClient.saveProjectAssessDetail3(busMes);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "国内法规入库项目评估流程保存")
|
||||
@PostMapping("/saveProjectAssessDetail4")
|
||||
public Wrapper<String> saveProjectAssessDetail4(BusMes busMes){
|
||||
return workFlowFeignClient.saveProjectAssessDetail4(busMes);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "国内法规入库项目评估流程保存")
|
||||
@PostMapping("/saveProjectAssessDetail5")
|
||||
public Wrapper<String> saveProjectAssessDetail5(BusMes busMes){
|
||||
return workFlowFeignClient.saveProjectAssessDetail5(busMes);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "政策法规评估流程保存")
|
||||
@PostMapping("/saveZcfgpg")
|
||||
public Wrapper<String> saveZcfgpg(BusMes busMes){
|
||||
return workFlowFeignClient.saveZcfgpg(busMes);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "国内法规入库评估流程保存")
|
||||
@PostMapping("/saveTaskForPub")
|
||||
public Wrapper<String> saveTaskForPub(BusMes busMes){
|
||||
return workFlowFeignClient.saveTaskForPub(busMes);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "保存任务第一步")
|
||||
@PostMapping("/saveTaskFirst")
|
||||
public Wrapper<String> saveTaskFirst(BusMes busMes){
|
||||
|
||||
return workFlowFeignClient.saveTaskFirst(busMes);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询任务第一步")
|
||||
@GetMapping("/queryTaskFirst")
|
||||
public BusProcessName queryTaskFirst(@RequestParam("bpnId")String bpnId) {
|
||||
return workFlowFeignClient.queryTaskFirst(bpnId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询taskid任务")
|
||||
@GetMapping("/queryTaskIndex")
|
||||
public BusProcessNew queryTaskIndex(@RequestParam("prcId") String prcId,@RequestParam("taskIds") String taskIds){
|
||||
return workFlowFeignClient.queryTaskIndex(prcId,taskIds);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询草稿")
|
||||
@PostMapping("/queryTaskDraft")
|
||||
public PageInfo<BusProcessName> queryTaskDraft(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
List<BusProcessName> busProcessNames = workFlowFeignClient.queryTaskDraft(taskCommonQuery);
|
||||
List list1 = this.startPage(busProcessNames, taskCommonQuery.getCurrent(), taskCommonQuery.getSize());
|
||||
PageInfo<BusProcessName> pageInfo= new PageInfo<BusProcessName>();
|
||||
if(busProcessNames!=null){
|
||||
pageInfo.setList(list1);
|
||||
pageInfo.setPageNo(taskCommonQuery.getCurrent());
|
||||
pageInfo.setCount(Long.valueOf(busProcessNames.size()));
|
||||
pageInfo.setPageSize(taskCommonQuery.getSize());
|
||||
}else{
|
||||
List<BusProcessName> list = new ArrayList<BusProcessName>();
|
||||
pageInfo.setList(list);
|
||||
pageInfo.setPageNo(taskCommonQuery.getCurrent());
|
||||
pageInfo.setCount(Long.valueOf(0));
|
||||
pageInfo.setPageSize(taskCommonQuery.getSize());
|
||||
}
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "定时任务发起流程")
|
||||
@PostMapping("/autoSaveFirst")
|
||||
public Wrapper<String> autoSaveFirst(@RequestBody BusMes busMes){
|
||||
return workFlowFeignClient.autoSaveFirst(busMes);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询流程是否结束")
|
||||
@GetMapping("/isEnd")
|
||||
public String isEnd(@RequestParam("pId")String pId){
|
||||
return workFlowFeignClient.isEnd(pId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除流程")
|
||||
@GetMapping("/deleteProcessInstance")
|
||||
public Wrapper<String> deleteProcessInstance(@RequestParam("pId")String pId){
|
||||
return workFlowFeignClient.deleteProcessInstance(pId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除草稿")
|
||||
@GetMapping("/deleteDraft")
|
||||
public Wrapper<String> deleteDraft(@RequestParam("id")String id){
|
||||
return workFlowFeignClient.deleteDraft(id);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "已发流程")
|
||||
@PostMapping("/IssuedProcess")
|
||||
public PageInfo<BusProcessName> IssuedProcess(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
Page page = workFlowFeignClient.issuedProcess(taskCommonQuery);
|
||||
PageInfo<BusProcessName> pageInfo= new PageInfo<BusProcessName>();
|
||||
pageInfo.setList(page.getList());
|
||||
pageInfo.setPageNo(taskCommonQuery.getCurrent());
|
||||
pageInfo.setCount(Long.valueOf(page.getCount()));
|
||||
pageInfo.setPageSize(page.getPageSize());
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "已办流程")
|
||||
@PostMapping("/doneProcess")
|
||||
public PageInfo<BusProcessName> doneProcess(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
Page page = workFlowFeignClient.doneProcess(taskCommonQuery);
|
||||
PageInfo<BusProcessName> pageInfo= new PageInfo<BusProcessName>();
|
||||
pageInfo.setList(page.getList());
|
||||
pageInfo.setPageNo(page.getPageNo());
|
||||
pageInfo.setCount(page.getCount());
|
||||
pageInfo.setPageSize(page.getPageSize());
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始分页
|
||||
* @param list
|
||||
* @param pageNum 页码
|
||||
* @param pageSize 每页多少条数据
|
||||
* @return
|
||||
*/
|
||||
public static List startPage(List list, Integer pageNum,
|
||||
Integer pageSize) {
|
||||
if (list == null) {
|
||||
return null;
|
||||
}
|
||||
if (list.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Integer count = list.size(); // 记录总数
|
||||
Integer pageCount = 0; // 页数
|
||||
if (count % pageSize == 0) {
|
||||
pageCount = count / pageSize;
|
||||
} else {
|
||||
pageCount = count / pageSize + 1;
|
||||
}
|
||||
|
||||
int fromIndex = 0; // 开始索引
|
||||
int toIndex = 0; // 结束索引
|
||||
|
||||
if (pageNum != pageCount) {
|
||||
fromIndex = (pageNum - 1) * pageSize;
|
||||
toIndex = fromIndex + pageSize;
|
||||
} else {
|
||||
fromIndex = (pageNum - 1) * pageSize;
|
||||
toIndex = count;
|
||||
}
|
||||
|
||||
List pageList = list.subList(fromIndex, toIndex);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "流程实例明细列表")
|
||||
@GetMapping("/get_list_by_instance")
|
||||
public List<Map<String, Object>> get_list_by_instance(@RequestParam("prcNum") String prcNum, @RequestParam(value="sortWord",required = false)String sortWord, @RequestParam(value="shunxu",required = false) String shunxu){
|
||||
return workFlowFeignClient.get_list_by_instance(prcNum,sortWord,shunxu);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "流程实例汇总列表")
|
||||
@GetMapping("/get_gather_by_instance")
|
||||
public List<Map<String, Object>> get_gather_by_instance(@RequestParam("prcNum") String prcNum, @RequestParam(value="sortWord",required = false)String sortWord, @RequestParam(value="shunxu",required = false) String shunxu){
|
||||
return workFlowFeignClient.get_gather_by_instance(prcNum,sortWord,shunxu);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取图片")
|
||||
@GetMapping("/getImg")
|
||||
public void getImg(@RequestParam("prcNum")String prcNum, HttpServletResponse response) throws IOException {
|
||||
OutputStream os = null;
|
||||
response.setContentType("image/jpg");
|
||||
response.flushBuffer();
|
||||
os = response.getOutputStream();
|
||||
os.write(workFlowFeignClient.getImg(prcNum));
|
||||
os.flush();
|
||||
os.close();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "监控流程列表")
|
||||
@PostMapping("/allProcess")
|
||||
public PageInfo<BusProcessName> allProcess(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
Page page= workFlowFeignClient.allProcess(taskCommonQuery);
|
||||
PageInfo<BusProcessName> pageInfo= new PageInfo<BusProcessName>();
|
||||
pageInfo.setPageNo(taskCommonQuery.getCurrent());
|
||||
pageInfo.setList(page.getList() == null ? new ArrayList<>():page.getList());
|
||||
pageInfo.setCount(page.getCount() == null ? 0 : page.getCount());
|
||||
pageInfo.setPageSize(page.getPageSize() == null ? 0 : page.getPageSize());
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|exportProcessDetailInfo|导出excel")
|
||||
@GetMapping(value = "/exportProcessDetailInfo")
|
||||
public void exportProcessDetailInfo(String idAndSartypeList, String prcNum, HttpServletResponse response,
|
||||
HttpServletRequest request, String exportName) throws Exception {
|
||||
if (StringUtils.isEmpty(exportName)) {
|
||||
exportName = "流程明细清单";
|
||||
}
|
||||
OutputStream os = null;
|
||||
Workbook workbook = null;
|
||||
try {
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment; filename=" + ReadExcel.encodeFileName(exportName + ".xlsx", request));
|
||||
response.setContentType("application/force-download");
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
List<Map<String, Object>> list = workFlowFeignClient.get_list_by_instance(prcNum,null,null);
|
||||
List<ProcessDetailExport> exportDatas=new ArrayList<>();
|
||||
List<String> listId = Arrays.asList(idAndSartypeList.split(","));
|
||||
for(Map<String, Object> map:list){
|
||||
for(String id:listId){
|
||||
if(id.equals(map.get("id").toString())){
|
||||
if(map.get("endTime")!=null){
|
||||
map.put("flag","已完成");
|
||||
}else{
|
||||
map.put("flag","未完成");
|
||||
}
|
||||
if(map.get("comment")!=null && !map.get("comment").toString().equals("")){
|
||||
String comment = map.get("comment").toString();
|
||||
switch (comment){
|
||||
case "0":
|
||||
map.put("comment","同意");
|
||||
break;
|
||||
case "1":
|
||||
map.put("comment","不同意");
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
ProcessDetailExport user = JSON.parseObject(JSON.toJSONString(map), ProcessDetailExport.class);
|
||||
exportDatas.add(user);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
workbook = ExcelExportUtil.exportExcel(exportParams, ProcessDetailExport.class, exportDatas);
|
||||
os = response.getOutputStream();
|
||||
workbook.write(os);
|
||||
os.flush();
|
||||
} catch (IOException e) {
|
||||
throw new AdcDaBaseException("下载文件失败,请重试");
|
||||
} finally {
|
||||
IOUtils.closeQuietly(os);
|
||||
if (workbook != null) {
|
||||
workbook.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "强制撤回")
|
||||
@GetMapping("/forceRecall")
|
||||
public Wrapper<String> forceRecall(@RequestParam("prcId") String prcId){
|
||||
return workFlowFeignClient.forceRecall(prcId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "流程分类列表")
|
||||
@GetMapping("/categoryList")
|
||||
public Wrapper<List<Category>> categoryList(){
|
||||
return workFlowFeignClient.categoryList();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "添加流程分类")
|
||||
@PostMapping("/addCategory")
|
||||
public Wrapper<String> addCategory(@RequestBody Category category){
|
||||
return workFlowFeignClient.addCategory(category);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除流程分类")
|
||||
@GetMapping("/deleteCategory")
|
||||
public Wrapper<String> deleteCategory(@RequestParam("objectId") String objectId){
|
||||
return workFlowFeignClient.deleteCategory(objectId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "编辑流程分类")
|
||||
@PostMapping("/editCategory")
|
||||
public Wrapper<String> editCategory(@RequestBody Category category){
|
||||
return workFlowFeignClient.editCategory(category);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询流程")
|
||||
@GetMapping("/modelListPage")
|
||||
public Wrapper<Map<String, Object>> modelListPage(@RequestParam(value="name",required = false)String name, @RequestParam(value="category_id ",required = false)String category_id,
|
||||
@RequestParam("current")int current, @RequestParam("size")int size){
|
||||
return workFlowFeignClient.modelListPage(name,category_id,current,size);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "政策法规入库评估查看最后数据")
|
||||
@GetMapping("/zcfgrkpgDetail")
|
||||
public List<BusProcessNew> zcfgrkpgDetail(@RequestParam("pId") String pId){
|
||||
return workFlowFeignClient.zcfgrkpgDetail(pId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改流程所属分类")
|
||||
@GetMapping("/updatModel")
|
||||
public Wrapper<String> updatModel(@RequestParam("modelId")String modelId, @RequestParam("categoryId")String categoryId){
|
||||
return workFlowFeignClient.updatModel(modelId,categoryId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询流程编号")
|
||||
@GetMapping("/findPrcNumByPid")
|
||||
public Wrapper<String> findPrcNumByPid(@RequestParam("pId")String pId){
|
||||
return workFlowFeignClient.findPrcNumByPid(pId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "行政管理要求评估流程详情")
|
||||
@GetMapping("/inboundLiaisonDetailForXZYQ")
|
||||
public BusProcessNew inboundLiaisonDetailForXZYQ(@RequestParam("taskIds") String taskIds) {
|
||||
return workFlowFeignClient.inboundLiaisonDetailForXZYQ(taskIds);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "标准解读流程汇总详情")
|
||||
@GetMapping("/decodeDetail")
|
||||
public BusProcessNew decodeDetail(@RequestParam("taskIds") String taskIds, @RequestParam("pId") String pId){
|
||||
return workFlowFeignClient.decodeDetail(taskIds,pId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "采购保存接口")
|
||||
@PostMapping("/saveCgSq")
|
||||
public Wrapper<String> saveCgSq(BusMes busMes) {
|
||||
return workFlowFeignClient.saveTaskForPub(busMes);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
ProcessTimer processTimer;
|
||||
@ApiOperation(value = "自动催办,任务截至时间前3天开始每天催办")
|
||||
@PostMapping("/send123")
|
||||
public String send123() {
|
||||
processTimer.urging();
|
||||
return "0";
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private IUserEOService userEOService;
|
||||
|
||||
@Autowired
|
||||
private EmailUtils mailUtil;
|
||||
|
||||
@ApiOperation(value = "手动催办")
|
||||
@PostMapping("/sendEmailByHands")
|
||||
private ResponseMessage<String> sendEmailByHands(String taskId) {
|
||||
List<BusProcessName> busProcessNames = workFlowFeignClient.queryBusProcessNameForEnd(taskId);
|
||||
if (null != busProcessNames && 0 < busProcessNames.size()) {
|
||||
for (BusProcessName busProcessName : busProcessNames) {
|
||||
String type = busProcessName.getPrcType();
|
||||
Integer typeInt = 99;
|
||||
if (org.apache.commons.lang3.StringUtils.isNotEmpty(type)) {
|
||||
typeInt = Integer.valueOf(type);
|
||||
}
|
||||
type = processTimer.chooseType(typeInt, type);
|
||||
UserEO userEO = userEOService.selectByPrimaryKey(busProcessName.getCreatUserName());
|
||||
String[] array = userEO.getEmail().split(",");
|
||||
|
||||
String msg = "您好,[" + busProcessName.getPrcNum() + "]-[" + busProcessName.getPrcName() + "] 您有待办任务未及时办理 ,请登录全球标准法规管理系统( http://39.98.140.126:10005/#/login )办理:链接( http://39.98.140.126:10005/#/processCenter?tabsName=ProcessCenter )。如有问题请联系发起人[" + userEO.getUname() + "][" + userEO.getEmail() + "]\n" +
|
||||
" ——来自 全球标准法规管理系统";
|
||||
String title = "GSRM——【待办任务】[" + type + "] 您有未完成的待办任务";
|
||||
mailUtil.sendMsgFeign(array, title, msg);
|
||||
}
|
||||
}
|
||||
return Result.success("发送成功");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "草稿删除")
|
||||
@PostMapping("/delCG")
|
||||
public String delCG(@RequestParam("id")String id){
|
||||
return workFlowFeignClient.delCG(id);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "通过企标计划和技术标准起草关联表查询对应的计划id")
|
||||
@GetMapping("/getEsByWk")
|
||||
public String getEsByWk(@RequestParam("prcId")String prcId){
|
||||
return workFlowFeignClient.getEsByWk(prcId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.adc.da.workFlow.dao;
|
||||
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.ActSarItemsEO;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface ActSarItemsEODao {
|
||||
|
||||
List<ActSarItemsEO> queryByPage(ActSarItemsEO actSarItemsEO);
|
||||
|
||||
Integer process4PageDateCount(ActSarItemsEO actSarItemsEO);
|
||||
|
||||
int queryByCount();
|
||||
|
||||
List<ActSarItemsEO> queryStandAndLaws(ActSarItemsEO actSarItemsEO);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.adc.da.workFlow.dao;
|
||||
|
||||
|
||||
import com.adc.da.workFlow.entity.ExportExcel;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
public interface ExportExcelMapper extends BaseMapper<ExportExcel> {
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.adc.da.workFlow.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author yangxuenan
|
||||
* @Description 工作流使用
|
||||
* Date 2018/10/23 14:29
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
@Data
|
||||
public class ActSarItemsEO {
|
||||
private String resId;// 标准法规ID
|
||||
private String resFlag; //类型
|
||||
private String resNum; //标准,文件号
|
||||
private String resName; //标准,文件名称
|
||||
private String resType; //标准类型
|
||||
private String deptName; //部门id
|
||||
private String orgName; // 责任部门名称
|
||||
private String parentId; //仅条目有
|
||||
private String userId; //评估人ID
|
||||
private List<ActSarItemsEO> itemsList; //条目信息
|
||||
private String accessId; //导入时查询
|
||||
private String applyArctic;
|
||||
private String[] applyArcticList;
|
||||
private String energyKind;
|
||||
private String[] energyKindList;
|
||||
private String mainPointImplementation;
|
||||
private String termsConditions;
|
||||
private String parts;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date tackTime;
|
||||
private String applyArcticShow;
|
||||
private String energyKindShow;
|
||||
private String remarks;
|
||||
private String resState; //标准状态
|
||||
private String fileState; //文本状态
|
||||
private String type; //符合性状态
|
||||
private String prcNum;
|
||||
private String foId;
|
||||
private String foName;
|
||||
private String form;
|
||||
private String roleId;
|
||||
private String roleName;
|
||||
//流程分页用
|
||||
private Integer startIndex;
|
||||
private Integer endIndex;
|
||||
private Integer pageSize;
|
||||
private Integer nowPage;
|
||||
private Map<String, Object> attrInfoMap = new LinkedHashMap<>(); //属性表字段与值
|
||||
private String sarState;
|
||||
private String newPutText;
|
||||
private String prodPutText;
|
||||
private String authObj;
|
||||
private String authDelive;
|
||||
private String performInfo;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.adc.da.workFlow.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* OA日志表
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-09-17
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="BusProcessEvaluationHis对象", description="流程评分历史表")
|
||||
public class BusProcessEvaluationHis implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId(value = "ID", type = IdType.UUID)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "标准id")
|
||||
@TableField("STAND_ID")
|
||||
private String standId;
|
||||
|
||||
@ApiModelProperty(value = "处理人")
|
||||
@TableField("USER_ID")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(value = "信息")
|
||||
@TableField("MESG")
|
||||
private String mesg;
|
||||
|
||||
@ApiModelProperty(value = "节点信息")
|
||||
@TableField("TASK_INFO")
|
||||
private String taskInfo;
|
||||
|
||||
@ApiModelProperty(value = "任务id")
|
||||
@TableField("TASK_ID")
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty(value = "流程实例id")
|
||||
@TableField("P_ID")
|
||||
private String pId;
|
||||
|
||||
@ApiModelProperty(value = "流程名称")
|
||||
@TableField("PRC_NAME")
|
||||
private String prcName;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("CREATE_TIME")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private String createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@TableField("UPDATE_TIME")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private String updateTime;
|
||||
|
||||
@ApiModelProperty(value = "onlyOffice 是否编辑 0 未编辑 1 已编辑")
|
||||
@TableField("EDIT_STATUS")
|
||||
private String editStatus;
|
||||
|
||||
@ApiModelProperty(value = "onlyOffice 编辑文件存储路径")
|
||||
@TableField("EDIT_FILE_PATH")
|
||||
private String editFilePath;
|
||||
|
||||
@ApiModelProperty(value = "逻辑状态")
|
||||
@TableField("FLAG")
|
||||
private String flag;
|
||||
|
||||
@ApiModelProperty(value = "onlyOffice 访问编辑文件全路径")
|
||||
@TableField(exist = false)
|
||||
private String downLoadUrl;
|
||||
|
||||
@ApiModelProperty(value = "处理人姓名")
|
||||
@TableField(exist = false)
|
||||
private String userName;
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.adc.da.workFlow.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程模块历史表
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-09-17
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="BusProcessModelHis对象", description="流程模块历史表")
|
||||
public class BusProcessModelHis implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId(value = "ID", type = IdType.UUID)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "标准id")
|
||||
@TableField("STAND_ID")
|
||||
private String standId;
|
||||
|
||||
@ApiModelProperty(value = "处理人")
|
||||
@TableField("USER_ID")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(value = "信息")
|
||||
@TableField("MESG")
|
||||
private String mesg;
|
||||
|
||||
@ApiModelProperty(value = "节点信息")
|
||||
@TableField("TASK_INFO")
|
||||
private String taskInfo;
|
||||
|
||||
@ApiModelProperty(value = "任务id")
|
||||
@TableField("TASK_ID")
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty(value = "流程实例id")
|
||||
@TableField("P_ID")
|
||||
private String pId;
|
||||
|
||||
@ApiModelProperty(value = "流程名称")
|
||||
@TableField("PRC_NAME")
|
||||
private String prcName;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("CREATE_TIME")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private String createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@TableField("UPDATE_TIME")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private String updateTime;
|
||||
|
||||
@ApiModelProperty(value = "onlyOffice 是否编辑 0 未编辑 1 已编辑")
|
||||
@TableField("EDIT_STATUS")
|
||||
private String editStatus;
|
||||
|
||||
@ApiModelProperty(value = "onlyOffice 编辑文件存储路径")
|
||||
@TableField("EDIT_FILE_PATH")
|
||||
private String editFilePath;
|
||||
|
||||
@ApiModelProperty(value = "onlyOffice 编辑类型 node 节点编辑 count 汇总编辑")
|
||||
@TableField("EDIT_TYPE")
|
||||
private String editType;
|
||||
|
||||
@ApiModelProperty(value = "逻辑状态")
|
||||
@TableField("FLAG")
|
||||
private String flag;
|
||||
|
||||
@ApiModelProperty(value = "onlyOffice 访问编辑文件全路径")
|
||||
@TableField(exist = false)
|
||||
private String downLoadUrl;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.workFlow.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.*;
|
||||
|
||||
@TableName("t_export_excel")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class ExportExcel {
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Integer id;
|
||||
@TableField(value = "json")
|
||||
private String json;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.adc.da.workFlow.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class ExportExcelEO {
|
||||
|
||||
private Map<String,String> columnName;
|
||||
|
||||
private List<Map<String,Object>> dataList;
|
||||
|
||||
private String fileName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.adc.da.workFlow.entity;
|
||||
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@HeadRowHeight(20)
|
||||
@ColumnWidth(15)
|
||||
public class GetQBZXDExcelDto {
|
||||
private String num; // 序号
|
||||
|
||||
private String partCode; // 条款号
|
||||
|
||||
private String oldText; // 修改前
|
||||
|
||||
private String newText; // 修改后
|
||||
|
||||
private String reason; // 修改理由
|
||||
|
||||
private String deptName; // 提出部门
|
||||
|
||||
private String userName; // 责任人
|
||||
|
||||
private String state; // 意见是否采纳
|
||||
|
||||
private String cause; // 采纳理由
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.adc.da.workFlow.entity;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class ProcessDetailExport {
|
||||
@Excel(name = "任务步骤", orderNum = "1",width = 15)
|
||||
private String name;
|
||||
@Excel(name = "任务受理人", orderNum = "2",width = 15)
|
||||
private String assignee;
|
||||
@Excel(name = "创建时间", orderNum = "3",exportFormat = "yyyy/MM/dd",width = 15)
|
||||
private Date startTime;
|
||||
@Excel(name = "完成时间", orderNum = "4",exportFormat = "yyyy/MM/dd",width = 15)
|
||||
private Date endTime;
|
||||
@Excel(name = "流程信息", orderNum = "5",width = 15)
|
||||
private String commentText;
|
||||
@Excel(name = "状态", orderNum = "6",width = 15)
|
||||
private String flag;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.adc.da.workFlow.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ProcessRollBackEO {
|
||||
|
||||
private String json;
|
||||
|
||||
private String type;
|
||||
|
||||
private String id;
|
||||
|
||||
private String userId;
|
||||
|
||||
private String bpnId;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.adc.da.workFlow.enums;
|
||||
|
||||
public enum FlowFinishEnum {
|
||||
FSLC_JSBZQC_START("正处于技术标准起草节点","0"),
|
||||
FSLC_JSBZQC_FINISH("技术标准起草节点已结束","1"),
|
||||
JSBZLC_FINISH("技术标准流程已结束","2");
|
||||
|
||||
FlowFinishEnum(String label, String value) {
|
||||
this.label = label;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
String label;
|
||||
String value;
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
+704
@@ -0,0 +1,704 @@
|
||||
package com.adc.da.workFlow.service;
|
||||
|
||||
import com.adc.da.FeignClientImpl.workFlowFeignClientImpl;
|
||||
import com.adc.da.common.BussEnum;
|
||||
import com.adc.da.common.SarConformStateEnum;
|
||||
import com.adc.da.common.SarStateColorEnum;
|
||||
import com.adc.da.common.SarTypeEnum;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.login.util.UserUtils;
|
||||
import com.adc.da.slrs.SarCompResAssess.entity.SarCompResAssess;
|
||||
import com.adc.da.slrs.SarCompResAssess.service.ISarCompResAssessService;
|
||||
import com.adc.da.slrs.SarCompStatusInfo.dao.SarCompStatusInfoDao;
|
||||
import com.adc.da.slrs.SarCompStatusInfo.entity.SarCompStatusInfo;
|
||||
import com.adc.da.slrs.SarFileSplitItems.service.ISarFileSplitItemsService;
|
||||
import com.adc.da.slrs.esRevisePlan.dao.EsRevisePlanDao;
|
||||
import com.adc.da.slrs.esRevisePlan.dao.EsRevisePlanLogDao;
|
||||
import com.adc.da.slrs.esRevisePlan.entity.EsRevisePlan;
|
||||
import com.adc.da.slrs.esRevisePlan.entity.EsRevisePlanLog;
|
||||
import com.adc.da.slrs.esRevisePlan.service.IEsRevisePlanService;
|
||||
import com.adc.da.slrs.sarBussStandAttrInfo.dao.SarBussStandAttrInfoDao;
|
||||
import com.adc.da.slrs.sarBussStandAttrInfo.entity.SarBussStandAttrInfo;
|
||||
import com.adc.da.slrs.sarBussStandAttrInfo.service.ISarBussStandAttrInfoService;
|
||||
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
||||
import com.adc.da.slrs.sarBussionessStand.service.ISarBussionessStandService;
|
||||
import com.adc.da.slrs.sarBussionessStandState.entity.SarBussionessStandState;
|
||||
import com.adc.da.slrs.sarBussionessStandState.service.ISarBussionessStandStateService;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IQualityEvaluationService;
|
||||
import com.adc.da.slrs.sarLawsAttrInfo.service.ISarLawsAttrInfoService;
|
||||
import com.adc.da.slrs.sarLawsItemVal.dao.SarLawsItemValDao;
|
||||
import com.adc.da.slrs.sarLawsItems.dao.SarLawsItemsDao;
|
||||
import com.adc.da.slrs.sarLawsItems.entity.SarLawsItems;
|
||||
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
|
||||
import com.adc.da.slrs.sarLawsStandInfo.service.ISarLawsStandInfoService;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
|
||||
import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService;
|
||||
import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.adc.da.utils.util.DateUtil;
|
||||
import com.adc.da.utils.util.InitStandAttrUtil;
|
||||
import com.adc.da.utils.util.Utils;
|
||||
import com.adc.da.workFlow.dao.ActSarItemsEODao;
|
||||
import com.adc.da.workFlow.entity.BusProcessEvaluationHis;
|
||||
import com.adc.da.workFlow.enums.FlowFinishEnum;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.json.JSONTokener;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service("actSarItemsBussEOService")
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class ActSarItemsBussEOService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ActSarItemsBussEOService.class);
|
||||
|
||||
@Autowired
|
||||
private SarStandAttrInfoDao sarStandAttrInfoEODao;
|
||||
|
||||
@Autowired
|
||||
private workFlowFeignClientImpl workFlowFeignClient;
|
||||
|
||||
@Autowired
|
||||
private SarBussStandAttrInfoDao sarBussStandAttrInfoEODao;
|
||||
|
||||
@Autowired
|
||||
private ISarBussStandAttrInfoService sarBussStandAttrInfoService;
|
||||
|
||||
@Autowired
|
||||
private ISarBussionessStandService iSarBussionessStandService;
|
||||
|
||||
@Autowired
|
||||
private IQualityEvaluationService qualityEvaluationService;
|
||||
|
||||
@Autowired
|
||||
private ISarUpdLogService sarUpdLogEOService;
|
||||
|
||||
@Autowired
|
||||
IEsRevisePlanService iEsRevisePlanService;
|
||||
|
||||
@Autowired
|
||||
private EsRevisePlanDao esRevisePlanDao;
|
||||
|
||||
@Autowired
|
||||
private ISarBussionessStandStateService bussionessStandStateService;
|
||||
|
||||
@Value("${elas.flag}")
|
||||
private boolean elasflag;
|
||||
|
||||
@Autowired
|
||||
private EsRevisePlanLogDao esRevisePlanLogDao;
|
||||
|
||||
|
||||
public void processCreateFsBuss(String standJson) throws Exception {
|
||||
Map<String,Object> standMap = new HashMap();
|
||||
standMap = JSONObject.parseObject(standJson);
|
||||
if (standMap != null && !standMap.isEmpty()) {
|
||||
String standId = String.valueOf(standMap.get("standId"));
|
||||
String standCode = String.valueOf(standMap.get("standCode"));
|
||||
String standSort = String.valueOf(standMap.get("standSort"));
|
||||
String standName = String.valueOf(standMap.get("standName"));
|
||||
String issueTime = String.valueOf(standMap.get("issueTime"));
|
||||
String reviewTime = String.valueOf(standMap.get("reviewTime"));
|
||||
String reviewResults = String.valueOf(standMap.get("reviewResults"));
|
||||
|
||||
// 更新企标文本状态
|
||||
String textStatus = "";
|
||||
if("1".equals(reviewResults)){
|
||||
textStatus = BussEnum.BUSS_XD.getValue();
|
||||
}else if("2".equals(reviewResults)){
|
||||
textStatus = BussEnum.BUSS_FZ.getValue();
|
||||
}else if("3".equals(reviewResults)){
|
||||
textStatus = BussEnum.BUSS_YX.getValue();
|
||||
}
|
||||
|
||||
Map<String, Object> attrInfoMap = sarBussStandAttrInfoService.getBussAttrInfo(standId);
|
||||
String sarStandAttrInfo = JSONObject.toJSONString(attrInfoMap);
|
||||
SarBussionessStand bussionessStand = new SarBussionessStand();
|
||||
bussionessStand.setId(standId);
|
||||
bussionessStand.setTextStatusBuss(textStatus);
|
||||
bussionessStand.setSarStandAttrEOStr(sarStandAttrInfo);
|
||||
if("2".equals(reviewResults) || "3".equals(reviewResults)) { // 废止,有效时才修改文本状态
|
||||
iSarBussionessStandService.updateSarBussionessStand(bussionessStand);
|
||||
}
|
||||
|
||||
SarBussionessStandState state = new SarBussionessStandState();
|
||||
state.setStandId(standId);
|
||||
state.setStandCode(standCode);
|
||||
state.setStandName(standName);
|
||||
state.setReviewResults(Integer.parseInt(reviewResults));
|
||||
if(DateUtil.printToDate(issueTime) != null){
|
||||
state.setIssueTime(issueTime);
|
||||
}
|
||||
state.setModifyTime(DateUtil.printDateAll(new Date()));
|
||||
QueryWrapper wrapper = new QueryWrapper();
|
||||
wrapper.eq("STAND_ID",standId);
|
||||
List<SarBussionessStandState> stateList = bussionessStandStateService.list(wrapper);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Integer addYear = 0;
|
||||
if (standSort.contains("Q/QCBFC")) {
|
||||
addYear = 3;
|
||||
}else {
|
||||
addYear = 5;
|
||||
}
|
||||
Date FSDate = sdf.parse(issueTime);
|
||||
if (ObjectUtils.isNotEmpty(reviewTime)) {
|
||||
FSDate = new Date();
|
||||
}
|
||||
|
||||
if(!stateList.isEmpty()){
|
||||
state.setId(stateList.get(0).getId());
|
||||
if ("3".equals(reviewResults)) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(FSDate);//设置起时间
|
||||
cal.add(Calendar.YEAR, addYear);//增加年份
|
||||
cal.add(Calendar.MONTH, -1);//减去一个月
|
||||
state.setReviewTime(sdf.format(cal.getTime()));
|
||||
}
|
||||
bussionessStandStateService.updateById(state);
|
||||
}else {
|
||||
if ("3".equals(reviewResults)) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(FSDate);//设置起时间
|
||||
cal.add(Calendar.YEAR, addYear);//增加年份
|
||||
cal.add(Calendar.MONTH, -1);//减去一个月
|
||||
state.setReviewTime(sdf.format(cal.getTime()));
|
||||
}
|
||||
state.setCreationTime(DateUtil.printDateAll(new Date()));
|
||||
bussionessStandStateService.save(state);
|
||||
}
|
||||
|
||||
if ("3".equals(reviewResults)) {
|
||||
List<SarBussStandAttrInfo> sarBussStandAttrInfos = sarBussStandAttrInfoService.list(wrapper);
|
||||
if (ObjectUtils.isNotEmpty(sarBussStandAttrInfos)) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(FSDate);//设置起时间
|
||||
cal.add(Calendar.YEAR, addYear);//增加年份
|
||||
cal.add(Calendar.MONTH, -1);//减去一个月
|
||||
SarBussStandAttrInfo sarBussStandAttrInfo = sarBussStandAttrInfos.get(0);
|
||||
sarBussStandAttrInfoEODao.updateFSQR(sarBussStandAttrInfo.getId(),sdf.format(cal.getTime()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(StringUtils.isNotBlank(standSort) && !standSort.contains("Q/QCBFC")){
|
||||
String QCDWID = String.valueOf(standMap.get("QCDWID"));
|
||||
String QCDW = String.valueOf(standMap.get("QCDW"));
|
||||
String QCRBUSSID = String.valueOf(standMap.get("QCRBUSSID"));
|
||||
String QCRBUSS = String.valueOf(standMap.get("QCRBUSS"));
|
||||
String draftTime = String.valueOf(standMap.get("draftTime"));
|
||||
String releaseTime = String.valueOf(standMap.get("releaseTime"));
|
||||
String YYBZ = String.valueOf(standMap.get("YYBZ"));
|
||||
String CYBZ = String.valueOf(standMap.get("CYBZ"));
|
||||
String SYCXCLASS = ObjectUtils.isEmpty(standMap.get("SYCXCLASS")) ? "" : getFieldsValue(standMap, "SYCXCLASS");
|
||||
String DTQBBHBUSS = String.valueOf(standMap.get("DTQBBHBUSS"));
|
||||
String LXD = String.valueOf(standMap.get("LXD"));
|
||||
|
||||
//立项
|
||||
EsRevisePlan esRevisePlanDTO=new EsRevisePlan();
|
||||
esRevisePlanDTO.setEsName(standName);
|
||||
esRevisePlanDTO.setUnit(QCDWID);
|
||||
esRevisePlanDTO.setUnitName(QCDW);
|
||||
esRevisePlanDTO.setDrafter(QCRBUSSID);
|
||||
esRevisePlanDTO.setDrafterName(QCRBUSS);
|
||||
esRevisePlanDTO.setPlanStatus("6");
|
||||
esRevisePlanDTO.setReviseStatus("2");
|
||||
esRevisePlanDTO.setDraftTime(DateUtil.printToDate(draftTime));
|
||||
esRevisePlanDTO.setReleaseTime(DateUtil.printToDate(releaseTime));
|
||||
esRevisePlanDTO.setBussSort(standSort);
|
||||
esRevisePlanDTO.setEsMatingRelations(YYBZ);
|
||||
esRevisePlanDTO.setEsStandRelations(CYBZ);
|
||||
esRevisePlanDTO.setUseLevel(CYBZ);
|
||||
esRevisePlanDTO.setArea(SYCXCLASS);
|
||||
esRevisePlanDTO.setRqbName(DTQBBHBUSS);
|
||||
esRevisePlanDTO.setLxd(LXD);
|
||||
esRevisePlanDTO.setLogType("复审");
|
||||
|
||||
EsRevisePlan qw = new EsRevisePlan();
|
||||
qw.setEsName(standName);
|
||||
qw.setBussSort(standSort);
|
||||
List<EsRevisePlan> list = esRevisePlanDao.selectPageByName(qw);
|
||||
|
||||
String esPlanId = "";
|
||||
if(!list.isEmpty()){
|
||||
esRevisePlanDTO.setId(list.get(0).getId());
|
||||
iEsRevisePlanService.updateById(esRevisePlanDTO);
|
||||
//日志
|
||||
if ("1".equals(reviewResults)) {
|
||||
String esName = list.get(0).getEsName();
|
||||
String id = list.get(0).getId();
|
||||
Date date = new Date();
|
||||
String msg = UserUtils.getUser().getUname() + " " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date) + " "
|
||||
+"通过复审流程创建了《"+ esName +"》,其复审结果为修订。";
|
||||
esRevisePlanLogDao.insert(new EsRevisePlanLog(null,id,msg,date));
|
||||
}
|
||||
esPlanId = list.get(0).getId();
|
||||
}else{
|
||||
if("1".equals(reviewResults)) { // 修订时才生成企标计划
|
||||
ResponseMessage<Object> objectResponseMessage = iEsRevisePlanService.addPlan(esRevisePlanDTO);
|
||||
esPlanId = objectResponseMessage.getMessage();
|
||||
}
|
||||
}
|
||||
if ("1".equals(reviewResults)) {
|
||||
workFlowFeignClient.setRelation(esPlanId, String.valueOf(standMap.get("prcId")) , FlowFinishEnum.FSLC_JSBZQC_START.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private String getFieldsValue(Map<String,Object> standMap, String key){
|
||||
String str = "";
|
||||
Object json= new JSONTokener(standMap.get(key).toString()).nextValue();
|
||||
if(json instanceof org.json.JSONArray){
|
||||
str = String.join(",",JSONObject.parseArray(standMap.get(key).toString(),String.class));
|
||||
}else {
|
||||
if(!json.equals("null")){
|
||||
str = standMap.get(key).toString();
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
public void autoUpdIndex(String pid,String bussId){
|
||||
List<BusProcessEvaluationHis> evaluationHisFilter = workFlowFeignClient.evaluationHisList(pid);
|
||||
List<BusProcessEvaluationHis> evaluationHis = new ArrayList<>();
|
||||
Map<String, List<BusProcessEvaluationHis>> listMap = new TreeMap<>();
|
||||
|
||||
// 按 相同数据分组
|
||||
listMap = evaluationHisFilter.stream().collect(
|
||||
Collectors.groupingBy(a -> Utils.format("{0}#{1}", a.getPId(),a.getTaskInfo())));
|
||||
|
||||
List<QualityEvaluation> evaluations = new ArrayList<>();
|
||||
if(!listMap.isEmpty()){
|
||||
SimpleDateFormat sdf=new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
|
||||
listMap.forEach((key, value) -> {
|
||||
if(!value.isEmpty()){
|
||||
evaluationHis.add(value.get(0));
|
||||
}
|
||||
});
|
||||
String finalBussId = bussId;
|
||||
Date date = new Date();
|
||||
evaluationHis.forEach(busProcessEvaluationHis -> {
|
||||
List<JSONObject> valueArr = JSONArray.parseArray(busProcessEvaluationHis.getMesg(),JSONObject.class);
|
||||
if(!valueArr.isEmpty()){
|
||||
valueArr.forEach(object -> {
|
||||
QualityEvaluation evaluation = new QualityEvaluation();
|
||||
evaluation.setId(UUIDUtils.randomUUID20());
|
||||
evaluation.setLawId(finalBussId);
|
||||
evaluation.setUserId(object.getString("userId"));
|
||||
evaluation.setScore(object.getString("score"));
|
||||
evaluation.setReason(object.getString("reason"));
|
||||
evaluation.setEvaluationIndex(object.getString("code"));
|
||||
evaluation.setProcessNode(object.getString("processNode"));
|
||||
evaluation.setEvaluationType(object.getString("indexType"));
|
||||
evaluation.setCreateTime(date);
|
||||
evaluation.setModifyTime(date);
|
||||
evaluations.add(evaluation);
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
qualityEvaluationService.saveBatch(evaluations);
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
* @Description: 国内外标准流程入库"
|
||||
* @Date: 2020/12/7 13:48
|
||||
* @Param: [standJson]
|
||||
* @Return: void
|
||||
*/
|
||||
public String processCreateBuss(String standJson) throws Exception{
|
||||
Map<String,Object> standMap = new HashMap();
|
||||
standMap = JSONObject.parseObject(standJson);
|
||||
String bussId = "";
|
||||
if (standMap != null && !standMap.isEmpty()) {
|
||||
String prcNum = String.valueOf(standMap.get("prcNum"));
|
||||
String pid = String.valueOf(standMap.get("topId"));
|
||||
String prcName = String.valueOf(standMap.get("prcName"));
|
||||
String prcCreateUser = String.valueOf(standMap.get("prcCreateUser"));
|
||||
String standType = String.valueOf(standMap.get("standType"));
|
||||
// String isJudge = String.valueOf(standMap.get("ifIn")); //是否经过技术评估
|
||||
SarBussionessStand sarBussionessStand = new SarBussionessStand();
|
||||
// if(standMap.containsKey("standId")) {
|
||||
// if (standMap.get("standId") != null && !standMap.get("standId").toString().equals("")) {
|
||||
// String resId = standMap.get("standId").toString();
|
||||
// //此处说明是带入的形式
|
||||
// sarStandardsInfoEO.setId(resId);
|
||||
// SarCompResAssess assessInfoByResId = sarCompResAssessEOService.ssessInfoByResId(resId);
|
||||
// if (assessInfoByResId != null) {
|
||||
// assessInfoByResId.setProcessState("2");
|
||||
// sarCompResAssessEOService.updateByPrimaryKeySelective(assessInfoByResId);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
Map<String,Object> attInfoMap = new HashMap<>();
|
||||
List<String> jsonArray = new ArrayList<>();
|
||||
Object breakVal = null;
|
||||
Object itemList = null;
|
||||
for (Map.Entry<String,Object> entry : standMap.entrySet()) {
|
||||
String field = entry.getKey().toUpperCase();
|
||||
Object value = entry.getValue();
|
||||
if (InitStandAttrUtil.queryFieldListBuss.contains(field)) {
|
||||
if (value instanceof JSONArray) {
|
||||
String valStr = String.valueOf(value);
|
||||
List<String> valueArr = JSONArray.parseArray(valStr,String.class);
|
||||
if (valueArr != null && !valueArr.isEmpty()) {
|
||||
String newValue = "";
|
||||
for (String val : valueArr) {
|
||||
newValue += val + ",";
|
||||
}
|
||||
newValue = newValue.substring(0,newValue.length()-1);
|
||||
value = newValue;
|
||||
}else {
|
||||
value = "";
|
||||
}
|
||||
}
|
||||
attInfoMap.put(field,value);
|
||||
} else {
|
||||
createStandBaseField(sarBussionessStand,entry.getKey(),value);
|
||||
}
|
||||
}
|
||||
//处理文件
|
||||
//此处需要处理之前的文件信息,防止文件丢失
|
||||
// attInfoMap = saveFileMsg(attInfoMap,sarStandardsInfoEO.getFileIds(),sarStandardsInfoEO.getTextStatus());
|
||||
String resData = JSON.toJSONString(attInfoMap, SerializerFeature.WriteMapNullValue);
|
||||
sarBussionessStand.setSarStandAttrEOStr(resData);
|
||||
// 根据标准号判断数据是否已存在
|
||||
//2021年4月9日 此处检查当前是否存在standId
|
||||
String standCode = "";
|
||||
if(StringUtils.isNotBlank(sarBussionessStand.getStandCode()) && !"null".equals(sarBussionessStand.getStandCode())){
|
||||
standCode = sarBussionessStand.getStandCode();
|
||||
}
|
||||
List<SarBussionessStand> lawsList = iSarBussionessStandService.selectStandardsByStandNumber(standCode);
|
||||
// if (StringUtils.isBlank(sarStandardsInfoEO.getMenuId()) && "INLAND".equals(sarStandardsInfoEO.getStandType())) {
|
||||
// sarStandardsInfoEO.setMenuId("64df1d5522bb49c09af2");
|
||||
// sarStandardsInfoEO.setCountry("CN");
|
||||
// } else if (StringUtils.isBlank(sarStandardsInfoEO.getMenuId()) && "FOREIGN".equals(sarStandardsInfoEO.getStandType())) {
|
||||
// sarStandardsInfoEO.setMenuId("22179d54d4e640098e29");
|
||||
// }
|
||||
//此处判断是否是带入的标准
|
||||
if(StringUtils.isNotBlank(sarBussionessStand.getId())) {
|
||||
bussId = sarBussionessStand.getId();
|
||||
SarBussionessStand query = new SarBussionessStand();
|
||||
query.setId(sarBussionessStand.getId());
|
||||
iSarBussionessStandService.attrInfoDetails(query);
|
||||
Map<String, Object> attrInfoMap = query.getAttrInfoMap();
|
||||
if(attInfoMap!=null && !attInfoMap.isEmpty()){
|
||||
// updateStandFileFieldData(attInfoMap,attrInfoMap);
|
||||
resData = JSON.toJSONString(attInfoMap, SerializerFeature.WriteMapNullValue);
|
||||
sarBussionessStand.setSarStandAttrEOStr(resData);
|
||||
}
|
||||
// 查询原相关流程
|
||||
String relatePro = sarBussStandAttrInfoService.selectFieldValByStandId("XGLC",sarBussionessStand.getId());
|
||||
if (StringUtils.isNotBlank(relatePro)) {
|
||||
String[] processSplit = relatePro.split(",");
|
||||
Set<String> processSet = new HashSet<>();
|
||||
for(String sData:processSplit){
|
||||
processSet.add(sData);
|
||||
}
|
||||
processSet.add(prcNum);
|
||||
relatePro = StringUtils.join(processSet.toArray(), ",");
|
||||
} else {
|
||||
relatePro = prcNum;
|
||||
}
|
||||
// 编辑标准
|
||||
iSarBussionessStandService.updateSarBussionessStand(sarBussionessStand);
|
||||
// 编辑相关流程
|
||||
sarBussStandAttrInfoService.updateStandInfo(sarBussionessStand.getId(),"XGLC",relatePro);
|
||||
String content = "新增一条相关流程:" +prcName+" "+prcNum;
|
||||
sarUpdLogEOService.createBaseProcessLog(sarBussionessStand.getId(),"BUSINESS",content,prcCreateUser);
|
||||
}else if (lawsList != null && !lawsList.isEmpty()) {//Id不存在,但是标准号存在的情况
|
||||
String standId = lawsList.get(0).getId();
|
||||
bussId = lawsList.get(0).getId();
|
||||
SarBussionessStand query = new SarBussionessStand();
|
||||
query.setId(standId);
|
||||
iSarBussionessStandService.attrInfoDetails(query);
|
||||
Map<String, Object> attrInfoMap = query.getAttrInfoMap();
|
||||
if(attInfoMap!=null && !attInfoMap.isEmpty()){
|
||||
// updateStandFileFieldData(attInfoMap,attrInfoMap);
|
||||
resData = JSON.toJSONString(attInfoMap, SerializerFeature.WriteMapNullValue);
|
||||
sarBussionessStand.setSarStandAttrEOStr(resData);
|
||||
}
|
||||
// 查询原相关流程
|
||||
String relatePro = sarBussStandAttrInfoService.selectFieldValByStandId("XGLC",standId);
|
||||
if (StringUtils.isNotBlank(relatePro)) {
|
||||
String[] processSplit = relatePro.split(",");
|
||||
Set<String> processSet = new HashSet<>();
|
||||
for(String sData:processSplit){
|
||||
processSet.add(sData);
|
||||
}
|
||||
processSet.add(prcNum);
|
||||
relatePro = StringUtils.join(processSet.toArray(), ",");
|
||||
} else {
|
||||
relatePro = prcNum;
|
||||
}
|
||||
// 编辑标准
|
||||
sarBussionessStand.setId(standId);
|
||||
iSarBussionessStandService.updateSarBussionessStand(sarBussionessStand);
|
||||
// 编辑相关流程
|
||||
sarBussStandAttrInfoService.updateStandInfo(standId,"XGLC",relatePro);
|
||||
String content = "新增一条相关流程:" +prcName+" "+prcNum;
|
||||
sarUpdLogEOService.createBaseProcessLog(standId,"BUSINESS",content,prcCreateUser);
|
||||
} else {//标准号、ID都不存在的情况
|
||||
// 新增方法
|
||||
sarBussionessStand.setPrcCreateUser(prcCreateUser);
|
||||
ResponseMessage<SarBussionessStand> responseMessage = iSarBussionessStandService.createSarBussionessStand(sarBussionessStand);
|
||||
if(responseMessage.isOk()){
|
||||
SarBussionessStand bussionessStand = responseMessage.getData();
|
||||
bussId = bussionessStand.getId() == null ? "":bussionessStand.getId();
|
||||
}
|
||||
|
||||
// 编辑相关流程
|
||||
sarBussStandAttrInfoService.updateStandInfo(sarBussionessStand.getId(),"XGLC",prcNum);
|
||||
}
|
||||
List<SarStandItems> allItems = new ArrayList<>();
|
||||
//开始处理条款数据,从去重后的结果中直接处理即可
|
||||
// if(itemData!=null && !itemData.isEmpty()){
|
||||
// // allItems =
|
||||
// saveStandItemsData(itemData, sarStandardsInfoEO);
|
||||
// }
|
||||
//技术评估结果入库 重构技术评估结果入库内容
|
||||
// if ("0".equals(isJudge)) {
|
||||
// saveCompStatusInfo(sarStandardsInfoEO,breakVal,allItems,prcNum);
|
||||
// }
|
||||
|
||||
List<BusProcessEvaluationHis> evaluationHisFilter = workFlowFeignClient.evaluationHisList(pid);
|
||||
List<BusProcessEvaluationHis> evaluationHis = new ArrayList<>();
|
||||
Map<String, List<BusProcessEvaluationHis>> listMap = new TreeMap<>();
|
||||
|
||||
// 按 相同数据分组
|
||||
listMap = evaluationHisFilter.stream().collect(
|
||||
Collectors.groupingBy(a -> Utils.format("{0}#{1}#{2}", a.getPId(),a.getTaskInfo(),a.getUserId())));
|
||||
|
||||
List<QualityEvaluation> evaluations = new ArrayList<>();
|
||||
if(!listMap.isEmpty()){
|
||||
SimpleDateFormat sdf=new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
|
||||
listMap.forEach((key, value) -> {
|
||||
if(!value.isEmpty()){
|
||||
evaluationHis.add(value.get(0));
|
||||
}
|
||||
});
|
||||
String finalBussId = bussId;
|
||||
Date date = new Date();
|
||||
evaluationHis.forEach(busProcessEvaluationHis -> {
|
||||
List<JSONObject> valueArr = JSONArray.parseArray(busProcessEvaluationHis.getMesg(),JSONObject.class);
|
||||
if(!valueArr.isEmpty()){
|
||||
valueArr.forEach(object -> {
|
||||
QualityEvaluation evaluation = new QualityEvaluation();
|
||||
evaluation.setId(UUIDUtils.randomUUID20());
|
||||
evaluation.setLawId(finalBussId);
|
||||
evaluation.setUserId(object.getString("userId"));
|
||||
evaluation.setScore(object.getString("score"));
|
||||
evaluation.setReason(object.getString("reason"));
|
||||
evaluation.setEvaluationIndex(object.getString("code"));
|
||||
evaluation.setProcessNode(object.getString("processNode"));
|
||||
evaluation.setEvaluationType(object.getString("indexType"));
|
||||
evaluation.setCreateTime(date);
|
||||
evaluation.setModifyTime(date);
|
||||
evaluations.add(evaluation);
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
qualityEvaluationService.saveBatch(evaluations);
|
||||
}
|
||||
}
|
||||
|
||||
return bussId;
|
||||
}
|
||||
|
||||
private void updateStandFileFieldData(Map<String,Object> addAttInfoMap,Map<String,Object> oldAttInfoMap){
|
||||
if(oldAttInfoMap.containsKey("CA")){
|
||||
String fileStr = (String) oldAttInfoMap.get("CA");
|
||||
if(StringUtils.isNotBlank(fileStr)){
|
||||
String newFileStr =addAttInfoMap.containsKey("CA")?(String)addAttInfoMap.get("CA"):null;
|
||||
if(StringUtils.isNotBlank(newFileStr)){
|
||||
String[] fileSplit = fileStr.split(",");
|
||||
String[] newFileSplit = newFileStr.split(",");
|
||||
Set<String> fileSet = new HashSet<>();
|
||||
for(String sData:fileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
for(String sData:newFileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
addAttInfoMap.put("CA",StringUtils.join(fileSet.toArray(), ","));
|
||||
}else{
|
||||
addAttInfoMap.put("CA",fileStr);
|
||||
}
|
||||
}
|
||||
}else if(oldAttInfoMap.containsKey("ZQYJG")){
|
||||
String fileStr = (String) oldAttInfoMap.get("ZQYJG");
|
||||
if(StringUtils.isNotBlank(fileStr)){
|
||||
String newFileStr =addAttInfoMap.containsKey("ZQYJG")?(String)addAttInfoMap.get("ZQYJG"):null;
|
||||
if(StringUtils.isNotBlank(newFileStr)){
|
||||
String[] fileSplit = fileStr.split(",");
|
||||
String[] newFileSplit = newFileStr.split(",");
|
||||
Set<String> fileSet = new HashSet<>();
|
||||
for(String sData:fileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
for(String sData:newFileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
addAttInfoMap.put("ZQYJG",StringUtils.join(fileSet.toArray(), ","));
|
||||
}else{
|
||||
addAttInfoMap.put("ZQYJG",fileStr);
|
||||
}
|
||||
}
|
||||
}else if(oldAttInfoMap.containsKey("BPG")){
|
||||
String fileStr = (String) oldAttInfoMap.get("BPG");
|
||||
if(StringUtils.isNotBlank(fileStr)){
|
||||
String newFileStr =addAttInfoMap.containsKey("BPG")?(String)addAttInfoMap.get("BPG"):null;
|
||||
if(StringUtils.isNotBlank(newFileStr)){
|
||||
String[] fileSplit = fileStr.split(",");
|
||||
String[] newFileSplit = newFileStr.split(",");
|
||||
Set<String> fileSet = new HashSet<>();
|
||||
for(String sData:fileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
for(String sData:newFileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
addAttInfoMap.put("BPG",StringUtils.join(fileSet.toArray(), ","));
|
||||
}else{
|
||||
addAttInfoMap.put("BPG",fileStr);
|
||||
}
|
||||
}
|
||||
}else if(oldAttInfoMap.containsKey("SSG")){
|
||||
String fileStr = (String) oldAttInfoMap.get("SSG");
|
||||
if(StringUtils.isNotBlank(fileStr)){
|
||||
String newFileStr =addAttInfoMap.containsKey("SSG")?(String)addAttInfoMap.get("SSG"):null;
|
||||
if(StringUtils.isNotBlank(newFileStr)){
|
||||
String[] fileSplit = fileStr.split(",");
|
||||
String[] newFileSplit = newFileStr.split(",");
|
||||
Set<String> fileSet = new HashSet<>();
|
||||
for(String sData:fileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
for(String sData:newFileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
addAttInfoMap.put("SSG",StringUtils.join(fileSet.toArray(), ","));
|
||||
}else{
|
||||
addAttInfoMap.put("SSG",fileStr);
|
||||
}
|
||||
}
|
||||
}else if(oldAttInfoMap.containsKey("ZBJBD")){
|
||||
String fileStr = (String) oldAttInfoMap.get("ZBJBD");
|
||||
if(StringUtils.isNotBlank(fileStr)){
|
||||
String newFileStr =addAttInfoMap.containsKey("ZBJBD")?(String)addAttInfoMap.get("ZBJBD"):null;
|
||||
if(StringUtils.isNotBlank(newFileStr)){
|
||||
String[] fileSplit = fileStr.split(",");
|
||||
String[] newFileSplit = newFileStr.split(",");
|
||||
Set<String> fileSet = new HashSet<>();
|
||||
for(String sData:fileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
for(String sData:newFileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
addAttInfoMap.put("ZBJBD",StringUtils.join(fileSet.toArray(), ","));
|
||||
}else{
|
||||
addAttInfoMap.put("ZBJBD",fileStr);
|
||||
}
|
||||
}
|
||||
}else if(oldAttInfoMap.containsKey("FBGBJBD")){
|
||||
String fileStr = (String) oldAttInfoMap.get("FBGBJBD");
|
||||
if(StringUtils.isNotBlank(fileStr)){
|
||||
String newFileStr =addAttInfoMap.containsKey("FBGBJBD")?(String)addAttInfoMap.get("FBGBJBD"):null;
|
||||
if(StringUtils.isNotBlank(newFileStr)){
|
||||
String[] fileSplit = fileStr.split(",");
|
||||
String[] newFileSplit = newFileStr.split(",");
|
||||
Set<String> fileSet = new HashSet<>();
|
||||
for(String sData:fileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
for(String sData:newFileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
addAttInfoMap.put("FBGBJBD",StringUtils.join(fileSet.toArray(), ","));
|
||||
}else{
|
||||
addAttInfoMap.put("FBGBJBD",fileStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理标准基础库字段
|
||||
* @param sarBussionessStand
|
||||
* @param field
|
||||
* @param value
|
||||
* @throws Exception
|
||||
*/
|
||||
public void createStandBaseField (SarBussionessStand sarBussionessStand,String field,Object value) throws Exception{
|
||||
String valueStr = "";
|
||||
if (value != null) {
|
||||
valueStr = String.valueOf(value);
|
||||
}
|
||||
switch (field) {
|
||||
case "id": sarBussionessStand.setId(valueStr); break;
|
||||
case "standSort": sarBussionessStand.setStandSort(valueStr); break;
|
||||
case "standNumber": sarBussionessStand.setStandNumber(valueStr); break;
|
||||
case "standYear": sarBussionessStand.setStandYear(valueStr); break;
|
||||
case "standCode": sarBussionessStand.setStandCode(valueStr); break;
|
||||
case "standName": sarBussionessStand.setStandName(valueStr); break;
|
||||
case "standEnName": sarBussionessStand.setStandEnName(valueStr); break;
|
||||
case "textStatusBuss": sarBussionessStand.setTextStatusBuss(valueStr); break;
|
||||
case "reviseStatus": sarBussionessStand.setReviseStatus(valueStr); break;
|
||||
case "standSn": sarBussionessStand.setStandSn(valueStr); break;
|
||||
case "issueTime":
|
||||
if (StringUtils.isNotBlank(valueStr)) {
|
||||
sarBussionessStand.setIssueTime(tTo(valueStr));
|
||||
}
|
||||
break;
|
||||
case "putTime":
|
||||
if (StringUtils.isNotBlank(valueStr)) {
|
||||
sarBussionessStand.setPutTime(tTo(valueStr));
|
||||
}
|
||||
break;
|
||||
case "prcNum": sarBussionessStand.setProcessNum(valueStr); break;
|
||||
case "menuId": sarBussionessStand.setMenuId(valueStr); break;
|
||||
case "fileWord":
|
||||
if (StringUtils.isNotBlank(sarBussionessStand.getFileIds()) && StringUtils.isNotBlank(valueStr)) {
|
||||
valueStr = sarBussionessStand.getFileIds() + "," + valueStr;
|
||||
}
|
||||
sarBussionessStand.setFileIds(valueStr); break;
|
||||
case "filePdf":
|
||||
if (StringUtils.isNotBlank(sarBussionessStand.getFileIds()) && StringUtils.isNotBlank(valueStr)) {
|
||||
valueStr = sarBussionessStand.getFileIds() + "," + valueStr;
|
||||
}
|
||||
sarBussionessStand.setFileIds(valueStr);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
private String tTo(String dateStr){
|
||||
return dateStr.contains("T") ? dateStr.split("T")[0] : dateStr;
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+885
@@ -0,0 +1,885 @@
|
||||
package com.adc.da.workFlow.service;
|
||||
|
||||
import com.adc.da.common.PropertyTypeEnum;
|
||||
import com.adc.da.common.SarConformStateEnum;
|
||||
import com.adc.da.common.SarStateColorEnum;
|
||||
import com.adc.da.common.SarTypeEnum;
|
||||
import com.adc.da.login.util.UserUtils;
|
||||
import com.adc.da.slrs.SarCompResAssess.entity.SarCompResAssess;
|
||||
import com.adc.da.slrs.SarCompResAssess.service.ISarCompResAssessService;
|
||||
import com.adc.da.slrs.SarCompStatusInfo.dao.SarCompStatusInfoDao;
|
||||
import com.adc.da.slrs.SarCompStatusInfo.entity.SarCompStatusInfo;
|
||||
import com.adc.da.slrs.SarFileSplitItems.entity.SarFileSplitItems;
|
||||
import com.adc.da.slrs.SarFileSplitItems.service.ISarFileSplitItemsService;
|
||||
import com.adc.da.slrs.SarStandItemVal.dao.SarStandItemValDao;
|
||||
import com.adc.da.slrs.SarStandItemVal.entity.SarStandItemVal;
|
||||
import com.adc.da.slrs.sarLawsAttrInfo.dao.SarLawsAttrInfoDao;
|
||||
import com.adc.da.slrs.sarLawsAttrInfo.service.ISarLawsAttrInfoService;
|
||||
import com.adc.da.slrs.sarLawsItemVal.dao.SarLawsItemValDao;
|
||||
import com.adc.da.slrs.sarLawsItems.dao.SarLawsItemsDao;
|
||||
import com.adc.da.slrs.sarLawsItems.entity.SarLawsItems;
|
||||
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
|
||||
import com.adc.da.slrs.sarLawsStandInfo.service.ISarLawsStandInfoService;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.service.ISarStandAttrInfoService;
|
||||
import com.adc.da.slrs.sarStandItems.dao.SarStandItemsDao;
|
||||
import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
|
||||
import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService;
|
||||
import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
|
||||
import com.adc.da.sys.constant.ValueStateEnum;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.adc.da.utils.util.InitStandAttrUtil;
|
||||
import com.adc.da.workFlow.dao.ActSarItemsEODao;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.json.JSONTokener;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
@Service("actSarItemsLawsEOService")
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class ActSarItemsLawsEOService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ActSarItemsLawsEOService.class);
|
||||
|
||||
@Autowired
|
||||
private ActSarItemsEODao actSarItemsEODao;
|
||||
|
||||
@Autowired
|
||||
private SarLawsItemsDao sarLawsItemsDao;
|
||||
|
||||
@Autowired
|
||||
private SysInfoEOService sysInfoEOService;
|
||||
|
||||
@Autowired
|
||||
private ISarLawsStandInfoService sarLawsStandInfoService;
|
||||
|
||||
@Autowired
|
||||
private ISarLawsAttrInfoService iSarLawsAttrInfoService;
|
||||
|
||||
@Autowired
|
||||
private ISarUpdLogService sarUpdLogEOService;
|
||||
|
||||
@Autowired
|
||||
private SarCompStatusInfoDao sarCompStatusInfoEODao;
|
||||
|
||||
@Autowired
|
||||
private ISarCompResAssessService sarCompResAssessEOService;
|
||||
|
||||
@Autowired
|
||||
private ISarFileSplitItemsService sarFileSplitItemsEOService;
|
||||
|
||||
@Autowired
|
||||
private SarLawsItemValDao sarLawsItemValDao;
|
||||
|
||||
|
||||
@Value("${elas.flag}")
|
||||
private boolean elasflag;
|
||||
|
||||
/***
|
||||
* @Description: 国内外标准流程入库"
|
||||
* @Author: yangxuenan
|
||||
* @Date: 2020/12/7 13:48
|
||||
* @Param: [standJson]
|
||||
* @Return: void
|
||||
*/
|
||||
public void processCreateLaws(String standJson) throws Exception{
|
||||
Map<String,Object> standMap = new HashMap();
|
||||
standMap = JSONObject.parseObject(standJson);
|
||||
if (standMap != null && !standMap.isEmpty()) {
|
||||
String prcNum = String.valueOf(standMap.get("prcNum"));
|
||||
String prcName = String.valueOf(standMap.get("prcName"));
|
||||
String standType = String.valueOf(standMap.get("standType"));
|
||||
// String isJudge = String.valueOf(standMap.get("ifIn")); //是否经过技术评估
|
||||
SarLawsStandInfo sarLawsStandInfo = new SarLawsStandInfo();
|
||||
// if(standMap.containsKey("standId")) {
|
||||
// if (standMap.get("standId") != null && !standMap.get("standId").toString().equals("")) {
|
||||
// String resId = standMap.get("standId").toString();
|
||||
// //此处说明是带入的形式
|
||||
// sarStandardsInfoEO.setId(resId);
|
||||
// SarCompResAssess assessInfoByResId = sarCompResAssessEOService.ssessInfoByResId(resId);
|
||||
// if (assessInfoByResId != null) {
|
||||
// assessInfoByResId.setProcessState("2");
|
||||
// sarCompResAssessEOService.updateByPrimaryKeySelective(assessInfoByResId);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
Map<String,Object> attInfoMap = new HashMap<>();
|
||||
for (Map.Entry<String,Object> entry : standMap.entrySet()) {
|
||||
String field = entry.getKey().toUpperCase();
|
||||
String result = "";
|
||||
if(StringUtils.isNotBlank(standMap.get(entry.getKey()).toString())){
|
||||
Object value= new JSONTokener(standMap.get(entry.getKey()).toString()).nextValue();
|
||||
if(value instanceof org.json.JSONArray && !",".contains(standMap.get(entry.getKey()).toString())){
|
||||
result = String.join(",",JSONObject.parseArray(value.toString(),String.class));
|
||||
}else {
|
||||
if(!value.equals("null")){
|
||||
result =standMap.get(entry.getKey()).toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (InitStandAttrUtil.queryFieldListLaws.contains(field)) {
|
||||
attInfoMap.put(field,result);
|
||||
} else {
|
||||
createStandBaseField(sarLawsStandInfo,entry.getKey(),result);
|
||||
}
|
||||
}
|
||||
String resData = JSON.toJSONString(attInfoMap, SerializerFeature.WriteMapNullValue);
|
||||
sarLawsStandInfo.setSarStandAttrEOStr(resData);
|
||||
// 根据标准号判断数据是否已存在
|
||||
String lawsNumber = "";
|
||||
if(StringUtils.isNotBlank(sarLawsStandInfo.getLawsNumber()) && !"null".equals(sarLawsStandInfo.getLawsNumber())){
|
||||
lawsNumber = sarLawsStandInfo.getLawsNumber();
|
||||
}
|
||||
List<SarLawsStandInfo> lawsList = sarLawsStandInfoService.selectStandardsByStandNumber(lawsNumber);
|
||||
//此处判断是否是带入的标准
|
||||
if(StringUtils.isNotBlank(sarLawsStandInfo.getId())) {
|
||||
SarLawsStandInfo query = new SarLawsStandInfo();
|
||||
query.setId(sarLawsStandInfo.getId());
|
||||
sarLawsStandInfoService.attrInfoDetails(query);
|
||||
Map<String, Object> attrInfoMap = query.getAttrInfoMap();
|
||||
if(attInfoMap!=null && !attInfoMap.isEmpty()){
|
||||
updateStandFileFieldData(attInfoMap,attrInfoMap);
|
||||
resData = JSON.toJSONString(attInfoMap, SerializerFeature.WriteMapNullValue);
|
||||
sarLawsStandInfo.setSarStandAttrEOStr(resData);
|
||||
}
|
||||
// 查询原相关流程
|
||||
String relatePro = iSarLawsAttrInfoService.selectFieldValByLawsId("XGLC",sarLawsStandInfo.getId());
|
||||
if (StringUtils.isNotBlank(relatePro)) {
|
||||
String[] processSplit = relatePro.split(",");
|
||||
Set<String> processSet = new HashSet<>();
|
||||
for(String sData:processSplit){
|
||||
processSet.add(sData);
|
||||
}
|
||||
processSet.add(prcNum);
|
||||
relatePro = StringUtils.join(processSet.toArray(), ",");
|
||||
} else {
|
||||
relatePro = prcNum;
|
||||
}
|
||||
// 编辑标准
|
||||
sarLawsStandInfoService.updateSarLawsStandInfo(sarLawsStandInfo);
|
||||
// 编辑相关流程
|
||||
iSarLawsAttrInfoService.updateLawsInfo(sarLawsStandInfo.getId(),"XGLC",relatePro);
|
||||
String content = "新增一条相关流程:" +prcName+" "+prcNum;
|
||||
sarUpdLogEOService.createBaseLog(sarLawsStandInfo.getId(),standType+"_STAND",content);
|
||||
}else if (lawsList != null && !lawsList.isEmpty()) {//Id不存在,但是标准号存在的情况
|
||||
String standId = lawsList.get(0).getId();
|
||||
SarLawsStandInfo query = new SarLawsStandInfo();
|
||||
query.setId(standId);
|
||||
sarLawsStandInfoService.attrInfoDetails(query);
|
||||
Map<String, Object> attrInfoMap = query.getAttrInfoMap();
|
||||
if(attInfoMap!=null && !attInfoMap.isEmpty()){
|
||||
updateStandFileFieldData(attInfoMap,attrInfoMap);
|
||||
resData = JSON.toJSONString(attInfoMap, SerializerFeature.WriteMapNullValue);
|
||||
sarLawsStandInfo.setSarStandAttrEOStr(resData);
|
||||
}
|
||||
// 查询原相关流程
|
||||
String relatePro = iSarLawsAttrInfoService.selectFieldValByLawsId("XGLC",standId);
|
||||
if (StringUtils.isNotBlank(relatePro)) {
|
||||
String[] processSplit = relatePro.split(",");
|
||||
Set<String> processSet = new HashSet<>();
|
||||
for(String sData:processSplit){
|
||||
processSet.add(sData);
|
||||
}
|
||||
processSet.add(prcNum);
|
||||
relatePro = StringUtils.join(processSet.toArray(), ",");
|
||||
} else {
|
||||
relatePro = prcNum;
|
||||
}
|
||||
// 编辑标准
|
||||
sarLawsStandInfo.setId(standId);
|
||||
sarLawsStandInfoService.updateSarLawsStandInfo(sarLawsStandInfo);
|
||||
// 编辑相关流程
|
||||
iSarLawsAttrInfoService.updateLawsInfo(standId,"XGLC",relatePro);
|
||||
String content = "新增一条相关流程:" +prcName+" "+prcNum;
|
||||
sarUpdLogEOService.createBaseLog(standId,standType+"_STAND",content);
|
||||
} else {//标准号、ID都不存在的情况
|
||||
// 新增方法
|
||||
sarLawsStandInfoService.createSarStandardsInfo(sarLawsStandInfo);
|
||||
// 编辑相关流程
|
||||
iSarLawsAttrInfoService.updateLawsInfo(sarLawsStandInfo.getId(),"XGLC",prcNum);
|
||||
}
|
||||
List<SarStandItems> allItems = new ArrayList<>();
|
||||
//开始处理条款数据,从去重后的结果中直接处理即可
|
||||
// if(itemData!=null && !itemData.isEmpty()){
|
||||
// // allItems =
|
||||
// saveStandItemsData(itemData, sarStandardsInfoEO);
|
||||
// }
|
||||
//技术评估结果入库 重构技术评估结果入库内容
|
||||
// if ("0".equals(isJudge)) {
|
||||
// saveCompStatusInfo(sarStandardsInfoEO,breakVal,allItems,prcNum);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
private String getFieldsValue(Map<String,Object> standMap, String key){
|
||||
String str = "";
|
||||
Object json= new JSONTokener(standMap.get(key).toString()).nextValue();
|
||||
if(json instanceof org.json.JSONArray){
|
||||
str = String.join(",",JSONObject.parseArray(standMap.get(key).toString(),String.class));
|
||||
}else {
|
||||
if(!json.equals("null")){
|
||||
str = standMap.get(key).toString();
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
/***
|
||||
* 标准法规入库流程中技术评估结果入库归档操作
|
||||
* @param sarStandardsInfoEO
|
||||
* @param allItems
|
||||
* @param prcNum
|
||||
*/
|
||||
public void saveCompStatusInfo (SarStandardsInfo sarStandardsInfoEO,Object taskBreak,List<SarStandItems> allItems,String prcNum) throws Exception {
|
||||
//首先将入库的标准条款通过之前的拆分库ID转换成入库后的条款的对应关系
|
||||
Map<String,String> itemConvertDataMap = new HashMap<>();
|
||||
if(allItems!=null && !allItems.isEmpty()){
|
||||
for(SarStandItems itemsEO:allItems){
|
||||
itemConvertDataMap.put(itemsEO.getOldId(),itemsEO.getId());
|
||||
}
|
||||
}
|
||||
//获取本次入库的标准ID和类型
|
||||
String standId = sarStandardsInfoEO.getId();//标准ID
|
||||
//主要时区分国内、国外
|
||||
String sarType = sarStandardsInfoEO.getStandType()+"_STAND";
|
||||
//判断填写表单是哦服存在
|
||||
if(taskBreak!=null){
|
||||
List<SarCompStatusInfo> compStatusInfoEOS = new ArrayList<>();
|
||||
//解析表单数据
|
||||
String compResultStr = String.valueOf(taskBreak);
|
||||
List<String> jsonArray = JSONArray.parseArray(compResultStr, String.class);
|
||||
//判断数据是否正常
|
||||
if (jsonArray != null && !jsonArray.isEmpty()) {
|
||||
//当入库时只有标准时 itemList是空的
|
||||
for (String jsonStr : jsonArray) {
|
||||
if (StringUtils.isNotBlank(jsonStr)) {
|
||||
Map<String, Object> jsonMap = JSONObject.parseObject(jsonStr);
|
||||
if(jsonMap.containsKey("itemsList")){//开始读取条款集合数据处理结果
|
||||
String itemsList = jsonMap.get("itemsList").toString();
|
||||
//获取条款级别的评估集合列表
|
||||
List<String> itemCompStrList = JSONArray.parseArray(itemsList, String.class);
|
||||
if(itemCompStrList!=null && !itemCompStrList.isEmpty()){
|
||||
for(String itemCompDataStr : itemCompStrList){
|
||||
//解析每个人填写的具体评估结果
|
||||
Map<String, Object> itemDataMap = JSONObject.parseObject(itemCompDataStr);
|
||||
if(itemDataMap.containsKey("pgForm")){
|
||||
String pgResult = itemDataMap.get("pgForm").toString();
|
||||
//新旧条款ID转换
|
||||
String oldItemId = itemDataMap.containsKey("id")?itemDataMap.get("id").toString():null;
|
||||
//获取到评估表单
|
||||
SarCompStatusInfo sarCompStatusInfoEO = JSONObject.parseObject(pgResult,SarCompStatusInfo.class);
|
||||
sarCompStatusInfoEO.setId(UUIDUtils.randomUUID(32));
|
||||
sarCompStatusInfoEO.setSarType(sarType);
|
||||
sarCompStatusInfoEO.setSarId(standId);
|
||||
//评估结果
|
||||
sarCompStatusInfoEO.setSarState(itemDataMap.containsKey("jspg")?itemDataMap.get("jspg").toString():null);
|
||||
//新旧条款号转换存储
|
||||
if(StringUtils.isNotBlank(oldItemId)){
|
||||
sarCompStatusInfoEO.setSarItemId(itemConvertDataMap.get(oldItemId));
|
||||
sarCompStatusInfoEO.setSarItemState(sarCompStatusInfoEO.getSarState());
|
||||
}
|
||||
sarCompStatusInfoEO.setPrcNum(prcNum);
|
||||
sarCompStatusInfoEO.setColor(convertColorByState(sarCompStatusInfoEO.getSarState()));//此处需要处理
|
||||
sarCompStatusInfoEO.setPrcState(null);//技术评估不需要状态
|
||||
sarCompStatusInfoEO.setCreationTime(new Date());
|
||||
//评估人处理
|
||||
sarCompStatusInfoEO.setCompPerson(itemDataMap.containsKey("foFillUser")?itemDataMap.get("foFillUser").toString():null);
|
||||
sarCompStatusInfoEO.setCompTime(new Date());
|
||||
compStatusInfoEOS.add(sarCompStatusInfoEO);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(jsonMap.containsKey("pgForm")){
|
||||
String pgResult = jsonMap.get("pgForm").toString();
|
||||
//获取到评估表单
|
||||
SarCompStatusInfo sarCompStatusInfoEO = JSONObject.parseObject(pgResult,SarCompStatusInfo.class);
|
||||
sarCompStatusInfoEO.setId(UUIDUtils.randomUUID(32));
|
||||
sarCompStatusInfoEO.setSarType(sarType);
|
||||
sarCompStatusInfoEO.setSarId(standId);
|
||||
sarCompStatusInfoEO.setSarState(jsonMap.containsKey("jspg")?jsonMap.get("jspg").toString():null);
|
||||
sarCompStatusInfoEO.setPrcNum(prcNum);
|
||||
sarCompStatusInfoEO.setColor(convertColorByState(sarCompStatusInfoEO.getSarState()));//此处需要处理
|
||||
sarCompStatusInfoEO.setPrcState(null);//技术评估不需要状态
|
||||
sarCompStatusInfoEO.setCreationTime(new Date());
|
||||
sarCompStatusInfoEO.setCompPerson(jsonMap.containsKey("foFillUser")?jsonMap.get("foFillUser").toString():null);
|
||||
sarCompStatusInfoEO.setCompTime(new Date());
|
||||
compStatusInfoEOS.add(sarCompStatusInfoEO);
|
||||
}
|
||||
}
|
||||
}else{//只有标准的情况下
|
||||
//获取
|
||||
if(jsonMap.containsKey("pgForm")){
|
||||
String pgResult = jsonMap.get("pgForm").toString();
|
||||
//获取到评估表单
|
||||
SarCompStatusInfo sarCompStatusInfoEO = JSONObject.parseObject(pgResult,SarCompStatusInfo.class);
|
||||
sarCompStatusInfoEO.setId(UUIDUtils.randomUUID(32));
|
||||
sarCompStatusInfoEO.setSarType(sarType);
|
||||
sarCompStatusInfoEO.setSarId(standId);
|
||||
sarCompStatusInfoEO.setSarState(jsonMap.containsKey("jspg")?jsonMap.get("jspg").toString():null);
|
||||
sarCompStatusInfoEO.setPrcNum(prcNum);
|
||||
sarCompStatusInfoEO.setColor(convertColorByState(sarCompStatusInfoEO.getSarState()));//此处需要处理
|
||||
sarCompStatusInfoEO.setPrcState(null);//技术评估不需要状态
|
||||
sarCompStatusInfoEO.setCreationTime(new Date());
|
||||
sarCompStatusInfoEO.setCompPerson(jsonMap.containsKey("foFillUser")?jsonMap.get("foFillUser").toString():null);
|
||||
sarCompStatusInfoEO.setCompTime(new Date());
|
||||
compStatusInfoEOS.add(sarCompStatusInfoEO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//最后开始将评估结果入库同时将评估结果汇总后给出标准的评估结果
|
||||
saveJSPGResultDataList(compStatusInfoEOS);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库技术评估结果
|
||||
* @param compResultData
|
||||
*/
|
||||
private void saveJSPGResultDataList(List<SarCompStatusInfo> compResultData) throws Exception {
|
||||
if(compResultData!=null && !compResultData.isEmpty()){
|
||||
//1、将数据存储到记录表中
|
||||
//2、汇总本次评估的结果 更新所有清单中的状态 此处有坑,如果标准评估后又在新的清单中添加的时候状态可能就是空的,
|
||||
// 此时就会显示空,所以需要更换实现方法
|
||||
//需要中间需要增加一层技术评估的结果,但是代价太大,2021年3月21日 无法在今天修改完,需要于2021年3月22日 整体想下这块,
|
||||
// 目前的实现思路时有问题的
|
||||
//正确逻辑时: 现将当前的评估结果记录到所有的技术评估结果中,然后汇总本次的评估结果内容到当前标准的技术评估汇总表中
|
||||
//汇总后形成最新的评估内容,此时有2种做法 1、不记录上一次的状态 直接更新 2、记录上一次状态,新增一条整体评估结果记录
|
||||
//在清单查询的时候 查询当前标准的最新一次评估结果,将评估结果不再清单中直接显示,而是在汇总表中的信息进行修改,这样能够达到
|
||||
//单一标准不论在任何时间添加到清单的时候都可以查看,同时在标准的技术评估状态的时候也可以直接调用即可。不用每次评估完都需要更新
|
||||
//技术清单的逻辑
|
||||
/**
|
||||
* 整体表关系如下:
|
||||
* 基础库: 国内标准库 海外标准库 政策库
|
||||
* 技术评估汇总表 资源的汇总结果记录
|
||||
* 详细评估内容记录表 资源本身每次评估的详细记录
|
||||
* 清单: 根据标准号到资源的汇总记录表中查询汇总结果 直接展现即可
|
||||
* 目前缺少的就是资源的汇总结果记录缺失,导致查询的时候可能汇总结果会有问题
|
||||
*/
|
||||
//开始汇总数据以及状态变更
|
||||
//首先先检查当前标准在汇总表中是否存在
|
||||
Map<String,Map<String,Integer>> assessMap = new HashMap<>();
|
||||
Map<String, SarCompResAssess> compResAssessEOMap = new HashMap<>();
|
||||
for(SarCompStatusInfo data : compResultData){
|
||||
//评估结果转换
|
||||
String state = sysInfoEOService.changeCompStatus(data.getSarState());
|
||||
String itemSate = sysInfoEOService.changeCompStatus(data.getSarItemState());
|
||||
data.setSarState(state);
|
||||
data.setSarItemState(itemSate);
|
||||
if(StringUtils.equals("INLAND",data.getSarType())){
|
||||
data.setSarType(SarTypeEnum.INLAND_STAND.getValue());
|
||||
}else if(StringUtils.equals("FOREIGN",data.getSarType())){
|
||||
data.setSarType(SarTypeEnum.FOREIGN_STAND.getValue());
|
||||
}
|
||||
SarCompResAssess info =null;
|
||||
if(assessMap.containsKey(data.getSarId())){
|
||||
info = compResAssessEOMap.get(data.getSarId());
|
||||
}else{
|
||||
info= sarCompResAssessEOService.getAssessInfoByResId(data.getSarId());
|
||||
if(info==null){
|
||||
info = new SarCompResAssess();
|
||||
info.setId(UUIDUtils.randomUUID(32));
|
||||
info.setAssessTime(new Date());
|
||||
info.setCreatedTime(new Date());
|
||||
info.setModifyTime(new Date());
|
||||
info.setProcessNum(data.getPrcNum());
|
||||
info.setResId(data.getSarId());
|
||||
info.setResType(data.getSarType());
|
||||
sarCompResAssessEOService.save(info);
|
||||
}
|
||||
compResAssessEOMap.put(data.getSarId(),info);
|
||||
}
|
||||
//汇总结果
|
||||
if(!assessMap.containsKey(info.getResId())){
|
||||
Map<String,Integer> accessData = new HashMap<>();
|
||||
accessData.put(state,1);
|
||||
assessMap.put(info.getResId(),accessData);
|
||||
}else{
|
||||
Map<String, Integer> accessData = assessMap.get(info.getResId());
|
||||
if(accessData.containsKey(state)){
|
||||
Integer stateNum = accessData.get(state);
|
||||
accessData.put(state,stateNum+1);
|
||||
assessMap.put(info.getResId(),accessData);
|
||||
}else{
|
||||
accessData.put(state,1);
|
||||
assessMap.put(info.getResId(),accessData);
|
||||
}
|
||||
}
|
||||
//入库操作
|
||||
sarCompStatusInfoEODao.insert(data);
|
||||
}
|
||||
//开始遍历状态集合
|
||||
for (Map.Entry entry : compResAssessEOMap.entrySet()) {
|
||||
String compId = entry.getKey().toString();//汇总ID
|
||||
SarCompResAssess compResAssessEO = (SarCompResAssess) entry.getValue();
|
||||
Map<String, Integer> stringIntegerMap = assessMap.get(compId);
|
||||
if(stringIntegerMap!=null){
|
||||
if(stringIntegerMap.containsKey(SarConformStateEnum.UNFIT.getValue()+"")){//只要包含不符合的就是不符合
|
||||
compResAssessEO.setAssessResult(SarConformStateEnum.UNFIT.getValue());
|
||||
compResAssessEO.setAssessColor(SarStateColorEnum.YELLOW.getValue());
|
||||
}else if(stringIntegerMap.size() ==1){//只有一种情况的
|
||||
if(stringIntegerMap.containsKey(SarConformStateEnum.FIT.getValue()+"")){
|
||||
compResAssessEO.setAssessResult(SarConformStateEnum.FIT.getValue());
|
||||
compResAssessEO.setAssessColor(SarStateColorEnum.GREEN.getValue());
|
||||
}else if(stringIntegerMap.containsKey(SarConformStateEnum.CHECK.getValue()+"")){
|
||||
compResAssessEO.setAssessResult(SarConformStateEnum.CHECK.getValue());
|
||||
compResAssessEO.setAssessColor(SarStateColorEnum.YELLOW.getValue());
|
||||
}else if(stringIntegerMap.containsKey(SarConformStateEnum.NOT_INVOLVE.getValue()+"")){
|
||||
compResAssessEO.setAssessResult(SarConformStateEnum.NOT_INVOLVE.getValue());
|
||||
compResAssessEO.setAssessColor(SarStateColorEnum.NA.getValue());
|
||||
}
|
||||
}else if(stringIntegerMap.containsKey(SarConformStateEnum.CHECK.getValue()+"")){
|
||||
compResAssessEO.setAssessResult(SarConformStateEnum.CHECK.getValue());
|
||||
compResAssessEO.setAssessColor(SarStateColorEnum.YELLOW.getValue());
|
||||
}else if(stringIntegerMap.containsKey(SarConformStateEnum.NOT_INVOLVE.getValue()+"")){
|
||||
compResAssessEO.setAssessResult(SarConformStateEnum.NOT_INVOLVE.getValue());
|
||||
compResAssessEO.setAssessColor(SarStateColorEnum.NA.getValue());
|
||||
}else{
|
||||
compResAssessEO.setAssessResult(SarConformStateEnum.FIT.getValue());
|
||||
compResAssessEO.setAssessColor(SarStateColorEnum.GREEN.getValue());
|
||||
}
|
||||
// else {//不包含不符合的并且单一情况并不存在的也就是说是 部分符合或者待确认的
|
||||
// if(stringIntegerMap.containsKey(SarConformStateEnum.FIT.getValue()+"")){
|
||||
// compResAssessEO.setAssessResult(SarConformStateEnum.PART_FIT.getValue());
|
||||
// compResAssessEO.setAssessColor(SarStateColorEnum.YELLOW.getValue());
|
||||
// }else{
|
||||
// compResAssessEO.setAssessResult(SarConformStateEnum.CHECK.getValue());
|
||||
// compResAssessEO.setAssessColor(SarStateColorEnum.NA.getValue());
|
||||
// }
|
||||
// }
|
||||
}
|
||||
compResAssessEO.setProcessState("2");
|
||||
compResAssessEO.setModifyTime(new Date());
|
||||
if(StringUtils.equals("INLAND",compResAssessEO.getResType())){
|
||||
compResAssessEO.setResType(SarTypeEnum.INLAND_STAND.getValue());
|
||||
}else if(StringUtils.equals("FOREIGN",compResAssessEO.getResType())){
|
||||
compResAssessEO.setResType(SarTypeEnum.FOREIGN_STAND.getValue());
|
||||
}
|
||||
//更新汇总后的结果
|
||||
sarCompResAssessEOService.updateById(compResAssessEO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String convertColorByState(String stateStr){
|
||||
String colorStr = "";
|
||||
switch (stateStr){
|
||||
case "1":
|
||||
colorStr = SarStateColorEnum.GREEN.getValue();
|
||||
break;
|
||||
case "2":
|
||||
colorStr = SarStateColorEnum.YELLOW.getValue();
|
||||
break;
|
||||
case "3":
|
||||
colorStr = SarStateColorEnum.YELLOW.getValue();
|
||||
case "4":
|
||||
colorStr = SarStateColorEnum.NA.getValue();
|
||||
}
|
||||
return colorStr;
|
||||
}
|
||||
|
||||
|
||||
public String changeStatus (String textStatus) {
|
||||
String status = "";
|
||||
switch (textStatus) {
|
||||
case "草稿": status="CA";break;
|
||||
case "征求意见稿": status="ZQYJG";break;
|
||||
case "报批稿": status="BPG";break;
|
||||
case "送审稿": status="SSG";break;
|
||||
case "发布稿(必读)": status="FBGBJBD";break;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理条款信息转换
|
||||
* @param itemsEO
|
||||
* @param field
|
||||
* @param value
|
||||
* @throws Exception
|
||||
*/
|
||||
public void createItemsBaseField (SarLawsItems itemsEO,String field,Object value) throws Exception{
|
||||
String valueStr = "";
|
||||
if (value != null) {
|
||||
valueStr = String.valueOf(value);
|
||||
}
|
||||
switch (field) {
|
||||
case "itemsName": itemsEO.setItemsName(valueStr); break;
|
||||
case "FO":
|
||||
List<String> jsonArray = JSONArray.parseArray(valueStr,String.class);
|
||||
String fo = "";
|
||||
if (jsonArray != null && !jsonArray.isEmpty()) {
|
||||
for (String json : jsonArray) {
|
||||
fo += json + ",";
|
||||
}
|
||||
fo = fo.substring(0,fo.length()-1);
|
||||
itemsEO.setFoUser(fo);
|
||||
}
|
||||
break;
|
||||
case "itemsNum": itemsEO.setItemsNum(valueStr); break;
|
||||
case "termsConditions": itemsEO.setTermsConditions(valueStr); break;
|
||||
case "svpps": itemsEO.setSvpps(valueStr); break;
|
||||
case "role": itemsEO.setDutyEngineer(valueStr); break;
|
||||
case "parts": itemsEO.setResponsibleUnit(valueStr); break;
|
||||
case "FORoleId": itemsEO.setFo(valueStr); break;
|
||||
case "id": itemsEO.setOldId(valueStr); break;
|
||||
case "jspg": itemsEO.setJspg(valueStr); break;
|
||||
case "pgForm":
|
||||
if (StringUtils.isNotBlank(valueStr)) {
|
||||
SarCompStatusInfo list = JSONObject.parseObject(valueStr,SarCompStatusInfo.class);
|
||||
itemsEO.setPgForm(list);
|
||||
};
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理保存标准条款信息数据
|
||||
* @return
|
||||
*/
|
||||
// private List<SarLawsItems> saveStandItemsData(List<Map<String,Object>> itemDataList,SarLawsStandInfo sarStandardsInfoEO) throws Exception {
|
||||
// String standId = sarStandardsInfoEO.getId();
|
||||
// String fileType = changeStatus(sarStandardsInfoEO.getLawsTextState());
|
||||
// List<SarLawsItems> itemsEOList = new ArrayList<>();//添加的条款信息
|
||||
// List<SarLawsItems> upItemsEOList = new ArrayList<>();//更新的条款数据
|
||||
// List<String> delValItemIds = new ArrayList<>();//需要删除重新添加的条款数据集合
|
||||
// List<SarStandItemVal> itemValEOS = new ArrayList<>();//批量更新进去的条款参数集合
|
||||
// List<SarFileSplitItems> UpSarFileSplitItemsList = new ArrayList<>();
|
||||
// for(Map<String,Object> itemData:itemDataList){
|
||||
// String itemStr = itemData.get("itemStr").toString();//条款的具体内容
|
||||
// Map<String,String> itemAttrInfo = (Map<String, String>) itemData.get("itemAttrInfo");//条款的属性字段
|
||||
// Map<String,Object> itemMap = new HashMap();
|
||||
// //此处需要查询拆分库数据,将之前的拆分数据带入到当前标准中同时检查当前分解单中是否已经包含相关的条款信息,
|
||||
// // 如果是则更新,如果没有则添加
|
||||
// itemMap = JSONObject.parseObject(itemStr);;
|
||||
// if (itemMap != null && !itemMap.isEmpty()) {
|
||||
// if(itemMap.containsKey("resId")){
|
||||
// //存在
|
||||
// String splitItemId = String.valueOf(itemMap.get("resId"));
|
||||
// if(StringUtils.isNotBlank(splitItemId)){
|
||||
// SarFileSplitItems splitItemsEO = sarFileSplitItemsEOService.getById(splitItemId);
|
||||
// if(splitItemsEO!=null){
|
||||
// //拆分库有数据,检查当前的表单中是否有数据,如果有则直接获取后更新即可
|
||||
// SarLawsItems nowItemEO = sarLawsItemsDao.selectById(splitItemId);
|
||||
// if(nowItemEO!=null){
|
||||
// //更新数据
|
||||
// nowItemEO.setItemsNum(splitItemsEO.getItemsNum());
|
||||
// nowItemEO.setItemsName(splitItemsEO.getItemsName());
|
||||
// nowItemEO.setApplyArctic(splitItemsEO.getApplyArctic());
|
||||
// nowItemEO.setLawsId(standId);
|
||||
// nowItemEO.setTermsConditions(splitItemsEO.getItermsConditions());
|
||||
// nowItemEO.setParts(splitItemsEO.getSvpps());
|
||||
// nowItemEO.setCreationUser(UserUtils.getUserId());
|
||||
// nowItemEO.setValidFlag(0);
|
||||
// if(null!=fileType){
|
||||
// nowItemEO.setFileType(fileType);
|
||||
// }
|
||||
// nowItemEO.setRemarks(splitItemsEO.getRemarks());
|
||||
// nowItemEO.setModifyTime(new Date());
|
||||
//
|
||||
// nowItemEO.setClaimType(splitItemsEO.getClaimType());
|
||||
// nowItemEO.setBusStandCover(splitItemsEO.getBusStandCover());
|
||||
// nowItemEO.setResponsibleUnit(itemAttrInfo.get("ZRBM"));
|
||||
// nowItemEO.setFo(itemAttrInfo.get("FO"));
|
||||
// nowItemEO.setDutyEngineer(itemAttrInfo.get("XMPGJS"));
|
||||
// nowItemEO.setSvpps(itemAttrInfo.get("SVPPS"));
|
||||
// upItemsEOList.add(nowItemEO);
|
||||
// }else{
|
||||
// SarLawsItems itemsEO = new SarLawsItems();
|
||||
// itemsEO.setId(splitItemId);
|
||||
// itemsEO.setCreationTime(new Date());
|
||||
// itemsEO.setModifyTime(new Date());
|
||||
// itemsEO.setValidFlag(0);
|
||||
// itemsEO.setLawsId(standId);
|
||||
// itemsEO.setFileType(fileType);
|
||||
// for (Map.Entry<String,Object> entry : itemMap.entrySet()) {
|
||||
// String field = entry.getKey();
|
||||
// Object value = entry.getValue();
|
||||
// createItemsBaseField(itemsEO,field,value);
|
||||
// }
|
||||
// itemsEO.setItemsNum(splitItemsEO.getItemsNum());
|
||||
// itemsEO.setItemsName(splitItemsEO.getItemsName());
|
||||
// itemsEO.setApplyArctic(splitItemsEO.getApplyArctic());
|
||||
// itemsEO.setTermsConditions(splitItemsEO.getItermsConditions());
|
||||
// itemsEO.setParts(splitItemsEO.getSvpps());
|
||||
// itemsEO.setCreationUser(UserUtils.getUserId());
|
||||
// itemsEO.setRemarks(splitItemsEO.getRemarks());
|
||||
// itemsEO.setClaimType(splitItemsEO.getClaimType());
|
||||
// itemsEO.setBusStandCover(splitItemsEO.getBusStandCover());
|
||||
// itemsEO.setResponsibleUnit(itemAttrInfo.get("ZRBM"));
|
||||
// itemsEO.setFo(itemAttrInfo.get("FO"));
|
||||
// itemsEO.setDutyEngineer(itemAttrInfo.get("XMPGJS"));
|
||||
// itemsEO.setSvpps(itemAttrInfo.get("SVPPS"));
|
||||
// //开始处理后续逻辑
|
||||
// itemsEOList.add(itemsEO);
|
||||
// }
|
||||
// //apply数据
|
||||
// if(StringUtils.isNotEmpty(splitItemsEO.getApplyArctic())){
|
||||
// delValItemIds.add(splitItemsEO.getId());
|
||||
// String[] applyarr = splitItemsEO.getApplyArctic().trim().split(",");
|
||||
// for(String applya:applyarr){
|
||||
// SarStandItemVal sarStandItemValEO = new SarStandItemVal();
|
||||
// sarStandItemValEO.setValidFlag(ValueStateEnum.VALUE_TRUE.getValue());
|
||||
// sarStandItemValEO.setCreationTime(new Date());
|
||||
// sarStandItemValEO.setModifyTime(new Date());
|
||||
// sarStandItemValEO.setItemId(splitItemsEO.getId());
|
||||
// sarStandItemValEO.setId(UUIDUtils.randomUUID20());
|
||||
// sarStandItemValEO.setPropertyType(PropertyTypeEnum.APPLY_ARCTIC.getValue());
|
||||
// sarStandItemValEO.setPropertyVal(applya);
|
||||
// itemValEOS.add(sarStandItemValEO);
|
||||
// }
|
||||
// }
|
||||
// //TODO 开始处理拆分库数据
|
||||
// splitItemsEO.setModifyTime(new Date());
|
||||
// splitItemsEO.setResponsibleUnit(itemAttrInfo.get("ZRBM"));
|
||||
// splitItemsEO.setFo(itemAttrInfo.get("FO"));
|
||||
// splitItemsEO.setDutyEngineer(itemAttrInfo.get("XMPGJS"));
|
||||
// splitItemsEO.setSvpps(itemAttrInfo.get("SVPPS"));
|
||||
// UpSarFileSplitItemsList.add(splitItemsEO);
|
||||
// }else{
|
||||
// logger.error("拆分库中找不到对应数据了,数据不见了 /(ㄒoㄒ)/~~"+itemStr);
|
||||
// }
|
||||
// }else{
|
||||
// logger.error("流程中携带的拆分库ID不见了 Σ(っ °Д °;)っ "+itemStr);
|
||||
// }
|
||||
// }else{
|
||||
// //不存在 说明数据出现问题了
|
||||
// logger.error("流程中携带的拆分库ID,数据不见了 /(ㄒoㄒ)/~~"+itemStr);
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// //更新拆分库数据
|
||||
// if(UpSarFileSplitItemsList!=null && !UpSarFileSplitItemsList.isEmpty()){
|
||||
// for(SarFileSplitItems items : UpSarFileSplitItemsList){
|
||||
// sarFileSplitItemsEOService.updateById(items);
|
||||
// }
|
||||
// }
|
||||
// //执行批量新增操作
|
||||
// if(itemsEOList != null && !itemsEOList.isEmpty()){
|
||||
// sarLawsItemsDao.insertForeach(itemsEOList);
|
||||
//
|
||||
// }
|
||||
// //执行批量修改操作
|
||||
// if(upItemsEOList != null && !upItemsEOList.isEmpty()){
|
||||
// sarLawsItemsDao.updateForeach(upItemsEOList);
|
||||
//
|
||||
// }
|
||||
// //执行适用车型批量操作
|
||||
// if(itemValEOS != null && !itemValEOS.isEmpty()){
|
||||
// sarLawsItemValDao.deleteByItemsIds(delValItemIds);
|
||||
// sarLawsItemValDao.insertForeach(itemValEOS);
|
||||
// }
|
||||
// return itemsEOList;
|
||||
// }
|
||||
|
||||
private void updateStandFileFieldData(Map<String,Object> addAttInfoMap,Map<String,Object> oldAttInfoMap){
|
||||
if(oldAttInfoMap.containsKey("CA")){
|
||||
String fileStr = (String) oldAttInfoMap.get("CA");
|
||||
if(StringUtils.isNotBlank(fileStr)){
|
||||
String newFileStr =addAttInfoMap.containsKey("CA")?(String)addAttInfoMap.get("CA"):null;
|
||||
if(StringUtils.isNotBlank(newFileStr)){
|
||||
String[] fileSplit = fileStr.split(",");
|
||||
String[] newFileSplit = newFileStr.split(",");
|
||||
Set<String> fileSet = new HashSet<>();
|
||||
for(String sData:fileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
for(String sData:newFileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
addAttInfoMap.put("CA",StringUtils.join(fileSet.toArray(), ","));
|
||||
}else{
|
||||
addAttInfoMap.put("CA",fileStr);
|
||||
}
|
||||
}
|
||||
}else if(oldAttInfoMap.containsKey("ZQYJG")){
|
||||
String fileStr = (String) oldAttInfoMap.get("ZQYJG");
|
||||
if(StringUtils.isNotBlank(fileStr)){
|
||||
String newFileStr =addAttInfoMap.containsKey("ZQYJG")?(String)addAttInfoMap.get("ZQYJG"):null;
|
||||
if(StringUtils.isNotBlank(newFileStr)){
|
||||
String[] fileSplit = fileStr.split(",");
|
||||
String[] newFileSplit = newFileStr.split(",");
|
||||
Set<String> fileSet = new HashSet<>();
|
||||
for(String sData:fileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
for(String sData:newFileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
addAttInfoMap.put("ZQYJG",StringUtils.join(fileSet.toArray(), ","));
|
||||
}else{
|
||||
addAttInfoMap.put("ZQYJG",fileStr);
|
||||
}
|
||||
}
|
||||
}else if(oldAttInfoMap.containsKey("BPG")){
|
||||
String fileStr = (String) oldAttInfoMap.get("BPG");
|
||||
if(StringUtils.isNotBlank(fileStr)){
|
||||
String newFileStr =addAttInfoMap.containsKey("BPG")?(String)addAttInfoMap.get("BPG"):null;
|
||||
if(StringUtils.isNotBlank(newFileStr)){
|
||||
String[] fileSplit = fileStr.split(",");
|
||||
String[] newFileSplit = newFileStr.split(",");
|
||||
Set<String> fileSet = new HashSet<>();
|
||||
for(String sData:fileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
for(String sData:newFileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
addAttInfoMap.put("BPG",StringUtils.join(fileSet.toArray(), ","));
|
||||
}else{
|
||||
addAttInfoMap.put("BPG",fileStr);
|
||||
}
|
||||
}
|
||||
}else if(oldAttInfoMap.containsKey("SSG")){
|
||||
String fileStr = (String) oldAttInfoMap.get("SSG");
|
||||
if(StringUtils.isNotBlank(fileStr)){
|
||||
String newFileStr =addAttInfoMap.containsKey("SSG")?(String)addAttInfoMap.get("SSG"):null;
|
||||
if(StringUtils.isNotBlank(newFileStr)){
|
||||
String[] fileSplit = fileStr.split(",");
|
||||
String[] newFileSplit = newFileStr.split(",");
|
||||
Set<String> fileSet = new HashSet<>();
|
||||
for(String sData:fileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
for(String sData:newFileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
addAttInfoMap.put("SSG",StringUtils.join(fileSet.toArray(), ","));
|
||||
}else{
|
||||
addAttInfoMap.put("SSG",fileStr);
|
||||
}
|
||||
}
|
||||
}else if(oldAttInfoMap.containsKey("ZBJBD")){
|
||||
String fileStr = (String) oldAttInfoMap.get("ZBJBD");
|
||||
if(StringUtils.isNotBlank(fileStr)){
|
||||
String newFileStr =addAttInfoMap.containsKey("ZBJBD")?(String)addAttInfoMap.get("ZBJBD"):null;
|
||||
if(StringUtils.isNotBlank(newFileStr)){
|
||||
String[] fileSplit = fileStr.split(",");
|
||||
String[] newFileSplit = newFileStr.split(",");
|
||||
Set<String> fileSet = new HashSet<>();
|
||||
for(String sData:fileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
for(String sData:newFileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
addAttInfoMap.put("ZBJBD",StringUtils.join(fileSet.toArray(), ","));
|
||||
}else{
|
||||
addAttInfoMap.put("ZBJBD",fileStr);
|
||||
}
|
||||
}
|
||||
}else if(oldAttInfoMap.containsKey("FBGBJBD")){
|
||||
String fileStr = (String) oldAttInfoMap.get("FBGBJBD");
|
||||
if(StringUtils.isNotBlank(fileStr)){
|
||||
String newFileStr =addAttInfoMap.containsKey("FBGBJBD")?(String)addAttInfoMap.get("FBGBJBD"):null;
|
||||
if(StringUtils.isNotBlank(newFileStr)){
|
||||
String[] fileSplit = fileStr.split(",");
|
||||
String[] newFileSplit = newFileStr.split(",");
|
||||
Set<String> fileSet = new HashSet<>();
|
||||
for(String sData:fileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
for(String sData:newFileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
addAttInfoMap.put("FBGBJBD",StringUtils.join(fileSet.toArray(), ","));
|
||||
}else{
|
||||
addAttInfoMap.put("FBGBJBD",fileStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String,Object> saveFileMsg (Map<String,Object> attInfoMap,String fileIds,String textStatus) {
|
||||
switch (textStatus) {
|
||||
case "草案": attInfoMap.put("CA",fileIds);break;
|
||||
case "征求意见稿": attInfoMap.put("ZQYJG",fileIds);break;
|
||||
case "报批稿": attInfoMap.put("BPG",fileIds);break;
|
||||
case "送审稿": attInfoMap.put("SSG",fileIds);break;
|
||||
case "增补件(必读)":attInfoMap.put("ZBJBD",fileIds);break;
|
||||
case "发布稿(必读)": attInfoMap.put("FBGBJBD",fileIds);break;
|
||||
}
|
||||
return attInfoMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理标准基础库字段
|
||||
* @param sarLawsStandInfo
|
||||
* @param field
|
||||
* @param value
|
||||
* @throws Exception
|
||||
*/
|
||||
public void createStandBaseField (SarLawsStandInfo sarLawsStandInfo,String field,Object value) throws Exception{
|
||||
String valueStr = "";
|
||||
if (value != null) {
|
||||
valueStr = String.valueOf(value);
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
switch (field) {
|
||||
case "country": sarLawsStandInfo.setCountry(valueStr); break;
|
||||
case "id": sarLawsStandInfo.setId(valueStr); break;
|
||||
case "lawsType": sarLawsStandInfo.setLawsType(valueStr); break;
|
||||
case "lawsNumber": sarLawsStandInfo.setLawsNumber(valueStr); break;
|
||||
case "lawsName": sarLawsStandInfo.setLawsName(valueStr); break;
|
||||
case "lawsEnName": sarLawsStandInfo.setLawsEnName(valueStr); break;
|
||||
case "lawsNo": sarLawsStandInfo.setLawsNo(valueStr); break;
|
||||
case "issueTime":
|
||||
if (StringUtils.isNotBlank(valueStr)) {
|
||||
sarLawsStandInfo.setIssueTime(valueStr);
|
||||
}
|
||||
break;
|
||||
case "issueCompany": sarLawsStandInfo.setIssueCompany(valueStr); break;
|
||||
case "commentCycleStart":
|
||||
if (StringUtils.isNotBlank(valueStr)) {
|
||||
sarLawsStandInfo.setCommentCycleStart(valueStr);
|
||||
}
|
||||
break;
|
||||
case "commentCycleEnd":
|
||||
if (StringUtils.isNotBlank(valueStr)) {
|
||||
sarLawsStandInfo.setCommentCycleEnd(valueStr);
|
||||
}
|
||||
break;
|
||||
case "lawsTextState": sarLawsStandInfo.setLawsTextState(valueStr); break;
|
||||
case "lawsSyqy": sarLawsStandInfo.setLawsSyqy(valueStr); break;
|
||||
case "lawsSycx": sarLawsStandInfo.setLawsSycx(valueStr); break;
|
||||
case "isRelateAccess": sarLawsStandInfo.setIsRelateAccess(valueStr); break;
|
||||
case "lawsYear": sarLawsStandInfo.setLawsYear(valueStr); break;
|
||||
case "lawsNotisyncNum": sarLawsStandInfo.setLawsNotisyncNum(valueStr); break;
|
||||
case "lawsBulletin": sarLawsStandInfo.setLawsBulletin(valueStr); break;
|
||||
case "lawsLabel": sarLawsStandInfo.setLawsLabel(valueStr); break;
|
||||
case "lawsRemark": sarLawsStandInfo.setLawsRemark(valueStr); break;
|
||||
case "prcNum": sarLawsStandInfo.setProcessNum(valueStr); break;
|
||||
case "menuId": sarLawsStandInfo.setMenuId(valueStr); break;
|
||||
case "fileWord":
|
||||
if (StringUtils.isNotBlank(sarLawsStandInfo.getFileIds()) && StringUtils.isNotBlank(valueStr)) {
|
||||
valueStr = sarLawsStandInfo.getFileIds() + "," + valueStr;
|
||||
}
|
||||
sarLawsStandInfo.setFileIds(valueStr); break;
|
||||
case "filePdf":
|
||||
if (StringUtils.isNotBlank(sarLawsStandInfo.getFileIds()) && StringUtils.isNotBlank(valueStr)) {
|
||||
valueStr = sarLawsStandInfo.getFileIds() + "," + valueStr;
|
||||
}
|
||||
sarLawsStandInfo.setFileIds(valueStr);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
package com.adc.da.workFlow.service;
|
||||
|
||||
import com.adc.da.login.util.UserUtils;
|
||||
import com.adc.da.slrs.esRevisePlan.dao.EsRevisePlanDao;
|
||||
import com.adc.da.slrs.esRevisePlan.dao.EsRevisePlanLogDao;
|
||||
import com.adc.da.slrs.esRevisePlan.entity.EsRevisePlan;
|
||||
import com.adc.da.slrs.esRevisePlan.entity.EsRevisePlanLog;
|
||||
import com.adc.da.slrs.esRevisePlan.service.IEsRevisePlanService;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.adc.da.workFlow.dao.ActSarItemsEODao;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
@Service("actSarItemsPlanService")
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class ActSarItemsPlanService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ActSarItemsPlanService.class);
|
||||
|
||||
@Autowired
|
||||
private IEsRevisePlanService iEsRevisePlanService;
|
||||
|
||||
@Autowired
|
||||
private EsRevisePlanDao esRevisePlanDao;
|
||||
|
||||
@Autowired
|
||||
private EsRevisePlanLogDao esRevisePlanLogDao;
|
||||
|
||||
|
||||
@Value("${elas.flag}")
|
||||
private boolean elasflag;
|
||||
|
||||
public String processCreatePlan(String standJson) throws Exception{
|
||||
JSONObject object = new JSONObject();
|
||||
object = JSONObject.parseObject(standJson);
|
||||
String id = "";
|
||||
if (object != null && !object.isEmpty()) {
|
||||
Map<String,String> plan_status=new HashMap<>();
|
||||
plan_status.put("未开始","0");
|
||||
plan_status.put("制定中","1");
|
||||
plan_status.put("修订中","2");
|
||||
plan_status.put("已取消","3");
|
||||
plan_status.put("已完成","4");
|
||||
plan_status.put("立项已完成","5");
|
||||
plan_status.put("计划已确认","6");
|
||||
Map<String,String> revise_status=new HashMap<>();
|
||||
revise_status.put("制定","1");
|
||||
revise_status.put("修订","2");
|
||||
|
||||
EsRevisePlan esRevisePlanDTO=new EsRevisePlan();
|
||||
esRevisePlanDTO.setEsName(object.getString("esName"));
|
||||
esRevisePlanDTO.setUnit(object.getString("unit"));
|
||||
esRevisePlanDTO.setUnitName(object.getString("unitName"));
|
||||
esRevisePlanDTO.setDrafter(object.getString("drafter"));
|
||||
esRevisePlanDTO.setPlanStatus("5");
|
||||
esRevisePlanDTO.setReviseStatus(revise_status.get(object.getString("reviseStatus")));
|
||||
esRevisePlanDTO.setDraftTime(object.getDate("firstDraftTime"));
|
||||
esRevisePlanDTO.setReleaseTime(object.getDate("planTime"));
|
||||
esRevisePlanDTO.setBussSort(object.getString("bussSort"));
|
||||
esRevisePlanDTO.setLxd(object.getString("LXD"));
|
||||
if(StringUtils.isNotBlank(object.getString("esName")) && StringUtils.isNotBlank(object.getString("bussSort"))){
|
||||
EsRevisePlan qw = new EsRevisePlan();
|
||||
qw.setEsName(object.getString("esName"));
|
||||
qw.setBussSort(object.getString("bussSort"));
|
||||
List<EsRevisePlan> list = esRevisePlanDao.selectPageByName(qw);
|
||||
if(!list.isEmpty()){
|
||||
id = list.get(0).getId();
|
||||
esRevisePlanDTO.setId(list.get(0).getId());
|
||||
iEsRevisePlanService.updateById(esRevisePlanDTO);
|
||||
}else{
|
||||
id = UUIDUtils.randomUUID(32);
|
||||
esRevisePlanDTO.setId(id);
|
||||
esRevisePlanDao.insertOne(esRevisePlanDTO);
|
||||
//日志
|
||||
Date date = new Date();
|
||||
String msg = UserUtils.getUser().getUname() + " " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date) + " "
|
||||
+"创建了《"+ object.getString("esName") +"》";
|
||||
esRevisePlanLogDao.insert(new EsRevisePlanLog(null,id,msg,date));
|
||||
}
|
||||
}else {
|
||||
id = UUIDUtils.randomUUID(32);
|
||||
esRevisePlanDTO.setId(id);
|
||||
esRevisePlanDao.insertOne(esRevisePlanDTO);
|
||||
//日志
|
||||
Date date = new Date();
|
||||
String msg = UserUtils.getUser().getUname() + " " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date) + " "
|
||||
+"创建了《"+ object.getString("esName") +"》";
|
||||
esRevisePlanLogDao.insert(new EsRevisePlanLog(null,id,msg,date));
|
||||
}
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.adc.da.workFlow.service;
|
||||
|
||||
import com.adc.da.slrs.sarStandUnqualified.entity.BusinessDeptIssue;
|
||||
import com.adc.da.slrs.sarStandUnqualified.service.IBusinessDeptIssueService;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class PolicyWorkFlowService {
|
||||
|
||||
@Autowired
|
||||
private IBusinessDeptIssueService businessDeptIssueService;
|
||||
|
||||
|
||||
public boolean enterIssue(String json){
|
||||
boolean count=false; //是否成功
|
||||
JSONObject dataJsonObj = JSONObject.parseObject(json);
|
||||
JSONObject jsonData = dataJsonObj.getJSONObject("json");
|
||||
|
||||
|
||||
if ("1".equals( jsonData.getString("feedbackDept"))) {
|
||||
JSONArray dataList = jsonData.getJSONArray("infoTableDatas");
|
||||
|
||||
/**
|
||||
* 把json对象转换未实体对象
|
||||
*/
|
||||
List<BusinessDeptIssue> data = dataList
|
||||
.stream()
|
||||
.map(jsonObj -> {
|
||||
BusinessDeptIssue businessDeptIssue = JSONObject.parseObject(jsonObj.toString(), BusinessDeptIssue.class);
|
||||
businessDeptIssue.setLawId(businessDeptIssue.getId());
|
||||
businessDeptIssue.setId(UUIDUtils.randomUUID20());
|
||||
businessDeptIssue.setIsClose("0");
|
||||
return businessDeptIssue;
|
||||
}).collect(Collectors.toList())
|
||||
.stream()
|
||||
.filter(item->"1".equals(item.getIsRisk()))
|
||||
.collect(Collectors.toList());
|
||||
count=businessDeptIssueService.saveBatch(data);
|
||||
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.adc.da.workFlow.service;
|
||||
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
import com.adc.da.att.service.IAttFileEOService;
|
||||
import com.adc.da.common.SarConformStateEnum;
|
||||
import com.adc.da.common.SelectionTypeEnum;
|
||||
import com.adc.da.slrs.otSvpps.dao.OtSvppsDao;
|
||||
import com.adc.da.slrs.sarGroupMenu.dao.SarGroupMenuDao;
|
||||
import com.adc.da.sys.dao.DicTypeEODao;
|
||||
import com.adc.da.sys.dao.OrgEODao;
|
||||
import com.adc.da.sys.dao.RoleEODao;
|
||||
import com.adc.da.sys.dao.UserEODao;
|
||||
import com.adc.da.sys.entity.DicTypeEO;
|
||||
import com.adc.da.sys.page.DicTypeEOPage;
|
||||
import com.adc.da.utils.util.InitStandAttrUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: super_liu
|
||||
* date: 2020/06/02 9:43
|
||||
*/
|
||||
@Service("workFlowService")
|
||||
public class WorkFlowService {
|
||||
|
||||
/**
|
||||
* 后续优化工作流
|
||||
*/
|
||||
|
||||
}
|
||||
@@ -0,0 +1,423 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.workFlow.dao.ActSarItemsEODao">
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.workFlow.entity.ActSarItemsEO" >
|
||||
<id column="resId" property="resId" />
|
||||
<id column="resFlag" property="resFlag" />
|
||||
<id column="resNum" property="resNum" />
|
||||
<id column="resName" property="resName" />
|
||||
<id column="orgName" property="orgName" />
|
||||
<id column="deptName" property="deptName" />
|
||||
<id column="parentId" property="parentId" />
|
||||
<id column="resState" property="resState" />
|
||||
</resultMap>
|
||||
|
||||
<!-- MSG_FILE table all fields -->
|
||||
<sql id="Base_Column_List" >
|
||||
resId,resFlag,resNum,resName,deptName,orgName,resState
|
||||
</sql>
|
||||
|
||||
<!-- MSG_FILE 列表总数-->
|
||||
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.workFlow.entity.ActSarItemsEO">
|
||||
select count(1) from
|
||||
(
|
||||
SELECT
|
||||
SAR_STANDARDS_INFO.id AS resId,
|
||||
if(
|
||||
SAR_STANDARDS_INFO.STAND_YEAR='',
|
||||
CONCAT(SAR_STANDARDS_INFO.stand_sort,' ',SAR_STANDARDS_INFO.stand_number),
|
||||
CONCAT(SAR_STANDARDS_INFO.stand_sort,' ',SAR_STANDARDS_INFO.stand_number,'-',SAR_STANDARDS_INFO.stand_year)
|
||||
) AS resNum,
|
||||
SAR_STANDARDS_INFO.RESPONSIBLE_UNIT as ,
|
||||
SAR_STANDARDS_INFO.STAND_NAME AS resName,
|
||||
SAR_STANDARDS_INFO.stand_type || '_STAND' AS resFlag
|
||||
FROM
|
||||
SAR_STANDARDS_INFO
|
||||
WHERE
|
||||
SAR_STANDARDS_INFO.VALID_FLAG=0
|
||||
<if test="fileState != null and fileState != '' ">
|
||||
<if test='fileState == "STAND_FILE"'>
|
||||
and SAR_STANDARDS_INFO.STAND_FILE is not null
|
||||
</if>
|
||||
<if test='fileState == "STAND_MODIFY_FILE"'>
|
||||
and SAR_STANDARDS_INFO.STAND_MODIFY_FILE is not null
|
||||
</if>
|
||||
<if test='fileState == "DRAFT_FILE"'>
|
||||
and SAR_STANDARDS_INFO.DRAFT_FILE is not null
|
||||
</if>
|
||||
<if test='fileState == "OPINION_FILE"'>
|
||||
and SAR_STANDARDS_INFO.OPINION_FILE is not null
|
||||
</if>
|
||||
<if test='fileState == "SENT_SCREEN_FILE"'>
|
||||
and SAR_STANDARDS_INFO.SENT_SCREEN_FILE is not null
|
||||
</if>
|
||||
<if test='fileState == "APPROVAL_FILE"'>
|
||||
and SAR_STANDARDS_INFO.APPROVAL_FILE is not null
|
||||
</if>
|
||||
<if test='fileState == "RELEVANCE_FILE"'>
|
||||
and SAR_STANDARDS_INFO.RELEVANCE_FILE is not null
|
||||
</if>
|
||||
</if>
|
||||
UNION
|
||||
SELECT
|
||||
SAR_LAWS_INFO.id AS resId,
|
||||
SAR_LAWS_INFO.laws_NUMBER AS resNum,
|
||||
SAR_LAWS_INFO.RESPONSIBLE_UNIT as deptName,
|
||||
SAR_LAWS_INFO.laws_NAME AS resName,
|
||||
SAR_LAWS_INFO.laws_type || '_LAWS' AS resFlag
|
||||
FROM
|
||||
SAR_LAWS_INFO
|
||||
WHERE
|
||||
SAR_LAWS_INFO.VALID_FLAG=0
|
||||
UNION
|
||||
SELECT
|
||||
SAR_BUSSIONESS_STAND.id AS resId,
|
||||
SAR_BUSSIONESS_STAND.stand_code AS resNum,
|
||||
SAR_BUSSIONESS_STAND.RESPONSIBLE_UNIT as deptName,
|
||||
SAR_BUSSIONESS_STAND.stand_NAME AS resName,
|
||||
'BUSINESS_STAND' AS resFlag
|
||||
FROM
|
||||
SAR_BUSSIONESS_STAND
|
||||
left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code= SAR_BUSSIONESS_STAND.STAND_SORT and dicstandSort.valid_flag=0 and dicstandSort.dic_id is not null AND dicstandSort.dic_id = 'NGETEMDJDI')
|
||||
WHERE
|
||||
SAR_BUSSIONESS_STAND.VALID_FLAG=0
|
||||
)
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 查询MSG_FILE列表 -->
|
||||
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.workFlow.entity.ActSarItemsEO">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
tmp_tb.*
|
||||
FROM
|
||||
(
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from
|
||||
(
|
||||
SELECT
|
||||
SAR_STANDARDS_INFO.id AS resId,
|
||||
if(
|
||||
SAR_STANDARDS_INFO.STAND_YEAR='',
|
||||
CONCAT(SAR_STANDARDS_INFO.stand_sort,' ',SAR_STANDARDS_INFO.stand_number),
|
||||
CONCAT(SAR_STANDARDS_INFO.stand_sort,' ',SAR_STANDARDS_INFO.stand_number,'-',SAR_STANDARDS_INFO.stand_year)
|
||||
) AS resNum,
|
||||
SAR_STANDARDS_INFO.RESPONSIBLE_UNIT as deptName,
|
||||
SAR_STANDARDS_INFO.STAND_NAME AS resName,
|
||||
SAR_STANDARDS_INFO.stand_type || '_STAND' AS resFlag,
|
||||
TS_ORG.ORG_NAME as orgName,
|
||||
dicstandState.DIC_TYPE_NAME as resState
|
||||
FROM
|
||||
SAR_STANDARDS_INFO left join TS_ORG on SAR_STANDARDS_INFO.RESPONSIBLE_UNIT = TS_ORG.ID
|
||||
left join TS_DICTYPE dicstandState on (dicstandState.dic_type_code = SAR_STANDARDS_INFO.stand_state and
|
||||
dicstandState.dic_id is not null and dicstandState.valid_flag = 0 )
|
||||
WHERE
|
||||
SAR_STANDARDS_INFO.VALID_FLAG=0
|
||||
<if test="fileState != null and fileState != '' ">
|
||||
<if test='fileState == "STAND_FILE"'>
|
||||
and SAR_STANDARDS_INFO.STAND_FILE is not null
|
||||
</if>
|
||||
<if test='fileState == "STAND_MODIFY_FILE"'>
|
||||
and SAR_STANDARDS_INFO.STAND_MODIFY_FILE is not null
|
||||
</if>
|
||||
<if test='fileState == "DRAFT_FILE"'>
|
||||
and SAR_STANDARDS_INFO.DRAFT_FILE is not null
|
||||
</if>
|
||||
<if test='fileState == "OPINION_FILE"'>
|
||||
and SAR_STANDARDS_INFO.OPINION_FILE is not null
|
||||
</if>
|
||||
<if test='fileState == "SENT_SCREEN_FILE"'>
|
||||
and SAR_STANDARDS_INFO.SENT_SCREEN_FILE is not null
|
||||
</if>
|
||||
<if test='fileState == "APPROVAL_FILE"'>
|
||||
and SAR_STANDARDS_INFO.APPROVAL_FILE is not null
|
||||
</if>
|
||||
<if test='fileState == "RELEVANCE_FILE"'>
|
||||
and SAR_STANDARDS_INFO.RELEVANCE_FILE is not null
|
||||
</if>
|
||||
</if>
|
||||
UNION
|
||||
SELECT
|
||||
SAR_LAWS_INFO.id AS resId,
|
||||
sar_laws_info.laws_NUMBER AS resNum,
|
||||
sar_laws_info.RESPONSIBLE_UNIT as deptName,
|
||||
sar_laws_info.laws_NAME AS resName,
|
||||
sar_laws_info.laws_type || '_LAWS' AS resFlag,
|
||||
TS_ORG.ORG_NAME as orgName,
|
||||
dic2.dic_type_name as resState
|
||||
FROM
|
||||
SAR_LAWS_INFO left join TS_ORG on SAR_LAWS_INFO.RESPONSIBLE_UNIT = TS_ORG.ID
|
||||
left join TS_DICTYPE dic2 on (SAR_LAWS_INFO.laws_state = dic2.dic_type_code AND dic2.VALID_FLAG = 0)
|
||||
WHERE
|
||||
SAR_LAWS_INFO.VALID_FLAG=0
|
||||
UNION
|
||||
SELECT
|
||||
SAR_BUSSIONESS_STAND.id AS resId,
|
||||
SAR_BUSSIONESS_STAND.stand_code AS resNum,
|
||||
SAR_BUSSIONESS_STAND.RESPONSIBLE_UNIT as deptName,
|
||||
SAR_BUSSIONESS_STAND.stand_NAME AS resName,
|
||||
'BUSINESS_STAND' AS resFlag,
|
||||
TS_ORG.ORG_NAME as orgName,
|
||||
dicstandStatus.DIC_TYPE_NAME as resState
|
||||
FROM
|
||||
SAR_BUSSIONESS_STAND left join TS_ORG on SAR_BUSSIONESS_STAND.RESPONSIBLE_UNIT = TS_ORG.ID
|
||||
left join TS_DICTYPE dicstandSort ON ( dicstandSort.dic_type_code = SAR_BUSSIONESS_STAND.STAND_SORT AND dicstandSort.dic_id IS NOT NULL and
|
||||
dicstandSort.valid_flag = 0 AND dicstandSort.dic_id = 'NGETEMDJDI')
|
||||
left join TS_DICTYPE dicstandStatus ON ( dicstandStatus.dic_type_code = SAR_BUSSIONESS_STAND.STAND_STATUS AND dicstandStatus.dic_id IS NOT NULL and dicstandStatus.valid_flag = 0)
|
||||
WHERE
|
||||
SAR_BUSSIONESS_STAND.VALID_FLAG=0
|
||||
)
|
||||
where 1=1
|
||||
<if test="resFlag != null and resFlag != '' ">
|
||||
and resFlag = #{resFlag}
|
||||
</if>
|
||||
<if test="resNum != null and resNum != '' ">
|
||||
and resNum like concat(concat('%',#{resNum}),'%')
|
||||
</if>
|
||||
<if test="resName != null and resName != '' ">
|
||||
and resName like concat(concat('%',#{resName}),'%')
|
||||
</if>
|
||||
)tmp_tb limit ${pager.startIndex-1},${pageSize}) a
|
||||
</select>
|
||||
|
||||
<select id="process4PageDateCount" resultType="java.lang.Integer" parameterType="com.adc.da.workFlow.entity.ActSarItemsEO">
|
||||
SELECT
|
||||
count(1)
|
||||
FROM
|
||||
(
|
||||
select
|
||||
*
|
||||
from
|
||||
(
|
||||
SELECT
|
||||
SAR_STANDARDS_INFO.id AS resId,
|
||||
if(
|
||||
SAR_STANDARDS_INFO.STAND_YEAR='',
|
||||
CONCAT(SAR_STANDARDS_INFO.stand_sort,' ',SAR_STANDARDS_INFO.stand_number),
|
||||
CONCAT(SAR_STANDARDS_INFO.stand_sort,' ',SAR_STANDARDS_INFO.stand_number,'-',SAR_STANDARDS_INFO.stand_year)
|
||||
) AS resNum,
|
||||
SAR_STANDARDS_INFO.RESPONSIBLE_UNIT as deptName,
|
||||
SAR_STANDARDS_INFO.STAND_NAME AS resName,
|
||||
SAR_STANDARDS_INFO.stand_type || '_STAND' AS resFlag,
|
||||
TS_ORG.ORG_NAME as orgName
|
||||
FROM
|
||||
SAR_STANDARDS_INFO left join TS_ORG on SAR_STANDARDS_INFO.RESPONSIBLE_UNIT = TS_ORG.ID
|
||||
WHERE
|
||||
SAR_STANDARDS_INFO.VALID_FLAG=0
|
||||
UNION
|
||||
SELECT
|
||||
SAR_LAWS_INFO.id AS resId,
|
||||
SAR_LAWS_INFO.laws_NUMBER AS resNum,
|
||||
SAR_LAWS_INFO.RESPONSIBLE_UNIT as deptName,
|
||||
SAR_LAWS_INFO.laws_NAME AS resName,
|
||||
SAR_LAWS_INFO.laws_type || '_LAWS' AS resFlag,
|
||||
TS_ORG.ORG_NAME as orgName
|
||||
FROM
|
||||
SAR_LAWS_INFO left join TS_ORG on SAR_LAWS_INFO.RESPONSIBLE_UNIT = TS_ORG.ID
|
||||
WHERE
|
||||
SAR_LAWS_INFO.VALID_FLAG=0
|
||||
UNION
|
||||
SELECT
|
||||
SAR_BUSSIONESS_STAND.id AS resId,
|
||||
SAR_BUSSIONESS_STAND.stand_code AS resNum,
|
||||
SAR_BUSSIONESS_STAND.RESPONSIBLE_UNIT as deptName,
|
||||
SAR_BUSSIONESS_STAND.stand_NAME AS resName,
|
||||
'BUSINESS_STAND' AS resFlag,
|
||||
TS_ORG.ORG_NAME as orgName
|
||||
FROM
|
||||
SAR_BUSSIONESS_STAND left join TS_ORG on SAR_BUSSIONESS_STAND.RESPONSIBLE_UNIT = TS_ORG.ID
|
||||
left join TS_DICTYPE dicstandSort ON ( dicstandSort.dic_type_code = SAR_BUSSIONESS_STAND.STAND_SORT AND dicstandSort.dic_id IS NOT NULL and
|
||||
dicstandSort.valid_flag = 0 AND dicstandSort.dic_id = 'NGETEMDJDI' )
|
||||
WHERE
|
||||
SAR_BUSSIONESS_STAND.VALID_FLAG=0
|
||||
)
|
||||
where 1=1
|
||||
<if test="resFlag != null and resFlag != '' ">
|
||||
and resFlag = #{resFlag}
|
||||
</if>
|
||||
<if test="resNum != null and resNum != '' ">
|
||||
and resNum like concat(concat('%',#{resNum}),'%')
|
||||
</if>
|
||||
<if test="resName != null and resName != '' ">
|
||||
and resName like concat(concat('%',#{resName}),'%')
|
||||
</if>
|
||||
)
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="queryStandAndLaws" resultMap="BaseResultMap" parameterType="com.adc.da.workFlow.entity.ActSarItemsEO">
|
||||
select resId,resFlag,resNum,resName,deptName,orgName
|
||||
from
|
||||
(
|
||||
SELECT
|
||||
SAR_STANDARDS_INFO.id AS resId,
|
||||
if(
|
||||
SAR_STANDARDS_INFO.STAND_YEAR='',
|
||||
CONCAT(SAR_STANDARDS_INFO.stand_sort,' ',SAR_STANDARDS_INFO.stand_number),
|
||||
CONCAT(SAR_STANDARDS_INFO.stand_sort,' ',SAR_STANDARDS_INFO.stand_number,'-',SAR_STANDARDS_INFO.stand_year)
|
||||
) AS resNum,
|
||||
SAR_STANDARDS_INFO.RESPONSIBLE_UNIT as deptName,
|
||||
SAR_STANDARDS_INFO.STAND_NAME AS resName,
|
||||
SAR_STANDARDS_INFO.stand_type || '_STAND' AS resFlag,
|
||||
TS_ORG.ORG_NAME as orgName
|
||||
FROM
|
||||
SAR_SAR_ACCESS_INFO
|
||||
left join SAR_STANDARDS_INFO on SAR_SAR_ACCESS_INFO.res_id = SAR_STANDARDS_INFO.id
|
||||
LEFT JOIN SAR_STAND_VAL valapp ON ( SAR_STANDARDS_INFO.id = valapp.stand_id AND valapp.PROPERTY_TYPE = 'APPLY_ARCTIC' )
|
||||
LEFT JOIN SAR_STAND_VAL valeng ON ( SAR_STANDARDS_INFO.id = valeng.stand_id AND valeng.PROPERTY_TYPE = 'ENERGY_KIND' )
|
||||
left join TS_ORG on SAR_STANDARDS_INFO.RESPONSIBLE_UNIT = TS_ORG.ID
|
||||
WHERE
|
||||
SAR_SAR_ACCESS_INFO.VALID_FLAG=0 and
|
||||
SAR_STANDARDS_INFO.VALID_FLAG=0
|
||||
<if test="accessId != null and accessId != '' ">
|
||||
and SAR_SAR_ACCESS_INFO.access_id = #{accessId}
|
||||
</if>
|
||||
<if test="applyArcticList!=null">AND
|
||||
valapp.property_val IN
|
||||
<foreach collection="applyArcticList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="energyKindList!=null"> AND
|
||||
valeng.property_val IN
|
||||
<foreach collection="energyKindList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<!--<if test="applyArctic != null and applyArctic != '' ">-->
|
||||
<!--and SAR_STANDARDS_INFO.apply_arctic = #{applyArctic}-->
|
||||
<!--</if>-->
|
||||
<!--and-->
|
||||
<!--(-->
|
||||
<!--( SAR_STAND_VAL.property_type = 'APPLY_ARCTIC'-->
|
||||
<!--<if test="applyArcticList!=null">AND-->
|
||||
<!--SAR_STAND_VAL.property_val IN-->
|
||||
<!--<foreach collection="applyArcticList" index="index" item="item" open="(" separator="," close=")">-->
|
||||
<!--#{item}-->
|
||||
<!--</foreach>-->
|
||||
<!--</if>-->
|
||||
<!--)-->
|
||||
<!--AND (-->
|
||||
<!--SAR_STAND_VAL.property_type = 'ENERGY_KIND'<if test="energyKindList!=null">AND-->
|
||||
<!--SAR_STAND_VAL.property_val IN-->
|
||||
<!--<foreach collection="energyKindList" index="index" item="item" open="(" separator="," close=")">-->
|
||||
<!--#{item}-->
|
||||
<!--</foreach>-->
|
||||
<!--</if>-->
|
||||
<!--)-->
|
||||
<!--)-->
|
||||
|
||||
UNION
|
||||
SELECT
|
||||
SAR_LAWS_INFO.id AS resId,
|
||||
SAR_LAWS_INFO.laws_NUMBER AS resNum,
|
||||
SAR_LAWS_INFO.RESPONSIBLE_UNIT as deptName,
|
||||
SAR_LAWS_INFO.laws_NAME AS resName,
|
||||
SAR_LAWS_INFO.laws_type || '_LAWS' AS resFlag,
|
||||
TS_ORG.ORG_NAME as orgName
|
||||
FROM
|
||||
SAR_SAR_ACCESS_INFO
|
||||
left join SAR_LAWS_INFO on SAR_SAR_ACCESS_INFO.res_id = SAR_LAWS_INFO.id
|
||||
LEFT JOIN SAR_LAWS_VAL valapp ON ( SAR_LAWS_INFO.id = valapp.laws_id AND valapp.PROPERTY_TYPE = 'APPLY_ARCTIC' )
|
||||
LEFT JOIN SAR_LAWS_VAL valeng ON ( SAR_LAWS_INFO.id = valeng.laws_id AND valeng.PROPERTY_TYPE = 'ENERGY_KIND' )
|
||||
left join TS_ORG on SAR_LAWS_INFO.RESPONSIBLE_UNIT = TS_ORG.ID
|
||||
WHERE
|
||||
SAR_SAR_ACCESS_INFO.VALID_FLAG=0 and
|
||||
SAR_LAWS_INFO.VALID_FLAG=0
|
||||
<if test="accessId != null and accessId != '' ">
|
||||
and SAR_SAR_ACCESS_INFO.access_id = #{accessId}
|
||||
</if>
|
||||
<if test="applyArcticList!=null"> AND
|
||||
valapp.property_val IN
|
||||
<foreach collection="applyArcticList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="energyKindList!=null"> AND
|
||||
valeng.property_val IN
|
||||
<foreach collection="energyKindList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<!--and-->
|
||||
<!--(-->
|
||||
<!--( SAR_laws_VAL.property_type = 'APPLY_ARCTIC'-->
|
||||
<!--<if test="applyArcticList!=null"> AND-->
|
||||
<!--SAR_laws_VAL.property_val IN-->
|
||||
<!--<foreach collection="applyArcticList" index="index" item="item" open="(" separator="," close=")">-->
|
||||
<!--#{item}-->
|
||||
<!--</foreach>-->
|
||||
<!--</if>-->
|
||||
<!--)-->
|
||||
<!--AND-->
|
||||
<!--( SAR_laws_VAL.property_type = 'ENERGY_KIND'-->
|
||||
<!--<if test="energyKindList!=null"> AND-->
|
||||
<!--SAR_laws_VAL.property_val IN-->
|
||||
<!--<foreach collection="energyKindList" index="index" item="item" open="(" separator="," close=")">-->
|
||||
<!--#{item}-->
|
||||
<!--</foreach>-->
|
||||
<!--</if>-->
|
||||
<!--)-->
|
||||
<!--)-->
|
||||
UNION
|
||||
SELECT
|
||||
SAR_BUSSIONESS_STAND.id AS resId,
|
||||
SAR_BUSSIONESS_STAND.stand_code AS resNum,
|
||||
SAR_BUSSIONESS_STAND.RESPONSIBLE_UNIT as deptName,
|
||||
SAR_BUSSIONESS_STAND.stand_NAME AS resName,
|
||||
'BUSINESS_STAND' AS resFlag,
|
||||
TS_ORG.ORG_NAME as orgName
|
||||
FROM
|
||||
SAR_SAR_ACCESS_INFO
|
||||
left join SAR_BUSSIONESS_STAND on SAR_SAR_ACCESS_INFO.res_id = SAR_BUSSIONESS_STAND.id
|
||||
LEFT JOIN SAR_BUSS_STAND_VAL valapp ON ( SAR_BUSSIONESS_STAND.id = valapp.stand_id AND valapp.PROPERTY_TYPE = 'APPLY_ARCTIC' )
|
||||
LEFT JOIN SAR_BUSS_STAND_VAL valeng ON ( SAR_BUSSIONESS_STAND.id = valeng.stand_id AND valeng.PROPERTY_TYPE = 'ENERGY_KIND' )
|
||||
left join TS_ORG on SAR_BUSSIONESS_STAND.RESPONSIBLE_UNIT = TS_ORG.ID
|
||||
left join TS_DICTYPE dicstandSort ON ( dicstandSort.dic_type_code = SAR_BUSSIONESS_STAND.STAND_SORT AND dicstandSort.dic_id IS NOT NULL and dicstandSort.valid_flag = 0 AND dicstandSort.dic_id = 'NGETEMDJDI')
|
||||
WHERE
|
||||
SAR_SAR_ACCESS_INFO.VALID_FLAG=0 and
|
||||
SAR_BUSSIONESS_STAND.VALID_FLAG=0
|
||||
<if test="accessId != null and accessId != '' ">
|
||||
and SAR_SAR_ACCESS_INFO.access_id = #{accessId}
|
||||
</if>
|
||||
<if test="applyArcticList!=null"> AND
|
||||
valapp.property_value IN
|
||||
<foreach collection="applyArcticList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="energyKindList!=null"> AND
|
||||
valeng.property_value IN
|
||||
<foreach collection="energyKindList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<!--and-->
|
||||
<!--(-->
|
||||
<!--( SAR_BUSS_STAND_VAL.property_type = 'APPLY_ARCTIC'-->
|
||||
<!--<if test="applyArcticList!=null"> AND-->
|
||||
<!--SAR_BUSS_STAND_VAL.PROPERTY_VALUE IN-->
|
||||
<!--<foreach collection="applyArcticList" index="index" item="item" open="(" separator="," close=")">-->
|
||||
<!--#{item}-->
|
||||
<!--</foreach>-->
|
||||
<!--</if>-->
|
||||
<!--)-->
|
||||
<!--AND-->
|
||||
<!--( SAR_BUSS_STAND_VAL.property_type = 'ENERGY_KIND'-->
|
||||
<!--<if test="energyKindList!=null"> AND-->
|
||||
<!--SAR_BUSS_STAND_VAL.PROPERTY_VALUE IN-->
|
||||
<!--<foreach collection="energyKindList" index="index" item="item" open="(" separator="," close=")">-->
|
||||
<!--#{item}-->
|
||||
<!--</foreach>-->
|
||||
<!--</if>-->
|
||||
<!--)-->
|
||||
<!--)-->
|
||||
)
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -37,6 +37,20 @@
|
||||
<artifactId>UserAgentUtils</artifactId>
|
||||
<version>1.21</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.itextpdf</groupId>
|
||||
<artifactId>itextpdf</artifactId>
|
||||
<version>5.5.13</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt</artifactId>
|
||||
<version>0.9.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -1,13 +1,23 @@
|
||||
package com.adc.da.base.page;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
|
||||
public class BasePage {
|
||||
@TableField(exist = false)
|
||||
private Integer page = 1;
|
||||
@TableField(exist = false)
|
||||
private Integer pageSize = 20;
|
||||
@TableField(exist = false)
|
||||
private Integer startIndex;
|
||||
@TableField(exist = false)
|
||||
private Integer endIndex;
|
||||
@TableField(exist = false)
|
||||
private String orderBy;
|
||||
@TableField(exist = false)
|
||||
private String order;
|
||||
@TableField(exist = false)
|
||||
private String q;
|
||||
@TableField(exist = false)
|
||||
private Pager pager = new Pager();
|
||||
|
||||
public BasePage() {
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.exception;
|
||||
|
||||
public class ServiceException extends Exception {
|
||||
|
||||
|
||||
/**
|
||||
* Instantiates a new Service exception.
|
||||
*/
|
||||
public ServiceException() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new Service exception.
|
||||
*
|
||||
* @param message the message
|
||||
*/
|
||||
public ServiceException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
package com.adc.da.http;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class PageInfo<T> {
|
||||
private Integer pageNo;
|
||||
private Integer pageSize;
|
||||
private Long count;
|
||||
private Long pageCount;
|
||||
private List<T> list;
|
||||
private List<Map<String, Object>> title;
|
||||
private Map<String, String> ext;
|
||||
private String orderBy;
|
||||
|
||||
public PageInfo() {
|
||||
this.pageNo = 1;
|
||||
this.pageSize = 10;
|
||||
this.list = new ArrayList();
|
||||
this.title = new ArrayList();
|
||||
this.ext = new HashMap();
|
||||
this.orderBy = "";
|
||||
this.pageSize = 1;
|
||||
}
|
||||
|
||||
public PageInfo(HttpServletRequest request) {
|
||||
this.pageNo = 1;
|
||||
this.pageSize = 10;
|
||||
this.list = new ArrayList();
|
||||
this.title = new ArrayList();
|
||||
this.ext = new HashMap();
|
||||
this.orderBy = "";
|
||||
String no = request.getParameter("pageNo");
|
||||
if (StringUtils.isEmpty(no)) {
|
||||
this.setPageNo(1);
|
||||
} else if (StringUtils.isNumeric(no)) {
|
||||
this.setPageNo(Integer.parseInt(no));
|
||||
}
|
||||
|
||||
String size = request.getParameter("pageSize");
|
||||
if (StringUtils.isEmpty(size)) {
|
||||
this.setPageSize(10);
|
||||
}
|
||||
|
||||
if (StringUtils.isNumeric(size)) {
|
||||
this.setPageSize(Integer.parseInt(size));
|
||||
}
|
||||
|
||||
String orderByParam = request.getParameter("orderBy");
|
||||
if (StringUtils.isNotBlank(orderByParam)) {
|
||||
this.setOrderBy(orderByParam);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public PageInfo(Integer pageNo, Integer pageSize) {
|
||||
this(pageNo, pageSize, 0L);
|
||||
}
|
||||
|
||||
public PageInfo(Integer pageNo, Integer pageSize, Long count) {
|
||||
this(pageNo, pageSize, count, new ArrayList());
|
||||
}
|
||||
|
||||
public PageInfo(Integer pageNo, Integer pageSize, Long count, List<T> list) {
|
||||
this.pageNo = 1;
|
||||
this.pageSize = 10;
|
||||
this.list = new ArrayList();
|
||||
this.title = new ArrayList();
|
||||
this.ext = new HashMap();
|
||||
this.orderBy = "";
|
||||
if (pageNo == null) {
|
||||
pageNo = 1;
|
||||
}
|
||||
|
||||
if (pageSize == null) {
|
||||
pageSize = 10;
|
||||
}
|
||||
|
||||
this.setCount(count);
|
||||
this.setPageNo(Math.abs(pageNo));
|
||||
this.setPageSize(Math.abs(pageSize));
|
||||
this.setList(list);
|
||||
}
|
||||
|
||||
public Long getCount() {
|
||||
return this.count;
|
||||
}
|
||||
|
||||
public void setCount(Long count) {
|
||||
this.count = count;
|
||||
if ((long) this.pageSize >= count) {
|
||||
this.pageNo = 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Integer getPageNo() {
|
||||
return this.pageNo;
|
||||
}
|
||||
|
||||
public void setPageNo(Integer pageNo) {
|
||||
this.pageNo = pageNo;
|
||||
}
|
||||
|
||||
public Integer getPageSize() {
|
||||
return this.pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize <= 0 ? 10 : pageSize;
|
||||
}
|
||||
|
||||
public List<T> getList() {
|
||||
return this.list;
|
||||
}
|
||||
|
||||
public PageInfo<T> setList(List<T> list) {
|
||||
this.list = list;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getOrderBy() {
|
||||
return this.orderBy;
|
||||
}
|
||||
|
||||
public void setOrderBy(String orderBy) {
|
||||
this.orderBy = orderBy;
|
||||
}
|
||||
|
||||
public Map<String, String> getExt() {
|
||||
return this.ext;
|
||||
}
|
||||
|
||||
public void setExt(Map<String, String> ext) {
|
||||
this.ext = ext;
|
||||
}
|
||||
|
||||
public Long getPageCount() {
|
||||
if (this.count % (long) this.pageSize != 0L) {
|
||||
this.pageCount = this.count / (long) this.pageSize + 1L;
|
||||
} else {
|
||||
this.pageCount = this.count / (long) this.pageSize;
|
||||
}
|
||||
|
||||
if (this.pageCount < 1L) {
|
||||
this.pageCount = 1L;
|
||||
}
|
||||
|
||||
return this.pageCount;
|
||||
}
|
||||
|
||||
public void setPageCount(Long pageCount) {
|
||||
this.pageCount = pageCount;
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getTitle() {
|
||||
return this.title;
|
||||
}
|
||||
|
||||
public void setTitle(List<Map<String, Object>> title) {
|
||||
this.title = title;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.adc.da.http;
|
||||
|
||||
public class ResponseMessage<T> {
|
||||
private String respCode;
|
||||
private String respMsg;
|
||||
private T data;
|
||||
private boolean ok;
|
||||
|
||||
public ResponseMessage() {
|
||||
}
|
||||
|
||||
public ResponseMessage(String respCode, String message) {
|
||||
this.respCode = respCode;
|
||||
this.respMsg = message;
|
||||
}
|
||||
|
||||
public ResponseMessage(String respCode, String message, boolean ok) {
|
||||
this.respCode = respCode;
|
||||
this.respMsg = message;
|
||||
this.ok = ok;
|
||||
}
|
||||
|
||||
public ResponseMessage(String respCode, String message, boolean ok, T data) {
|
||||
this.respCode = respCode;
|
||||
this.respMsg = message;
|
||||
this.ok = ok;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public String getRespCode() {
|
||||
return this.respCode;
|
||||
}
|
||||
|
||||
public void setRespCode(String respCode) {
|
||||
this.respCode = respCode;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return this.respMsg;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.respMsg = message;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return this.data;
|
||||
}
|
||||
|
||||
public void setData(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public boolean isOk() {
|
||||
return this.ok;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.adc.da.http;
|
||||
|
||||
public enum ResponseMessageCodeEnum {
|
||||
SUCCESS("0"),
|
||||
ERROR("-1"),
|
||||
ERROR_TOKEN("LE505"),
|
||||
VALID_ERROR("1000"),
|
||||
SAVE_SUCCESS("r0001"),
|
||||
UPDATE_SUCCESS("r0002"),
|
||||
REMOVE_SUCCESS("r0003");
|
||||
|
||||
private String code;
|
||||
|
||||
private ResponseMessageCodeEnum(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return this.code;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.adc.da.http;
|
||||
|
||||
public class Result {
|
||||
public Result() {
|
||||
}
|
||||
|
||||
public static ResponseMessage success() {
|
||||
return new ResponseMessage(ResponseMessageCodeEnum.SUCCESS.getCode(), "", true);
|
||||
}
|
||||
|
||||
public static <T> ResponseMessage<T> success(String code, T t) {
|
||||
return new ResponseMessage(code, "", true, t);
|
||||
}
|
||||
|
||||
public static <T> ResponseMessage<T> success(String code, String message) {
|
||||
return new ResponseMessage(code, message);
|
||||
}
|
||||
|
||||
public static <T> ResponseMessage<T> success(String code, String message, T t) {
|
||||
return new ResponseMessage(code, message, true, t);
|
||||
}
|
||||
|
||||
public static <T> ResponseMessage<T> success(T t) {
|
||||
return new ResponseMessage(ResponseMessageCodeEnum.SUCCESS.getCode(), "", true, t);
|
||||
}
|
||||
|
||||
public static ResponseMessage error() {
|
||||
return error("");
|
||||
}
|
||||
|
||||
public static ResponseMessage error(String message) {
|
||||
return error(ResponseMessageCodeEnum.ERROR.getCode(), message);
|
||||
}
|
||||
|
||||
public static ResponseMessage error(String code, String message) {
|
||||
return error(code, message, (Object)null);
|
||||
}
|
||||
|
||||
public static <T> ResponseMessage<T> error(String code, String message, T t) {
|
||||
return new ResponseMessage(code, message, false, t);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.adc.da.util;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||
public static final String yyyy_MM_dd_EN = "yyyy-MM-dd";
|
||||
public static final String yyyy_MM_dd_HH_mm_ss_EN = "yyyy-MM-dd HH:mm:ss";
|
||||
public static final String yyyy_MM_dd_CN = "yyyy年MM月dd日";
|
||||
public static final String yyyy_MM_dd_HH_mm_ss_CN = "yyyy年MM月dd日HH时mm分ss秒";
|
||||
private static Map<String, DateFormat> dateFormatMap = new HashMap();
|
||||
|
||||
public DateUtils() {
|
||||
}
|
||||
|
||||
public static DateFormat getDateFormat(String formatStr) {
|
||||
DateFormat df = (DateFormat)dateFormatMap.get(formatStr);
|
||||
if (df == null) {
|
||||
df = new SimpleDateFormat(formatStr);
|
||||
dateFormatMap.put(formatStr, df);
|
||||
}
|
||||
|
||||
return (DateFormat)df;
|
||||
}
|
||||
|
||||
public static String dateToString(Date date, String dateFormatStr) {
|
||||
DateFormat format = getDateFormat(dateFormatStr);
|
||||
return date != null ? format.format(date) : null;
|
||||
}
|
||||
|
||||
public static Date stringToDate(String dateTimeStr, String dateFormatStr) {
|
||||
try {
|
||||
if (dateTimeStr != null && !dateTimeStr.equals("")) {
|
||||
DateFormat format = getDateFormat(dateFormatStr);
|
||||
Date date = format.parse(dateTimeStr);
|
||||
return date;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} catch (ParseException var4) {
|
||||
throw new RuntimeException(var4);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.adc.da.util;
|
||||
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.SecureRandom;
|
||||
|
||||
public class Digests {
|
||||
private static final String SHA1 = "SHA-1";
|
||||
private static final String MD5 = "MD5";
|
||||
private static SecureRandom random = new SecureRandom();
|
||||
|
||||
public Digests() {
|
||||
}
|
||||
|
||||
public static byte[] sha1(byte[] input) {
|
||||
return digest(input, "SHA-1", (byte[])null, 1);
|
||||
}
|
||||
|
||||
public static byte[] sha1(byte[] input, byte[] salt) {
|
||||
return digest(input, "SHA-1", salt, 1);
|
||||
}
|
||||
|
||||
public static byte[] sha1(byte[] input, byte[] salt, int iterations) {
|
||||
return digest(input, "SHA-1", salt, iterations);
|
||||
}
|
||||
|
||||
private static byte[] digest(byte[] input, String algorithm, byte[] salt, int iterations){
|
||||
|
||||
try {
|
||||
MessageDigest digest = MessageDigest.getInstance(algorithm);
|
||||
if (salt != null) {
|
||||
digest.update(salt);
|
||||
}
|
||||
|
||||
byte[] result = digest.digest(input);
|
||||
|
||||
for(int i = 1; i < iterations; ++i) {
|
||||
digest.reset();
|
||||
result = digest.digest(result);
|
||||
}
|
||||
return result;
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] generateSalt(int numBytes) {
|
||||
Validate.isTrue(numBytes > 0, "numBytes argument must be a positive integer (1 or larger)", (long)numBytes);
|
||||
byte[] bytes = new byte[numBytes];
|
||||
random.nextBytes(bytes);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
public static byte[] md5(InputStream input) throws IOException {
|
||||
return digest(input, "MD5");
|
||||
}
|
||||
|
||||
public static byte[] sha1(InputStream input) throws IOException {
|
||||
return digest(input, "SHA-1");
|
||||
}
|
||||
|
||||
private static byte[] digest(InputStream input, String algorithm) throws IOException {
|
||||
try {
|
||||
MessageDigest messageDigest = MessageDigest.getInstance(algorithm);
|
||||
int bufferLength = 8192;
|
||||
byte[] buffer = new byte[bufferLength];
|
||||
|
||||
for(int read = input.read(buffer, 0, bufferLength); read > -1; read = input.read(buffer, 0, bufferLength)) {
|
||||
messageDigest.update(buffer, 0, read);
|
||||
}
|
||||
|
||||
return messageDigest.digest();
|
||||
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.adc.da.util;
|
||||
|
||||
import com.adc.da.exception.AdcDaBaseException;
|
||||
import org.apache.commons.codec.DecoderException;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.codec.binary.Hex;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
public class Encodes {
|
||||
|
||||
private static final String DEFAULT_URL_ENCODING = "UTF-8";
|
||||
private static final char[] BASE62 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".toCharArray();
|
||||
|
||||
public Encodes() {
|
||||
}
|
||||
|
||||
public static String encodeHex(byte[] input) {
|
||||
return Hex.encodeHexString(input);
|
||||
}
|
||||
|
||||
public static byte[] decodeHex(String input) {
|
||||
|
||||
try {
|
||||
return Hex.decodeHex(input.toCharArray());
|
||||
} catch (DecoderException e) {
|
||||
throw new AdcDaBaseException(e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static String encodeBase64(byte[] input) {
|
||||
return Base64.encodeBase64String(input);
|
||||
}
|
||||
|
||||
public static String encodeUrlSafeBase64(byte[] input) {
|
||||
return Base64.encodeBase64URLSafeString(input);
|
||||
}
|
||||
|
||||
public static byte[] decodeBase64(String input) {
|
||||
return Base64.decodeBase64(input);
|
||||
}
|
||||
|
||||
public static String encodeBase62(byte[] input) {
|
||||
char[] chars = new char[input.length];
|
||||
|
||||
for(int i = 0; i < input.length; ++i) {
|
||||
chars[i] = BASE62[(input[i] & 255) % BASE62.length];
|
||||
}
|
||||
|
||||
return new String(chars);
|
||||
}
|
||||
|
||||
public static String escapeHtml(String html) {
|
||||
return StringEscapeUtils.escapeHtml4(html);
|
||||
}
|
||||
|
||||
public static String unescapeHtml(String htmlEscaped) {
|
||||
return StringEscapeUtils.unescapeHtml4(htmlEscaped);
|
||||
}
|
||||
|
||||
public static String escapeXml(String xml) {
|
||||
return StringEscapeUtils.escapeXml(xml);
|
||||
}
|
||||
|
||||
public static String unescapeXml(String xmlEscaped) {
|
||||
return StringEscapeUtils.unescapeXml(xmlEscaped);
|
||||
}
|
||||
|
||||
public static String urlEncode(String part) {
|
||||
try {
|
||||
return URLEncoder.encode(part, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static String urlDecode(String part) {
|
||||
try {
|
||||
return URLDecoder.decode(part, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
package com.adc.da.util;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class FileUtil extends FileUtils {
|
||||
|
||||
private static final int BUFF_SIZE = 1024;
|
||||
private static Logger log = LoggerFactory.getLogger(FileUtil.class);
|
||||
|
||||
public FileUtil() {
|
||||
}
|
||||
|
||||
public static void copyFile(String src, String target) {
|
||||
InputStream in = null;
|
||||
BufferedOutputStream out = null;
|
||||
|
||||
try {
|
||||
in = new BufferedInputStream(new FileInputStream(src));
|
||||
out = new BufferedOutputStream(new FileOutputStream(target));
|
||||
byte[] buffer = new byte[1024];
|
||||
|
||||
int len;
|
||||
while((len = in.read(buffer, 0, 1024)) > 0) {
|
||||
out.write(buffer, 0, len);
|
||||
out.flush();
|
||||
}
|
||||
} catch (IOException var9) {
|
||||
var9.printStackTrace();
|
||||
} finally {
|
||||
IOUtils.closeQuietly(in);
|
||||
IOUtils.closeQuietly(out);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static List<String> readAsStringList(String fileName) {
|
||||
List<String> list = new ArrayList();
|
||||
BufferedReader reader = null;
|
||||
FileInputStream fis = null;
|
||||
|
||||
try {
|
||||
File f = new File(fileName);
|
||||
if (f.isFile() && f.exists()) {
|
||||
fis = new FileInputStream(f);
|
||||
reader = new BufferedReader(new InputStreamReader(fis, "UTF-8"));
|
||||
|
||||
String line;
|
||||
while((line = reader.readLine()) != null) {
|
||||
if (!"".equals(line)) {
|
||||
list.add(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception var18) {
|
||||
log.error("readFile", var18);
|
||||
} finally {
|
||||
try {
|
||||
if (reader != null) {
|
||||
reader.close();
|
||||
}
|
||||
} catch (IOException var17) {
|
||||
log.error("InputStream关闭异常", var17);
|
||||
}
|
||||
|
||||
try {
|
||||
if (fis != null) {
|
||||
fis.close();
|
||||
}
|
||||
} catch (IOException var16) {
|
||||
log.error("FileInputStream关闭异常", var16);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public static byte[] readFile(File file) {
|
||||
byte[] bytes = null;
|
||||
|
||||
try {
|
||||
bytes = IOUtils.readFully(new FileInputStream(file));
|
||||
} catch (Exception var3) {
|
||||
var3.printStackTrace();
|
||||
}
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
public static byte[] readFile(String fileName) {
|
||||
return readFile(new File(fileName));
|
||||
}
|
||||
|
||||
public static void writeFile(byte[] bytes, String outputFile) {
|
||||
FileOutputStream os = null;
|
||||
|
||||
try {
|
||||
os = new FileOutputStream(outputFile);
|
||||
os.write(bytes);
|
||||
} catch (Exception var7) {
|
||||
var7.printStackTrace();
|
||||
} finally {
|
||||
IOUtils.closeQuietly(os);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static File mkdir(String folderPath) {
|
||||
File file = new File(folderPath);
|
||||
if (!file.exists() || !file.isDirectory()) {
|
||||
boolean success = false;
|
||||
|
||||
do {
|
||||
success = file.mkdirs();
|
||||
} while(success);
|
||||
}
|
||||
|
||||
return file;
|
||||
}
|
||||
|
||||
public static void delFolder(String folderPath) throws Exception {
|
||||
delAllFile(folderPath);
|
||||
File myFilePath = new File(folderPath);
|
||||
myFilePath.delete();
|
||||
}
|
||||
|
||||
public static boolean delAllFile(String path) throws Exception {
|
||||
boolean flag = false;
|
||||
File file = new File(path);
|
||||
if (!file.exists()) {
|
||||
return flag;
|
||||
} else if (!file.isDirectory()) {
|
||||
return flag;
|
||||
} else {
|
||||
String[] tempList = file.list();
|
||||
File temp = null;
|
||||
|
||||
for(int i = 0; i < tempList.length; ++i) {
|
||||
if (path.endsWith(File.separator)) {
|
||||
temp = new File(path + tempList[i]);
|
||||
} else {
|
||||
temp = new File(path + File.separator + tempList[i]);
|
||||
}
|
||||
|
||||
if (temp.isFile()) {
|
||||
temp.delete();
|
||||
}
|
||||
|
||||
if (temp.isDirectory()) {
|
||||
delAllFile(path + "/" + tempList[i]);
|
||||
delFolder(path + "/" + tempList[i]);
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean delFile(String fileName) {
|
||||
File file = new File(fileName);
|
||||
if (!file.exists()) {
|
||||
log.info(fileName + " 文件不存在!");
|
||||
return true;
|
||||
} else {
|
||||
return file.isFile() ? deleteFile(fileName) : deleteDirectory(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean deleteFile(String fileName) {
|
||||
File file = new File(fileName);
|
||||
if (file.exists() && file.isFile()) {
|
||||
if (file.delete()) {
|
||||
log.info("删除单个文件 " + fileName + " 成功!");
|
||||
return true;
|
||||
} else {
|
||||
log.info("删除单个文件 " + fileName + " 失败!");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
log.info(fileName + " 文件不存在!");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean deleteDirectory(String dirName) {
|
||||
String dirNames = dirName;
|
||||
if (!dirName.endsWith(File.separator)) {
|
||||
dirNames = dirName + File.separator;
|
||||
}
|
||||
|
||||
File dirFile = new File(dirNames);
|
||||
if (dirFile.exists() && dirFile.isDirectory()) {
|
||||
boolean flag = true;
|
||||
File[] files = dirFile.listFiles();
|
||||
|
||||
for(int i = 0; i < files.length; ++i) {
|
||||
if (files[i].isFile()) {
|
||||
flag = deleteFile(files[i].getAbsolutePath());
|
||||
if (!flag) {
|
||||
break;
|
||||
}
|
||||
} else if (files[i].isDirectory()) {
|
||||
flag = deleteDirectory(files[i].getAbsolutePath());
|
||||
if (!flag) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!flag) {
|
||||
log.info("删除目录失败!");
|
||||
return false;
|
||||
} else if (dirFile.delete()) {
|
||||
log.info("删除目录 " + dirName + " 成功!");
|
||||
return true;
|
||||
} else {
|
||||
log.info("删除目录 " + dirName + " 失败!");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
log.info(dirNames + " 目录不存在!");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean exists(String path) {
|
||||
return (new File(path)).exists();
|
||||
}
|
||||
|
||||
public static void checkAndMkdirs(File file) {
|
||||
if (!file.getParentFile().exists()) {
|
||||
file.getParentFile().mkdirs();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static String getFileExtension(String fileName) {
|
||||
return fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length());
|
||||
}
|
||||
|
||||
public static String getFileName(String fileName) {
|
||||
return fileName.substring(0, fileName.lastIndexOf("."));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.adc.da.util;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
public class IOUtils extends org.apache.commons.io.IOUtils {
|
||||
|
||||
|
||||
public static byte[] readFully(InputStream is) throws IOException {
|
||||
byte[] bytes = new byte[is.available()];
|
||||
readFully(is, bytes);
|
||||
return bytes;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.adc.da.util;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public class IpUtil {
|
||||
private IpUtil() {
|
||||
throw new IllegalStateException("Utility class");
|
||||
}
|
||||
|
||||
private static boolean checkIp(String ip) {
|
||||
return ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip);
|
||||
}
|
||||
|
||||
public static String getIpAddr(HttpServletRequest request) {
|
||||
String ip = request.getHeader("X-Forwarded-For");
|
||||
if (checkIp(ip)) {
|
||||
ip = request.getHeader("Proxy-Client-IP");
|
||||
if (checkIp(ip)) {
|
||||
ip = request.getHeader("WL-Proxy-Client-IP");
|
||||
}
|
||||
|
||||
if (checkIp(ip)) {
|
||||
ip = request.getHeader("HTTP_CLIENT_IP");
|
||||
}
|
||||
|
||||
if (checkIp(ip)) {
|
||||
ip = request.getHeader("HTTP_X_FORWARDED_FOR");
|
||||
}
|
||||
|
||||
if (checkIp(ip)) {
|
||||
ip = request.getRemoteAddr();
|
||||
}
|
||||
} else if (ip.length() > 15) {
|
||||
String[] ips = ip.split(",");
|
||||
|
||||
for(int index = 0; index < ips.length; ++index) {
|
||||
String strIp = ips[index];
|
||||
if (!"unknown".equalsIgnoreCase(strIp)) {
|
||||
ip = strIp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return StringUtils.trim(ip);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.adc.da.util;
|
||||
|
||||
import io.jsonwebtoken.Claims;
|
||||
import io.jsonwebtoken.ExpiredJwtException;
|
||||
import io.jsonwebtoken.Jwts;
|
||||
import io.jsonwebtoken.SignatureAlgorithm;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* token 工具类
|
||||
*
|
||||
* @author ch
|
||||
* @version 1.0.0
|
||||
* @since 1.0.0
|
||||
* <p>
|
||||
* Created at 2020/7/30 2:23 下午
|
||||
*/
|
||||
@Component
|
||||
public class JwtSysUtils {
|
||||
|
||||
// 过期时间
|
||||
private static long expire = 6048000;
|
||||
// 秘钥
|
||||
private static String secret = "HSyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9";
|
||||
|
||||
/**
|
||||
* 创建一个token
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public String generateToken(String userId) {
|
||||
Date now = new Date();
|
||||
Date expireDate = new Date(now.getTime() + expire);
|
||||
return Jwts.builder().setHeaderParam("type", "JWT").setSubject(userId).setIssuedAt(now)
|
||||
.setExpiration(expireDate).signWith(
|
||||
SignatureAlgorithm.HS512, secret).compact();
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析token
|
||||
*/
|
||||
public Claims getClaimsByToken(String token) {
|
||||
Claims claims;
|
||||
try {
|
||||
claims = Jwts.parser()
|
||||
.setSigningKey(secret) // 设置标识名
|
||||
.parseClaimsJws(token) //解析token
|
||||
.getBody();
|
||||
} catch (ExpiredJwtException e) {
|
||||
claims = e.getClaims();
|
||||
}
|
||||
return claims;
|
||||
}
|
||||
|
||||
public String getUserIdByToken(){
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
String user = "";
|
||||
if(attributes != null){
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
if(StringUtils.isNotBlank(request.getHeader("token"))){
|
||||
Claims claim = getClaimsByToken(request.getHeader("token"));
|
||||
user = claim.getSubject();
|
||||
}else {
|
||||
user = "chenchunmei";
|
||||
}
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.adc.da.util;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.UnavailableSecurityManagerException;
|
||||
import org.apache.shiro.session.InvalidSessionException;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class LoginUserUtil {
|
||||
/**
|
||||
* 获取当前登录用户ID
|
||||
*
|
||||
*/
|
||||
public static String getUserId() {
|
||||
return UserSysUtils.getUserId();
|
||||
}
|
||||
|
||||
public static String getUserParamValue() {
|
||||
String paramValue = null;
|
||||
try {
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
Object object=subject.getPrincipal();
|
||||
if(object!=null){
|
||||
String json = JSONObject.toJSONString(object);
|
||||
if(json!=null && json.length()>0){
|
||||
Map<String, Object> userInfo=JSONObject.parseObject(json, Map.class);
|
||||
paramValue=userInfo.get("paramValue").toString();
|
||||
}
|
||||
}
|
||||
} catch (UnavailableSecurityManagerException e) {
|
||||
} catch (InvalidSessionException e) {
|
||||
}
|
||||
return paramValue;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.adc.da.util;
|
||||
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 采用MD5加密解密
|
||||
* @author tfq
|
||||
* @datetime 2011-10-13
|
||||
*/
|
||||
public class MD5Util {
|
||||
|
||||
/***
|
||||
* MD5加码 生成32位md5码
|
||||
*/
|
||||
public static String string2MD5(String inStr){
|
||||
MessageDigest md5 = null;
|
||||
try{
|
||||
md5 = MessageDigest.getInstance("MD5");
|
||||
}catch (Exception e){
|
||||
System.out.println(e.toString());
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
char[] charArray = inStr.toCharArray();
|
||||
byte[] byteArray = new byte[charArray.length];
|
||||
|
||||
for (int i = 0; i < charArray.length; i++)
|
||||
byteArray[i] = (byte) charArray[i];
|
||||
byte[] md5Bytes = md5.digest(byteArray);
|
||||
StringBuffer hexValue = new StringBuffer();
|
||||
for (int i = 0; i < md5Bytes.length; i++){
|
||||
int val = ((int) md5Bytes[i]) & 0xff;
|
||||
if (val < 16)
|
||||
hexValue.append("0");
|
||||
hexValue.append(Integer.toHexString(val));
|
||||
}
|
||||
return hexValue.toString();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 加密解密算法 执行一次加密,两次解密
|
||||
*/
|
||||
public static String convertMD5(String inStr){
|
||||
|
||||
char[] a = inStr.toCharArray();
|
||||
for (int i = 0; i < a.length; i++){
|
||||
a[i] = (char) (a[i] ^ 't');
|
||||
}
|
||||
String s = new String(a);
|
||||
return s;
|
||||
|
||||
}
|
||||
|
||||
// 测试主函数
|
||||
public static void main(String args[]) {
|
||||
/* String s = new String("tangfuqiang");
|
||||
System.out.println("原始:" + s);
|
||||
System.out.println("MD5后:" + string2MD5(s));
|
||||
|
||||
System.out.println("加密的:" + convertMD5(s));
|
||||
|
||||
System.out.println("解密的:" + convertMD5(convertMD5(s)));*/
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH");
|
||||
String time = df.format(new Date());
|
||||
System.out.println(time);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.adc.da.util;
|
||||
|
||||
import cn.hutool.crypto.digest.DigestAlgorithm;
|
||||
import cn.hutool.crypto.digest.Digester;
|
||||
|
||||
public class PasswordUtils {
|
||||
|
||||
public PasswordUtils() {
|
||||
}
|
||||
|
||||
public static String encryptPassword(String plainPassword) {
|
||||
byte[] salt = Digests.generateSalt(8);
|
||||
byte[] hashPassword = Digests.sha1(plainPassword.getBytes(), salt, 1024);
|
||||
return Encodes.encodeHex(salt) + Encodes.encodeHex(hashPassword);
|
||||
}
|
||||
|
||||
public static boolean validatePassword(String plainPassword, String password) {
|
||||
byte[] salt = Encodes.decodeHex(password.substring(0, 16));
|
||||
byte[] hashPassword = Digests.sha1(plainPassword.getBytes(), salt, 1024);
|
||||
return password.equals(Encodes.encodeHex(salt) + Encodes.encodeHex(hashPassword));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.adc.da.util;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public class RequestUtils {
|
||||
public static final String LOGIN_USER = "LOGIN_USER";
|
||||
public static final String LOGIN_USER_ID = "LOGIN_USER_ID";
|
||||
public static final String LOGIN_ROLE_ID = "LOGIN_ROLE_ID";
|
||||
|
||||
private RequestUtils() {
|
||||
throw new IllegalStateException("RequestUtils");
|
||||
}
|
||||
|
||||
public static String getClientIp(HttpServletRequest request) {
|
||||
String remoteAddr = "";
|
||||
if (request != null) {
|
||||
remoteAddr = request.getHeader("X-FORWARDED-FOR");
|
||||
if (StringUtils.isEmpty(remoteAddr)) {
|
||||
remoteAddr = request.getRemoteAddr();
|
||||
}
|
||||
}
|
||||
|
||||
return remoteAddr;
|
||||
}
|
||||
|
||||
public static String getLoginUserId(HttpServletRequest request) {
|
||||
return (String)request.getSession().getAttribute("LOGIN_USER_ID");
|
||||
}
|
||||
|
||||
public static String getLoginRoleId(HttpServletRequest request) {
|
||||
return (String)request.getSession().getAttribute("LOGIN_ROLE_ID");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.adc.da.util;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class SpringContextHolder1 implements ApplicationContextAware {
|
||||
|
||||
|
||||
private static ApplicationContext applicationContext;
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
this.applicationContext = applicationContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取applicationContext
|
||||
* @return
|
||||
*/
|
||||
public static ApplicationContext getApplicationContext() {
|
||||
return applicationContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过name获取 Bean.
|
||||
* @param name 参数传入要获取的实例的类名 首字母小写,这是默认的
|
||||
* @return
|
||||
*/
|
||||
public static Object getBean(String name){
|
||||
return getApplicationContext().getBean(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过class获取Bean.
|
||||
* @param clazz
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> T getBean(Class<T> clazz){
|
||||
return getApplicationContext().getBean(clazz);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.adc.da.util;
|
||||
|
||||
|
||||
|
||||
import cn.hutool.core.lang.Snowflake;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
public class UUIDUtils {
|
||||
|
||||
public static Snowflake snowflake;
|
||||
|
||||
public static Snowflake getSnowflake() {
|
||||
return snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务编码
|
||||
*/
|
||||
private static long serverCode;
|
||||
|
||||
/**
|
||||
* 中心端编码
|
||||
*
|
||||
*/
|
||||
private static long appCenter;
|
||||
|
||||
@Value("${application.code}")
|
||||
public static void setServerCode(long serverCode) {
|
||||
UUIDUtils.serverCode = serverCode;
|
||||
}
|
||||
|
||||
@Value("${application.center}")
|
||||
public static void setAppCenter(long appCenter) {
|
||||
UUIDUtils.appCenter = appCenter;
|
||||
}
|
||||
|
||||
|
||||
public static void setSnowflake(Snowflake snowflake) {
|
||||
IdUtil.getSnowflake(serverCode,appCenter);
|
||||
}
|
||||
|
||||
public static String randomUUID10() {
|
||||
return RandomUtil.randomString(10);
|
||||
}
|
||||
|
||||
public static String randomUUID20() {
|
||||
return RandomUtil.randomString(20);
|
||||
}
|
||||
|
||||
public static String randomUUID(int length) {
|
||||
return RandomUtil.randomString(length);
|
||||
}
|
||||
|
||||
public static String randomSnowflakeID(){
|
||||
return snowflake.nextIdStr();
|
||||
}
|
||||
|
||||
|
||||
public static String getUUIDPath(String uuid){
|
||||
StringBuilder builder=new StringBuilder();
|
||||
builder.append("/");
|
||||
builder.append((uuid.substring(0, 3).hashCode())%100+"").append("/");
|
||||
builder.append((uuid.substring(7,10).hashCode())%100+"").append("/");
|
||||
builder.append((uuid.substring(11,14).hashCode())%100+"").append("/");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
public static String getAttTable(){
|
||||
int nextInt = RandomUtil.randomInt(10)+1;
|
||||
StringBuilder builder=new StringBuilder();
|
||||
builder.append("ATT_FILE_").append(String.format("%02d", nextInt));
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.adc.da.util;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.UnavailableSecurityManagerException;
|
||||
import org.apache.shiro.authz.SimpleAuthorizationInfo;
|
||||
import org.apache.shiro.session.InvalidSessionException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class UserSysUtils {
|
||||
|
||||
private UserSysUtils() {
|
||||
super();
|
||||
}
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(UserSysUtils.class);
|
||||
|
||||
/**
|
||||
* 当前登陆用户
|
||||
*/
|
||||
public static final String CURRENT_USER = "currentUser";
|
||||
|
||||
/**
|
||||
* 角色信息
|
||||
*/
|
||||
public static final String CACHE_ROLE_LIST = "roleList";
|
||||
/**
|
||||
* 菜单信息
|
||||
*/
|
||||
public static final String CACHE_MENU_LIST = "menuList";
|
||||
public static final String CACHE_MENU_TREE = "menuTree";
|
||||
public static final String CACHE_AREA_LIST = "areaList";
|
||||
public static final String CACHE_OFFICE_LIST = "officeList";
|
||||
|
||||
/**
|
||||
* @see JwtSysUtils
|
||||
*/
|
||||
private static JwtSysUtils jwtUtils = SpringContextHolder1.getBean(JwtSysUtils.class);
|
||||
|
||||
/**
|
||||
* 退出
|
||||
*/
|
||||
public static void logout() {
|
||||
try {
|
||||
SecurityUtils.getSubject().logout();
|
||||
} catch (UnavailableSecurityManagerException e) {
|
||||
logger.error(e.getMessage(),e);
|
||||
} catch (InvalidSessionException e) {
|
||||
logger.error(e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前登陆用户ID
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String getUserId() {
|
||||
return jwtUtils.getUserIdByToken();
|
||||
}
|
||||
|
||||
|
||||
public static void flush() {
|
||||
CacheUtils.removeCache(CURRENT_USER);
|
||||
}
|
||||
|
||||
private static final class CacheUtils {
|
||||
|
||||
public static Object getCache(String key) {
|
||||
return getCache(key, null);
|
||||
}
|
||||
|
||||
public static Object getCache(String key, Object defaultValue) {
|
||||
Object obj = getCacheMap().get(key);
|
||||
return obj == null ? defaultValue : obj;
|
||||
}
|
||||
|
||||
public static void putCache(String key, Object value) {
|
||||
getCacheMap().put(key, value);
|
||||
}
|
||||
|
||||
public static void removeCache(String key) {
|
||||
getCacheMap().remove(key);
|
||||
}
|
||||
|
||||
public static Map<String, Object> getCacheMap() {
|
||||
Map<String, Object> map = Maps.newHashMap();
|
||||
return map;
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user