feat: 添加子模块-工作流 集成相关配置

This commit is contained in:
super_liu
2021-06-08 22:23:40 +08:00
parent 79beef6692
commit 2b5164ddd3
56 changed files with 4461 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
<?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>
</dependencies>
</project>
@@ -0,0 +1,395 @@
package com.adc.da.FeignClient;
import com.adc.da.common.*;
import com.adc.da.common.Category;
import com.adc.da.common.Page;
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 java.util.List;
import java.util.Map;
import java.util.Set;
@FeignClient(value = "bat-wkflow")
public interface workFlowFeignClient {
@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);
/**
* 企标复审流程专用
* @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/completeTask",method = RequestMethod.POST)
Wrapper<String> completeTaskByUserId(@RequestBody BusMes 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 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);
/**
* @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/queryBusProcessNameForEnd",method = RequestMethod.POST)
List<BusProcessName> queryBusProcessNameForEnd(@RequestBody String taskId);
// @RequestMapping(value = "/bat-wkflow/findProcessNameByPrcNum",method = RequestMethod.POST)
// List<BusProcessName> findProcessNameByPrcNum(@RequestBody String taskId);
}
@@ -0,0 +1,309 @@
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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;
@Component
public class workFlowFeignClientImpl {
@Autowired
private workFlowFeignClient workFlowFeignClient;
@Autowired
private IUserEOService userEOService;
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 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;
}
/**
* 开始分页
* @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> 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 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 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 List<BusProcessName> queryBusProcessNameForEnd(@RequestBody String prcNum){
return workFlowFeignClient.queryBusProcessNameForEnd(prcNum);
}
}
@@ -0,0 +1,154 @@
package com.adc.da.Timer;
import com.adc.da.FeignClient.workFlowFeignClient;
import com.adc.da.common.BusProcessName;
import com.adc.da.sys.common.EmailUtils;
import com.adc.da.sys.entity.UserEO;
import com.adc.da.sys.service.IUserEOService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
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.Date;
import java.util.List;
/**
* @Description: 流程相关定时任务
* @Author: yangxuenan
* date: 2020/12/11 10:18
*/
@Component
@EnableScheduling
public class ProcessTimer {
@Autowired
private workFlowFeignClient workFlowFeignClient;
@Autowired
private EmailUtils mailUtil;
@Autowired
private IUserEOService userEOService;
/***
* @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() {
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);
}
}
}
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;
}
}
@@ -0,0 +1,131 @@
package com.adc.da.common;
public class BusMes {
private String userId;
private String taskId;
private String json;
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,48 @@
package com.adc.da.common;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <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;
}
@@ -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,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,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>&nbsp; &nbsp; 本标准规定了XXXX的术语和定义、技术要求、试验方法、检验规则和标志、包装、运输及贮存。</p><p>&nbsp; &nbsp; 本标准适用于广汽研究院开发的乘用车用的XXXX。</p><p><br/></p>";
private String titleTwo = "<p>&nbsp; &nbsp; &nbsp; &nbsp;下列文件对于本文件的应用是必不可少的。凡是注日期的引用文件,仅所注日期的版本适用于本文件。凡是不注日期的引用文件,其最新版本(包括所有的修改单)适用于本文件。</p><p>&nbsp; &nbsp; &nbsp; &nbsp;[国家标准]</p><p>&nbsp; &nbsp; &nbsp; &nbsp;[行业标准]</p><p>&nbsp; &nbsp; &nbsp; &nbsp;[地方标准]</p><p>&nbsp; &nbsp; &nbsp; &nbsp;[法规、规程、规范和其它有关文件]</p><p>&nbsp; &nbsp; &nbsp; &nbsp;[ISO标准]</p><p>&nbsp; &nbsp; &nbsp; &nbsp;[IEC标准]</p><p>&nbsp; &nbsp; &nbsp; &nbsp;[ISO、IEC有关文件]</p><p>&nbsp; &nbsp; &nbsp; &nbsp;[其它国际标准]</p><p>&nbsp; &nbsp; &nbsp; &nbsp;[其它国际有关文件]</p><p>&nbsp; &nbsp; &nbsp; &nbsp;[本企业已发布的院级标准]</p><p><br/></p>";
private String titleThree = "<p>&nbsp; &nbsp; &nbsp; &nbsp; 下列术语和定义适用于本标准。</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,628 @@
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 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.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.entity.ProcessDetailExport;
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.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/${restPath}/lawss/activiti")
@Api(tags = "福田标准法规-工作流管理")
public class WorkFlowController {
@Autowired
private workFlowFeignClientImpl workFlowFeignClient;
@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_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(type.equals("1")){
return this.activiti_define_start("fgrk", LoginUserUtil.getUserId(),id);
}else if(type.equals("2")){
return this.activiti_define_start("fgjspglc",LoginUserUtil.getUserId(),id);
}else if(type.equals("3")){
return this.activiti_define_start("projectreview",LoginUserUtil.getUserId(),id);
}else if(type.equals("4")){
return this.activiti_define_start("qbzxd",LoginUserUtil.getUserId(),id);
}else if(type.equals("5")){
return this.activiti_define_start("whgxgllc",LoginUserUtil.getUserId(),id);
}else if(type.equals("6")){
return this.activiti_define_start("qbzxdsqlc",LoginUserUtil.getUserId(),id);
}else if(type.equals("9")){
return this.activiti_define_start("bzcgsqlc",LoginUserUtil.getUserId(),id);
}else if(type.equals("8")){
return this.activiti_define_start("zxdyqsplc",LoginUserUtil.getUserId(),id);
}else if(type.equals("10")){
return this.activiti_define_start("bzhyhqsqlc",LoginUserUtil.getUserId(),id);
}else if(type.equals("11")){
return this.activiti_define_start("qbzxdpglc",LoginUserUtil.getUserId(),id);
}else if(type.equals("12")){
return this.activiti_define_start("qbkwlc",LoginUserUtil.getUserId(),id);
}else if(type.equals("13")){
return this.activiti_define_start("xzyqpglc",LoginUserUtil.getUserId(),id);
}else if(type.equals("7")){
return this.activiti_define_start("qbfzlc",LoginUserUtil.getUserId(),id);
}
else if(type.equals("15")){
return this.activiti_define_start("bzfysqlc",LoginUserUtil.getUserId(),id);
}else if(type.equals("16")){
return this.activiti_define_start("bzhyhhgllc",LoginUserUtil.getUserId(),id);
}else if(type.equals("17")){
return this.activiti_define_start("qbbalc",LoginUserUtil.getUserId(),id);
}else if(type.equals("18")){
return this.activiti_define_start("hwfgqdfbjgxlc",LoginUserUtil.getUserId(),id);
}else if(type.equals("19")){
return this.activiti_define_start("qbfslc","3U5F8UJJVPZB4B4BKN3P",id);
}else if(type.equals("14")){
return this.activiti_define_start("zcrkjpglc",LoginUserUtil.getUserId(),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("/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("/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 = "查询草稿")
@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("/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());
pageInfo.setCount(page.getCount());
pageInfo.setPageSize(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("")){
if(map.get("comment").toString().equals("0")){
map.put("comment","同意");
}else if(map.get("comment").toString().equals("1")){
map.put("comment","不同意");
}else{
map.put("comment",map.get("commentText").toString());
}
}
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 = "采购保存接口")
@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("发送成功");
}
}
@@ -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 comment;
@Excel(name = "状态", orderNum = "6",width = 15)
private String flag;
}
@@ -0,0 +1,34 @@
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,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);
}
}
+5
View File
@@ -29,6 +29,11 @@
<artifactId>adc-da-slrs</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>com.adc</groupId>
<artifactId>adc-da-activiti</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>com.adc</groupId>
<artifactId>adc-da-sys</artifactId>
@@ -5,7 +5,11 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@EnableEurekaClient
@EnableFeignClients
@ServletComponentScan
@SpringBootApplication(exclude = SecurityAutoConfiguration.class)
@MapperScan(value = {"com.adc.da.file.store"})
@@ -1,6 +1,7 @@
##############################################
# 项目启动模式
##############################################
spring.application.name=FotonLAWSSystem
spring.profiles.active=dev
##############################################
@@ -87,6 +88,24 @@ spring.activiti.check-process-definitions=false
spring.activiti.job-executor-activate=false
spring.activiti.process-definition-location-prefix=classpath:/mybatis/mapper/activiti/
# =============================================================================
# 邮箱配置
# =============================================================================
mail.valid=false
spring.mail.host=smtp.163.com
spring.mail.protocol=smtp
spring.mail.username=xxx@163.com
spring.mail.password=xxx
spring.mail.properties.smtp.auth=true
spring.mail.properties.smtp.starttls.enable=true
spring.mail.properties.smtp.starttls.required=true
spring.mail.properties.mail.smtp.ssl.enable=true
spring.mail.port=465
#全球标准法规管理系统 十六进制码
mail.personName=E585A8E79083E6A087E58786E6B395E8A784E7AEA1E79086E7B3BBE7BB9F
#邮箱内容中嵌入的系统地址
Lawss.address =http://standard.gacrnd.com:60090
# =========================================
# login value
@@ -0,0 +1,296 @@
package com.adc.da.sys.common;
import com.adc.da.exception.ServiceException;
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.mail.MailException;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import javax.mail.MessagingException;
import javax.mail.internet.MimeMessage;
import java.io.File;
import java.io.UnsupportedEncodingException;
@Component
public class EmailUtils {
private final Logger logger = LoggerFactory.getLogger(getClass());
/**
* The Mail sender.
*/
@Autowired
JavaMailSender mailSender;
@Value("${mail.valid}")
private boolean mailValid;
@Value("${spring.mail.username}")
private String userName;
/**
* Send simple email.
*
* @param deliver the deliver
* @param receiver the receiver
* @param subject the subject
* @param content the content
* @throws ServiceException the service exception
*/
public void sendSimpleEmail(String deliver,String personName, String receiver, String subject, String content) throws ServiceException {
if(mailValid){
String[] receivers = {receiver};
sendSimpleEmail(deliver,personName, receivers, null, subject, content);
}
}
/**
* Send simple email.
*
* @param deliver the deliver
* @param receiver the receiver
* @param carbonCopy the carbon copy
* @param subject the subject
* @param content the content
* @throws ServiceException the service exception
*/
public void sendSimpleEmail(String deliver,String personName, String[] receiver, String[] carbonCopy, String subject, String content) throws ServiceException {
long startTimestamp = System.currentTimeMillis();
logger.info("Start send mail ... ");
try {
SimpleMailMessage message = new SimpleMailMessage();
personName=javax.mail.internet.MimeUtility.encodeText(personName);
message.setFrom(personName + "<"+deliver+">");
message.setTo(receiver);
if(carbonCopy!=null && carbonCopy.length>0){
message.setCc(carbonCopy);
}
message.setSubject(subject);
message.setText(content);
mailSender.send(message);
logger.info("Send mail success, cost {} million seconds", System.currentTimeMillis() - startTimestamp);
} catch (MailException e) {
logger.error("Send mail failed, error message is : {} \n", e.getMessage());
logger.error(e.getMessage(),e);
throw new ServiceException(e.getMessage());
} catch (UnsupportedEncodingException e) {
logger.error("Send mail failed, error message is : {} \n", e.getMessage());
logger.error(e.getMessage(),e);
throw new ServiceException(e.getMessage());
}
}
/**
* Send html email.
*
* @param deliver the deliver
* @param receiver the receiver
* @param subject the subject
* @param content the content
* @throws ServiceException the service exception
*/
public void sendHtmlEmail(String deliver, String receiver, String subject, String content) throws ServiceException {
String[] receivers = {receiver};
sendHtmlEmail(deliver, receivers, null, subject, content, true);
}
/**
* Send html email.
*
* @param deliver the deliver
* @param receiver the receiver
* @param carbonCopy the carbon copy
* @param subject the subject
* @param content the content
* @param isHtml the is html
* @throws ServiceException the service exception
*/
public void sendHtmlEmail(String deliver, String[] receiver, String[] carbonCopy, String subject, String content, boolean isHtml) throws ServiceException {
long startTimestamp = System.currentTimeMillis();
logger.info("Start send email ...");
try {
MimeMessage message = mailSender.createMimeMessage();
MimeMessageHelper messageHelper = new MimeMessageHelper(message);
messageHelper.setFrom(deliver);
messageHelper.setTo(receiver);
messageHelper.setCc(carbonCopy);
messageHelper.setSubject(subject);
messageHelper.setText(content, isHtml);
mailSender.send(message);
logger.info("Send email success, cost {} million seconds", System.currentTimeMillis() - startTimestamp);
} catch (MessagingException e) {
logger.error("Send email failed, error message is {} \n", e.getMessage());
logger.error(e.getMessage(),e);
throw new ServiceException(e.getMessage());
}
}
/**
* Send attachment file email.
*
* @param deliver the deliver
* @param receiver the receiver
* @param subject the subject
* @param content the content
* @param fileName the file name
* @param file the file
* @throws ServiceException the service exception
*/
public void sendAttachmentFileEmail(String deliver, String receiver, String subject, String content, String fileName, File file) throws ServiceException {
String[] receivers = {receiver};
sendAttachmentFileEmail(deliver, receivers, null, subject, content, true, fileName, file);
}
/**
* Send attachment file mail.
*
* @param deliver the deliver
* @param receiver the receiver
* @param carbonCopy the carbon copy
* @param subject the subject
* @param content the content
* @param isHtml the is html
* @param fileName the file name
* @param file the file
* @throws ServiceException the service exception
*/
public void sendAttachmentFileEmail(String deliver, String[] receiver, String[] carbonCopy, String subject, String content, boolean isHtml, String fileName, File file) throws ServiceException {
long startTimestamp = System.currentTimeMillis();
logger.info("Start send mail ...");
try {
MimeMessage message = mailSender.createMimeMessage();
MimeMessageHelper messageHelper = new MimeMessageHelper(message, true);
messageHelper.setFrom(deliver);
messageHelper.setTo(receiver);
messageHelper.setCc(carbonCopy);
messageHelper.setSubject(subject);
messageHelper.setText(content, isHtml);
messageHelper.addAttachment(fileName, file);
mailSender.send(message);
logger.info("Send mail success, cost {} million seconds", System.currentTimeMillis() - startTimestamp);
} catch (MessagingException e) {
logger.error("Send mail failed, error message is {}\n", e.getMessage());
logger.error(e.getMessage(),e);
throw new ServiceException(e.getMessage());
}
}
/* *//**
* Send template email.
*
* @param deliver the deliver
* @param receiver the receiver
* @param subject the subject
* @param template the template
* @param context the context
* @throws ServiceException the service exception
*//*
public void sendTemplateEmail(String deliver, String receiver, String subject, String template, Context context) throws ServiceException {
String[] receivers = {receiver};
sendTemplateEmail(deliver, receivers, null, subject, template, context);
}*/
/* *//**
* Send template mail.
* @throws ServiceException the service exception
*//*
public void sendTemplateEmail(String deliver, String[] receiver, String[] carbonCopy, String subject, String template, Context context) throws ServiceException {
long startTimestamp = System.currentTimeMillis();
logger.info("Start send mail ...");
try {
MimeMessage message = mailSender.createMimeMessage();
MimeMessageHelper messageHelper = new MimeMessageHelper(message);
String content = templateEngine.process(template, context);
messageHelper.setFrom(deliver);
messageHelper.setTo(receiver);
messageHelper.setCc(carbonCopy);
messageHelper.setSubject(subject);
messageHelper.setText(content, true);
mailSender.send(message);
logger.info("Send mail success, cost {} million seconds", System.currentTimeMillis() - startTimestamp);
} catch (MessagingException e) {
logger.error("Send mail failed, error message is {} \n", e.getMessage());
e.printStackTrace();
throw new ServiceException(e.getMessage());
}
}*/
@Async
public void sendMsg(String[] tos,String msg){
//创建简单邮件消息
SimpleMailMessage message = new SimpleMailMessage();
//谁发的
message.setFrom(userName);
//谁要接收
message.setTo(tos);
//邮件标题
message.setSubject(msg);
//邮件内容
message.setText(msg);
try {
mailSender.send(message);
} catch (MailException e) {
e.printStackTrace();
}
}
@Async
public void sendMsgFeign(String[] tos,String title, String msg){
//创建简单邮件消息
SimpleMailMessage message = new SimpleMailMessage();
//谁发的
message.setFrom(userName);
//谁要接收
message.setTo(tos);
//邮件标题
message.setSubject(title);
//邮件内容
message.setText(msg);
try {
mailSender.send(message);
} catch (MailException e) {
e.printStackTrace();
}
}
@Async
public void sendMsgWithCC(String[] tos,String[] cc,String msg){
//创建简单邮件消息
SimpleMailMessage message = new SimpleMailMessage();
//谁发的
message.setFrom(userName);
//谁要接收
message.setTo(tos);
//抄送
message.setCc(cc);
//邮件标题
message.setSubject(msg);
//邮件内容
message.setText(msg);
try {
mailSender.send(message);
} catch (MailException e) {
e.printStackTrace();
}
}
}
+1
View File
@@ -37,6 +37,7 @@
<module>adc-da-sys</module>
<module>adc-da-jwtLogin</module>
<module>adc-da-slrs</module>
<module>adc-da-activiti</module>
</modules>
<repositories>