Merge remote-tracking branch 'origin/develop_master' into develop_1
This commit is contained in:
@@ -3,6 +3,9 @@ package com.adc.da.FeignClient;
|
||||
import com.adc.da.common.*;
|
||||
import com.adc.da.common.Category;
|
||||
import com.adc.da.common.Page;
|
||||
import com.adc.da.workFlow.entity.BusProcessEvaluationHis;
|
||||
import com.adc.da.workFlow.entity.BusProcessModelHis;
|
||||
import com.adc.da.workFlow.entity.ProcessRollBackEO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -17,6 +20,18 @@ import java.util.Set;
|
||||
//@FeignClient(value = "shan6")
|
||||
public interface workFlowFeignClient {
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/busProcessModel/processModelHisOneUpdStatus",method = RequestMethod.GET)
|
||||
BusProcessModelHis processModelHisOneUpdStatus(@RequestParam("pid") String pid, @RequestParam("taskId") String taskId);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/busProcessModel/processModelHisOneCount",method = RequestMethod.GET)
|
||||
BusProcessModelHis processModelHisOneCount(@RequestParam("pid") String pid);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/busProcessModel/processModelHisOne",method = RequestMethod.GET)
|
||||
BusProcessModelHis processModelHisOne(@RequestParam("pid") String pid, @RequestParam("taskId") String taskId);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/busProcessEvaluation/evaluationHisList",method = RequestMethod.GET)
|
||||
List<BusProcessEvaluationHis> evaluationHisList(@RequestParam("pid") String pid);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/oaTaskExec/execTask",method = RequestMethod.GET)
|
||||
Map<String,Object> execTask(@RequestParam("todoId") String todoId);
|
||||
|
||||
@@ -26,6 +41,9 @@ 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);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/activiti_define_start_user_rollBack",method = RequestMethod.POST)
|
||||
Wrapper<String> activiti_define_start_rollBack(@RequestBody ProcessRollBackEO processRollBackEO);
|
||||
|
||||
/**
|
||||
* 企标复审流程专用
|
||||
* @param id
|
||||
@@ -44,6 +62,9 @@ public interface workFlowFeignClient {
|
||||
@RequestMapping(value = "/bat-wkflow/todoTaskList",method = RequestMethod.POST)
|
||||
List<BusProcessName> todoTaskListByUserId(@RequestBody TaskCommonQuery taskCommonQuery);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/todoTaskListNew",method = RequestMethod.POST)
|
||||
List<BusProcessName> todoTaskListByUserIdNew(@RequestBody TaskCommonQuery taskCommonQuery);
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/completeTask",method = RequestMethod.POST)
|
||||
Wrapper<String> completeTaskByUserId(@RequestBody BusMes busMes);
|
||||
|
||||
@@ -405,4 +426,7 @@ public interface workFlowFeignClient {
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/datas/bus-process-new/everyDayTenOlockSAM",method = RequestMethod.GET)
|
||||
List<BusProcessNew> everyDayTenOlockSAM();
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/delCG",method = RequestMethod.POST)
|
||||
String delCG(@RequestParam("id") String id);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@ import com.adc.da.common.*;
|
||||
import com.adc.da.common.Page;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.sys.service.IUserEOService;
|
||||
import com.adc.da.workFlow.entity.BusProcessEvaluationHis;
|
||||
import com.adc.da.workFlow.entity.BusProcessModelHis;
|
||||
import com.adc.da.workFlow.entity.ProcessRollBackEO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -25,6 +28,26 @@ public class workFlowFeignClientImpl {
|
||||
@Autowired
|
||||
private IUserEOService userEOService;
|
||||
|
||||
public BusProcessModelHis processModelHisOneUpdStatus(@RequestParam("pid") String pid,@RequestParam("taskId") String taskId){
|
||||
BusProcessModelHis stringWrapper = workFlowFeignClient.processModelHisOneUpdStatus(pid,taskId);
|
||||
return stringWrapper;
|
||||
}
|
||||
|
||||
public BusProcessModelHis processModelHisOneCount(@RequestParam("pid") String pid){
|
||||
BusProcessModelHis stringWrapper = workFlowFeignClient.processModelHisOneCount(pid);
|
||||
return stringWrapper;
|
||||
}
|
||||
|
||||
public BusProcessModelHis processModelHisOne(@RequestParam("pid") String pid,@RequestParam("taskId") String taskId){
|
||||
BusProcessModelHis stringWrapper = workFlowFeignClient.processModelHisOne(pid,taskId);
|
||||
return stringWrapper;
|
||||
}
|
||||
|
||||
public List<BusProcessEvaluationHis> evaluationHisList(@RequestParam("pid") String pid){
|
||||
List<BusProcessEvaluationHis> stringWrapper = workFlowFeignClient.evaluationHisList(pid);
|
||||
return stringWrapper;
|
||||
}
|
||||
|
||||
public Map<String,Object> execTask(@RequestParam("todoId") String todoId){
|
||||
Map<String,Object> stringWrapper = workFlowFeignClient.execTask(todoId);
|
||||
return stringWrapper;
|
||||
@@ -39,6 +62,16 @@ public class workFlowFeignClientImpl {
|
||||
Wrapper<String> stringWrapper = workFlowFeignClient.activiti_define_start(Id,userId,bpnId);
|
||||
return Result.success(stringWrapper.getResult());
|
||||
}
|
||||
|
||||
public ResponseMessage activiti_define_start_rollBack(@RequestParam("Id") String Id, @RequestParam("userId") String userId, @RequestParam("bpnId") String bpnId,@RequestParam("json")String json){
|
||||
ProcessRollBackEO rollBackEO=new ProcessRollBackEO();
|
||||
rollBackEO.setId(Id);
|
||||
rollBackEO.setBpnId(bpnId);
|
||||
rollBackEO.setJson(json);
|
||||
rollBackEO.setUserId(userId);
|
||||
Wrapper<String> stringWrapper = workFlowFeignClient.activiti_define_start_rollBack(rollBackEO);
|
||||
return Result.success(stringWrapper.getResult());
|
||||
}
|
||||
public Map<String,String> activiti_define_start1(@RequestParam("Id") String Id, @RequestParam("userId") String userId, @RequestParam("standName") String standName){
|
||||
Map<String,String> map = workFlowFeignClient.activiti_define_start1(Id,userId,standName);
|
||||
return map;
|
||||
@@ -64,6 +97,11 @@ public class workFlowFeignClientImpl {
|
||||
return mapWrapper;
|
||||
}
|
||||
|
||||
public List<BusProcessName> todoTaskListByUserIdNew(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
List<BusProcessName> mapWrapper = workFlowFeignClient.todoTaskListByUserId(taskCommonQuery);
|
||||
return mapWrapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始分页
|
||||
* @param list
|
||||
@@ -316,4 +354,8 @@ public class workFlowFeignClientImpl {
|
||||
public List<BusProcessName> queryBusProcessNameForEnd(@RequestBody String prcNum){
|
||||
return workFlowFeignClient.queryBusProcessNameForEnd(prcNum);
|
||||
}
|
||||
|
||||
public String delCG(@RequestParam("id") String id){
|
||||
return workFlowFeignClient.delCG(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public class ActDefineStartMap {
|
||||
Map<String,String> map = new TreeMap<>();
|
||||
map.put("1","standardLibraryWkflow");
|
||||
map.put("2","standardSurveyWorkFlow");
|
||||
map.put("3","standardCommentProcessWorkFlow");
|
||||
map.put("3","StandAskForOpinion");
|
||||
map.put("4","standardregulatoryinventory");
|
||||
map.put("5","projectEvaluationProcess");
|
||||
map.put("6","Projectcomplianceassessment");
|
||||
@@ -32,6 +32,9 @@ public class ActDefineStartMap {
|
||||
map.put("laws2","PolicyCommentProcessWorkFlow");
|
||||
map.put("laws3","KCSTPReviewProcessWorkFlow");
|
||||
|
||||
// 企标制修订流程及企业标准库流程
|
||||
map.put("buss1","bussLibraryWkflow");
|
||||
|
||||
//张超然
|
||||
map.put("20","StandardApplyMeetProcess");
|
||||
map.put("21","StandardMeetProcess");
|
||||
|
||||
@@ -47,20 +47,34 @@ public class TableToExcel {
|
||||
if (j<3)
|
||||
hCell.setCellValue(columnMap.get(key));
|
||||
}
|
||||
Cell hCellh = headRow.createCell(2);
|
||||
hCellh.setCellValue("修改意见内容");
|
||||
Cell hCell = headRow.createCell(5);
|
||||
hCell.setCellValue("提出部门");
|
||||
Cell hCell1 = headRow.createCell(6);
|
||||
hCell1.setCellValue("提出人");
|
||||
Cell hCell2 = headRow.createCell(7);
|
||||
hCell2.setCellValue("处理意见");
|
||||
Cell nCell = neckRow.createCell(2);
|
||||
nCell.setCellValue("修改前");
|
||||
Cell nCell1 = neckRow.createCell(3);
|
||||
nCell1.setCellValue("修改后");
|
||||
Cell nCell2 = neckRow.createCell(4);
|
||||
nCell2.setCellValue("修改理由");
|
||||
if (null!=columnMap.get("commentText")) {
|
||||
Cell hCellh = headRow.createCell(2);
|
||||
hCellh.setCellValue("修改意见内容");
|
||||
}
|
||||
if (null!=columnMap.get("department")) {
|
||||
Cell hCell = headRow.createCell(5);
|
||||
hCell.setCellValue("提出部门");
|
||||
}
|
||||
if (null!=columnMap.get("responUserName")) {
|
||||
Cell hCell1 = headRow.createCell(6);
|
||||
hCell1.setCellValue("提出人");
|
||||
}
|
||||
if (null!=columnMap.get("stateText")) {
|
||||
Cell hCell2 = headRow.createCell(7);
|
||||
hCell2.setCellValue("处理意见");
|
||||
}
|
||||
if (null!=columnMap.get("oldText")) {
|
||||
Cell nCell = neckRow.createCell(2);
|
||||
nCell.setCellValue("修改前");
|
||||
}
|
||||
if (null!=columnMap.get("newText")) {
|
||||
Cell nCell1 = neckRow.createCell(3);
|
||||
nCell1.setCellValue("修改后");
|
||||
}
|
||||
if (null!=columnMap.get("reason")) {
|
||||
Cell nCell1 = neckRow.createCell(4);
|
||||
nCell1.setCellValue("修改理由");
|
||||
}
|
||||
|
||||
|
||||
//从第三行开始填充数据
|
||||
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.adc.da.workFlow.controller;
|
||||
|
||||
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.ActSarItemsEO;
|
||||
import com.adc.da.workFlow.service.ActSarItemsBussEOService;
|
||||
import com.adc.da.workFlow.service.ActSarItemsLawsEOService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/lawss/actSarItemsBuss")
|
||||
@Api(description = "|ActSarItemsBuss|")
|
||||
public class ActSarItemsBussEOController extends BaseController<ActSarItemsEO> {
|
||||
|
||||
@Autowired
|
||||
private ActSarItemsBussEOService actSarItemsEOService;
|
||||
|
||||
// private static final Logger logger = LoggerFactory.getLogger(AttFileEOController.class);
|
||||
|
||||
@ApiOperation(value = "|SarBussionessStand|企标入库流程")
|
||||
@PostMapping("/processCreateBuss")
|
||||
public ResponseMessage processCreateBuss(String infoJson) throws Exception {
|
||||
if (StringUtils.isNotBlank(infoJson)) {
|
||||
actSarItemsEOService.processCreateBuss(infoJson);
|
||||
return Result.success("入库成功");
|
||||
} else {
|
||||
return Result.error("传入数据json不能为空");
|
||||
}
|
||||
}
|
||||
}
|
||||
+122
-6
@@ -12,14 +12,15 @@ import com.adc.da.http.PageInfo;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.common.Page;
|
||||
import com.adc.da.login.util.JwtUtils;
|
||||
import com.adc.da.slrs.sarUser.entity.TsUser;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.adc.da.sys.common.EmailUtils;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.sys.service.IUserEOService;
|
||||
import com.adc.da.util.LoginUserUtil;
|
||||
import com.adc.da.workFlow.dao.ExportExcelMapper;
|
||||
import com.adc.da.workFlow.entity.ExportExcel;
|
||||
import com.adc.da.workFlow.entity.ExportExcelEO;
|
||||
import com.adc.da.workFlow.entity.ProcessDetailExport;
|
||||
import com.adc.da.workFlow.entity.*;
|
||||
import com.adc.da.workFlow.service.WorkFlowService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -27,14 +28,19 @@ import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import sun.misc.BASE64Encoder;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.io.*;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -43,12 +49,76 @@ import java.util.stream.Collectors;
|
||||
@Api(tags = "福田标准法规-工作流管理")
|
||||
public class WorkFlowController {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(WorkFlowController.class);
|
||||
|
||||
@Autowired
|
||||
private workFlowFeignClientImpl workFlowFeignClient;
|
||||
|
||||
@Value("${stand.edit.file.path}")
|
||||
private String standEditFilePath;
|
||||
|
||||
@Autowired
|
||||
private JwtUtils jwtUtils;
|
||||
|
||||
@Autowired
|
||||
private ITsUserService userService;
|
||||
|
||||
// @Autowired
|
||||
// private ExportExcelMapper exportExcelMapper;
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value = "手机获取token")
|
||||
@PostMapping(value = "/loginMobile")
|
||||
@ResponseBody
|
||||
public ResponseMessage<String> loginMobile(String taskIds, String pId) throws UnsupportedEncodingException {
|
||||
BusProcessNew busProcessNew = workFlowFeignClient.queryDetail(taskIds);
|
||||
if(busProcessNew == null || StringUtils.isBlank(busProcessNew.getUserId())){
|
||||
return Result.error("r0011", "用户不存在");
|
||||
}
|
||||
TsUser userEO = userService.getById(busProcessNew.getUserId());
|
||||
if (null == userEO) {
|
||||
return Result.error("r0011", "用户不存在");
|
||||
}
|
||||
if(userEO.getDisableFlag().equals("1")){
|
||||
return Result.error("r0011", "帐号已禁用");
|
||||
}
|
||||
String token = jwtUtils.generateToken(userEO.getUserId());
|
||||
userEO.setToken(token);
|
||||
// 加密重要信息
|
||||
BASE64Encoder encoder = new BASE64Encoder();
|
||||
String userStr = JSON.toJSONString(userEO);
|
||||
String userStr2 = URLEncoder.encode(userStr,"UTF-8");
|
||||
userStr = encoder.encode(userStr2.getBytes());
|
||||
return Result.success(userStr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value = "查询在线编辑流程汇总文件编辑对象")
|
||||
@GetMapping("/processModelHisOneCount")
|
||||
public BusProcessModelHis processModelHisOneCount(@RequestParam("pid") String pid){
|
||||
return workFlowFeignClient.processModelHisOneCount(pid);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "更新在线编辑流程当前节点编辑状态")
|
||||
@GetMapping("/processModelHisOneUpd")
|
||||
public BusProcessModelHis processModelHisOneUpd(@RequestParam("pid") String pid,@RequestParam("taskId") String taskId){
|
||||
return workFlowFeignClient.processModelHisOneUpdStatus(pid,taskId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询在线编辑流程当前节点编辑对象")
|
||||
@GetMapping("/processModelHisOne")
|
||||
public BusProcessModelHis processModelHisOne(@RequestParam("pid") String pid,@RequestParam("taskId") String taskId){
|
||||
return workFlowFeignClient.processModelHisOne(pid,taskId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询流程父节点所有评分")
|
||||
@GetMapping("/evaluationHisList")
|
||||
public List<BusProcessEvaluationHis> evaluationHisList(@RequestParam("pid") String pid){
|
||||
return workFlowFeignClient.evaluationHisList(pid);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "干活流程接收待办")
|
||||
@GetMapping("/execTask")
|
||||
public Map<String,Object> execTask(@RequestParam("todoId") String todoId){
|
||||
@@ -106,6 +176,13 @@ public class WorkFlowController {
|
||||
public ResponseMessage activiti_define_start(@RequestParam("id") String id, @RequestParam("userId") String userId, @RequestParam(value = "bpnId",required = false) String bpnId){
|
||||
return workFlowFeignClient.activiti_define_start(id,userId,bpnId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "启动流程-以流程定义id")
|
||||
@GetMapping("/activiti_define_start_rollBack")
|
||||
public ResponseMessage activiti_define_start_rollBack(@RequestParam("id") String id, @RequestParam("userId") String userId,
|
||||
@RequestParam(value = "bpnId",required = false) String bpnId,@RequestParam(value = "json",required = false)String json){
|
||||
return workFlowFeignClient.activiti_define_start_rollBack(id,userId,bpnId,json);
|
||||
}
|
||||
@ApiOperation(value = "启动流程-以流程定义id")
|
||||
@GetMapping("/activiti_define_start1")
|
||||
public Map<String,String> activiti_define_start1(@RequestParam("id") String id, @RequestParam("userId") String userId, @RequestParam("standName") String standName){
|
||||
@@ -122,6 +199,16 @@ public class WorkFlowController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "启动流程-以流程定义id-加上草稿内容(为了实现撤回)")
|
||||
@PostMapping("/startProcessRollBack")
|
||||
public ResponseMessage startProcessRollBack(ProcessRollBackEO processRollBackEO){
|
||||
if(StringUtils.isNotBlank(processRollBackEO.getType())){
|
||||
return this.activiti_define_start_rollBack(ActDefineStartMap.actDefineStartMap(processRollBackEO.getType()), LoginUserUtil.getUserId(),processRollBackEO.getId(),processRollBackEO.getJson());
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "定时任务启动流程-以流程定义id")
|
||||
@GetMapping("/startProcessNew")
|
||||
public ResponseMessage startProcessNew(@RequestParam("type") String type, @RequestParam(value="userId",required = false) String userId, @RequestParam(value="id",required = false) String id){
|
||||
@@ -280,6 +367,27 @@ public class WorkFlowController {
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "我的待办任务列表")
|
||||
@PostMapping("/todoTaskListNew")
|
||||
public PageInfo<BusProcessName> todoTaskListNew(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
List<BusProcessName> busProcessNames = workFlowFeignClient.todoTaskListByUserId(taskCommonQuery);
|
||||
List list1 = this.startPage(busProcessNames, taskCommonQuery.getCurrent(), taskCommonQuery.getSize());
|
||||
PageInfo<BusProcessName> pageInfo= new PageInfo<BusProcessName>();
|
||||
if(busProcessNames!=null){
|
||||
pageInfo.setList(list1);
|
||||
pageInfo.setPageNo(taskCommonQuery.getCurrent());
|
||||
pageInfo.setCount(Long.valueOf(busProcessNames.size()));
|
||||
pageInfo.setPageSize(taskCommonQuery.getSize());
|
||||
}else{
|
||||
List<BusProcessName> list = new ArrayList<>();
|
||||
pageInfo.setList(list);
|
||||
pageInfo.setPageNo(taskCommonQuery.getCurrent());
|
||||
pageInfo.setCount(Long.valueOf(0));
|
||||
pageInfo.setPageSize(taskCommonQuery.getSize());
|
||||
}
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "完成任务")
|
||||
@PostMapping("/completeTask")
|
||||
public Wrapper<String> completeTaskByUserId( BusMes busMes){
|
||||
@@ -666,4 +774,12 @@ public class WorkFlowController {
|
||||
}
|
||||
return Result.success("发送成功");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "草稿删除")
|
||||
@PostMapping("/delCG")
|
||||
public String delCG(@RequestParam("id")String id){
|
||||
return workFlowFeignClient.delCG(id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.adc.da.workFlow.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* OA日志表
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-09-17
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="BusProcessEvaluationHis对象", description="流程评分历史表")
|
||||
public class BusProcessEvaluationHis implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId(value = "ID", type = IdType.UUID)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "标准id")
|
||||
@TableField("STAND_ID")
|
||||
private String standId;
|
||||
|
||||
@ApiModelProperty(value = "处理人")
|
||||
@TableField("USER_ID")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(value = "信息")
|
||||
@TableField("MESG")
|
||||
private String mesg;
|
||||
|
||||
@ApiModelProperty(value = "节点信息")
|
||||
@TableField("TASK_INFO")
|
||||
private String taskInfo;
|
||||
|
||||
@ApiModelProperty(value = "任务id")
|
||||
@TableField("TASK_ID")
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty(value = "流程实例id")
|
||||
@TableField("P_ID")
|
||||
private String pId;
|
||||
|
||||
@ApiModelProperty(value = "流程名称")
|
||||
@TableField("PRC_NAME")
|
||||
private String prcName;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("CREATE_TIME")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private String createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@TableField("UPDATE_TIME")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private String updateTime;
|
||||
|
||||
@ApiModelProperty(value = "onlyOffice 是否编辑 0 未编辑 1 已编辑")
|
||||
@TableField("EDIT_STATUS")
|
||||
private String editStatus;
|
||||
|
||||
@ApiModelProperty(value = "onlyOffice 编辑文件存储路径")
|
||||
@TableField("EDIT_FILE_PATH")
|
||||
private String editFilePath;
|
||||
|
||||
@ApiModelProperty(value = "逻辑状态")
|
||||
@TableField("FLAG")
|
||||
private String flag;
|
||||
|
||||
@ApiModelProperty(value = "onlyOffice 访问编辑文件全路径")
|
||||
@TableField(exist = false)
|
||||
private String downLoadUrl;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.adc.da.workFlow.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程模块历史表
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-09-17
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="BusProcessModelHis对象", description="流程模块历史表")
|
||||
public class BusProcessModelHis implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId(value = "ID", type = IdType.UUID)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "标准id")
|
||||
@TableField("STAND_ID")
|
||||
private String standId;
|
||||
|
||||
@ApiModelProperty(value = "处理人")
|
||||
@TableField("USER_ID")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(value = "信息")
|
||||
@TableField("MESG")
|
||||
private String mesg;
|
||||
|
||||
@ApiModelProperty(value = "节点信息")
|
||||
@TableField("TASK_INFO")
|
||||
private String taskInfo;
|
||||
|
||||
@ApiModelProperty(value = "任务id")
|
||||
@TableField("TASK_ID")
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty(value = "流程实例id")
|
||||
@TableField("P_ID")
|
||||
private String pId;
|
||||
|
||||
@ApiModelProperty(value = "流程名称")
|
||||
@TableField("PRC_NAME")
|
||||
private String prcName;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("CREATE_TIME")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private String createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@TableField("UPDATE_TIME")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private String updateTime;
|
||||
|
||||
@ApiModelProperty(value = "onlyOffice 是否编辑 0 未编辑 1 已编辑")
|
||||
@TableField("EDIT_STATUS")
|
||||
private String editStatus;
|
||||
|
||||
@ApiModelProperty(value = "onlyOffice 编辑文件存储路径")
|
||||
@TableField("EDIT_FILE_PATH")
|
||||
private String editFilePath;
|
||||
|
||||
@ApiModelProperty(value = "onlyOffice 编辑类型 node 节点编辑 count 汇总编辑")
|
||||
@TableField("EDIT_TYPE")
|
||||
private String editType;
|
||||
|
||||
@ApiModelProperty(value = "逻辑状态")
|
||||
@TableField("FLAG")
|
||||
private String flag;
|
||||
|
||||
@ApiModelProperty(value = "onlyOffice 访问编辑文件全路径")
|
||||
@TableField(exist = false)
|
||||
private String downLoadUrl;
|
||||
}
|
||||
@@ -15,7 +15,7 @@ public class ProcessDetailExport {
|
||||
private Date startTime;
|
||||
@Excel(name = "完成时间", orderNum = "4",exportFormat = "yyyy/MM/dd",width = 15)
|
||||
private Date endTime;
|
||||
@Excel(name = "审批意见", orderNum = "5",width = 15)
|
||||
@Excel(name = "流程信息", orderNum = "5",width = 15)
|
||||
private String comment;
|
||||
@Excel(name = "状态", orderNum = "6",width = 15)
|
||||
private String flag;
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.adc.da.workFlow.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ProcessRollBackEO {
|
||||
|
||||
private String json;
|
||||
|
||||
private String type;
|
||||
|
||||
private String id;
|
||||
|
||||
private String userId;
|
||||
|
||||
private String bpnId;
|
||||
}
|
||||
+442
@@ -0,0 +1,442 @@
|
||||
package com.adc.da.workFlow.service;
|
||||
|
||||
import com.adc.da.FeignClientImpl.workFlowFeignClientImpl;
|
||||
import com.adc.da.common.SarConformStateEnum;
|
||||
import com.adc.da.common.SarStateColorEnum;
|
||||
import com.adc.da.common.SarTypeEnum;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.slrs.SarCompResAssess.entity.SarCompResAssess;
|
||||
import com.adc.da.slrs.SarCompResAssess.service.ISarCompResAssessService;
|
||||
import com.adc.da.slrs.SarCompStatusInfo.dao.SarCompStatusInfoDao;
|
||||
import com.adc.da.slrs.SarCompStatusInfo.entity.SarCompStatusInfo;
|
||||
import com.adc.da.slrs.SarFileSplitItems.service.ISarFileSplitItemsService;
|
||||
import com.adc.da.slrs.sarBussStandAttrInfo.dao.SarBussStandAttrInfoDao;
|
||||
import com.adc.da.slrs.sarBussStandAttrInfo.service.ISarBussStandAttrInfoService;
|
||||
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
||||
import com.adc.da.slrs.sarBussionessStand.service.ISarBussionessStandService;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IQualityEvaluationService;
|
||||
import com.adc.da.slrs.sarLawsAttrInfo.service.ISarLawsAttrInfoService;
|
||||
import com.adc.da.slrs.sarLawsItemVal.dao.SarLawsItemValDao;
|
||||
import com.adc.da.slrs.sarLawsItems.dao.SarLawsItemsDao;
|
||||
import com.adc.da.slrs.sarLawsItems.entity.SarLawsItems;
|
||||
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
|
||||
import com.adc.da.slrs.sarLawsStandInfo.service.ISarLawsStandInfoService;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
|
||||
import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService;
|
||||
import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.adc.da.utils.util.InitStandAttrUtil;
|
||||
import com.adc.da.workFlow.dao.ActSarItemsEODao;
|
||||
import com.adc.da.workFlow.entity.BusProcessEvaluationHis;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
@Service("actSarItemsBussEOService")
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class ActSarItemsBussEOService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ActSarItemsBussEOService.class);
|
||||
|
||||
@Autowired
|
||||
private SarStandAttrInfoDao sarStandAttrInfoEODao;
|
||||
|
||||
@Autowired
|
||||
private workFlowFeignClientImpl workFlowFeignClient;
|
||||
|
||||
@Autowired
|
||||
private SarBussStandAttrInfoDao sarBussStandAttrInfoEODao;
|
||||
|
||||
@Autowired
|
||||
private ISarBussStandAttrInfoService sarBussStandAttrInfoService;
|
||||
|
||||
@Autowired
|
||||
private ISarBussionessStandService iSarBussionessStandService;
|
||||
|
||||
@Autowired
|
||||
private IQualityEvaluationService qualityEvaluationService;
|
||||
|
||||
@Autowired
|
||||
private ISarUpdLogService sarUpdLogEOService;
|
||||
|
||||
|
||||
@Value("${elas.flag}")
|
||||
private boolean elasflag;
|
||||
|
||||
/***
|
||||
* @Description: 国内外标准流程入库"
|
||||
* @Date: 2020/12/7 13:48
|
||||
* @Param: [standJson]
|
||||
* @Return: void
|
||||
*/
|
||||
public void processCreateBuss(String standJson) throws Exception{
|
||||
Map<String,Object> standMap = new HashMap();
|
||||
standMap = JSONObject.parseObject(standJson);
|
||||
if (standMap != null && !standMap.isEmpty()) {
|
||||
String prcNum = String.valueOf(standMap.get("prcNum"));
|
||||
String pid = String.valueOf(standMap.get("topId"));
|
||||
String prcName = String.valueOf(standMap.get("prcName"));
|
||||
String standType = String.valueOf(standMap.get("standType"));
|
||||
// String isJudge = String.valueOf(standMap.get("ifIn")); //是否经过技术评估
|
||||
SarBussionessStand sarBussionessStand = new SarBussionessStand();
|
||||
// if(standMap.containsKey("standId")) {
|
||||
// if (standMap.get("standId") != null && !standMap.get("standId").toString().equals("")) {
|
||||
// String resId = standMap.get("standId").toString();
|
||||
// //此处说明是带入的形式
|
||||
// sarStandardsInfoEO.setId(resId);
|
||||
// SarCompResAssess assessInfoByResId = sarCompResAssessEOService.ssessInfoByResId(resId);
|
||||
// if (assessInfoByResId != null) {
|
||||
// assessInfoByResId.setProcessState("2");
|
||||
// sarCompResAssessEOService.updateByPrimaryKeySelective(assessInfoByResId);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
Map<String,Object> attInfoMap = new HashMap<>();
|
||||
List<String> jsonArray = new ArrayList<>();
|
||||
Object breakVal = null;
|
||||
Object itemList = null;
|
||||
for (Map.Entry<String,Object> entry : standMap.entrySet()) {
|
||||
String field = entry.getKey().toUpperCase();
|
||||
Object value = entry.getValue();
|
||||
if (InitStandAttrUtil.queryFieldListBuss.contains(field)) {
|
||||
if (value instanceof JSONArray) {
|
||||
String valStr = String.valueOf(value);
|
||||
List<String> valueArr = JSONArray.parseArray(valStr,String.class);
|
||||
if (valueArr != null && !valueArr.isEmpty()) {
|
||||
String newValue = "";
|
||||
for (String val : valueArr) {
|
||||
newValue += val + ",";
|
||||
}
|
||||
newValue = newValue.substring(0,newValue.length()-1);
|
||||
value = newValue;
|
||||
}else {
|
||||
value = "";
|
||||
}
|
||||
}
|
||||
attInfoMap.put(field,value);
|
||||
} else {
|
||||
createStandBaseField(sarBussionessStand,entry.getKey(),value);
|
||||
}
|
||||
}
|
||||
//处理文件
|
||||
//此处需要处理之前的文件信息,防止文件丢失
|
||||
// attInfoMap = saveFileMsg(attInfoMap,sarStandardsInfoEO.getFileIds(),sarStandardsInfoEO.getTextStatus());
|
||||
String resData = JSON.toJSONString(attInfoMap, SerializerFeature.WriteMapNullValue);
|
||||
sarBussionessStand.setSarStandAttrEOStr(resData);
|
||||
// 根据标准号判断数据是否已存在
|
||||
//2021年4月9日 此处检查当前是否存在standId
|
||||
String standCode = "";
|
||||
if(StringUtils.isNotBlank(sarBussionessStand.getStandCode()) && !"null".equals(sarBussionessStand.getStandCode())){
|
||||
standCode = sarBussionessStand.getStandCode();
|
||||
}
|
||||
List<SarBussionessStand> lawsList = iSarBussionessStandService.selectStandardsByStandNumber(standCode);
|
||||
// if (StringUtils.isBlank(sarStandardsInfoEO.getMenuId()) && "INLAND".equals(sarStandardsInfoEO.getStandType())) {
|
||||
// sarStandardsInfoEO.setMenuId("64df1d5522bb49c09af2");
|
||||
// sarStandardsInfoEO.setCountry("CN");
|
||||
// } else if (StringUtils.isBlank(sarStandardsInfoEO.getMenuId()) && "FOREIGN".equals(sarStandardsInfoEO.getStandType())) {
|
||||
// sarStandardsInfoEO.setMenuId("22179d54d4e640098e29");
|
||||
// }
|
||||
//此处判断是否是带入的标准
|
||||
String bussId = "";
|
||||
if(StringUtils.isNotBlank(sarBussionessStand.getId())) {
|
||||
bussId = sarBussionessStand.getId();
|
||||
SarBussionessStand query = new SarBussionessStand();
|
||||
query.setId(sarBussionessStand.getId());
|
||||
iSarBussionessStandService.attrInfoDetails(query);
|
||||
Map<String, Object> attrInfoMap = query.getAttrInfoMap();
|
||||
if(attInfoMap!=null && !attInfoMap.isEmpty()){
|
||||
updateStandFileFieldData(attInfoMap,attrInfoMap);
|
||||
resData = JSON.toJSONString(attInfoMap, SerializerFeature.WriteMapNullValue);
|
||||
sarBussionessStand.setSarStandAttrEOStr(resData);
|
||||
}
|
||||
// 查询原相关流程
|
||||
String relatePro = sarBussStandAttrInfoService.selectFieldValByStandId("XGLC",sarBussionessStand.getId());
|
||||
if (StringUtils.isNotBlank(relatePro)) {
|
||||
String[] processSplit = relatePro.split(",");
|
||||
Set<String> processSet = new HashSet<>();
|
||||
for(String sData:processSplit){
|
||||
processSet.add(sData);
|
||||
}
|
||||
processSet.add(prcNum);
|
||||
relatePro = StringUtils.join(processSet.toArray(), ",");
|
||||
} else {
|
||||
relatePro = prcNum;
|
||||
}
|
||||
// 编辑标准
|
||||
iSarBussionessStandService.updateSarBussionessStand(sarBussionessStand);
|
||||
// 编辑相关流程
|
||||
sarBussStandAttrInfoService.updateStandInfo(sarBussionessStand.getId(),"XGLC",relatePro);
|
||||
String content = "新增一条相关流程:" +prcName+" "+prcNum;
|
||||
sarUpdLogEOService.createBaseLog(sarBussionessStand.getId(),standType+"_STAND",content);
|
||||
}else if (lawsList != null && !lawsList.isEmpty()) {//Id不存在,但是标准号存在的情况
|
||||
String standId = lawsList.get(0).getId();
|
||||
bussId = lawsList.get(0).getId();
|
||||
SarBussionessStand query = new SarBussionessStand();
|
||||
query.setId(standId);
|
||||
iSarBussionessStandService.attrInfoDetails(query);
|
||||
Map<String, Object> attrInfoMap = query.getAttrInfoMap();
|
||||
if(attInfoMap!=null && !attInfoMap.isEmpty()){
|
||||
updateStandFileFieldData(attInfoMap,attrInfoMap);
|
||||
resData = JSON.toJSONString(attInfoMap, SerializerFeature.WriteMapNullValue);
|
||||
sarBussionessStand.setSarStandAttrEOStr(resData);
|
||||
}
|
||||
// 查询原相关流程
|
||||
String relatePro = sarBussStandAttrInfoService.selectFieldValByStandId("XGLC",standId);
|
||||
if (StringUtils.isNotBlank(relatePro)) {
|
||||
String[] processSplit = relatePro.split(",");
|
||||
Set<String> processSet = new HashSet<>();
|
||||
for(String sData:processSplit){
|
||||
processSet.add(sData);
|
||||
}
|
||||
processSet.add(prcNum);
|
||||
relatePro = StringUtils.join(processSet.toArray(), ",");
|
||||
} else {
|
||||
relatePro = prcNum;
|
||||
}
|
||||
// 编辑标准
|
||||
sarBussionessStand.setId(standId);
|
||||
iSarBussionessStandService.updateSarBussionessStand(sarBussionessStand);
|
||||
// 编辑相关流程
|
||||
sarBussStandAttrInfoService.updateStandInfo(standId,"XGLC",relatePro);
|
||||
String content = "新增一条相关流程:" +prcName+" "+prcNum;
|
||||
sarUpdLogEOService.createBaseLog(standId,standType+"_STAND",content);
|
||||
} else {//标准号、ID都不存在的情况
|
||||
// 新增方法
|
||||
ResponseMessage<SarBussionessStand> responseMessage = iSarBussionessStandService.createSarBussionessStand(sarBussionessStand);
|
||||
if(responseMessage.isOk()){
|
||||
SarBussionessStand bussionessStand = responseMessage.getData();
|
||||
bussId = bussionessStand.getId() == null ? "":bussionessStand.getId();
|
||||
}
|
||||
|
||||
// 编辑相关流程
|
||||
sarBussStandAttrInfoService.updateStandInfo(sarBussionessStand.getId(),"XGLC",prcNum);
|
||||
}
|
||||
List<SarStandItems> allItems = new ArrayList<>();
|
||||
//开始处理条款数据,从去重后的结果中直接处理即可
|
||||
// if(itemData!=null && !itemData.isEmpty()){
|
||||
// // allItems =
|
||||
// saveStandItemsData(itemData, sarStandardsInfoEO);
|
||||
// }
|
||||
//技术评估结果入库 重构技术评估结果入库内容
|
||||
// if ("0".equals(isJudge)) {
|
||||
// saveCompStatusInfo(sarStandardsInfoEO,breakVal,allItems,prcNum);
|
||||
// }
|
||||
|
||||
List<BusProcessEvaluationHis> evaluationHis = workFlowFeignClient.evaluationHisList(pid);
|
||||
List<QualityEvaluation> evaluations = new ArrayList<>();
|
||||
if(!evaluationHis.isEmpty()){
|
||||
String finalBussId = bussId;
|
||||
evaluationHis.forEach(busProcessEvaluationHis -> {
|
||||
List<JSONObject> valueArr = JSONArray.parseArray(busProcessEvaluationHis.getMesg(),JSONObject.class);
|
||||
if(!valueArr.isEmpty()){
|
||||
valueArr.forEach(object -> {
|
||||
QualityEvaluation evaluation = new QualityEvaluation();
|
||||
evaluation.setId(UUIDUtils.randomUUID20());
|
||||
evaluation.setLawId(finalBussId);
|
||||
evaluation.setUserId(object.getString("userId"));
|
||||
evaluation.setScore(object.getString("score"));
|
||||
evaluation.setReason(object.getString("reason"));
|
||||
evaluation.setEvaluationIndex(object.getString("code"));
|
||||
evaluation.setProcessNode(object.getString("processNode"));
|
||||
evaluation.setEvaluationType(object.getString("indexType"));
|
||||
evaluation.setCreateTime(new Date());
|
||||
evaluation.setModifyTime(new Date());
|
||||
evaluations.add(evaluation);
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
qualityEvaluationService.saveBatch(evaluations);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void updateStandFileFieldData(Map<String,Object> addAttInfoMap,Map<String,Object> oldAttInfoMap){
|
||||
if(oldAttInfoMap.containsKey("CA")){
|
||||
String fileStr = (String) oldAttInfoMap.get("CA");
|
||||
if(StringUtils.isNotBlank(fileStr)){
|
||||
String newFileStr =addAttInfoMap.containsKey("CA")?(String)addAttInfoMap.get("CA"):null;
|
||||
if(StringUtils.isNotBlank(newFileStr)){
|
||||
String[] fileSplit = fileStr.split(",");
|
||||
String[] newFileSplit = newFileStr.split(",");
|
||||
Set<String> fileSet = new HashSet<>();
|
||||
for(String sData:fileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
for(String sData:newFileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
addAttInfoMap.put("CA",StringUtils.join(fileSet.toArray(), ","));
|
||||
}else{
|
||||
addAttInfoMap.put("CA",fileStr);
|
||||
}
|
||||
}
|
||||
}else if(oldAttInfoMap.containsKey("ZQYJG")){
|
||||
String fileStr = (String) oldAttInfoMap.get("ZQYJG");
|
||||
if(StringUtils.isNotBlank(fileStr)){
|
||||
String newFileStr =addAttInfoMap.containsKey("ZQYJG")?(String)addAttInfoMap.get("ZQYJG"):null;
|
||||
if(StringUtils.isNotBlank(newFileStr)){
|
||||
String[] fileSplit = fileStr.split(",");
|
||||
String[] newFileSplit = newFileStr.split(",");
|
||||
Set<String> fileSet = new HashSet<>();
|
||||
for(String sData:fileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
for(String sData:newFileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
addAttInfoMap.put("ZQYJG",StringUtils.join(fileSet.toArray(), ","));
|
||||
}else{
|
||||
addAttInfoMap.put("ZQYJG",fileStr);
|
||||
}
|
||||
}
|
||||
}else if(oldAttInfoMap.containsKey("BPG")){
|
||||
String fileStr = (String) oldAttInfoMap.get("BPG");
|
||||
if(StringUtils.isNotBlank(fileStr)){
|
||||
String newFileStr =addAttInfoMap.containsKey("BPG")?(String)addAttInfoMap.get("BPG"):null;
|
||||
if(StringUtils.isNotBlank(newFileStr)){
|
||||
String[] fileSplit = fileStr.split(",");
|
||||
String[] newFileSplit = newFileStr.split(",");
|
||||
Set<String> fileSet = new HashSet<>();
|
||||
for(String sData:fileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
for(String sData:newFileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
addAttInfoMap.put("BPG",StringUtils.join(fileSet.toArray(), ","));
|
||||
}else{
|
||||
addAttInfoMap.put("BPG",fileStr);
|
||||
}
|
||||
}
|
||||
}else if(oldAttInfoMap.containsKey("SSG")){
|
||||
String fileStr = (String) oldAttInfoMap.get("SSG");
|
||||
if(StringUtils.isNotBlank(fileStr)){
|
||||
String newFileStr =addAttInfoMap.containsKey("SSG")?(String)addAttInfoMap.get("SSG"):null;
|
||||
if(StringUtils.isNotBlank(newFileStr)){
|
||||
String[] fileSplit = fileStr.split(",");
|
||||
String[] newFileSplit = newFileStr.split(",");
|
||||
Set<String> fileSet = new HashSet<>();
|
||||
for(String sData:fileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
for(String sData:newFileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
addAttInfoMap.put("SSG",StringUtils.join(fileSet.toArray(), ","));
|
||||
}else{
|
||||
addAttInfoMap.put("SSG",fileStr);
|
||||
}
|
||||
}
|
||||
}else if(oldAttInfoMap.containsKey("ZBJBD")){
|
||||
String fileStr = (String) oldAttInfoMap.get("ZBJBD");
|
||||
if(StringUtils.isNotBlank(fileStr)){
|
||||
String newFileStr =addAttInfoMap.containsKey("ZBJBD")?(String)addAttInfoMap.get("ZBJBD"):null;
|
||||
if(StringUtils.isNotBlank(newFileStr)){
|
||||
String[] fileSplit = fileStr.split(",");
|
||||
String[] newFileSplit = newFileStr.split(",");
|
||||
Set<String> fileSet = new HashSet<>();
|
||||
for(String sData:fileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
for(String sData:newFileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
addAttInfoMap.put("ZBJBD",StringUtils.join(fileSet.toArray(), ","));
|
||||
}else{
|
||||
addAttInfoMap.put("ZBJBD",fileStr);
|
||||
}
|
||||
}
|
||||
}else if(oldAttInfoMap.containsKey("FBGBJBD")){
|
||||
String fileStr = (String) oldAttInfoMap.get("FBGBJBD");
|
||||
if(StringUtils.isNotBlank(fileStr)){
|
||||
String newFileStr =addAttInfoMap.containsKey("FBGBJBD")?(String)addAttInfoMap.get("FBGBJBD"):null;
|
||||
if(StringUtils.isNotBlank(newFileStr)){
|
||||
String[] fileSplit = fileStr.split(",");
|
||||
String[] newFileSplit = newFileStr.split(",");
|
||||
Set<String> fileSet = new HashSet<>();
|
||||
for(String sData:fileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
for(String sData:newFileSplit){
|
||||
fileSet.add(sData);
|
||||
}
|
||||
addAttInfoMap.put("FBGBJBD",StringUtils.join(fileSet.toArray(), ","));
|
||||
}else{
|
||||
addAttInfoMap.put("FBGBJBD",fileStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理标准基础库字段
|
||||
* @param sarBussionessStand
|
||||
* @param field
|
||||
* @param value
|
||||
* @throws Exception
|
||||
*/
|
||||
public void createStandBaseField (SarBussionessStand sarBussionessStand,String field,Object value) throws Exception{
|
||||
String valueStr = "";
|
||||
if (value != null) {
|
||||
valueStr = String.valueOf(value);
|
||||
}
|
||||
switch (field) {
|
||||
case "id": sarBussionessStand.setId(valueStr); break;
|
||||
case "standSort": sarBussionessStand.setStandSort(valueStr); break;
|
||||
case "standNumber": sarBussionessStand.setStandNumber(valueStr); break;
|
||||
case "standYear": sarBussionessStand.setStandYear(valueStr); break;
|
||||
case "standCode": sarBussionessStand.setStandCode(valueStr); break;
|
||||
case "standName": sarBussionessStand.setStandName(valueStr); break;
|
||||
case "standEnName": sarBussionessStand.setStandEnName(valueStr); break;
|
||||
case "textStatusBuss": sarBussionessStand.setTextStatusBuss(valueStr); break;
|
||||
case "issueTime":
|
||||
if (StringUtils.isNotBlank(valueStr)) {
|
||||
sarBussionessStand.setIssueTime(tTo(valueStr));
|
||||
}
|
||||
break;
|
||||
case "putTime":
|
||||
if (StringUtils.isNotBlank(valueStr)) {
|
||||
sarBussionessStand.setPutTime(tTo(valueStr));
|
||||
}
|
||||
break;
|
||||
case "prcNum": sarBussionessStand.setProcessNum(valueStr); break;
|
||||
case "menuId": sarBussionessStand.setMenuId(valueStr); break;
|
||||
case "fileWord":
|
||||
if (StringUtils.isNotBlank(sarBussionessStand.getFileIds()) && StringUtils.isNotBlank(valueStr)) {
|
||||
valueStr = sarBussionessStand.getFileIds() + "," + valueStr;
|
||||
}
|
||||
sarBussionessStand.setFileIds(valueStr); break;
|
||||
case "filePdf":
|
||||
if (StringUtils.isNotBlank(sarBussionessStand.getFileIds()) && StringUtils.isNotBlank(valueStr)) {
|
||||
valueStr = sarBussionessStand.getFileIds() + "," + valueStr;
|
||||
}
|
||||
sarBussionessStand.setFileIds(valueStr);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
private String tTo(String dateStr){
|
||||
return dateStr.contains("T") ? dateStr.split("T")[0] : dateStr;
|
||||
}
|
||||
|
||||
}
|
||||
-32
@@ -87,38 +87,6 @@ public class ActSarItemsLawsEOService {
|
||||
@Value("${elas.flag}")
|
||||
private boolean elasflag;
|
||||
|
||||
/**
|
||||
* 标准解读流程入库"
|
||||
* @param standJson
|
||||
* @throws Exception
|
||||
*/
|
||||
public void createStandardRead(String standJson) throws Exception{
|
||||
JSONObject object = JSONObject.parseObject(standJson);
|
||||
String fileName = object.getString("fileName");
|
||||
String fileType = object.getString("fileType");
|
||||
String creationTime = object.getString("creationTime");
|
||||
String creationUser = object.getString("creationUser");
|
||||
String standId = object.getString("standId");
|
||||
//数组去重
|
||||
JSONArray responUserList1 = object.getJSONArray("itemList");
|
||||
for (Object obj:responUserList1) {
|
||||
JSONObject object1 = (JSONObject) obj;
|
||||
JSONArray preResponUserList = object1.getJSONArray("zxUserId");
|
||||
String oldNumber = object1.getString("oldNumber");
|
||||
String itemsNum = object1.getString("itemsNum");
|
||||
String itemsName = object1.getString("itemsName");
|
||||
String itemsTitle = object1.getString("itemsTitle");
|
||||
String applyArcticId = object1.getString("applyArcticId");
|
||||
String applyArctic = object1.getString("applyArctic");
|
||||
String changePoint = object1.getString("changePoint");
|
||||
String technicalRequir = object1.getString("technicalRequir");
|
||||
String onlineData = object1.getString("onlineData");
|
||||
String newData = object1.getString("newData");
|
||||
String complianceRequir = object1.getString("complianceRequir");
|
||||
String complianceState = object1.getString("complianceState");
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
* @Description: 国内外标准流程入库"
|
||||
* @Author: yangxuenan
|
||||
|
||||
@@ -46,21 +46,22 @@ public class WaterMarkUtil {
|
||||
// 获得PDF最顶层
|
||||
under = stamper.getOverContent(i);
|
||||
under.saveState();
|
||||
// set Transparency
|
||||
PdfGState gs = new PdfGState();
|
||||
// 设置透明度为0.2
|
||||
gs.setFillOpacity(0.25f);
|
||||
under.setGState(gs);
|
||||
|
||||
under.restoreState();
|
||||
under.beginText();
|
||||
under.setFontAndSize(base, 50);
|
||||
under.setFontAndSize(base, 30);
|
||||
under.setTextMatrix(30, 30);
|
||||
under.setColorFill(BaseColor.LIGHT_GRAY);
|
||||
for (int y = 0; y < 5; y++) {
|
||||
for (int x = 0; x < 10; x++) {
|
||||
// 水印文字成45度角倾斜
|
||||
// 设置透明度为0.2
|
||||
// set Transparency
|
||||
PdfGState gs = new PdfGState();
|
||||
gs.setFillOpacity(0.2f);
|
||||
under.setGState(gs);
|
||||
for (int y = 0; y < 50; y++) {
|
||||
for (int x = 0; x < 50; x++) {
|
||||
// 水印文字成45度角倾斜 x位置 y位置 角度
|
||||
under.showTextAligned(Element.ALIGN_LEFT
|
||||
, waterMarkName, 100 + 300 * x, 300 * y, 40);
|
||||
, waterMarkName, 40 + 120 * x, 100 * y, 40);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,368 @@
|
||||
//package com.adc.da.convert.mq;
|
||||
//
|
||||
//import com.adc.da.att.entity.AttFileEO;
|
||||
//import com.adc.da.att.service.IAttFileEOService;
|
||||
//import com.adc.da.common.SarTypeEnum;
|
||||
//import com.adc.da.common.UseModuleEnum;
|
||||
//import com.adc.da.convert.common.AsposeOfficeConvertUtils;
|
||||
//import com.adc.da.mq.CreateMQService;
|
||||
//import com.adc.da.slrs.otConvertMq.entity.OtConvertMq;
|
||||
//import com.adc.da.slrs.otConvertMq.service.IOtConvertMqService;
|
||||
//import com.adc.da.slrs.sarBussStandFile.dao.SarBussStandFileDao;
|
||||
//import com.adc.da.slrs.sarBussStandFile.entity.SarBussStandFile;
|
||||
//import com.adc.da.slrs.sarLawsFile.dao.SarLawsFileDao;
|
||||
//import com.adc.da.slrs.sarLawsFile.entity.SarLawsFile;
|
||||
//import com.adc.da.slrs.sarStandFile.dao.SarStandFileDao;
|
||||
//import com.adc.da.slrs.sarStandFile.entity.SarStandFile;
|
||||
//import com.adc.da.sys.util.LoginUserUtil;
|
||||
//import com.adc.da.util.http.ResponseMessage;
|
||||
//import com.adc.da.util.http.Result;
|
||||
//import com.adc.da.util.utils.StringUtils;
|
||||
//import com.adc.da.util.utils.UUID;
|
||||
//import com.rabbitmq.client.Channel;
|
||||
//import org.slf4j.Logger;
|
||||
//import org.slf4j.LoggerFactory;
|
||||
//import org.springframework.amqp.rabbit.annotation.Exchange;
|
||||
//import org.springframework.amqp.rabbit.annotation.Queue;
|
||||
//import org.springframework.amqp.rabbit.annotation.QueueBinding;
|
||||
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
//import org.springframework.amqp.support.AmqpHeaders;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.beans.factory.annotation.Value;
|
||||
//import org.springframework.messaging.Message;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
//import java.io.File;
|
||||
//import java.util.Date;
|
||||
//import java.util.Map;
|
||||
//
|
||||
//@Component
|
||||
//public class SendUploadConvertService {
|
||||
//
|
||||
// // 文档转换远程服务IP地址s
|
||||
// @Value("${convert.host}")
|
||||
// private String convertHost;
|
||||
//
|
||||
// @Value("${server.port}")
|
||||
// private String port;
|
||||
//
|
||||
// @Value("${file.path}")
|
||||
// private String localFilePath;
|
||||
//
|
||||
// @Autowired
|
||||
// private IAttFileEOService attFileEOService;
|
||||
//
|
||||
// @Autowired
|
||||
// private CreateMQService convertMq;
|
||||
//
|
||||
// @Autowired
|
||||
// private IOtConvertMqService convertMqEOService;
|
||||
//
|
||||
// @Autowired
|
||||
// private SarStandFileDao sarStandFileEODao;
|
||||
//
|
||||
// @Autowired
|
||||
// private SarBussStandFileDao sarBussStandFileEODao;
|
||||
//
|
||||
// @Autowired
|
||||
// private SarLawsFileDao sarLawsFileDao;
|
||||
//
|
||||
// private static final Logger logger = LoggerFactory.getLogger(SendUploadConvertService.class);
|
||||
//
|
||||
// @RabbitListener(bindings = @QueueBinding(
|
||||
// value = @Queue(value = "createUploadConvertMQ_SQ_GSAR_RELEASE", durable = "true"),
|
||||
// exchange = @Exchange(value = "convertUpload-exchange_SQ_GSAR_RELEASE", ignoreDeclarationExceptions = "true"),
|
||||
// key = "convertUpload-key_SQ_GSAR_RELEASE"))
|
||||
// public void createMQ(Map<String,Object> convertInfo, Message message, Channel channel) throws Exception{
|
||||
// try{
|
||||
// try{
|
||||
// Thread.sleep(5000);
|
||||
// insertConvertMsg(convertInfo);
|
||||
// }catch(InterruptedException e){
|
||||
// logger.error(e.toString());
|
||||
// Thread.currentThread().interrupt();
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// logger.error("文档转换消息队列进入添加数据方法前失败!");
|
||||
// logger.error(e.getMessage(),e);
|
||||
// }finally {
|
||||
// Long tag = (Long) message.getHeaders().get(AmqpHeaders.DELIVERY_TAG);
|
||||
// channel.basicAck(tag,false);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// public void insertConvertMsg(Map<String,Object> convertInfo) throws Exception{
|
||||
// docUploadConvert(convertMqEO);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @Description 文件转换
|
||||
// * Date 2018/8/21 15:51
|
||||
// * @Param [path]
|
||||
// * @return com.adc.da.util.http.ResponseMessage
|
||||
// **/
|
||||
// public ResponseMessage docUploadConvert(OtConvertMq convertMqEO) throws Exception{
|
||||
// //保存在数据库中的ID
|
||||
// String path = localFilePath + convertMqEO.getFilePath();
|
||||
// path = path.replace("//","/");
|
||||
// String convertId = convertMqEO.getId();
|
||||
// try {
|
||||
// //进入转换方法中,修改OT_CONVERT表中状态为转换中
|
||||
// convertMqEO.setId(convertId);
|
||||
// convertMqEO.setModifyTime(new Date());
|
||||
// convertMqEO.setMqState(3);
|
||||
// convertMqEOService.updateById(convertMqEO);
|
||||
// //开始转换。。。。。。
|
||||
// if(!"".equals(path)){
|
||||
// String converfilename = path.replaceAll("\\\\", "/");
|
||||
// logger.info("*****上传路径:*******"+localFilePath);
|
||||
// logger.info("************文件路径:**********" + convertMqEO.getFilePath());
|
||||
//// logger.info("************接口:**********" + port);
|
||||
// logger.info("*****上传路径替换,加入文件名*******"+converfilename);
|
||||
// //截取文件类型
|
||||
// int index = converfilename.lastIndexOf(".");
|
||||
// String fileType = converfilename.substring(index,converfilename.length());
|
||||
// String fileOriName = converfilename.substring(0,index);
|
||||
//// //调用转换类DocConverter,并将需要转换的文件传递给该类的构造方法
|
||||
//// DocConverterPdf d = new DocConverterPdf(converfilename,fileType);
|
||||
//// d.setConvertHost(convertHost);
|
||||
//// //调用conver方法开始转换,先执行doc2pdf()将office文件转换为pdf;再执行pdf2swf()将pdf转换为swf;
|
||||
//// File getPdf = d.conver(fileType);
|
||||
//// //调用getswfPath()方法,打印转换后的swf文件路径
|
||||
//// String dPath = d.getpdfPath();
|
||||
// String savePdfFileName = converfilename.substring(0, converfilename.lastIndexOf("."));
|
||||
// String savePdfPath = savePdfFileName+".pdf";
|
||||
// AsposeOfficeConvertUtils.convertOfficeFileToPDF(fileType,converfilename,savePdfPath);
|
||||
// File pdfFile = new File(savePdfPath);
|
||||
// logger.info("*****转换后的pdf文件路径*******"+savePdfPath);
|
||||
// //判断是否转换成功,修改数据状态
|
||||
// if(!savePdfPath.isEmpty() && pdfFile.length()>0){
|
||||
// // 上传转换后文件
|
||||
// String pdfId = attFileEOService.saveFileAttId(pdfFile);
|
||||
// logger.info("////////转换后文件id"+pdfId);
|
||||
// int count = 0;
|
||||
// if("0".equals(convertMqEO.getAddOrUp())){
|
||||
// count = insertConvertDocToFiles(convertMqEO,pdfId,fileOriName,fileType);
|
||||
// } else {
|
||||
// //查询之前在资源与文件关联表中是否有转换成功的数据,如果有执行修改,没有执行新增
|
||||
// if(StringUtils.isNotEmpty(convertMqEO.getPdfId())){
|
||||
// count = updateConvertDocToFIles(convertMqEO,pdfId);
|
||||
// } else {
|
||||
// count = insertConvertDocToFiles(convertMqEO,pdfId,fileOriName,fileType);
|
||||
// }
|
||||
// }
|
||||
// convertMqEO.setId(convertId);
|
||||
// if (count>0) {
|
||||
// // 转换成功
|
||||
// convertMqEO.setModifyTime(new Date());
|
||||
// convertMqEO.setMqState(1);
|
||||
// convertMqEOService.updateById(convertMqEO);
|
||||
// } else {
|
||||
// // 转换失败
|
||||
// convertMqEO.setModifyTime(new Date());
|
||||
// convertMqEO.setMqState(2);
|
||||
// convertMqEOService.updateById(convertMqEO);
|
||||
// }
|
||||
// } else {
|
||||
// // 转换失败
|
||||
// convertMqEO.setId(convertId);
|
||||
// convertMqEO.setModifyTime(new Date());
|
||||
// convertMqEO.setMqState(2);
|
||||
// convertMqEOService.updateById(convertMqEO);
|
||||
//// if(convertMqEO.getAgainNum()<=5){
|
||||
//// throw new Exception("转换失败");
|
||||
//// }
|
||||
// }
|
||||
// return Result.success(savePdfPath);
|
||||
// } else {
|
||||
// logger.error("转换时未获取到文件路径!");
|
||||
// return Result.error("文件存储失败,请重试");
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// // 转换失败
|
||||
// logger.error("转换过程中失败!");
|
||||
// logger.error(e.getMessage(),e);
|
||||
// convertMqEO.setId(convertId);
|
||||
// convertMqEO.setMqState(2);
|
||||
// convertMqEOService.updateById(convertMqEO);
|
||||
//// this.restartUploadConvert(convertMqEO);
|
||||
// return Result.error("r0072", "文件转换失败,请重试");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public ResponseMessage restartUploadConvert(OtConvertMq convertInfo) throws Exception{
|
||||
// OtConvertMq convertMqEO = new OtConvertMq();
|
||||
// convertMqEO.setLawsId(convertInfo.getLawsId());
|
||||
// convertMqEO.setConvertType(convertInfo.getConvertType());
|
||||
// convertMqEO.setAttId(convertInfo.getAttId());
|
||||
// convertMqEO.setOriAttId(convertInfo.getOriAttId());
|
||||
// convertMqEO.setId(convertInfo.getId());
|
||||
// convertMqEO.setFilePath(convertInfo.getFilePath());
|
||||
// convertMqEO.setAddOrUp(convertInfo.getAddOrUp());
|
||||
// convertMqEO.setPdfId(convertInfo.getPdfId());
|
||||
// convertMqEO.setStandFileClassify(convertInfo.getStandFileClassify());
|
||||
// int countAdd = 0;
|
||||
// convertMqEO.setAddOrUp("1");
|
||||
// int againNumNew = Integer.valueOf(convertInfo.getAgainNum());
|
||||
// convertMqEO.setAgainNum(againNumNew+1);
|
||||
// convertMq.sendMQ(convertMqEO);
|
||||
// return Result.success("true","已重新加入转换","");
|
||||
//
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @Author yangxuenan
|
||||
// * @Description 修改标准法规文件表pdf信息
|
||||
// * Date 2018/10/31 17:09
|
||||
// * @Param [convertMq, pdfId]
|
||||
// * @return int
|
||||
// **/
|
||||
// public int updateConvertDocToFIles(OtConvertMq convertMq,String pdfId){
|
||||
// int countSuccess = 0;
|
||||
// if(SarTypeEnum.STAND.getValue().equals(convertMq.getConvertType())){
|
||||
// SarStandFile lawsFile = new SarStandFile();
|
||||
// lawsFile.setId(convertMq.getPdfId());
|
||||
// lawsFile.setAttId(pdfId);
|
||||
// lawsFile.setOriAttId(convertMq.getOriAttId());
|
||||
// lawsFile.setModifyTime(new Date());
|
||||
// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
|
||||
// countSuccess = sarStandFileEODao.updateByPrimaryKeySelective(lawsFile);
|
||||
// } else if (SarTypeEnum.LAWS_STAND.getValue().equals(convertMq.getConvertType())) {
|
||||
// SarLawsFile lawsFile = new SarLawsFile();
|
||||
// lawsFile.setId(convertMq.getPdfId());
|
||||
// lawsFile.setAttId(pdfId);
|
||||
// lawsFile.setOriAttId(convertMq.getOriAttId());
|
||||
// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
|
||||
// lawsFile.setModifyTime(new Date());
|
||||
// countSuccess = sarLawsFileDao.updateByPrimaryKeySelective(lawsFile);
|
||||
// } else if (SarTypeEnum.BUSINESS.getValue().equals(convertMq.getConvertType())) {
|
||||
// SarBussStandFile lawsFile = new SarBussStandFile();
|
||||
// lawsFile.setId(convertMq.getPdfId());
|
||||
// lawsFile.setAttId(pdfId);
|
||||
// lawsFile.setOriAttId(convertMq.getOriAttId());
|
||||
// lawsFile.setUseModule(UseModuleEnum.WEB_FILE.getValue());
|
||||
// lawsFile.setModifyTime(new Date());
|
||||
// countSuccess = sarBussStandFileEODao.updateByPrimaryKeySelective(lawsFile);
|
||||
// }else if (SarTypeEnum.RECORDS.getValue().equals(convertMq.getConvertType())) {
|
||||
//// SarBussRecordsFileEO lawsFile = new SarBussRecordsFileEO();
|
||||
//// lawsFile.setId(convertMq.getPdfId());
|
||||
//// lawsFile.setRecordsId(convertMq.getLawsId());
|
||||
//// lawsFile.setAttId(pdfId);
|
||||
//// lawsFile.setOriAttId(convertMq.getOriAttId());
|
||||
//// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
|
||||
//// lawsFile.setValidFlag("0");
|
||||
//// lawsFile.setCreationTime(new Date());
|
||||
//// lawsFile.setModifyTime(new Date());
|
||||
//// countSuccess = sarBussRecordsFileEODao.updateByPrimaryKeySelective(lawsFile);
|
||||
// }
|
||||
// else {
|
||||
//// SarFileSplitItemsFileEO lawsFile = new SarFileSplitItemsFileEO();
|
||||
//// lawsFile.setId(convertMq.getPdfId());
|
||||
//// lawsFile.setAttId(pdfId);
|
||||
////// lawsFile.setOriAttId(convertMq.getOriAttId());
|
||||
//// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
|
||||
//// lawsFile.setModifyTime(new Date());
|
||||
//// countSuccess = sarFileSplitItemsFileEODao.updateByPrimaryKeySelective(lawsFile);
|
||||
// }
|
||||
// return countSuccess;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @Author yangxuenan
|
||||
// * @Description 添加标准法规文件表pdf信息
|
||||
// * Date 2018/10/30 21:52
|
||||
// * @Param [convertMq]
|
||||
// * @return int
|
||||
// **/
|
||||
// public int insertConvertDocToFiles(OtConvertMq convertMq,String pdfId,String fileOriName,String fileType) {
|
||||
// int countSuccess = 0;
|
||||
// String creationUser = LoginUserUtil.getUserId();
|
||||
// if(SarTypeEnum.STAND.getValue().equals(convertMq.getConvertType())){
|
||||
// SarStandFile lawsFile = new SarStandFile();
|
||||
// lawsFile.setId(UUID.randomUUID(20));
|
||||
// lawsFile.setStandId(convertMq.getLawsId());
|
||||
//// lawsFile.setResId(convertMq.getResId());
|
||||
// lawsFile.setAttId(pdfId);
|
||||
// lawsFile.setOriAttId(convertMq.getOriAttId());
|
||||
// lawsFile.setValidFlag("0");
|
||||
// lawsFile.setCreationUser(creationUser);
|
||||
// lawsFile.setCreationTime(new Date());
|
||||
// lawsFile.setModifyTime(new Date());
|
||||
// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
|
||||
// lawsFile.setStandFileClassify(convertMq.getStandFileClassify());
|
||||
// lawsFile.setFileName(fileOriName+".pdf");
|
||||
// lawsFile.setFileSuffix("pdf");
|
||||
// countSuccess = sarStandFileEODao.insertSelective(lawsFile);
|
||||
// } else if (SarTypeEnum.LAWS_STAND.getValue().equals(convertMq.getConvertType())) {
|
||||
// SarLawsFile lawsFile = new SarLawsFile();
|
||||
// lawsFile.setId(UUID.randomUUID(20));
|
||||
// lawsFile.setLawsId(convertMq.getLawsId());
|
||||
// lawsFile.setResId(convertMq.getResId());
|
||||
// lawsFile.setAttId(pdfId);
|
||||
// lawsFile.setOriAttId(convertMq.getOriAttId());
|
||||
// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
|
||||
// lawsFile.setValidFlag(0);
|
||||
// lawsFile.setCreationTime(new Date());
|
||||
// lawsFile.setModifyTime(new Date());
|
||||
// lawsFile.setLawsFileClassify(convertMq.getLawsFileClassify());
|
||||
// lawsFile.setFileName(fileOriName+".pdf");
|
||||
// lawsFile.setFileSuffix("pdf");
|
||||
// countSuccess = sarLawsFileDao.insertSelective(lawsFile);
|
||||
// } else if (SarTypeEnum.BUSINESS.getValue().equals(convertMq.getConvertType())) {
|
||||
// SarBussStandFile lawsFile = new SarBussStandFile();
|
||||
// lawsFile.setId(UUID.randomUUID(20));
|
||||
// lawsFile.setStandId(convertMq.getLawsId());
|
||||
// lawsFile.setResId(convertMq.getResId());
|
||||
// lawsFile.setAttId(pdfId);
|
||||
// lawsFile.setOriAttId(convertMq.getOriAttId());
|
||||
// lawsFile.setUseModule(UseModuleEnum.WEB_FILE.getValue());
|
||||
// lawsFile.setStandFileClassify(convertMq.getStandFileClassify());
|
||||
// lawsFile.setFileName(fileOriName+".pdf");
|
||||
// lawsFile.setFileSuffix("pdf");
|
||||
// lawsFile.setValidFlag(0);
|
||||
// lawsFile.setCreationTime(new Date());
|
||||
// lawsFile.setModifyTime(new Date());
|
||||
// countSuccess = sarBussStandFileEODao.insertSelective(lawsFile);
|
||||
// }
|
||||
// else if (SarTypeEnum.RECORDS.getValue().equals(convertMq.getConvertType())) {
|
||||
//// SarBussRecordsFileEO lawsFile = new SarBussRecordsFileEO();
|
||||
//// lawsFile.setId(UUID.randomUUID(20));
|
||||
//// lawsFile.setRecordsId(convertMq.getLawsId());
|
||||
//// lawsFile.setResId(convertMq.getResId());
|
||||
//// lawsFile.setAttId(pdfId);
|
||||
//// lawsFile.setOriAttId(convertMq.getOriAttId());
|
||||
//// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
|
||||
//// lawsFile.setRecordsFileClassify(convertMq.getStandFileClassify());
|
||||
//// lawsFile.setFileName(fileOriName+".pdf");
|
||||
//// lawsFile.setFileSuffix("pdf");
|
||||
//// lawsFile.setValidFlag("0");
|
||||
//// lawsFile.setCreationTime(new Date());
|
||||
//// lawsFile.setModifyTime(new Date());
|
||||
//// countSuccess = sarBussRecordsFileEODao.insertSelective(lawsFile);
|
||||
// }else {
|
||||
//// SarFileSplitItemsFileEO lawsFile = new SarFileSplitItemsFileEO();
|
||||
//// lawsFile.setId(UUID.randomUUID(20));
|
||||
//// lawsFile.setStandId(convertMq.getLawsId());
|
||||
//// lawsFile.setResId(convertMq.getResId());
|
||||
//// lawsFile.setAttId(pdfId);
|
||||
////// lawsFile.setOriAttId(convertMq.getOriAttId());
|
||||
//// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
|
||||
//// lawsFile.setValidFlag(0);
|
||||
//// lawsFile.setCreationTime(new Date());
|
||||
//// lawsFile.setModifyTime(new Date());
|
||||
//// countSuccess = sarFileSplitItemsFileEODao.insertSelective(lawsFile);
|
||||
// }
|
||||
// return countSuccess;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 文档转换逻辑
|
||||
// * @param attFileEO
|
||||
// */
|
||||
// public void insertOrUpdateStandInfo(AttFileEO attFileEO){
|
||||
//
|
||||
// }
|
||||
//
|
||||
//
|
||||
//}
|
||||
+63
-4
@@ -1,18 +1,38 @@
|
||||
package com.adc.da.convert.otConvert.controller;
|
||||
|
||||
|
||||
import com.adc.da.att.controller.AttFileEOController;
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
import com.adc.da.att.service.IAttFileEOService;
|
||||
import com.adc.da.att.vo.AttFileVo;
|
||||
import com.adc.da.convert.common.AsposeOfficeConvertUtils;
|
||||
import com.adc.da.convert.mq.CreateConvertMQService;
|
||||
import com.adc.da.convert.otConvert.service.IOtConvertService;
|
||||
import com.adc.da.util.http.ResponseMessage;
|
||||
import com.adc.da.util.http.Result;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.convert.otConvert.entity.OtConvert;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -24,12 +44,51 @@ import com.adc.da.base.web.BaseController;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "|OtConvert| 文档转换")
|
||||
@RequestMapping("/OtConvert")
|
||||
@RequestMapping("/${restPath}/OtConvert")
|
||||
public class OtConvertController extends BaseController<OtConvert> {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(OtConvertController.class);
|
||||
|
||||
@Value("${file.path}")
|
||||
private String filePath;//文件存储路径
|
||||
|
||||
@Value("${upload.file.white.lists}")
|
||||
private String uploadFileWhiteLists; //上传文件白名单
|
||||
|
||||
@Autowired
|
||||
private IOtConvertService iOtConvertService;
|
||||
|
||||
@Autowired
|
||||
private IAttFileEOService attFileEOService;
|
||||
|
||||
@Autowired
|
||||
private CreateConvertMQService createConvertMQService;
|
||||
|
||||
@ApiOperation(value = "|OtActConvertEO|根据文件ID获取流程转换文档")
|
||||
@GetMapping(value = "/getConvertFileByAttId")
|
||||
public ResponseMessage getConvertFileByAttId(String attId) throws Exception {
|
||||
// 根据attId查到地址
|
||||
if(StringUtils.isNotBlank(attId)){
|
||||
QueryWrapper wrapper = new QueryWrapper();
|
||||
wrapper.eq("ACT_FILE_ID",attId);
|
||||
List<OtConvert> resultList = iOtConvertService.list(wrapper);
|
||||
if(resultList!=null && !resultList.isEmpty()){
|
||||
OtConvert convertEO = resultList.get(0);
|
||||
if(StringUtils.isNotBlank(convertEO.getConvertFileId())){
|
||||
AttFileEO attFileEO = attFileEOService.getFileInfo(convertEO.getConvertFileId());
|
||||
convertEO.setConvertFileInfo(attFileEO);
|
||||
return Result.success(convertEO);
|
||||
}else{
|
||||
return Result.success("-100","查询的转件文件未找到,请检查状态",convertEO);
|
||||
}
|
||||
}else{
|
||||
return Result.error("-1","查询的转换记录不存在",null);
|
||||
}
|
||||
}else{
|
||||
return Result.error("-1","查询的转换文档ID不存在",null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author super_liu
|
||||
* @Description 查询文件信息
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.adc.da.convert.otConvert.entity;
|
||||
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <b>功能:</b>OT_ACT_CONVERT OtActConvertEOEntity<br>
|
||||
* <b>作者:</b>code generator<br>
|
||||
* <b>日期:</b> 2021-03-19 <br>
|
||||
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
|
||||
*/
|
||||
public class OtActConvertEO extends BaseEntity {
|
||||
|
||||
private String id;
|
||||
private String actFileId;
|
||||
private String convertState;
|
||||
private String convertFileId;
|
||||
@org.springframework.format.annotation.DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
@org.springframework.format.annotation.DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date modifyTime;
|
||||
|
||||
// 转换后文件信息
|
||||
private AttFileEO ConvertFileInfo;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* java字段名转换为原始数据库列名。<b>如果不存在则返回null</b><br>
|
||||
* <p>字段列表:</p>
|
||||
* <li>id -> id</li>
|
||||
* <li>actFileId -> act_file_id</li>
|
||||
* <li>convertState -> convert_state</li>
|
||||
* <li>convertFileId -> convert_file_id</li>
|
||||
* <li>createTime -> create_time</li>
|
||||
* <li>modifyTime -> modify_time</li>
|
||||
*/
|
||||
public static String fieldToColumn(String fieldName) {
|
||||
if (fieldName == null) { return null; };
|
||||
switch (fieldName) {
|
||||
case "id": return "id";
|
||||
case "actFileId": return "act_file_id";
|
||||
case "convertState": return "convert_state";
|
||||
case "convertFileId": return "convert_file_id";
|
||||
case "createTime": return "create_time";
|
||||
case "modifyTime": return "modify_time";
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 原始数据库列名转换为java字段名。<b>如果不存在则返回null</b><br>
|
||||
* <p>字段列表:</p>
|
||||
* <li>id -> id</li>
|
||||
* <li>act_file_id -> actFileId</li>
|
||||
* <li>convert_state -> convertState</li>
|
||||
* <li>convert_file_id -> convertFileId</li>
|
||||
* <li>create_time -> createTime</li>
|
||||
* <li>modify_time -> modifyTime</li>
|
||||
*/
|
||||
public static String columnToField(String columnName) {
|
||||
if (columnName == null) { return null; };
|
||||
switch (columnName) {
|
||||
case "id": return "id";
|
||||
case "act_file_id": return "actFileId";
|
||||
case "convert_state": return "convertState";
|
||||
case "convert_file_id": return "convertFileId";
|
||||
case "create_time": return "createTime";
|
||||
case "modify_time": return "modifyTime";
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** 主键 **/
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/** 主键 **/
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/** 流程中待转换文件ID **/
|
||||
public String getActFileId() {
|
||||
return this.actFileId;
|
||||
}
|
||||
|
||||
/** 流程中待转换文件ID **/
|
||||
public void setActFileId(String actFileId) {
|
||||
this.actFileId = actFileId;
|
||||
}
|
||||
|
||||
/** 转换状态:LODING:待转换 SUCCESS:成功 ERROR:错误 **/
|
||||
public String getConvertState() {
|
||||
return this.convertState;
|
||||
}
|
||||
|
||||
/** 转换状态:LODING:待转换 SUCCESS:成功 ERROR:错误 **/
|
||||
public void setConvertState(String convertState) {
|
||||
this.convertState = convertState;
|
||||
}
|
||||
|
||||
/** 转换后文件ID **/
|
||||
public String getConvertFileId() {
|
||||
return this.convertFileId;
|
||||
}
|
||||
|
||||
/** 转换后文件ID **/
|
||||
public void setConvertFileId(String convertFileId) {
|
||||
this.convertFileId = convertFileId;
|
||||
}
|
||||
|
||||
/** 数据创建时间 **/
|
||||
public Date getCreateTime() {
|
||||
return this.createTime;
|
||||
}
|
||||
|
||||
/** 数据创建时间 **/
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
/** 数据修改时间 **/
|
||||
public Date getModifyTime() {
|
||||
return this.modifyTime;
|
||||
}
|
||||
|
||||
/** 数据修改时间 **/
|
||||
public void setModifyTime(Date modifyTime) {
|
||||
this.modifyTime = modifyTime;
|
||||
}
|
||||
|
||||
|
||||
public AttFileEO getConvertFileInfo() {
|
||||
return ConvertFileInfo;
|
||||
}
|
||||
|
||||
public void setConvertFileInfo(AttFileEO convertFileInfo) {
|
||||
ConvertFileInfo = convertFileInfo;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.adc.da.convert.otConvert.entity;
|
||||
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
||||
@@ -62,5 +63,7 @@ public class OtConvert extends BaseEntity {
|
||||
@TableField("VALID_FLAG")
|
||||
private Integer validFlag;
|
||||
|
||||
|
||||
// 转换后文件信息
|
||||
@TableField(exist = false)
|
||||
private AttFileEO ConvertFileInfo;
|
||||
}
|
||||
|
||||
@@ -63,6 +63,17 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||
addInterceptor.excludePathPatterns("/api/sarStandUnqualified/sar-stand-unqualified/exportStandUnqulifiedExcel");
|
||||
//文件预览
|
||||
addInterceptor.excludePathPatterns("/api/att/attFile/getFileInfo");
|
||||
// onlyOffice 回调
|
||||
addInterceptor.excludePathPatterns("/api/lawss/activiti/recieveFile");
|
||||
|
||||
// 手机获取token
|
||||
addInterceptor.excludePathPatterns("/api/lawss/activiti/loginMobile");
|
||||
|
||||
addInterceptor.excludePathPatterns("/api/lawss/activiti/processModelHisOne");
|
||||
|
||||
addInterceptor.excludePathPatterns("/api/lawss/activiti/processModelHisOneCount");
|
||||
|
||||
addInterceptor.excludePathPatterns("/api/att/attFile/getSyncPdfFileInfo");
|
||||
//附件下载
|
||||
addInterceptor.excludePathPatterns("/api/att/attFile/downloadFileForSar");
|
||||
//水印下载
|
||||
@@ -70,6 +81,10 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||
//企业标准导出
|
||||
addInterceptor.excludePathPatterns("/api/lawss/sarBussionessStand/exportSarBussionessStand");
|
||||
|
||||
//预警导出
|
||||
addInterceptor.excludePathPatterns("/api/sys/EarlyWarning/exportWarning");
|
||||
|
||||
|
||||
//OCR回调存储文件
|
||||
addInterceptor.excludePathPatterns("/api/ocr/OCRRestful/OcrHandleResult");
|
||||
|
||||
@@ -81,6 +96,10 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||
//调研流程下载接口
|
||||
addInterceptor.excludePathPatterns("/api/att/attFile/downloadFile");
|
||||
|
||||
addInterceptor.excludePathPatterns("/api/lawss/activiti/exportProcessDetailInfo");
|
||||
|
||||
addInterceptor.excludePathPatterns("/api/lawss/activiti/getImg");
|
||||
|
||||
|
||||
// //测试接口使用
|
||||
// addInterceptor.excludePathPatterns("/api/**");
|
||||
@@ -88,7 +107,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||
|
||||
|
||||
|
||||
// 添加自定义拦截器,并拦截对应 url
|
||||
// // 添加自定义拦截器,并拦截对应 url
|
||||
addInterceptor.addPathPatterns("/**");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,13 +18,13 @@ public class CodeGen {
|
||||
|
||||
private static final String PACKAGE_PATH="/adc-da-slrs/src/main";
|
||||
|
||||
private static final String AUTHOR="super_liu";
|
||||
private static final String AUTHOR="zhaokaiyao";
|
||||
|
||||
private static final String DB_IP="127.0.0.1:3306/foton_slrs_test";
|
||||
private static final String DB_IP="123.56.177.15:3306/foton_slrs_test2";
|
||||
|
||||
private static final String DB_USER="root";
|
||||
|
||||
private static final String DB_PWD="root";
|
||||
private static final String DB_PWD="RsLDRj3dXtSwYjBI";
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -138,8 +138,11 @@ verifyCodeMode=1
|
||||
# =============================================================================
|
||||
# file模块上传文件的服务器地址
|
||||
file.path=D:/uploadfile/bus
|
||||
# 文件下载地址参数
|
||||
file.downloadUrl=http://39.98.140.126:10001/uploadPath
|
||||
|
||||
stand.edit.file.path = /usr/laws/file/
|
||||
# onlyoffice 预览地址
|
||||
file.downloadUrl=http://10.100.5.116:1080/file/
|
||||
|
||||
#上传文件白名单-以,分隔
|
||||
upload.file.white.lists = doc,docx,xls,xlsx,pdf,PDF,png,jpg,pptx,ppt
|
||||
|
||||
|
||||
@@ -3,28 +3,35 @@ package com.adc.da.scheduled;
|
||||
import com.adc.da.scheduled.dao.SarStandardInfoDao;
|
||||
import com.adc.da.scheduled.dao.SarStandardItemDao;
|
||||
import com.adc.da.scheduled.dao.SarStandardWarningDao;
|
||||
import com.adc.da.scheduled.entity.DataDTO;
|
||||
import com.adc.da.scheduled.entity.WarningEO;
|
||||
import com.adc.da.scheduled.entity.TermDTO;
|
||||
|
||||
import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
|
||||
|
||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningDate;
|
||||
import com.adc.da.slrs.sarStandWarning.service.IWarningDateService;
|
||||
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.sun.corba.se.spi.ior.iiop.IIOPFactories;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@EnableScheduling
|
||||
@@ -55,13 +62,15 @@ public class ScheduledJob {
|
||||
@Autowired
|
||||
private SarStandAttrInfoDao sarStandAttrInfoDao; //属性字段表
|
||||
|
||||
@Autowired
|
||||
private IWarningDateService iWarningDateService;// 预警日期
|
||||
|
||||
|
||||
// @PostConstruct //程序启动时执行一次
|
||||
@Scheduled(cron = "0 0 0 * * ?") //每天的凌晨0点执行
|
||||
// @Scheduled(cron="*/5 * * * * ?")
|
||||
@Async
|
||||
public void WarningSchedulingTasks() {
|
||||
|
||||
Logger logger = LoggerFactory.getLogger(ScheduledJob.class);
|
||||
|
||||
/**
|
||||
* 1.查询标准属性字段表(sar_stand_attr_info) XCXSSEQ ZCCSSRQ ZRGCS
|
||||
@@ -78,98 +87,44 @@ public class ScheduledJob {
|
||||
4:在产车标准预警
|
||||
1:新车条款预警
|
||||
2:在产车条款预警
|
||||
|
||||
2021/12/1 日需求修改
|
||||
分为标准预警与条款预警
|
||||
mark:标识预警的种类 stand 标准 item 条款
|
||||
*/
|
||||
|
||||
//删除不在预警范围的标准
|
||||
QueryWrapper<EarlyWarningEO> earlyWarningEOQW = new QueryWrapper<>();
|
||||
earlyWarningEOQW.lt("PUT_TIME",LocalDate.now());
|
||||
int remove = sarStandardWarningDao.delete(earlyWarningEOQW);
|
||||
System.out.println(remove);
|
||||
int remove = sarStandardWarningDao.autoCancelWarning();
|
||||
|
||||
logger.info("==========================================================================");
|
||||
logger.info("取消"+remove+"条预警");
|
||||
logger.info("开始执行预警!!!");
|
||||
logger.info("==========================================================================");
|
||||
|
||||
System.out.println("开始执行预警!!!");
|
||||
TermDTO term = new TermDTO(); //预警期限(当前日期至3个月后)
|
||||
|
||||
DataDTO term = new DataDTO(); //预警期限(当前日期至3个月后)
|
||||
List<WarningDate> warningDateList = sarStandardWarningDao.getWarningDate(term); //查询符合预警期限的标准 多个
|
||||
|
||||
LinkedList<WarningEO> warningList = new LinkedList<>();//需预警的标准和条款列表集合
|
||||
//分解单(条款) 新车型 mark=1
|
||||
List<WarningEO> itemForXCXSSRQ = sarStandardItemDao.selectWithinTerm(term, "XCXSSRQ");
|
||||
for (WarningEO warningEO : itemForXCXSSRQ) {
|
||||
warningEO.setId(UUIDUtils.randomUUID20())
|
||||
.setPower("1")
|
||||
.setMark("1")
|
||||
.setPutTime(warningEO.getXCXSSRQ())
|
||||
.setStandCode(warningEO.getStandSort()+" "+ warningEO.getStandNum()+"-"+ warningEO.getStandYear());
|
||||
}
|
||||
warningList.addAll(itemForXCXSSRQ);
|
||||
|
||||
//分解单(条款) 在产车型 mark=2
|
||||
List<WarningEO> itemForZCCSSRQ = sarStandardItemDao.selectWithinTerm(term, "ZCCSSRQ");
|
||||
for (WarningEO warningEO : itemForZCCSSRQ) {
|
||||
warningEO.setId(UUIDUtils.randomUUID20())
|
||||
.setPower("1")
|
||||
.setMark("2")
|
||||
.setPutTime(warningEO.getZCCSSRQ())
|
||||
.setStandCode(warningEO.getStandSort()+" "+ warningEO.getStandNum()+"-"+ warningEO.getStandYear());
|
||||
|
||||
}
|
||||
warningList.addAll(itemForZCCSSRQ);
|
||||
|
||||
//标准 新车型 预警 mark=3
|
||||
List<WarningEO> standInfoXCXSSRQ = sarStandardInfoDao.selectWithinTerm(term, "XCXSSRQ");
|
||||
for (WarningEO warningEO : standInfoXCXSSRQ) {
|
||||
warningEO.setId(UUIDUtils.randomUUID20())
|
||||
/**
|
||||
* //如果插入的值均为NULL,则根据索引的原理,
|
||||
* 全NULL值不被记录在索引上,所以插入全NULL值时,可以有重复的
|
||||
* 则此处设为 '-1'
|
||||
*/
|
||||
.setItemsId("-1")
|
||||
.setPower("1")
|
||||
.setMark("3")
|
||||
.setStandCode(warningEO.getStandSort()+" "+ warningEO.getStandNum()+"-"+ warningEO.getStandYear());
|
||||
|
||||
|
||||
//实施日期达到预警时间,但在产车实施日期不在时间内
|
||||
/**
|
||||
* 2021/9/9取消限制
|
||||
*/
|
||||
// if (term.isTerm(warningEO.getXCXSSRQ())){
|
||||
// warningEO.setPutTime(warningEO.getXCXSSRQ());
|
||||
// }
|
||||
warningEO.setPutTime(warningEO.getXCXSSRQ());
|
||||
|
||||
}
|
||||
warningList.addAll(standInfoXCXSSRQ);
|
||||
|
||||
|
||||
//标准 在产车型 mark=4
|
||||
List<WarningEO> standInfoZCCSSRQ = sarStandardInfoDao.selectWithinTerm(term, "ZCCSSRQ");
|
||||
for (WarningEO warningEO : standInfoZCCSSRQ) {
|
||||
warningEO.setId(UUIDUtils.randomUUID20())
|
||||
/**
|
||||
* 同上
|
||||
*/
|
||||
.setItemsId("-1")
|
||||
.setPower("1")
|
||||
.setMark("4")
|
||||
.setStandCode(warningEO.getStandSort()+" "+ warningEO.getStandNum()+"-"+ warningEO.getStandYear());
|
||||
//实施日期达到预警时间,但在产车实施日期不在时间内
|
||||
/**
|
||||
* 2021/9/9取消限制
|
||||
*/
|
||||
// if (term.isTerm(warningEO.getZCCSSRQ())){
|
||||
// warningEO.setPutTime(warningEO.getZCCSSRQ());
|
||||
// }
|
||||
warningEO.setPutTime(warningEO.getZCCSSRQ());
|
||||
}
|
||||
warningList.addAll(standInfoZCCSSRQ);
|
||||
warningDateList.forEach(item->{
|
||||
item.setId(UUIDUtils.randomUUID20());
|
||||
});
|
||||
iWarningDateService.remove(null); //清空标准的日期子表
|
||||
iWarningDateService.saveBatch(warningDateList); // 保存进入标准的日期子表 保存标准的实施日期 新车型实施日期 在产车实施日期 多个
|
||||
List<EarlyWarningEO> warningList = sarStandardWarningDao.getWarningId(term); //联接标准的日期子表 和分解单表 查询符合预警期限的标准和分解项
|
||||
|
||||
warningList.forEach(item->{
|
||||
item.setId(UUIDUtils.randomUUID20());
|
||||
});
|
||||
//持久化至预警表 忽略标准id和标志位都一样的数据
|
||||
if (warningList.size()!=0){
|
||||
//此表的STAND_ID和MARK字段以及ITEMS_ID字段需个建立唯一性约束
|
||||
int count = sarStandardWarningDao.ignoreInsert(warningList);
|
||||
System.out.println("已预警 " + count + " 条标准或条款!!");
|
||||
logger.info("==================================预警结束======================================");
|
||||
logger.info("==================================预警结束======================================");
|
||||
logger.info("已预警"+ count+"条标准或条款!!");
|
||||
logger.info("==================================预警结束======================================");
|
||||
logger.info("==================================预警结束======================================");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +145,7 @@ public class ScheduledJob {
|
||||
public void TextStatusSchedulingTasks() {
|
||||
QueryWrapper<SarStandardsInfo> wrapper = new QueryWrapper<>();
|
||||
|
||||
DataDTO data = new DataDTO(LocalDate.now(), LocalDate.now());
|
||||
TermDTO data = new TermDTO(LocalDate.now(), LocalDate.now());
|
||||
|
||||
/**
|
||||
*实施日期是当前系统时间的标准文本状态变为'现行有效'
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package com.adc.da.scheduled.dao;
|
||||
|
||||
|
||||
import com.adc.da.scheduled.entity.DataDTO;
|
||||
import com.adc.da.scheduled.entity.WarningEO;
|
||||
import com.adc.da.scheduled.entity.TermDTO;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
@@ -12,7 +11,7 @@ import java.util.List;
|
||||
@Repository
|
||||
public interface SarStandardInfoDao{
|
||||
|
||||
public List<WarningEO> selectWithinTerm(DataDTO date, String str);
|
||||
public List<String> selectWithinTerm(TermDTO date, String str);
|
||||
|
||||
public int updateStandardInfo(@Param("id")String id, @Param("textStatus") String textStatus);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.adc.da.scheduled.dao;
|
||||
|
||||
import com.adc.da.scheduled.entity.DataDTO;
|
||||
import com.adc.da.scheduled.entity.TermDTO;
|
||||
import com.adc.da.scheduled.entity.WarningEO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
@@ -11,6 +11,6 @@ import java.util.List;
|
||||
@Repository
|
||||
public interface SarStandardItemDao extends BaseMapper{
|
||||
|
||||
public List<WarningEO> selectWithinTerm(DataDTO date, String str);
|
||||
public List<WarningEO> selectWithinTerm(TermDTO date, String str);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,17 +1,26 @@
|
||||
package com.adc.da.scheduled.dao;
|
||||
|
||||
import com.adc.da.scheduled.entity.WarningEO;
|
||||
import com.adc.da.scheduled.entity.TermDTO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningDate;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface SarStandardWarningDao extends BaseMapper<EarlyWarningEO> {
|
||||
|
||||
public int ignoreInsert(@Param(value = "warningEOS") LinkedList<WarningEO> warningEOS);
|
||||
public int ignoreInsert(@Param(value = "warningEOS") List<EarlyWarningEO> warningEOS);
|
||||
|
||||
|
||||
public int autoCancelWarning();
|
||||
|
||||
public List<EarlyWarningEO> getWarningId(TermDTO term);
|
||||
|
||||
public List<WarningDate> getWarningDate(TermDTO term);
|
||||
|
||||
}
|
||||
|
||||
+3
-3
@@ -16,7 +16,7 @@ import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class DataDTO {
|
||||
public class TermDTO {
|
||||
/**
|
||||
* 预警的期限为系统日期的次日至3个月后
|
||||
*/
|
||||
@@ -28,14 +28,14 @@ public class DataDTO {
|
||||
|
||||
// private String str;
|
||||
|
||||
public DataDTO() {
|
||||
public TermDTO() {
|
||||
LocalDate starDate = LocalDate.now();//系统当前日期
|
||||
LocalDate endDate = LocalDate.now().plusMonths(3);//系统当前日期3个月后
|
||||
|
||||
convertToStr(starDate,endDate);
|
||||
}
|
||||
|
||||
public DataDTO(LocalDate startDate,LocalDate endDate){
|
||||
public TermDTO(LocalDate startDate, LocalDate endDate){
|
||||
convertToStr(startDate,endDate);
|
||||
}
|
||||
|
||||
@@ -31,5 +31,6 @@ public class WarningEO extends EarlyWarningEO {
|
||||
|
||||
private String standYear;
|
||||
|
||||
private String issueTime;
|
||||
|
||||
}
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.adc.da.slrs.ActivityDatas.controller;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.ActivityDatas.entity.receiveData;
|
||||
import com.adc.da.slrs.ActivityDatas.service.ActivityDataService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@Api(description = "|EsRevisePlan|")
|
||||
@RequestMapping("api/activityData")
|
||||
public class ActivityDataController {
|
||||
|
||||
@Autowired
|
||||
ActivityDataService activityDataService;
|
||||
|
||||
@ApiOperation(value = "返回拼接的数据")
|
||||
@PostMapping("/backData")
|
||||
public ResponseMessage<Object> queryAllPlans(receiveData receiveData){
|
||||
return Result.success(activityDataService.dealWithDatas(receiveData.getJson()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.adc.da.slrs.ActivityDatas.controller.tools;
|
||||
|
||||
import net.sf.json.JsonConfig;
|
||||
import net.sf.json.processors.JsonValueProcessor;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
public class JsonDateValueProcessor implements JsonValueProcessor {
|
||||
|
||||
private String datePattern = "yyyy-MM-dd HH:mm:ss";//默认样式,可以在构造方法中修改
|
||||
public JsonDateValueProcessor() {
|
||||
super();
|
||||
}
|
||||
public JsonDateValueProcessor(String datePattern) {
|
||||
super();
|
||||
this.datePattern = datePattern;
|
||||
}
|
||||
public Object processArrayValue(Object value, JsonConfig jsonConfig) {
|
||||
try {
|
||||
if(value instanceof Date){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(datePattern);
|
||||
Date date = (Date)value;
|
||||
return sdf.format(date);
|
||||
}
|
||||
return value == null ? null : value.toString();
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public Object processObjectValue(String key, Object value, JsonConfig jsonConfig) {
|
||||
return processArrayValue(value, jsonConfig);
|
||||
}
|
||||
public String getDatePattern() {
|
||||
return datePattern;
|
||||
}
|
||||
public void setDatePattern(String datePattern) {
|
||||
this.datePattern = datePattern;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
/**
|
||||
* Copyright 2021 bejson.com
|
||||
*/
|
||||
package com.adc.da.slrs.ActivityDatas.entity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Auto-generated: 2021-07-09 16:11:32
|
||||
*
|
||||
* @author bejson.com (i@bejson.com)
|
||||
* @website http://www.bejson.com/java2pojo/
|
||||
*/
|
||||
@Data
|
||||
public class BreakdownList {
|
||||
|
||||
private String id;
|
||||
private String svpps;
|
||||
private String standId;
|
||||
private String itemsNum;
|
||||
private String claimType;
|
||||
private String itemsName;
|
||||
private String applyArctic;
|
||||
private String busStandCover;
|
||||
private String responsibleUnit;
|
||||
private String responsibleEngineer;
|
||||
private String technicalRequir;
|
||||
private String changePoint;
|
||||
private String xcxssrq;
|
||||
private String zccssrq;
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setSvpps(String svpps) {
|
||||
this.svpps = svpps;
|
||||
}
|
||||
public String getSvpps() {
|
||||
return svpps;
|
||||
}
|
||||
|
||||
public void setStandId(String standId) {
|
||||
this.standId = standId;
|
||||
}
|
||||
public String getStandId() {
|
||||
return standId;
|
||||
}
|
||||
|
||||
public void setItemsNum(String itemsNum) {
|
||||
this.itemsNum = itemsNum;
|
||||
}
|
||||
public String getItemsNum() {
|
||||
return itemsNum;
|
||||
}
|
||||
|
||||
public void setClaimType(String claimType) {
|
||||
this.claimType = claimType;
|
||||
}
|
||||
public String getClaimType() {
|
||||
return claimType;
|
||||
}
|
||||
|
||||
public void setItemsName(String itemsName) {
|
||||
this.itemsName = itemsName;
|
||||
}
|
||||
public String getItemsName() {
|
||||
return itemsName;
|
||||
}
|
||||
|
||||
public void setApplyArctic(String applyArctic) {
|
||||
this.applyArctic = applyArctic;
|
||||
}
|
||||
public String getApplyArctic() {
|
||||
return applyArctic;
|
||||
}
|
||||
|
||||
public void setBusStandCover(String busStandCover) {
|
||||
this.busStandCover = busStandCover;
|
||||
}
|
||||
public String getBusStandCover() {
|
||||
return busStandCover;
|
||||
}
|
||||
|
||||
public void setResponsibleUnit(String responsibleUnit) {
|
||||
this.responsibleUnit = responsibleUnit;
|
||||
}
|
||||
public String getResponsibleUnit() {
|
||||
return responsibleUnit;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* Copyright 2021 bejson.com
|
||||
*/
|
||||
package com.adc.da.slrs.ActivityDatas.entity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Auto-generated: 2021-07-09 16:11:32
|
||||
*
|
||||
* @author bejson.com (i@bejson.com)
|
||||
* @website http://www.bejson.com/java2pojo/
|
||||
*/
|
||||
@Data
|
||||
public class DataList {
|
||||
|
||||
private String uname;
|
||||
private String productLine;
|
||||
private String distributePerson;
|
||||
private String distributePersonId;
|
||||
private String projectManager;
|
||||
|
||||
//合规评估添加的数据
|
||||
|
||||
private String itemNum;
|
||||
private String xCXSSRQ;
|
||||
private String zCCSSRQ;
|
||||
private String itemsName;
|
||||
private String standName;
|
||||
private String implementer;
|
||||
private String projectName;
|
||||
private String standNumber;
|
||||
private String noCompliance;
|
||||
private String implementerId;
|
||||
private String projectNumber;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date completionTime;
|
||||
private String zcNoCompliance;
|
||||
private String countermeasures;
|
||||
private String qualityEngineer;
|
||||
private String responsibleUnit;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date zcCompletionTime;
|
||||
private String certifiedEngineer;
|
||||
private String complianceReasons;
|
||||
private String zcCountermeasures;
|
||||
private String responsibleEngineer;
|
||||
private String zcComplianceReasons;
|
||||
private String technicalRequir;
|
||||
private String changePoint;
|
||||
|
||||
private List<SarStandProjectLibraries> sarStandProjectLibraries;
|
||||
public void setUname(String uname) {
|
||||
this.uname = uname;
|
||||
}
|
||||
public String getUname() {
|
||||
return uname;
|
||||
}
|
||||
|
||||
public void setProductLine(String productLine) {
|
||||
this.productLine = productLine;
|
||||
}
|
||||
public String getProductLine() {
|
||||
return productLine;
|
||||
}
|
||||
|
||||
public void setSarStandProjectLibraries(List<SarStandProjectLibraries> sarStandProjectLibraries) {
|
||||
this.sarStandProjectLibraries = sarStandProjectLibraries;
|
||||
}
|
||||
public List<SarStandProjectLibraries> getSarStandProjectLibraries() {
|
||||
return sarStandProjectLibraries;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.adc.da.slrs.ActivityDatas.entity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class PEPDTO {
|
||||
|
||||
private String id;
|
||||
private List<DataList> dataList;
|
||||
private SarStandProjectLibraries sarStandProjectLibraries;
|
||||
private String jlUserId;
|
||||
private String passFlag;
|
||||
private String zrUserId;
|
||||
private String standName;
|
||||
private String standNumber;
|
||||
private List<BreakdownList> breakdownList;
|
||||
private String prcCreateUser;
|
||||
private String applyUpdUserId;
|
||||
private String approvalOpinion;
|
||||
private String qualityEngineer;
|
||||
private String qualityEngineerName;
|
||||
private String certifiedEngineer;
|
||||
private String certifiedEngineerName;
|
||||
private String prcCreateUserName;
|
||||
//返回分发责任人
|
||||
private String distributePerson;
|
||||
private String distributePersonId;
|
||||
private String uname;
|
||||
private String projectManager;
|
||||
//责任人 (对应到每条数据一个责任人)
|
||||
private String workPeople;
|
||||
//在研在产字段!!! 待定中 下发落实人需要使用
|
||||
//时间字段
|
||||
private String ZCCSSRQ;
|
||||
private String XCXSSRQ;
|
||||
|
||||
private String commentText;
|
||||
|
||||
private List<Step3DTO> step3DTOS;
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setDataList(List<DataList> dataList) {
|
||||
this.dataList = dataList;
|
||||
}
|
||||
public List<DataList> getDataList() {
|
||||
return dataList;
|
||||
}
|
||||
|
||||
public void setJlUserId(String jlUserId) {
|
||||
this.jlUserId = jlUserId;
|
||||
}
|
||||
public String getJlUserId() {
|
||||
return jlUserId;
|
||||
}
|
||||
|
||||
public void setZrUserId(String zrUserId) {
|
||||
this.zrUserId = zrUserId;
|
||||
}
|
||||
public String getZrUserId() {
|
||||
return zrUserId;
|
||||
}
|
||||
|
||||
public void setStandName(String standName) {
|
||||
this.standName = standName;
|
||||
}
|
||||
public String getStandName() {
|
||||
return standName;
|
||||
}
|
||||
|
||||
public void setStandNumber(String standNumber) {
|
||||
this.standNumber = standNumber;
|
||||
}
|
||||
public String getStandNumber() {
|
||||
return standNumber;
|
||||
}
|
||||
|
||||
public void setBreakdownList(List<BreakdownList> breakdownList) {
|
||||
this.breakdownList = breakdownList;
|
||||
}
|
||||
public List<BreakdownList> getBreakdownList() {
|
||||
return breakdownList;
|
||||
}
|
||||
|
||||
public void setPrcCreateUser(String prcCreateUser) {
|
||||
this.prcCreateUser = prcCreateUser;
|
||||
}
|
||||
public String getPrcCreateUser() {
|
||||
return prcCreateUser;
|
||||
}
|
||||
|
||||
public void setApplyUpdUserId(String applyUpdUserId) {
|
||||
this.applyUpdUserId = applyUpdUserId;
|
||||
}
|
||||
public String getApplyUpdUserId() {
|
||||
return applyUpdUserId;
|
||||
}
|
||||
|
||||
public void setApprovalOpinion(String approvalOpinion) {
|
||||
this.approvalOpinion = approvalOpinion;
|
||||
}
|
||||
public String getApprovalOpinion() {
|
||||
return approvalOpinion;
|
||||
}
|
||||
|
||||
public void setQualityEngineer(String qualityEngineer) {
|
||||
this.qualityEngineer = qualityEngineer;
|
||||
}
|
||||
public String getQualityEngineer() {
|
||||
return qualityEngineer;
|
||||
}
|
||||
|
||||
public void setCertifiedEngineer(String certifiedEngineer) {
|
||||
this.certifiedEngineer = certifiedEngineer;
|
||||
}
|
||||
public String getCertifiedEngineer() {
|
||||
return certifiedEngineer;
|
||||
}
|
||||
|
||||
public void setPrcCreateUserName(String prcCreateUserName) {
|
||||
this.prcCreateUserName = prcCreateUserName;
|
||||
}
|
||||
public String getPrcCreateUserName() {
|
||||
return prcCreateUserName;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.adc.da.slrs.ActivityDatas.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class PEPres {
|
||||
|
||||
private List<PEPDTO> pepdtos;
|
||||
|
||||
|
||||
private List<Step3DTO> step3DTOS;
|
||||
}
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
/**
|
||||
* Copyright 2021 bejson.com
|
||||
*/
|
||||
package com.adc.da.slrs.ActivityDatas.entity;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Auto-generated: 2021-07-09 16:11:32
|
||||
*
|
||||
* @author bejson.com (i@bejson.com)
|
||||
* @website http://www.bejson.com/java2pojo/
|
||||
*/
|
||||
public class SarStandProjectLibraries {
|
||||
|
||||
private String id;
|
||||
private String uname;
|
||||
private String currentNode;
|
||||
private String productLine;
|
||||
private String projectName;
|
||||
private String projectGroup;
|
||||
private String projectLevel;
|
||||
private String projectNumber;
|
||||
private String projectStatus;
|
||||
private Date projectEndDate;
|
||||
private String projectManager;
|
||||
private String projectPlatfor;
|
||||
private Date projectStartDate;
|
||||
private String projectClassification;
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setUname(String uname) {
|
||||
this.uname = uname;
|
||||
}
|
||||
public String getUname() {
|
||||
return uname;
|
||||
}
|
||||
|
||||
public void setCurrentNode(String currentNode) {
|
||||
this.currentNode = currentNode;
|
||||
}
|
||||
public String getCurrentNode() {
|
||||
return currentNode;
|
||||
}
|
||||
|
||||
public void setProductLine(String productLine) {
|
||||
this.productLine = productLine;
|
||||
}
|
||||
public String getProductLine() {
|
||||
return productLine;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectGroup(String projectGroup) {
|
||||
this.projectGroup = projectGroup;
|
||||
}
|
||||
public String getProjectGroup() {
|
||||
return projectGroup;
|
||||
}
|
||||
|
||||
public void setProjectLevel(String projectLevel) {
|
||||
this.projectLevel = projectLevel;
|
||||
}
|
||||
public String getProjectLevel() {
|
||||
return projectLevel;
|
||||
}
|
||||
|
||||
public void setProjectNumber(String projectNumber) {
|
||||
this.projectNumber = projectNumber;
|
||||
}
|
||||
public String getProjectNumber() {
|
||||
return projectNumber;
|
||||
}
|
||||
|
||||
public void setProjectStatus(String projectStatus) {
|
||||
this.projectStatus = projectStatus;
|
||||
}
|
||||
public String getProjectStatus() {
|
||||
return projectStatus;
|
||||
}
|
||||
|
||||
public void setProjectEndDate(Date projectEndDate) {
|
||||
this.projectEndDate = projectEndDate;
|
||||
}
|
||||
public Date getProjectEndDate() {
|
||||
return projectEndDate;
|
||||
}
|
||||
|
||||
public void setProjectManager(String projectManager) {
|
||||
this.projectManager = projectManager;
|
||||
}
|
||||
public String getProjectManager() {
|
||||
return projectManager;
|
||||
}
|
||||
|
||||
public void setProjectPlatfor(String projectPlatfor) {
|
||||
this.projectPlatfor = projectPlatfor;
|
||||
}
|
||||
public String getProjectPlatfor() {
|
||||
return projectPlatfor;
|
||||
}
|
||||
|
||||
public void setProjectStartDate(Date projectStartDate) {
|
||||
this.projectStartDate = projectStartDate;
|
||||
}
|
||||
public Date getProjectStartDate() {
|
||||
return projectStartDate;
|
||||
}
|
||||
|
||||
public void setProjectClassification(String projectClassification) {
|
||||
this.projectClassification = projectClassification;
|
||||
}
|
||||
public String getProjectClassification() {
|
||||
return projectClassification;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* Copyright 2021 bejson.com
|
||||
*/
|
||||
package com.adc.da.slrs.ActivityDatas.entity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Auto-generated: 2021-07-12 17:52:47
|
||||
*
|
||||
* @author bejson.com (i@bejson.com)
|
||||
* @website http://www.bejson.com/java2pojo/
|
||||
*/
|
||||
@Data
|
||||
public class Step3DTO {
|
||||
|
||||
private String id;
|
||||
private String uname;
|
||||
private String itemNum;
|
||||
private String itemsName;
|
||||
private String standName;
|
||||
private String implementer;
|
||||
private String productLine;
|
||||
private String projectName;
|
||||
private String standNumber;
|
||||
private String implementerId;
|
||||
private String projectNumber;
|
||||
private String projectManager;
|
||||
private String qualityEngineer;
|
||||
private String qualityEngineerName;
|
||||
private String qaEngineer;
|
||||
private String distributePerson;
|
||||
private String certifiedEngineer;
|
||||
private String certifiedEngineerName;
|
||||
private String authEngineer;
|
||||
private String distributePersonId;
|
||||
private String zCCSSRQ;
|
||||
private String xCXSSRQ;
|
||||
private String responsibleUnit;
|
||||
private String responsibleEngineer;
|
||||
private String dutyEngineer;
|
||||
private String standId;
|
||||
private String standardInfo;
|
||||
private String typeId;
|
||||
|
||||
private String technicalRequir;
|
||||
private String changePoint;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.adc.da.slrs.ActivityDatas.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class receiveData {
|
||||
|
||||
private String json;
|
||||
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.adc.da.slrs.ActivityDatas.service;
|
||||
|
||||
|
||||
public interface ActivityDataService {
|
||||
|
||||
public String dealWithDatas(String json);
|
||||
|
||||
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package com.adc.da.slrs.ActivityDatas.service.impl;
|
||||
|
||||
import com.adc.da.slrs.ActivityDatas.controller.tools.JsonDateValueProcessor;
|
||||
import com.adc.da.slrs.ActivityDatas.entity.*;
|
||||
import com.adc.da.slrs.ActivityDatas.service.ActivityDataService;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import net.sf.json.JsonConfig;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class ActivityDataServiceimpl implements ActivityDataService {
|
||||
|
||||
public String dealWithDatas(String json){
|
||||
JSONObject object = JSONObject.parseObject(json);
|
||||
//先获取标准的数据
|
||||
List<BreakdownList> breakdownList = JSONArray.parseArray(object.getString("breakdownList"), BreakdownList.class);
|
||||
//再获取产品线和项目对应信息
|
||||
List<DataList> dataList = JSONArray.parseArray(object.getString("dataList"), DataList.class);
|
||||
|
||||
PEPDTO pepdto = JSONObject.parseObject(json, PEPDTO.class);
|
||||
|
||||
//生成任务信息
|
||||
Map<String,String> numberWithId=new HashMap<>();
|
||||
|
||||
PEPres pePres = new PEPres();
|
||||
for (DataList da : dataList) {
|
||||
List<PEPDTO> pepdtos = new ArrayList<>();
|
||||
for (SarStandProjectLibraries sa : da.getSarStandProjectLibraries()) {
|
||||
numberWithId.put(sa.getProjectNumber(), sa.getId());
|
||||
for (BreakdownList breakdownList1 : breakdownList) {
|
||||
//造数据
|
||||
//项目
|
||||
PEPDTO res = new PEPDTO();
|
||||
BeanUtils.copyProperties(pepdto, res);
|
||||
List<DataList> dataLists = new ArrayList<>();
|
||||
DataList dataList1 = new DataList();
|
||||
List<SarStandProjectLibraries> list = new ArrayList<>();
|
||||
SarStandProjectLibraries libraries = new SarStandProjectLibraries();
|
||||
BeanUtils.copyProperties(sa, libraries);
|
||||
res.setSarStandProjectLibraries(libraries);
|
||||
list.add(sa);
|
||||
dataList1.setSarStandProjectLibraries(list);
|
||||
dataLists.add(dataList1);
|
||||
res.setDataList(dataLists);
|
||||
//标准 数据
|
||||
BreakdownList breakdownList2 = new BreakdownList();
|
||||
BeanUtils.copyProperties(breakdownList1, breakdownList2);
|
||||
List<BreakdownList> breakdownLists = new ArrayList<>();
|
||||
breakdownLists.add(breakdownList2);
|
||||
res.setBreakdownList(breakdownLists);
|
||||
res.setCertifiedEngineerName(object.getString("certifiedEngineerName"));
|
||||
res.setQualityEngineerName(object.getString("qualityEngineerName"));
|
||||
//存储终点数据
|
||||
res.setDistributePerson(da.getDistributePerson());
|
||||
res.setDistributePersonId(da.getDistributePersonId());
|
||||
res.setUname(da.getUname());
|
||||
res.setProjectManager(da.getProjectManager());
|
||||
//时间
|
||||
res.setXCXSSRQ(breakdownList1.getXcxssrq());
|
||||
res.setZCCSSRQ(breakdownList1.getZccssrq());
|
||||
pepdtos.add(res);
|
||||
}
|
||||
}
|
||||
pePres.setPepdtos(pepdtos);
|
||||
}
|
||||
return delWithTime(pePres);
|
||||
}
|
||||
|
||||
|
||||
public static String delWithTime(PEPres a){
|
||||
JsonConfig jsonConfig = new JsonConfig();
|
||||
jsonConfig.registerJsonValueProcessor(Date.class, new JsonDateValueProcessor());
|
||||
net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(a,jsonConfig);
|
||||
return jsonObject.toString();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
package com.adc.da.slrs.ImportExcelDatas.POIUtil;
|
||||
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.file.Files;
|
||||
import java.util.List;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
public class ZIPUtil {
|
||||
|
||||
private static final int BUFFER_SIZE = 2 * 1024;
|
||||
|
||||
/**
|
||||
* 压缩成ZIP 方法1
|
||||
* @param srcDir 压缩文件夹路径
|
||||
* @param out 压缩文件输出流
|
||||
* @param KeepDirStructure 是否保留原来的目录结构,true:保留目录结构;
|
||||
* false:所有文件跑到压缩包根目录下(注意:不保留目录结构可能会出现同名文件,会压缩失败)
|
||||
* @throws RuntimeException 压缩失败会抛出运行时异常
|
||||
*/
|
||||
public static void toZip(String srcDir, OutputStream out, boolean KeepDirStructure)
|
||||
throws RuntimeException{
|
||||
|
||||
// long start = System.currentTimeMillis();
|
||||
ZipOutputStream zos = null ;
|
||||
try {
|
||||
zos = new ZipOutputStream(out);
|
||||
File sourceFile = new File(srcDir);
|
||||
compress(sourceFile,zos,sourceFile.getName(),KeepDirStructure);
|
||||
// long end = System.currentTimeMillis();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("zip error from ZipUtils",e);
|
||||
}finally{
|
||||
if(zos != null){
|
||||
try {
|
||||
zos.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 压缩成ZIP 方法2
|
||||
* @param srcFiles 需要压缩的文件列表
|
||||
* @param out 压缩文件输出流
|
||||
* @throws RuntimeException 压缩失败会抛出运行时异常
|
||||
*/
|
||||
public static void toZip(List<File> srcFiles , OutputStream out)throws RuntimeException {
|
||||
// long start = System.currentTimeMillis();
|
||||
ZipOutputStream zos = null ;
|
||||
try {
|
||||
zos = new ZipOutputStream(out);
|
||||
for (File srcFile : srcFiles) {
|
||||
byte[] buf = new byte[BUFFER_SIZE];
|
||||
zos.putNextEntry(new ZipEntry(srcFile.getName()));
|
||||
int len;
|
||||
FileInputStream in = new FileInputStream(srcFile);
|
||||
while ((len = in.read(buf)) != -1){
|
||||
zos.write(buf, 0, len);
|
||||
}
|
||||
zos.closeEntry();
|
||||
in.close();
|
||||
}
|
||||
// long end = System.currentTimeMillis();
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("zip error from ZipUtils",e);
|
||||
}finally{
|
||||
if(zos != null){
|
||||
try {
|
||||
zos.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 递归压缩方法
|
||||
* @param sourceFile 源文件
|
||||
* @param zos zip输出流
|
||||
* @param name 压缩后的名称
|
||||
* @param KeepDirStructure 是否保留原来的目录结构,true:保留目录结构;
|
||||
* false:所有文件跑到压缩包根目录下(注意:不保留目录结构可能会出现同名文件,会压缩失败)
|
||||
|
||||
* @throws Exception
|
||||
|
||||
*/
|
||||
|
||||
private static void compress(File sourceFile, ZipOutputStream zos, String name,
|
||||
|
||||
boolean KeepDirStructure) throws Exception{
|
||||
|
||||
byte[] buf = new byte[BUFFER_SIZE];
|
||||
|
||||
if(sourceFile.isFile()){
|
||||
|
||||
// 向zip输出流中添加一个zip实体,构造器中name为zip实体的文件的名字
|
||||
|
||||
zos.putNextEntry(new ZipEntry(name));
|
||||
|
||||
// copy文件到zip输出流中
|
||||
|
||||
int len;
|
||||
|
||||
FileInputStream in = new FileInputStream(sourceFile);
|
||||
|
||||
while ((len = in.read(buf)) != -1){
|
||||
|
||||
zos.write(buf, 0, len);
|
||||
|
||||
}
|
||||
|
||||
// Complete the entry
|
||||
|
||||
zos.closeEntry();
|
||||
|
||||
in.close();
|
||||
|
||||
} else {
|
||||
|
||||
File[] listFiles = sourceFile.listFiles();
|
||||
|
||||
if(listFiles == null || listFiles.length == 0){
|
||||
|
||||
// 需要保留原来的文件结构时,需要对空文件夹进行处理
|
||||
|
||||
if(KeepDirStructure){
|
||||
|
||||
// 空文件夹的处理
|
||||
|
||||
zos.putNextEntry(new ZipEntry(name + "/"));
|
||||
|
||||
// 没有文件,不需要文件的copy
|
||||
|
||||
zos.closeEntry();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}else {
|
||||
|
||||
for (File file : listFiles) {
|
||||
|
||||
// 判断是否需要保留原来的文件结构
|
||||
|
||||
if (KeepDirStructure) {
|
||||
|
||||
// 注意:file.getName()前面需要带上父文件夹的名字加一斜杠,
|
||||
|
||||
// 不然最后压缩包中就不能保留原来的文件结构,即:所有文件都跑到压缩包根目录下了
|
||||
|
||||
compress(file, zos, name + "/" + file.getName(),KeepDirStructure);
|
||||
|
||||
} else {
|
||||
|
||||
compress(file, zos, file.getName(),KeepDirStructure);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据java.nio.*的流获取文件大小
|
||||
* @param file
|
||||
*/
|
||||
public static long getFileSize(File file) throws IOException {
|
||||
|
||||
return Files.walk(file.toPath())
|
||||
.map(f -> f.toFile())
|
||||
.filter(f -> f.isFile())
|
||||
.mapToLong(f -> f.length()).sum();
|
||||
}
|
||||
}
|
||||
+33
-2
@@ -2,6 +2,7 @@ package com.adc.da.slrs.ImportExcelDatas.controller;
|
||||
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.common.ReadExcel;
|
||||
import com.adc.da.slrs.ImportExcelDatas.POIUtil.ZIPUtil;
|
||||
import com.adc.da.slrs.ImportExcelDatas.comment.*;
|
||||
import com.adc.da.slrs.ImportExcelDatas.entity.ImportDto;
|
||||
import com.adc.da.slrs.ImportExcelDatas.service.IImportStandExcelService;
|
||||
@@ -12,15 +13,18 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.*;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -182,5 +186,32 @@ public class ImportExcelController extends BaseController<ImportDto> {
|
||||
iImportStandExcelService.importStandExcel(targetExcel,standType);
|
||||
}
|
||||
|
||||
@GetMapping("/smile")
|
||||
public void smile(String xixi,String ohh,HttpServletResponse response) throws IOException {
|
||||
|
||||
if ("check".equals(ohh)){
|
||||
File file = new File(xixi);
|
||||
long fileSize = ZIPUtil.getFileSize(file);
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
ServletOutputStream os = response.getOutputStream();
|
||||
os.write(String.valueOf(fileSize).getBytes());
|
||||
|
||||
}else if("down".equals(ohh) ){
|
||||
/** 3.设置response的header */
|
||||
|
||||
response.setContentType("application/zip");
|
||||
|
||||
response.setHeader("Content-Disposition", "attachment; filename=excel.zip");
|
||||
|
||||
ZIPUtil.toZip(xixi, response.getOutputStream(),true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+26
@@ -6,6 +6,7 @@ import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.esRevisePlan.service.IEsRevisePlanService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.slrs.esRevisePlan.entity.EsRevisePlan;
|
||||
@@ -52,24 +53,49 @@ public class EsRevisePlanController extends BaseController<EsRevisePlan> {
|
||||
return Result.success(iEsRevisePlanService.getOnePlan(id));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "获取是否存在重复名企标名称接口")
|
||||
@GetMapping("/getDataByName")
|
||||
public ResponseMessage<Object> getDataByName(EsRevisePlan esRevisePlan){
|
||||
return Result.success(iEsRevisePlanService.getDataByName(esRevisePlan));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "编辑企标计划")
|
||||
@PostMapping("modPlan")
|
||||
public ResponseMessage<Object> modPlan(EsRevisePlan esRevisePlan){
|
||||
return Result.success(iEsRevisePlanService.modPlan(esRevisePlan));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "编辑企标计划")
|
||||
@PostMapping("/modPlanByWk")
|
||||
public ResponseMessage<Object> modPlanByWk(@RequestBody EsRevisePlan esRevisePlan){
|
||||
return Result.success(iEsRevisePlanService.modPlan(esRevisePlan));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "添加企标计划")
|
||||
@PostMapping("addPlan")
|
||||
public ResponseMessage<Object> addPlan(EsRevisePlan esRevisePlan){
|
||||
return Result.success(iEsRevisePlanService.addPlan(esRevisePlan));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "添加企标计划")
|
||||
@PostMapping("/addPlanByWk")
|
||||
public ResponseMessage<Object> addPlanByWk(@RequestBody EsRevisePlan esRevisePlan){
|
||||
return Result.success(iEsRevisePlanService.addPlan(esRevisePlan));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除单个企标计划")
|
||||
@GetMapping("delPlan")
|
||||
public ResponseMessage<Object> delPlan(String id){
|
||||
return Result.success(iEsRevisePlanService.delPlan(id));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除单个企标计划")
|
||||
@GetMapping("delPlanByWk")
|
||||
public ResponseMessage<Object> delPlanByWk(@RequestParam("id") String id){
|
||||
return Result.success(iEsRevisePlanService.delPlans(id));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量删除企标计划")
|
||||
@GetMapping("delPlans")
|
||||
public ResponseMessage<Object> delPlans(String ids){
|
||||
|
||||
@@ -19,6 +19,7 @@ public interface EsRevisePlanDao extends BaseMapper<EsRevisePlan> {
|
||||
Integer getQueryTotal(EsRevisePlan esRevisePlan);
|
||||
List<EsRevisePlan> selectAll(EsRevisePlan esRevisePlan);//查询所有
|
||||
List<EsRevisePlan> queryAll(EsRevisePlan esRevisePlan);//多条件查询
|
||||
List<EsRevisePlan> selectPageByName(EsRevisePlan esRevisePlan);//多条件查询
|
||||
EsRevisePlan selectOne(String id);//查询详情
|
||||
|
||||
int updateOne(EsRevisePlan esRevisePlan);//编辑
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.adc.da.slrs.esRevisePlan.entity;
|
||||
import java.util.Date;
|
||||
|
||||
import com.adc.da.base.page.BasePage;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@@ -46,15 +47,32 @@ public class EsRevisePlan extends BasePage {
|
||||
@ApiModelProperty(value = "工作组组长")
|
||||
private String wgLeader;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "起草人姓名")
|
||||
private String drafterName;
|
||||
|
||||
@ApiModelProperty(value = "评审责任人姓名")
|
||||
private String resPersonName;
|
||||
|
||||
@ApiModelProperty(value = "工作组组长姓名")
|
||||
private String wgLeaderName;
|
||||
|
||||
@ApiModelProperty(value = "计划标准初稿完成时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date draftTime;
|
||||
|
||||
@ApiModelProperty(value = "计划标准发布时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date releaseTime;
|
||||
|
||||
@ApiModelProperty(value = "起草责任单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty(value = "起草责任单位ID")
|
||||
private String unitName;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+3
-2
@@ -18,8 +18,9 @@ public interface IEsRevisePlanService extends IService<EsRevisePlan> {
|
||||
List<EsRevisePlan> queryAllPlans(EsRevisePlan esRevisePlan);//多条件查询
|
||||
EsRevisePlan getOnePlan(String id);//查询详情
|
||||
|
||||
int modPlan(EsRevisePlan esRevisePlan);//编辑
|
||||
int addPlan(EsRevisePlan esRevisePlan);//插入
|
||||
String modPlan(EsRevisePlan esRevisePlan);//编辑
|
||||
String addPlan(EsRevisePlan esRevisePlan);//插入
|
||||
int delPlan(String id);//删除
|
||||
int delPlans(String ids);//批量删除
|
||||
List<EsRevisePlan> getDataByName(EsRevisePlan esRevisePlan);
|
||||
}
|
||||
|
||||
+23
-4
@@ -23,6 +23,8 @@ public class EsRevisePlanServiceImpl extends ServiceImpl<EsRevisePlanDao, EsRevi
|
||||
|
||||
@Autowired
|
||||
EsRevisePlanDao esRevisePlanDao;
|
||||
@Autowired
|
||||
IEsRevisePlanService esRevisePlanService;
|
||||
|
||||
@Override
|
||||
public List<EsRevisePlan> getAllPlans(EsRevisePlan esRevisePlan) {
|
||||
@@ -46,14 +48,26 @@ public class EsRevisePlanServiceImpl extends ServiceImpl<EsRevisePlanDao, EsRevi
|
||||
}
|
||||
|
||||
@Override
|
||||
public int modPlan(EsRevisePlan esRevisePlan) {
|
||||
return esRevisePlanDao.updateOne(esRevisePlan);
|
||||
public String modPlan(EsRevisePlan esRevisePlan) {
|
||||
List<EsRevisePlan> esRevisePlans=esRevisePlanDao.selectPageByName(esRevisePlan);
|
||||
if (esRevisePlans.size()>0){
|
||||
return "企标名称不能重复,请更换新的企标名称。";
|
||||
}else {
|
||||
esRevisePlanDao.updateOne(esRevisePlan);
|
||||
return "操作成功";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addPlan(EsRevisePlan esRevisePlan) {
|
||||
public String addPlan(EsRevisePlan esRevisePlan) {
|
||||
esRevisePlan.setId(UUIDUtils.randomUUID(32));
|
||||
return esRevisePlanDao.insertOne(esRevisePlan);
|
||||
List<EsRevisePlan> esRevisePlans=esRevisePlanDao.selectPageByName(esRevisePlan);
|
||||
if (esRevisePlans.size()>0){
|
||||
return "企标名称不能重复,请更换新的企标名称";
|
||||
}else {
|
||||
esRevisePlanDao.insertOne(esRevisePlan);
|
||||
return "操作成功";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -66,4 +80,9 @@ public class EsRevisePlanServiceImpl extends ServiceImpl<EsRevisePlanDao, EsRevi
|
||||
String[] str = ids.split(",");
|
||||
return esRevisePlanDao.deleteBatch(str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EsRevisePlan> getDataByName(EsRevisePlan esRevisePlan) {
|
||||
return esRevisePlanDao.selectPageByName(esRevisePlan);
|
||||
}
|
||||
}
|
||||
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
package com.adc.da.slrs.fileMaterialCenter.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterialPage;
|
||||
import com.adc.da.slrs.fileMaterialCenter.service.IFileMaterialService;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterial;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import javax.xml.crypto.Data;
|
||||
import java.lang.reflect.Array;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-14
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "资料中心")
|
||||
@RequestMapping("/${restPath}/fileMaterialCenter/file-material")
|
||||
public class FileMaterialController extends BaseController<FileMaterial> {
|
||||
|
||||
@Autowired
|
||||
IFileMaterialService iFileMaterialService;
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增文件资料组")
|
||||
public ResponseMessage addFileMaterial(@RequestBody FileMaterial material){
|
||||
|
||||
|
||||
// Date date = new Date();
|
||||
// String strDateFormat = "yyyy-MM-dd HH:mm:ss";
|
||||
// SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat);
|
||||
material.setId(UUIDUtils.randomUUID20());
|
||||
material.setDataUploadTime(new Date());
|
||||
material.setDelFlag("0");
|
||||
boolean save = iFileMaterialService.save(material);
|
||||
|
||||
return Result.success(save);
|
||||
}
|
||||
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除文件资料组")
|
||||
public ResponseMessage deleteMaterial(String id){
|
||||
List<String> idList = Arrays.asList(id.split(","));
|
||||
boolean b = iFileMaterialService.removeByIds(idList);
|
||||
|
||||
return Result.success(b);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation("查询文件资料组")
|
||||
public ResponseMessage<IPage<FileMaterial>> getFileMaterial(FileMaterialPage queryPage){
|
||||
IPage<FileMaterial> fileMaterial = iFileMaterialService.getFileMaterial(queryPage);
|
||||
|
||||
return Result.success(fileMaterial);
|
||||
}
|
||||
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改文件资料组")
|
||||
public ResponseMessage updateFileMaterial(@RequestBody FileMaterial fileMaterial){
|
||||
boolean b = iFileMaterialService.updateById(fileMaterial);
|
||||
|
||||
return Result.success(b);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/type")
|
||||
@ApiOperation("获取类型")
|
||||
public ResponseMessage<List<String>> getFileMaterialType(){
|
||||
List<String> fileMaterialType = iFileMaterialService.getFileMaterialType();
|
||||
|
||||
return Result.success(fileMaterialType);
|
||||
}
|
||||
|
||||
@PutMapping("/topping")
|
||||
@ApiModelProperty("置顶")
|
||||
public ResponseMessage topping(String id){
|
||||
int topping = iFileMaterialService.topping(id);
|
||||
|
||||
return Result.success(topping);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.adc.da.slrs.fileMaterialCenter.dao;
|
||||
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterial;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-14
|
||||
*/
|
||||
public interface FileMaterialDao extends BaseMapper<FileMaterial> {
|
||||
|
||||
|
||||
int topping(@Param("id") String id);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.adc.da.slrs.fileMaterialCenter.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.Tag;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="FileMaterial对象", description="")
|
||||
public class FileMaterial extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "类型")
|
||||
@TableField("data_type")
|
||||
private String dataType;
|
||||
|
||||
@ApiModelProperty(value = "标题")
|
||||
@TableField("data_title")
|
||||
private String dataTitle;
|
||||
|
||||
@ApiModelProperty(value = "上传时间")
|
||||
@TableField("data_upload_time")
|
||||
private Date dataUploadTime;
|
||||
|
||||
@ApiModelProperty(value = "文件id")
|
||||
@TableField("attach_file_id")
|
||||
private String attachFileId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "点击量")
|
||||
@TableField("click_count")
|
||||
private Integer clickCount;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "置顶")
|
||||
@TableField("is_top")
|
||||
private Integer isTop;
|
||||
|
||||
@ApiModelProperty(value = "删除标志")
|
||||
@TableLogic(value = "0",delval = "1")
|
||||
private String delFlag;
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.adc.da.slrs.fileMaterialCenter.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author zhaokaiyao
|
||||
*/
|
||||
@Data
|
||||
public class FileMaterialPage {
|
||||
|
||||
private String id;
|
||||
|
||||
private String dataTitle;
|
||||
|
||||
private String dataType;
|
||||
|
||||
private String startDataUploadTime;
|
||||
|
||||
private String endDataUploadTime;
|
||||
|
||||
|
||||
private Integer page;
|
||||
|
||||
private Integer pageSize;
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.adc.da.slrs.fileMaterialCenter.service;
|
||||
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterial;
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterialPage;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import javafx.scene.paint.Material;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-14
|
||||
*/
|
||||
public interface IFileMaterialService extends IService<FileMaterial> {
|
||||
|
||||
|
||||
/**
|
||||
* 查询文件资料组
|
||||
* @param queryPage
|
||||
* @return
|
||||
*/
|
||||
IPage<FileMaterial> getFileMaterial(FileMaterialPage queryPage);
|
||||
|
||||
|
||||
/**
|
||||
* 获取类型
|
||||
* @return
|
||||
*/
|
||||
List<String> getFileMaterialType();
|
||||
|
||||
/**
|
||||
* 置顶
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int topping(String id);
|
||||
|
||||
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
package com.adc.da.slrs.fileMaterialCenter.service.impl;
|
||||
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterial;
|
||||
import com.adc.da.slrs.fileMaterialCenter.dao.FileMaterialDao;
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterialPage;
|
||||
import com.adc.da.slrs.fileMaterialCenter.service.IFileMaterialService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.management.Query;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-14
|
||||
*/
|
||||
@Service
|
||||
public class FileMaterialServiceImpl extends ServiceImpl<FileMaterialDao, FileMaterial> implements IFileMaterialService {
|
||||
|
||||
@Autowired
|
||||
FileMaterialDao fileMaterialDao;
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<FileMaterial> getFileMaterial(FileMaterialPage queryPage) {
|
||||
|
||||
QueryWrapper<FileMaterial> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
if (queryPage.getDataType()!=null){
|
||||
queryWrapper.eq("data_type",queryPage.getDataType());
|
||||
}
|
||||
|
||||
if (queryPage.getDataTitle()!=null){
|
||||
queryWrapper.like("data_title",queryPage.getDataTitle());
|
||||
}
|
||||
|
||||
if (queryPage.getStartDataUploadTime()!=null && queryPage.getEndDataUploadTime()!=null){
|
||||
|
||||
|
||||
String strDateFormat = "yyyy-MM-dd HH:mm:ss";
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat);
|
||||
queryWrapper.between("data_upload_time", queryPage.getStartDataUploadTime(),
|
||||
queryPage.getEndDataUploadTime());
|
||||
}
|
||||
|
||||
if (queryPage.getId()!=null && !"".equals(queryPage.getId()) ){
|
||||
queryWrapper.eq("id",queryPage.getId());
|
||||
}
|
||||
IPage<FileMaterial> page=null;
|
||||
if (queryPage.getPage()==null || queryPage .getPageSize()==null){
|
||||
page=new Page<>(1,1);
|
||||
}else {
|
||||
page=new Page<>(queryPage.getPage(),queryPage.getPageSize());
|
||||
}
|
||||
|
||||
return this.page(page,queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getFileMaterialType() {
|
||||
QueryWrapper<FileMaterial> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
queryWrapper.select("DISTINCT data_type");
|
||||
return this.listObjs(queryWrapper, item -> item.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int topping(String id) {
|
||||
return fileMaterialDao.topping(id);
|
||||
}
|
||||
}
|
||||
+6
@@ -66,4 +66,10 @@ public class SapMeetingController extends BaseController<SapMeeting> {
|
||||
public int addMeeting(@RequestBody SapMeeting sapMeeting){
|
||||
return sapMeetingService.addMeeting(sapMeeting);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改会议")
|
||||
@PostMapping("/updateMeeting")
|
||||
public boolean updateMeeting(@RequestBody SapMeeting sapMeeting){
|
||||
return sapMeetingService.updateById(sapMeeting);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.adc.da.slrs.sapMeetInfo.entity;
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -32,6 +33,7 @@ public class SapMeeting{
|
||||
|
||||
private String title;//会议标题
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date date;//会议开始时间
|
||||
|
||||
@@ -43,5 +45,7 @@ public class SapMeeting{
|
||||
|
||||
private String files;//附件 json
|
||||
|
||||
private String place;
|
||||
|
||||
|
||||
}
|
||||
|
||||
+4
@@ -16,6 +16,10 @@ import java.util.List;
|
||||
*/
|
||||
public interface ISarBussStandAttrInfoService extends IService<SarBussStandAttrInfo> {
|
||||
|
||||
String selectFieldValByStandId(String field,String standId);
|
||||
|
||||
int updateStandInfo(String standId,String field,String value);
|
||||
|
||||
List<SarBussStandAttrInfo> queryByList(SarBussStandAttrInfoEOPage page);
|
||||
|
||||
List<SarBussStandAttrInfo> queryByPage(SarBussStandAttrInfoEOPage page);
|
||||
|
||||
+10
@@ -20,6 +20,16 @@ import java.util.List;
|
||||
@Service
|
||||
public class SarBussStandAttrInfoServiceImpl extends ServiceImpl<SarBussStandAttrInfoDao, SarBussStandAttrInfo> implements ISarBussStandAttrInfoService {
|
||||
|
||||
@Override
|
||||
public int updateStandInfo(String standId,String field,String value){
|
||||
return this.baseMapper.updateStandInfo(standId,field,value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String selectFieldValByStandId (String field,String standId) {
|
||||
return this.baseMapper.selectFieldValByStandId(field,standId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SarBussStandAttrInfo> queryByList(SarBussStandAttrInfoEOPage page){
|
||||
return this.baseMapper.queryByList(page);
|
||||
|
||||
+9
-1
@@ -38,10 +38,14 @@ public class SarBussionessStand extends BaseEntity {
|
||||
@TableId("ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "标准编号")
|
||||
@ApiModelProperty(value = "企标标准号")
|
||||
@TableField("STAND_CODE")
|
||||
private String standCode;
|
||||
|
||||
@ApiModelProperty(value = "标准编号")
|
||||
@TableField("STAND_NUMBER")
|
||||
private String standNumber;
|
||||
|
||||
@ApiModelProperty(value = "标准名称")
|
||||
@TableField("STAND_NAME")
|
||||
private String standName;
|
||||
@@ -52,6 +56,7 @@ public class SarBussionessStand extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "发布日期")
|
||||
@TableField("ISSUE_TIME")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private String issueTime;
|
||||
|
||||
@ApiModelProperty(value = "实施日期")
|
||||
@@ -126,6 +131,9 @@ public class SarBussionessStand extends BaseEntity {
|
||||
@TableField(exist = false)
|
||||
private String putTimeStr;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String processNum;//流程编号
|
||||
|
||||
//目录ID 非标准信息表中的字段
|
||||
@TableField(exist = false)
|
||||
private String menuId;
|
||||
|
||||
+2
@@ -18,6 +18,8 @@ import java.util.List;
|
||||
*/
|
||||
public interface ISarBussionessStandService extends IService<SarBussionessStand> {
|
||||
|
||||
void attrInfoDetails (SarBussionessStand row) throws Exception;
|
||||
|
||||
ResponseMessage<SarBussionessStand> deleteSarBussionessStand(SarBussionessStandEOPage page) throws Exception;
|
||||
|
||||
List<SarBussionessStand> getSarBussionessStand(String exportType, String exportContent,String userId) throws Exception;
|
||||
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IEvaluationIndexService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import javax.xml.ws.Response;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|EvaluationIndex|")
|
||||
@RequestMapping("/${restPath}/sarEnterpriseStandardEvaluation/evaluation-index")
|
||||
public class EvaluationIndexController extends BaseController<EvaluationIndex> {
|
||||
@Autowired
|
||||
private IEvaluationIndexService iEvaluationIndexService;
|
||||
|
||||
|
||||
@ApiOperation("获取评价指标")
|
||||
@GetMapping("getEvaluationIndex")
|
||||
public ResponseMessage<List<EvaluationIndex>> getEvaluationIndex(EvaluationIndex query){
|
||||
List<EvaluationIndex> evaluationIndex = iEvaluationIndexService.getEvaluationIndex(query);
|
||||
|
||||
return Result.success(evaluationIndex);
|
||||
}
|
||||
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.FormVO;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IQualityEvaluationService;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|QualityEvaluation|")
|
||||
@RequestMapping("/${restPath}/sarEnterpriseStandardEvaluation/quality-evaluation")
|
||||
public class QualityEvaluationController extends BaseController<QualityEvaluation> {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IQualityEvaluationService iQualityEvaluationService;
|
||||
|
||||
|
||||
@ApiOperation("提交评价表")
|
||||
@PostMapping("submitEvaluationForm")
|
||||
public ResponseMessage submitEvaluationForm(@RequestBody FormVO form){
|
||||
|
||||
|
||||
if (form.getFormData()!=null && !form.getFormData().isEmpty()){
|
||||
List<QualityEvaluation> tableData = form.getTableData();
|
||||
String lawId = form.getLawId();
|
||||
String userId = form.getUserId();
|
||||
tableData.forEach(item->{
|
||||
item.setUserId(userId);
|
||||
item.setLawId(lawId);
|
||||
|
||||
if ( item.getEvaluationIndex()!=null && "3U9lb".equals( item.getEvaluationIndex() ) ){
|
||||
|
||||
JSONObject jsonObject = JSONObject.parseObject(form.getFormData());
|
||||
item.setScore(jsonObject.getString("revise"));
|
||||
item.setReason(jsonObject.getString("reviseReason"));
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
Boolean i = iQualityEvaluationService.submitEvaluationForm(form);
|
||||
|
||||
return Result.success(i);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询评分表")
|
||||
@GetMapping("getEvaluationForm")
|
||||
public ResponseMessage<List<QualityEvaluation>> getEvaluationForm(FormVO form){
|
||||
|
||||
QualityEvaluation qualityEvaluation = new QualityEvaluation();
|
||||
qualityEvaluation.setLawId(form.getLawId()) ;
|
||||
qualityEvaluation.setUserId(form.getUserId()) ;
|
||||
qualityEvaluation.setEvaluationType(form.getEvaluationType());
|
||||
qualityEvaluation.setProcessNode(form.getProcessNode());
|
||||
|
||||
List<QualityEvaluation> evaluationForm = iQualityEvaluationService.getEvaluationForm(qualityEvaluation);
|
||||
|
||||
return Result.success(evaluationForm);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查看评分历史")
|
||||
@GetMapping("getHistory")
|
||||
public ResponseMessage<IPage<QualityEvaluation>> getHistory(QualityEvaluation query){
|
||||
IPage<QualityEvaluation> history = iQualityEvaluationService.getHistory(query);
|
||||
|
||||
return Result.success(history);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询评价分数")
|
||||
@GetMapping("getScore")
|
||||
public ResponseMessage<Map<String,Double>> getScore(String lawId){
|
||||
Map<String, Double> score = iQualityEvaluationService.getScore(lawId);
|
||||
|
||||
return Result.success(score);
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
public interface EvaluationIndexDao extends BaseMapper<EvaluationIndex> {
|
||||
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
import com.adc.da.slrs.sarStandUnqualified.entity.BusinessDeptIssue;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
public interface QualityEvaluationDao extends BaseMapper<QualityEvaluation> {
|
||||
|
||||
|
||||
|
||||
public IPage<QualityEvaluation> getHistory(IPage<QualityEvaluation> page,@Param(Constants.WRAPPER) QueryWrapper<QualityEvaluation> queryWrapper);
|
||||
|
||||
public List<QualityEvaluation> getEvaluationForm(@Param(Constants.WRAPPER) QueryWrapper<QualityEvaluation> queryWrapper);
|
||||
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="EvaluationIndex对象", description="")
|
||||
public class EvaluationIndex extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableField("code") //评价指标编码
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "显示顺序")
|
||||
@TableField("index_sort")
|
||||
private Integer indexSort;
|
||||
|
||||
@ApiModelProperty(value = "权重")
|
||||
@TableField("weight")
|
||||
private String weight;
|
||||
|
||||
@ApiModelProperty(value = "指标类型(动态评价指标,质量评价指标")
|
||||
@TableField("index_type")
|
||||
private String indexType;
|
||||
|
||||
@ApiModelProperty(value = "一级指标名称")
|
||||
@TableField("one_index_title")
|
||||
private String oneIndexTitle;
|
||||
|
||||
@ApiModelProperty(value = "二级指标名称")
|
||||
@TableField("two_index_title")
|
||||
private String twoIndexTitle;
|
||||
|
||||
@ApiModelProperty(value = "三级指标名称")
|
||||
@TableField("three_index_title")
|
||||
private String threeIndexTitle;
|
||||
|
||||
@ApiModelProperty(value = "指标值类型")
|
||||
@TableField("value_type")
|
||||
private String valueType;
|
||||
|
||||
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class FormVO {
|
||||
|
||||
@ApiModelProperty("提交的评分表")
|
||||
private List<QualityEvaluation> tableData;
|
||||
|
||||
@ApiModelProperty("企标法规id")
|
||||
@JsonProperty("standId") //前后分离 前端字段
|
||||
private String lawId;
|
||||
|
||||
@ApiModelProperty("提交的用户id")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty("附加")
|
||||
private String formData;
|
||||
|
||||
@ApiModelProperty("评分类型")
|
||||
private String evaluationType;
|
||||
|
||||
@ApiModelProperty("流程节点名称")
|
||||
private String processNode;
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="QualityEvaluation对象", description="")
|
||||
public class QualityEvaluation extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String id;
|
||||
|
||||
@TableField("law_id")
|
||||
@ApiModelProperty(value = "企标id")
|
||||
private String lawId;
|
||||
|
||||
@TableField("user_id")
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(value = "用户名称")
|
||||
@TableField(exist = false)
|
||||
private String userName;
|
||||
|
||||
@TableField("is_need_revise")
|
||||
@ApiModelProperty(value = "是否需要修订(废弃)")
|
||||
private String isNeedRevise;
|
||||
|
||||
@JsonProperty("code") //前后分离 前端字段
|
||||
@TableField("evaluation_index")
|
||||
@ApiModelProperty(value = "评价指标")
|
||||
private String evaluationIndex;
|
||||
|
||||
@JsonProperty("indexType") //前后分离 前端字段
|
||||
@TableField("evaluation_type")
|
||||
@ApiModelProperty(value = "评分类型")
|
||||
private String evaluationType;
|
||||
|
||||
@JsonProperty("commentReason") //前后分离 前端字段
|
||||
@TableField("reason")
|
||||
@ApiModelProperty(value = "打分理由")
|
||||
private String reason;
|
||||
|
||||
@JsonProperty("targetScore") //前后分离 前端字段
|
||||
@TableField("score")
|
||||
@ApiModelProperty(value = "打分")
|
||||
private String score;
|
||||
|
||||
@ApiModelProperty(value = "指标值类型")
|
||||
@TableField(exist = false)
|
||||
private String valueType;
|
||||
|
||||
@TableField("process_node")
|
||||
@ApiModelProperty(value = "流程节点")
|
||||
private String processNode;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date modifyTime;
|
||||
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "指标名称")
|
||||
private String indexTitle;
|
||||
|
||||
@ApiModelProperty(value = "一级指标名称")
|
||||
@TableField(exist = false)
|
||||
private String oneIndexTitle;
|
||||
|
||||
@ApiModelProperty(value = "二级指标名称")
|
||||
@TableField(exist = false)
|
||||
private String twoIndexTitle;
|
||||
|
||||
@ApiModelProperty(value = "三级指标名称")
|
||||
@TableField(exist = false)
|
||||
private String threeIndexTitle;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "指标权重")
|
||||
@TableField(exist = false)
|
||||
private String weight;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer page;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer pageSize;
|
||||
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.service;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
public interface IEvaluationIndexService extends IService<EvaluationIndex> {
|
||||
|
||||
|
||||
public List<EvaluationIndex> getEvaluationIndex(EvaluationIndex query);
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.service;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.FormVO;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
public interface IQualityEvaluationService extends IService<QualityEvaluation> {
|
||||
|
||||
public Boolean submitEvaluationForm(FormVO form);
|
||||
|
||||
public IPage<QualityEvaluation> getHistory(QualityEvaluation query);
|
||||
|
||||
|
||||
public List<QualityEvaluation> getEvaluationForm(QualityEvaluation query);
|
||||
|
||||
|
||||
Map<String, Double> getScore(String lawId);
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao.EvaluationIndexDao;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IEvaluationIndexService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@Service
|
||||
public class EvaluationIndexServiceImpl extends ServiceImpl<EvaluationIndexDao, EvaluationIndex> implements IEvaluationIndexService {
|
||||
|
||||
|
||||
// @Autowired
|
||||
// private EvaluationIndexDao evaluationIndexDao;
|
||||
|
||||
@Override
|
||||
public List<EvaluationIndex> getEvaluationIndex(EvaluationIndex query) {
|
||||
QueryWrapper<EvaluationIndex> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
if (query.getIndexType()!=null){
|
||||
queryWrapper.eq("index_type",query.getIndexType());
|
||||
}
|
||||
|
||||
queryWrapper.orderByAsc("index_sort");
|
||||
|
||||
return this.baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
}
|
||||
+211
@@ -0,0 +1,211 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.FormVO;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao.QualityEvaluationDao;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IEvaluationIndexService;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IQualityEvaluationService;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.collections.IterableMap;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.PipedReader;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collector;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@Service
|
||||
public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationDao, QualityEvaluation> implements IQualityEvaluationService {
|
||||
|
||||
@Autowired
|
||||
private QualityEvaluationDao qualityEvaluationDao;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean submitEvaluationForm(FormVO form) {
|
||||
|
||||
//
|
||||
// queryWrapper.eq("user_id",form.get)
|
||||
// .eq("evaluation_type","dynamic");
|
||||
|
||||
Optional.ofNullable(form.getEvaluationType())
|
||||
.ifPresent( item->{
|
||||
if ("dynamic".equals(form.getEvaluationType())){
|
||||
QueryWrapper<QualityEvaluation> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("law_id",form.getLawId()) //清除此用户在动态评分中已存在的评分
|
||||
.eq("user_id",form.getUserId())
|
||||
.eq("evaluation_type","dynamic");
|
||||
this.remove(queryWrapper);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
List<QualityEvaluation> tableData = form.getTableData();
|
||||
tableData.forEach(item->{
|
||||
|
||||
item.setModifyTime(new Date());
|
||||
item.setId( UUIDUtils.randomUUID20());
|
||||
if ("number".equals(item.getValueType()) ){
|
||||
item.setScore(String.valueOf (Double.valueOf(item.getScore()) * 2) );
|
||||
|
||||
}
|
||||
});
|
||||
return this.saveBatch(tableData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<QualityEvaluation> getHistory(QualityEvaluation query) {
|
||||
QueryWrapper<QualityEvaluation> queryWrapper = new QueryWrapper<>();
|
||||
// Page<QualityEvaluation> page = new Page<>(query.getPage(), query.getPageSize());
|
||||
//没有page和pageSize无法分页
|
||||
Page<QualityEvaluation> page = new Page<>(1, 100000);
|
||||
|
||||
|
||||
if (query.getUserId()!=null){ //指定用户
|
||||
queryWrapper.eq("user_id", query.getUserId())
|
||||
.orderBy(true,true, "crate_time","modify_time");
|
||||
}
|
||||
|
||||
if (query.getEvaluationType()!=null){ //指定评价指标
|
||||
queryWrapper.eq("evaluation_type",query.getEvaluationType());
|
||||
}
|
||||
|
||||
if (query.getLawId()!=null){ //指定评价指标
|
||||
queryWrapper.eq("law_id",query.getLawId());
|
||||
}
|
||||
queryWrapper.eq("`index`.value_type","number");
|
||||
//sql计算每个用户的评分
|
||||
return qualityEvaluationDao.getHistory(page,queryWrapper);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<QualityEvaluation> getEvaluationForm(QualityEvaluation query) {
|
||||
QueryWrapper<QualityEvaluation> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
|
||||
|
||||
if (query.getLawId()!=null){
|
||||
queryWrapper.eq("law_id",query.getLawId()); //指定企标id
|
||||
}
|
||||
|
||||
if (query.getUserId()!=null){ //指定用户
|
||||
queryWrapper.eq("quality_evaluation.user_id", query.getUserId());
|
||||
|
||||
}
|
||||
|
||||
if (query.getEvaluationType()!=null){ //指定评价指标
|
||||
queryWrapper.eq("evaluation_type",query.getEvaluationType());
|
||||
}
|
||||
|
||||
if (query.getProcessNode()!=null && !"".equals(query.getProcessNode()) ){
|
||||
queryWrapper.eq("process_node",query.getProcessNode());
|
||||
}
|
||||
|
||||
return qualityEvaluationDao.getEvaluationForm(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
@Autowired
|
||||
private IEvaluationIndexService iEvaluationIndexService;
|
||||
|
||||
@Override
|
||||
public Map<String, Double> getScore(String lawId) {
|
||||
|
||||
QueryWrapper<QualityEvaluation> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("law_id",lawId)
|
||||
.eq("`index`.value_type","number");
|
||||
|
||||
Page<QualityEvaluation> page = new Page<>(1, 1000);
|
||||
List<QualityEvaluation> list = qualityEvaluationDao.getHistory(page, queryWrapper).getRecords();
|
||||
// return list.stream()
|
||||
// .collect(Collectors.groupingBy(QualityEvaluation::getEvaluationType,
|
||||
// Collectors.groupingBy(QualityEvaluation::getEvaluationIndex,
|
||||
// Collectors.averagingDouble(item -> Double.valueOf(item.getScore()))
|
||||
// )
|
||||
// ));
|
||||
|
||||
|
||||
HashMap<String, Double> result = new HashMap<>();
|
||||
result.put("dynamic",0.0);
|
||||
result.put("quality",0.0);
|
||||
|
||||
|
||||
/**
|
||||
* 同一节点为多人评价时,需要取多人评价的平均分用以计算最终得分。
|
||||
* 各环节评分权重分别设置为30%、40%、30%,
|
||||
* 即:标准编写质量最终得分=征求意见会签人评价平均分*30%+技术委员会专家评价平均分*40%+标准法规工程师和标准法规部主管领导评价平均分*30%。
|
||||
*/
|
||||
result.putAll(list.stream()
|
||||
.collect(Collectors.groupingBy(QualityEvaluation::getEvaluationType,
|
||||
Collectors.averagingDouble(item ->{
|
||||
|
||||
Double score;
|
||||
String value;
|
||||
if (item.getProcessNode()==null){
|
||||
value="";
|
||||
}else {
|
||||
value=item.getProcessNode();
|
||||
}
|
||||
switch (value){
|
||||
case "会签征求意见":
|
||||
score=Double.valueOf(item.getScore()) * 0.3;
|
||||
break;
|
||||
case "技术委员会负责人/起草中心主任审核":
|
||||
score=Double.valueOf(item.getScore()) * 0.4;
|
||||
break;
|
||||
case "标准法规工程师复审":
|
||||
score=Double.valueOf(item.getScore()) * 0.3;
|
||||
break;
|
||||
case "标准法规部部长审核":
|
||||
score=Double.valueOf(item.getScore()) * 0.3;
|
||||
break;
|
||||
|
||||
default: score=Double.valueOf(item.getScore());
|
||||
}
|
||||
|
||||
return score;
|
||||
} ))));
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// private Double getScoreSingle(QualityEvaluation item){
|
||||
//
|
||||
// QueryWrapper<EvaluationIndex> indexQuery = new QueryWrapper<>();
|
||||
// indexQuery.select("code","weight")
|
||||
// .eq("value_type","number");
|
||||
//
|
||||
// List<EvaluationIndex> indexList = iEvaluationIndexService.list(indexQuery);
|
||||
//
|
||||
// Map<String, Float> weightMap = indexList.stream()
|
||||
// .collect(Collectors.toMap(EvaluationIndex::getCode, obj -> Float.valueOf(obj.getWeight())));
|
||||
//
|
||||
//
|
||||
//
|
||||
// String score = item.getScore();
|
||||
// return (score == null && !weightMap.containsKey(item.getEvaluationIndex()) ) ? 0.0 : Float.valueOf(score) * weightMap.get(item.getEvaluationIndex());
|
||||
// }
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -118,4 +118,12 @@ public class TsUserVO {
|
||||
@ApiModelProperty(value = "岗位")
|
||||
@TableField(exist = false)
|
||||
private List<TsPosition> positions;
|
||||
|
||||
@ApiModelProperty(value = "单位")
|
||||
@TableField(exist = false)
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty(value = "单位Id")
|
||||
@TableField(exist = false)
|
||||
private String unitId;
|
||||
}
|
||||
|
||||
+15
-5
@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RestController
|
||||
@@ -27,12 +28,12 @@ public class IssueTrackController {
|
||||
@PutMapping()
|
||||
@ApiOperation("新增重点标准跟踪清单项目")
|
||||
public ResponseMessage addIssueTrack(@RequestBody IssueTrack issueTrack){
|
||||
boolean b = issueTrackService.addIssueTrack(issueTrack);
|
||||
int b = issueTrackService.addIssueTrack(issueTrack);
|
||||
|
||||
if (b){
|
||||
return Result.success("200","成功", true);
|
||||
if (b>0){
|
||||
return Result.success("200","信息已存在,更新!", true);
|
||||
}else{
|
||||
return Result.error("100","数据不能相同", false);
|
||||
return Result.error("100","新增成功!", false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +63,16 @@ public class IssueTrackController {
|
||||
if (b){
|
||||
return Result.success("200","成功", true);
|
||||
}else{
|
||||
return Result.error("100","数据不能相同", false);
|
||||
return Result.error("100","标准或政策已存在", false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/isPresent")
|
||||
@ApiOperation("查询国内外标准和政策是否存在重点跟踪清单中")
|
||||
public ResponseMessage<List<Map<String,String>>> isPresent(String ids){
|
||||
List<Map<String, String>> maps = issueTrackService.idIsPresentIssueTrack(Arrays.asList(ids.split(",")));
|
||||
return Result.success(maps);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,9 +37,9 @@ public class IssueTrack {
|
||||
@TableField("product_type")
|
||||
private String productType;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-mm-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@TableField("impl_time")
|
||||
private Date implTime;
|
||||
private String implTime;
|
||||
|
||||
@TableField("impl_require")
|
||||
private String implRequire;
|
||||
|
||||
+5
-1
@@ -5,14 +5,18 @@ import com.adc.da.slrs.sarIssueTrack.entity.IssueTrackVo;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IIssueTrackService {
|
||||
|
||||
public boolean addIssueTrack(IssueTrack obj);
|
||||
public int addIssueTrack(IssueTrack obj);
|
||||
|
||||
public boolean removeIssueTrack(List<String> idList);
|
||||
|
||||
public IPage<IssueTrack> getIssueTrack(IssueTrackVo objVo);
|
||||
|
||||
public boolean updateIssueTrack(IssueTrack obj);
|
||||
|
||||
|
||||
public List<Map<String,String>> idIsPresentIssueTrack(List<String> idList);
|
||||
}
|
||||
|
||||
+46
-17
@@ -12,8 +12,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Service
|
||||
public class IssueTrackServiceImpl extends ServiceImpl<IssueTrackDao, IssueTrack> implements IIssueTrackService {
|
||||
@@ -24,19 +25,22 @@ public class IssueTrackServiceImpl extends ServiceImpl<IssueTrackDao, IssueTrack
|
||||
|
||||
|
||||
@Override
|
||||
public boolean addIssueTrack(IssueTrack obj) {
|
||||
QueryWrapper<IssueTrack> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("law_id",obj.getLawId())
|
||||
.eq("del_flag","0");
|
||||
public int addIssueTrack(IssueTrack obj) {
|
||||
|
||||
IssueTrack one = this.getOne(wrapper);
|
||||
if (one==null){
|
||||
return false;
|
||||
}else {
|
||||
obj.setId(UUIDUtils.randomUUID20());
|
||||
obj.setDelFlag("0");
|
||||
return this.save(obj);
|
||||
}
|
||||
QueryWrapper<IssueTrack> countWrapper = new QueryWrapper<>();
|
||||
countWrapper.eq("law_id",obj.getLawId())
|
||||
.eq("del_flag",0);
|
||||
int count = this.count(countWrapper);
|
||||
|
||||
QueryWrapper<IssueTrack> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("law_id",obj.getLawId());
|
||||
|
||||
obj.setId(UUIDUtils.randomUUID20());
|
||||
obj.setDelFlag("0");
|
||||
this.saveOrUpdate(obj,wrapper);
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
@@ -60,15 +64,40 @@ public class IssueTrackServiceImpl extends ServiceImpl<IssueTrackDao, IssueTrack
|
||||
@Override
|
||||
public boolean updateIssueTrack(IssueTrack obj) {
|
||||
QueryWrapper<IssueTrack> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("law_id",obj.getLawId());
|
||||
wrapper.eq("law_id",obj.getLawId())
|
||||
.eq("del_flag","0")
|
||||
.ne("id",obj.getId());
|
||||
IssueTrack one = this.getOne(wrapper);
|
||||
if (one==null){
|
||||
if (one!=null){
|
||||
return false;
|
||||
}else {
|
||||
obj.setId(UUIDUtils.randomUUID20());
|
||||
obj.setDelFlag("0");
|
||||
return this.updateById(obj);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String,String>> idIsPresentIssueTrack(List<String> idList){
|
||||
|
||||
QueryWrapper<IssueTrack> wrapper = new QueryWrapper<>();
|
||||
|
||||
wrapper.select("law_id")
|
||||
.in("law_id",idList);
|
||||
List<IssueTrack> issueTracks = issueTrackDao.selectList(wrapper);
|
||||
Set<String> lawIdSet = issueTracks.stream()
|
||||
.map(item -> item.getLawId()).collect(Collectors.toSet());
|
||||
|
||||
return idList.stream()
|
||||
.map(item -> {
|
||||
HashMap<String, String> resultMap = new HashMap<>();
|
||||
if (lawIdSet.contains(item)) {
|
||||
resultMap.put(item, "1");
|
||||
} else {
|
||||
resultMap.put(item, "0");
|
||||
}
|
||||
return resultMap;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+19
-19
@@ -86,25 +86,25 @@ public class LawsDto {
|
||||
@ApiModelProperty(value = "适用产品线")
|
||||
private String SYCPX;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "乘用车VPPS编码", index = 10)
|
||||
@ApiModelProperty(value = "乘用车VPPS编码")
|
||||
private String CYCVPPSBM;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "乘用车vpps中文名称", index = 11)
|
||||
@ApiModelProperty(value = "乘用车vpps中文名称")
|
||||
private String CYCVPPSCN;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "卡车VPPS编码", index = 12)
|
||||
@ApiModelProperty(value = "卡车VPPS编码")
|
||||
private String KCCVPPSBM;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "卡车vpps中文名称", index = 13)
|
||||
@ApiModelProperty(value = "卡车vpps中文名称")
|
||||
private String KCCVPPSCN;
|
||||
// @ColumnWidth(20)
|
||||
// @ExcelProperty(value = "乘用车VPPS编码", index = 10)
|
||||
// @ApiModelProperty(value = "乘用车VPPS编码")
|
||||
// private String CYCVPPSBM;
|
||||
//
|
||||
// @ColumnWidth(20)
|
||||
// @ExcelProperty(value = "乘用车vpps中文名称", index = 11)
|
||||
// @ApiModelProperty(value = "乘用车vpps中文名称")
|
||||
// private String CYCVPPSCN;
|
||||
//
|
||||
// @ColumnWidth(20)
|
||||
// @ExcelProperty(value = "卡车VPPS编码", index = 12)
|
||||
// @ApiModelProperty(value = "卡车VPPS编码")
|
||||
// private String KCCVPPSBM;
|
||||
//
|
||||
// @ColumnWidth(20)
|
||||
// @ExcelProperty(value = "卡车vpps中文名称", index = 13)
|
||||
// @ApiModelProperty(value = "卡车vpps中文名称")
|
||||
// private String KCCVPPSCN;
|
||||
|
||||
@ApiModelProperty(value = "责任工程师")
|
||||
// @ExcelProperty(value = "责任工程师", index = 17)
|
||||
|
||||
+3
-3
@@ -21,15 +21,15 @@ public class StandRegionalTimeDto {
|
||||
@ApiModelProperty(value = "实施日期")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date putTime;
|
||||
private String putTime;
|
||||
|
||||
@ApiModelProperty(value = "在产车实施日期")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date zccssrq;
|
||||
private String zccssrq;
|
||||
|
||||
@ApiModelProperty(value = "新车型实施日期")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date xcxssrq;
|
||||
private String xcxssrq;
|
||||
}
|
||||
|
||||
+17
-17
@@ -43,7 +43,7 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
|
||||
IPage<SarLawsAttrDetailedList> pageRes = new Page<>(sarFindDto.getPage(), sarFindDto.getSize());
|
||||
QueryWrapper<SarLawsAttrDetailedList> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("detailed_list_id", sarFindDto.getId());
|
||||
IPage<SarLawsAttrDetailedList> selectPage = sarLawsAttrDetailedListDao.selectPage(pageRes,wrapper);
|
||||
IPage<SarLawsAttrDetailedList> selectPage = sarLawsAttrDetailedListDao.selectPage(pageRes,wrapper); //??????
|
||||
//查询标准id
|
||||
List<String> lawsIds = sarLawsAttrDetailedListDao.selectLawsId(sarFindDto.getId(),(sarFindDto.getPage())-1,sarFindDto.getSize(),sarFindDto);
|
||||
if (CollectionUtils.isEmpty(lawsIds)){
|
||||
@@ -60,16 +60,16 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
|
||||
/**
|
||||
*2021/9/13 摒弃使用清单实施日期,改用标准实施日期
|
||||
*/
|
||||
// List<SarLawsAttrDetailedList> sarLawsAttrDetailedLists = sarLawsAttrDetailedListDao.selectList(queryWrapper);/
|
||||
// if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getSsrq())){
|
||||
// lawsDto.setSSRQ(sarLawsAttrDetailedLists.get(0).getSsrq());
|
||||
// }
|
||||
// if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getXcxssrq())){
|
||||
// lawsDto.setXCXSSRQGJ(sarLawsAttrDetailedLists.get(0).getXcxssrq());
|
||||
// }
|
||||
// if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getZccssrq())){
|
||||
// lawsDto.setZCCSSRQGJ(sarLawsAttrDetailedLists.get(0).getZccssrq());
|
||||
// }
|
||||
List<SarLawsAttrDetailedList> sarLawsAttrDetailedLists = sarLawsAttrDetailedListDao.selectList(queryWrapper);
|
||||
if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getSsrq()) && "null"!=sarLawsAttrDetailedLists.get(0).getSsrq()){
|
||||
lawsDto.setSSRQ(sarLawsAttrDetailedLists.get(0).getSsrq());
|
||||
}
|
||||
if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getXcxssrq()) && "null"!=sarLawsAttrDetailedLists.get(0).getXcxssrq()){
|
||||
lawsDto.setXCXSSRQGJ(sarLawsAttrDetailedLists.get(0).getXcxssrq());
|
||||
}
|
||||
if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getZccssrq()) && "null"!=sarLawsAttrDetailedLists.get(0).getZccssrq()){
|
||||
lawsDto.setZCCSSRQGJ(sarLawsAttrDetailedLists.get(0).getZccssrq());
|
||||
}
|
||||
if ("INLAND".equals(lawsDto.getStandType()))lawsDto.setStandType("INLAND_STAND");
|
||||
if ("FOREIGN".equals(lawsDto.getStandType()))lawsDto.setStandType("FOREIGN_STAND");
|
||||
}
|
||||
@@ -301,14 +301,14 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
|
||||
}
|
||||
|
||||
private void dateTime(LinkedHashMap<String, List<String>> mapList, StandRegionalTimeDto s) {
|
||||
String putTime = new SimpleDateFormat("yyyy-MM-dd").format(s.getPutTime());
|
||||
String xcx = new SimpleDateFormat("yyyy-MM-dd").format(s.getXcxssrq());
|
||||
String zcc = new SimpleDateFormat("yyyy-MM-dd").format(s.getZccssrq());
|
||||
// String putTime = new SimpleDateFormat("yyyy-MM-dd").format(s.getPutTime());
|
||||
// String xcx = new SimpleDateFormat("yyyy-MM-dd").format(s.getXcxssrq());
|
||||
// String zcc = new SimpleDateFormat("yyyy-MM-dd").format(s.getZccssrq());
|
||||
// putTime.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getPutTime());
|
||||
// xcx.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getXcxssrq()));
|
||||
// zcc.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getZccssrq()));
|
||||
mapList.put("实施日期("+s.getCountry()+")", Collections.singletonList(putTime));
|
||||
mapList.put("新车型实施日期("+s.getCountry()+")", Collections.singletonList(xcx));
|
||||
mapList.put("在产车实施日期("+s.getCountry()+")", Collections.singletonList(zcc));
|
||||
mapList.put("实施日期("+s.getCountry()+")",Arrays.asList(s.getPutTime().split(",")));
|
||||
mapList.put("新车型实施日期("+s.getCountry()+")", Arrays.asList(s.getXcxssrq().split(",")));
|
||||
mapList.put("在产车实施日期("+s.getCountry()+")", Arrays.asList(s.getZccssrq().split(",")));
|
||||
}
|
||||
}
|
||||
|
||||
+53
-30
@@ -11,6 +11,10 @@ import com.adc.da.slrs.sarLawsDetailedList.entity.SarLawsDetailedList;
|
||||
import com.adc.da.slrs.sarLawsDetailedList.entity.DetailedUpDto;
|
||||
import com.adc.da.slrs.sarLawsDetailedList.entity.TimeDto;
|
||||
import com.adc.da.slrs.sarLawsDetailedList.service.ISarLawsDetailedListService;
|
||||
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
|
||||
import com.adc.da.slrs.sarStandardsInfo.service.impl.SarStandardsInfoServiceImpl;
|
||||
import com.adc.da.slrs.sarUser.entity.UpDTO;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.adc.da.sys.service.IDicTypeEOService;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -39,6 +43,9 @@ import static com.adc.da.login.util.UserUtils.getUserName;
|
||||
@Service
|
||||
public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedListDao, SarLawsDetailedList> implements ISarLawsDetailedListService {
|
||||
|
||||
@Autowired
|
||||
SarStandardsInfoDao sarStandardsInfoDao;
|
||||
|
||||
@Autowired
|
||||
public SarLawsDetailedListDao sarLawsDetailedListDao;
|
||||
@Autowired
|
||||
@@ -49,6 +56,8 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
private SarLawsAttrDetailedListServiceImpl service;
|
||||
@Autowired
|
||||
private IDicTypeEOService iDicTypeEOService;
|
||||
@Autowired
|
||||
private ITsUserService iTsUserService;
|
||||
|
||||
@Override
|
||||
public String del(List<String> idList) {
|
||||
@@ -95,7 +104,7 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
//就判断页面的值和数据库里的值是否相等
|
||||
for (int i = 0; i < sarLawsDetailedLists.size(); i++) {
|
||||
//判断数据库里的数据的车型类别字段是否为空
|
||||
if (null == sarLawsDetailedLists.get(i) || null == sarLawsDetailedLists.get(i).getCarType()){
|
||||
if (null == sarLawsDetailedLists.get(i) || null == sarLawsDetailedLists.get(i).getCarType()) {
|
||||
System.out.println("数据库里第" + (i + 1) + "条的车型类别字段长度为空,不重复,目前可以添加");
|
||||
}
|
||||
//相等就不许添加
|
||||
@@ -182,7 +191,7 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
newListMethod(addDetailedDto);
|
||||
return "车型类别清单添加成功";
|
||||
//添加方法结束
|
||||
} else if (carAddFlag == false){
|
||||
} else if (carAddFlag == false) {
|
||||
//0表示添加成功,1表示添加失败
|
||||
return "车型类别清单添加失败";
|
||||
}
|
||||
@@ -245,14 +254,14 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
if (addDetailedDto.getInforlist() != null) {
|
||||
if (addDetailedDto.getInforlist().contains(",")) {
|
||||
String[] id = addDetailedDto.getInforlist().split(",");
|
||||
String[] putTime = addDetailedDto.getInforlist1().split(",");
|
||||
String[] zcc = addDetailedDto.getInforlist2().split(",");
|
||||
String[] xcx = addDetailedDto.getInforlist3().split(",");
|
||||
String[] putTime = addDetailedDto.getInforlist1().split(";");
|
||||
String[] zcc = addDetailedDto.getInforlist2().split(";");
|
||||
String[] xcx = addDetailedDto.getInforlist3().split(";");
|
||||
for (int a = 0; a < id.length; a++) {
|
||||
TimeDto dto = new TimeDto();
|
||||
dto.setStandId(id[a]);
|
||||
//putTiem即ssrq可能为空 ''
|
||||
if (putTime.length>0){
|
||||
if (putTime.length > 0) {
|
||||
if ("-".equals(putTime[a]) || null == putTime[a]) {
|
||||
dto.setSsrq(null);
|
||||
} else {
|
||||
@@ -293,7 +302,7 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
@Override
|
||||
public IPage<SarLawsDetailedList> AllSelectD(Integer page, Integer pageSize, String sortKey,
|
||||
String countryArea, String projectName,
|
||||
String detailedList, String detailedListName,String carType) {
|
||||
String detailedList, String detailedListName, String carType) {
|
||||
QueryWrapper<SarLawsDetailedList> wrapper = new QueryWrapper<>();
|
||||
if ("1".equals(sortKey)) {
|
||||
wrapper.like(StringUtils.isNotEmpty(countryArea), "country_area", countryArea).
|
||||
@@ -327,7 +336,7 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
}
|
||||
}
|
||||
String completedString = "";
|
||||
if (builder.length()>0) {
|
||||
if (builder.length() > 0) {
|
||||
completedString = builder.delete(builder.length() - 1, builder.length()).toString();
|
||||
}
|
||||
list1.setCountryArea(completedString);
|
||||
@@ -342,6 +351,20 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
}
|
||||
userIPage.setRecords(list);
|
||||
}
|
||||
List<String> names = new ArrayList<>();
|
||||
userIPage.getRecords().forEach(sarLawsDetailedList -> {
|
||||
names.add(sarLawsDetailedList.getUpdatePeople());
|
||||
});
|
||||
List<UpDTO> upDTOS = iTsUserService.selectNameById(names, "0");
|
||||
Map<String, String> stringMap = new HashMap<>();
|
||||
upDTOS.forEach(upDTO -> {
|
||||
stringMap.put(upDTO.getId(), upDTO.getValue());
|
||||
});
|
||||
userIPage.getRecords().forEach(sarLawsDetailedList -> {
|
||||
if (null != stringMap.get(sarLawsDetailedList.getUpdatePeople())) {
|
||||
sarLawsDetailedList.setUpdatePeople(stringMap.get(sarLawsDetailedList.getUpdatePeople()));
|
||||
}
|
||||
});
|
||||
System.out.println("总条数" + userIPage.getTotal());
|
||||
System.out.println("总页数" + userIPage.getPages());
|
||||
return userIPage;
|
||||
@@ -356,8 +379,8 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
|
||||
//list是数据库里根据id查出来的数据;detailedUpDto是页面传回来的数据
|
||||
SarLawsDetailedList list = sarLawsDetailedListDao.selectById(detailedUpDto.getId());
|
||||
System.out.println("数据库里存的当前数据"+list.getCountryArea());
|
||||
System.out.println("页面现在的数据"+detailedUpDto.getCountryArea());
|
||||
System.out.println("数据库里存的当前数据" + list.getCountryArea());
|
||||
System.out.println("页面现在的数据" + detailedUpDto.getCountryArea());
|
||||
|
||||
//国家/地区清单 多选是否可以添加的标识,true表示可以添加,false表示不许添加
|
||||
boolean multiEditFlag = true;
|
||||
@@ -378,10 +401,9 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
//就判断页面的值和数据库里的值是否相等
|
||||
for (int i = 0; i < sarLawsDetailedLists.size(); i++) {
|
||||
//判断数据库里的数据的车型类别字段是否为空
|
||||
if (null == sarLawsDetailedLists.get(i) || null == sarLawsDetailedLists.get(i).getCarType()){
|
||||
if (null == sarLawsDetailedLists.get(i) || null == sarLawsDetailedLists.get(i).getCarType()) {
|
||||
System.out.println("数据库里第" + (i + 1) + "条的车型类别字段长度为空,不重复,目前可以添加");
|
||||
}
|
||||
else if (Objects.equals(detailedUpDto.getCarType(), list.getCarType())){
|
||||
} else if (Objects.equals(detailedUpDto.getCarType(), list.getCarType())) {
|
||||
System.out.println("页面的数据和数据库里存的当前数据相同,说明没有做更改,允许提交");
|
||||
}
|
||||
//相等就不许添加
|
||||
@@ -397,8 +419,7 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
//就先判断数据库里的数据的国家/地区字段是否为空
|
||||
if (null == sarLawsDetailedLists.get(i) || null == sarLawsDetailedLists.get(i).getCountryArea()) {
|
||||
System.out.println("数据库里第" + (i + 1) + "条的国家地区字段长度为空,不重复,目前可以添加");
|
||||
}
|
||||
else if (Objects.equals(detailedUpDto.getCountryArea(), list.getCountryArea())){
|
||||
} else if (Objects.equals(detailedUpDto.getCountryArea(), list.getCountryArea())) {
|
||||
System.out.println("页面的数据和数据库里存的当前数据相同,说明没有做更改,允许提交");
|
||||
}
|
||||
//再判断页面字段长度是否与数据库里的长度一样,如果长度不一样,允许新增
|
||||
@@ -472,7 +493,7 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
updateListMethod(detailedUpDto);
|
||||
return "车型类别清单修改成功";
|
||||
//添加方法结束
|
||||
} else if (carEditFlag == false){
|
||||
} else if (carEditFlag == false) {
|
||||
//0表示添加成功,1表示添加失败
|
||||
return "车型类别清单修改失败";
|
||||
}
|
||||
@@ -492,7 +513,6 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void updateListMethod(DetailedUpDto detailedUpDto) {
|
||||
@@ -550,9 +570,9 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
List<TimeDto> timeDto = new ArrayList<>();
|
||||
if (detailedUpDto.getInforlist().contains(",")) {
|
||||
String[] id = detailedUpDto.getInforlist().split(",");
|
||||
String[] putTime = detailedUpDto.getInforlist1().split(",");
|
||||
String[] zcc = detailedUpDto.getInforlist2().split(",");
|
||||
String[] xcx = detailedUpDto.getInforlist3().split(",");
|
||||
String[] putTime = detailedUpDto.getInforlist1().split(";");
|
||||
String[] zcc = detailedUpDto.getInforlist2().split(";");
|
||||
String[] xcx = detailedUpDto.getInforlist3().split(";");
|
||||
for (int a = 0; a < id.length; a++) {
|
||||
TimeDto dto = new TimeDto();
|
||||
dto.setStandId(id[a]);
|
||||
@@ -582,6 +602,10 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
timeDto.add(dto);
|
||||
}
|
||||
service.updateDetailedLaws(detailedUpDto.getId(), timeDto);
|
||||
|
||||
//更新标准是否纳入认证清单
|
||||
sarStandardsInfoDao.updateISRELATEACCESSById("1", Arrays.asList(detailedUpDto.getInforlist().split(",")));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -597,10 +621,10 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
|
||||
|
||||
@Override
|
||||
public void standardToLaws(String countryArea,TimeDto timeDto) {
|
||||
public void standardToLaws(String countryArea, TimeDto timeDto) {
|
||||
|
||||
if (countryArea==null){
|
||||
countryArea="";
|
||||
if (countryArea == null) {
|
||||
countryArea = "";
|
||||
}
|
||||
|
||||
|
||||
@@ -612,39 +636,38 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
|
||||
//1.获取标准清单的"国家/地区"
|
||||
QueryWrapper<SarLawsDetailedList> wrapper = new QueryWrapper<>();
|
||||
wrapper.select("country_area","id");
|
||||
wrapper.select("country_area", "id");
|
||||
//查询清单中的国家地区和清单id
|
||||
List<SarLawsDetailedList> sarLawsDetailedLists = sarLawsDetailedListDao.selectList(wrapper);
|
||||
//2.判断修改的标准的"国家/地区"与清单中的是否一致,一致则添加到清单中,不一致不作处理
|
||||
String[] split = countryArea.split(","); //拆分标准中的国家地区
|
||||
|
||||
|
||||
|
||||
//遍历清单 对比国家地区
|
||||
for (SarLawsDetailedList lawsDetailed : sarLawsDetailedLists) {
|
||||
if (lawsDetailed.getCountryArea()==null){
|
||||
if (lawsDetailed.getCountryArea() == null) {
|
||||
continue;
|
||||
}
|
||||
String[] sarLawsCounties = lawsDetailed.getCountryArea().split(",");//拆分清单中的国家地区
|
||||
// 对比清单列表中的国家地区,是否一致
|
||||
Arrays.sort(split);
|
||||
Arrays.sort(sarLawsCounties);
|
||||
if ( Arrays.equals(split,sarLawsCounties)){
|
||||
if (Arrays.equals(split, sarLawsCounties)) {
|
||||
|
||||
//一致时插入表并关联detailedListId和standId
|
||||
ArrayList<TimeDto> timeDtos = new ArrayList<>();
|
||||
timeDtos.add(timeDto);
|
||||
|
||||
QueryWrapper<SarLawsAttrDetailedList> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("stand_id",timeDto.getStandId());
|
||||
queryWrapper.eq("stand_id", timeDto.getStandId());
|
||||
|
||||
|
||||
//如果目标清单中已存标准在则更新 懒得写更新(⓿_⓿) 直接删掉,再重新插入
|
||||
if (sarLawsAttrDetailedListDao.selectCount(queryWrapper)>0) {
|
||||
if (sarLawsAttrDetailedListDao.selectCount(queryWrapper) > 0) {
|
||||
sarLawsAttrDetailedListDao.delete(queryWrapper);
|
||||
}
|
||||
|
||||
sarLawsAttrDetailedListService.insertDetailedList(lawsDetailed.getId(),timeDtos);
|
||||
sarLawsAttrDetailedListService.insertDetailedList(lawsDetailed.getId(), timeDtos);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -194,6 +194,8 @@ public class SarLawsStandInfoController extends BaseController<SarLawsStandInfo>
|
||||
@GetMapping(value = "/exportStandardsInfoExcel")
|
||||
public void exportStandardsInfoExcel(String exportContent, String exportType, String exportName,String userId, HttpServletResponse response,
|
||||
HttpServletRequest request) throws Exception {
|
||||
List<SarLawsStandInfo> data = sarLawsInfoEOService.getExportData(exportType,exportContent,userId);
|
||||
|
||||
OutputStream os = null;
|
||||
Workbook workbook = null;
|
||||
try {
|
||||
@@ -204,7 +206,7 @@ public class SarLawsStandInfoController extends BaseController<SarLawsStandInfo>
|
||||
"attachment; filename=" + ReadExcel.encodeFileName(exportName+".xlsx",request));
|
||||
response.setContentType("application/force-download");
|
||||
// 导出所有数据
|
||||
List<SarLawsStandInfo> data = sarLawsInfoEOService.getExportData(exportType,exportContent,userId);
|
||||
// List<SarLawsStandInfo> data = sarLawsInfoEOService.getExportData(exportType,exportContent,userId);
|
||||
workbook = LawsStandExportUtil.exportDatas(data);
|
||||
|
||||
os = response.getOutputStream();
|
||||
|
||||
+8
-6
@@ -3,6 +3,7 @@ package com.adc.da.slrs.sarModelTree.controller;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarModelTree.entity.SarModuleTree;
|
||||
import com.adc.da.slrs.sarModelTree.service.ISarModelTreeService;
|
||||
import com.adc.da.slrs.sarModelTree.service.ISarModuleTreeService;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
|
||||
@@ -38,17 +39,18 @@ public class SarModelTreeController extends BaseController<SarModelTree> {
|
||||
@ApiOperation("查询父所有资源")
|
||||
@GetMapping("/list")
|
||||
public ResponseMessage<List<SarModelTree>> getAll(){
|
||||
List<SarModelTree> tsResources = iSarModelTreeService.getAll(null);
|
||||
// TODO List<SarModelTree> tsResources = iSarModuleTreeService.getAll(null);
|
||||
// List<SarModuleTree> tsResources = iSarModuleTreeService.getAll(null);
|
||||
List<SarModelTree> tsResources = iSarModelTreeService.getAll(null);
|
||||
return Result.success(tsResources);
|
||||
}
|
||||
|
||||
@ApiOperation("根据父ID查询子所有资源")
|
||||
@GetMapping("/childByList")
|
||||
public ResponseMessage<List<SarModelTree>> childByList(String ids){
|
||||
SarModelTree tree = new SarModelTree();
|
||||
tree.setId(ids);
|
||||
List<SarModelTree> tsResources = iSarModelTreeService.recursionGetChildren(tree);
|
||||
public ResponseMessage<List<SarModelTree>> childByList(SarModelTree parentTree){
|
||||
// List<SarModuleTree> tsResources = iSarModuleTreeService.recursionGetChildren(parentTree);
|
||||
|
||||
List<SarModelTree> tsResources = iSarModelTreeService.recursionGetChildren(parentTree);
|
||||
|
||||
return Result.success(tsResources);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
@@ -65,4 +65,11 @@ public class SarModelTree extends BaseEntity {
|
||||
@TableField(exist=false)
|
||||
private List<String> childMenuIds;
|
||||
|
||||
@TableField("HAS_CHILDREN")
|
||||
private String hasChildren;
|
||||
|
||||
@TableField(exist = false)
|
||||
private boolean leaf;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -70,7 +70,13 @@ public class SarModuleTree {
|
||||
@TableField("CREATIONDATE")
|
||||
private String creationdate;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer level;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String model;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String nextCondition;
|
||||
|
||||
}
|
||||
|
||||
+3
-2
@@ -1,15 +1,16 @@
|
||||
package com.adc.da.slrs.sarModelTree.service;
|
||||
|
||||
import com.adc.da.slrs.sarModelTree.entity.SarModelTree;
|
||||
import com.adc.da.slrs.sarModelTree.entity.SarModuleTree;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ISarModuleTreeService {
|
||||
|
||||
List<SarModelTree> getAll(SarModelTree sarModelTree);
|
||||
List<SarModuleTree> getAll(SarModuleTree root);
|
||||
|
||||
List<SarModelTree> recursionGetChildren(SarModelTree parent);
|
||||
List<SarModuleTree> recursionGetChildren(SarModuleTree parent);
|
||||
|
||||
public Head analysisJsonAndStorage(String json);
|
||||
|
||||
|
||||
+36
-5
@@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -32,6 +34,17 @@ public class SarModelTreeServiceImpl extends ServiceImpl<SarModelTreeDao, SarMod
|
||||
// for(SarModelTree tree:list){
|
||||
// tree.setChildren(recursionGetChildren((tree)));
|
||||
// }
|
||||
list.forEach(item->{
|
||||
switch (item.getHasChildren()){
|
||||
case "0":
|
||||
item.setLeaf(true);
|
||||
break;
|
||||
case "1":
|
||||
item.setLeaf(false);
|
||||
break;
|
||||
}
|
||||
item.setId(item.getName());
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -44,11 +57,29 @@ public class SarModelTreeServiceImpl extends ServiceImpl<SarModelTreeDao, SarMod
|
||||
public List<SarModelTree> recursionGetChildren(SarModelTree parent){
|
||||
QueryWrapper<SarModelTree> sarMenuQueryWrapper=new QueryWrapper<>();
|
||||
sarMenuQueryWrapper.orderByAsc("SORT");
|
||||
sarMenuQueryWrapper.in("PID",parent.getId());
|
||||
// sarMenuQueryWrapper.in("PID",parent.getId());
|
||||
sarMenuQueryWrapper.eq("PID",parent.getId());
|
||||
List<SarModelTree> children=this.baseMapper.selectList(sarMenuQueryWrapper);
|
||||
for(SarModelTree sarMenu:children){
|
||||
sarMenu.setChildren(recursionGetChildren((sarMenu)));
|
||||
}
|
||||
return children;
|
||||
// for(SarModelTree sarMenu:children){
|
||||
// sarMenu.setChildren(recursionGetChildren((sarMenu)));
|
||||
// }
|
||||
|
||||
List<SarModelTree> collect = children.stream()
|
||||
.filter(item -> !parent.getModel().equals(item.getModel())).collect(Collectors.toList());
|
||||
|
||||
collect.forEach(item-> {
|
||||
switch (item.getHasChildren()) {
|
||||
case "0":
|
||||
item.setLeaf(true);
|
||||
break;
|
||||
case "1":
|
||||
item.setLeaf(false);
|
||||
break;
|
||||
}
|
||||
item.setId(item.getName());
|
||||
});
|
||||
|
||||
|
||||
return collect;
|
||||
}
|
||||
}
|
||||
|
||||
+55
-15
@@ -15,9 +15,11 @@ import com.google.gson.JsonParser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@@ -27,16 +29,27 @@ public class SarModuleTreeServiceImpl extends ServiceImpl<SarModuleTreeDao, SarM
|
||||
private SarModuleTreeServiceImpl sarModuleTreeService;
|
||||
|
||||
/**
|
||||
* @param sarModelTree
|
||||
* @return 所有的根节点
|
||||
*/
|
||||
@Override
|
||||
public List<SarModelTree> getAll(SarModelTree sarModelTree) {
|
||||
public List<SarModuleTree> getAll(SarModuleTree root) {
|
||||
QueryWrapper<SarModuleTree> treeQueryWrapper = new QueryWrapper<>();
|
||||
treeQueryWrapper.groupBy("FTVSTYPE1");
|
||||
List<SarModuleTree> moduleTreeList = this.baseMapper.selectList(treeQueryWrapper);
|
||||
treeQueryWrapper.select("FTVSTYPE1")
|
||||
.groupBy("FTVSTYPE1");
|
||||
|
||||
List<Map<String, Object>> moduleTreeList = this.baseMapper.selectMaps(treeQueryWrapper);
|
||||
|
||||
List<SarModuleTree> collect = moduleTreeList.stream()
|
||||
.map(item -> {
|
||||
SarModuleTree sarModuleTree = new SarModuleTree();
|
||||
sarModuleTree.setNextCondition(item.get("FTVSTYPE1").toString());
|
||||
sarModuleTree.setLevel(1);
|
||||
sarModuleTree.setModel(item.get("FTVSTYPE1").toString());
|
||||
return sarModuleTree;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
//返回转换元素后的数组
|
||||
return listTransform(moduleTreeList);
|
||||
return collect;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -45,20 +58,47 @@ public class SarModuleTreeServiceImpl extends ServiceImpl<SarModuleTreeDao, SarM
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SarModelTree> recursionGetChildren(SarModelTree parent) {
|
||||
public List<SarModuleTree> recursionGetChildren(SarModuleTree parent) {
|
||||
|
||||
QueryWrapper<SarModuleTree> treeQueryWrapper = new QueryWrapper<>();
|
||||
treeQueryWrapper.eq("GUID",parent.getId());
|
||||
List<SarModuleTree> moduleTreeList = this.baseMapper.selectList(treeQueryWrapper);
|
||||
Integer level =parent.getLevel();
|
||||
|
||||
switch (parent.getLevel()){
|
||||
case 1:
|
||||
level=2;
|
||||
break;
|
||||
case 6:
|
||||
return null;
|
||||
}
|
||||
|
||||
String column="FTVSTYPE"+(level+1);
|
||||
|
||||
treeQueryWrapper.select(column)
|
||||
.eq("FTVSTYPE"+parent.getLevel(),parent.getNextCondition())
|
||||
.groupBy(column);
|
||||
|
||||
List<Map<String, Object>> moduleTreeList = this.baseMapper.selectMaps(treeQueryWrapper);
|
||||
|
||||
Integer finalLevel = level;
|
||||
List<SarModuleTree> collect = moduleTreeList.stream()
|
||||
.map(item -> {
|
||||
SarModuleTree sarModuleTree = new SarModuleTree();
|
||||
sarModuleTree.setNextCondition(item.get(column).toString()); //查询子节点条件
|
||||
sarModuleTree.setLevel(finalLevel + 1);
|
||||
//拼接前端显示名称
|
||||
// switch (finalLevel){
|
||||
// case 3:
|
||||
// sarModuleTree.setModel(item.get(column).toString());//前端显示名称
|
||||
// break;
|
||||
// case
|
||||
// }
|
||||
|
||||
|
||||
Map<String, List<SarModuleTree>> collect = moduleTreeList.stream().collect(Collectors.groupingBy(SarModuleTree::getFtvstype1));
|
||||
collect.forEach((k, v)->{
|
||||
SarModelTree modelTree = new SarModelTree();
|
||||
//TODO 生成树型结构
|
||||
// modelTree
|
||||
});
|
||||
return null;
|
||||
return sarModuleTree;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
|
||||
return collect;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+9
-2
@@ -184,7 +184,12 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
|
||||
|
||||
for(TsResource resource:TsResources){
|
||||
QueryWrapper<TsResource> TsResourceQueryWrapper=new QueryWrapper<>();
|
||||
TsResourceQueryWrapper.like("PARENT_IDS",resource.getId());
|
||||
// TsResourceQueryWrapper.like("PARENT_IDS",resource.getId());
|
||||
/**
|
||||
* 没有把改节点查出
|
||||
*/
|
||||
TsResourceQueryWrapper.isNotNull("PARENT_ID");
|
||||
|
||||
if(StringUtils.isNotBlank(tsResource.getSorDivide())){
|
||||
TsResourceQueryWrapper.in("ID",getMenuIdList);
|
||||
}
|
||||
@@ -323,7 +328,9 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
|
||||
* @return List<TsResource>
|
||||
*/
|
||||
private List<TsResource> recursionGetListChildrenStand(TsResource resource,List<TsResource> children){
|
||||
List<TsResource> tsResources = children.stream().filter(resource1 -> resource1.getParentId().equals(resource.getId())).collect(Collectors.toList());
|
||||
List<TsResource> tsResources = children.stream()
|
||||
.filter(resource1 -> resource1.getParentId().equals(resource.getId()))
|
||||
.collect(Collectors.toList());
|
||||
if(!tsResources.isEmpty()){
|
||||
tsResources = tsResources.stream().sorted(Comparator.comparing(resource1 -> resource1.getDisplaySeq())).collect(Collectors.toList());
|
||||
tsResources.forEach(resource1 -> {
|
||||
|
||||
@@ -41,7 +41,7 @@ public interface TsRoleDao extends BaseMapper<TsRole> {
|
||||
* @param menuId:权限ID
|
||||
*/
|
||||
@Insert("insert into ts_role_menu (role_id,menu_id) values (#{roleId},#{menuId})")
|
||||
void addMenu(String roleId, String menuId);
|
||||
void addMenu(@Param("roleId") String roleId, @Param("menuId") String menuId);
|
||||
|
||||
/**
|
||||
* 删除权限
|
||||
|
||||
+13
@@ -161,4 +161,17 @@ public class SarStandAttrDetailsController extends BaseController<SarStandAttrDe
|
||||
public ResponseMessage<List<SelectionResult>> selectFileFieldForSel1(){
|
||||
return Result.success(sarStandAttrDetailsEOService.selectFileFieldForSel1(null));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|SarStandAttrDetailsEO|查询标准中所有文件类型")
|
||||
@GetMapping("/getListData")
|
||||
// @RequiresPermissions("lawss:sarStandAttrDetails:get")
|
||||
public ResponseMessage<List<SarStandAttrDetails>> getListData(){
|
||||
QueryWrapper<SarStandAttrDetails> queryWrapper=new QueryWrapper<>();
|
||||
queryWrapper.eq("ATTR_TYPE","file");
|
||||
List<SarStandAttrDetails> sarStandAttrDetails=sarStandAttrDetailsEOService.list(queryWrapper);
|
||||
return Result.success(sarStandAttrDetails);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.adc.da.slrs.sarStandAttrDetails.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class listDTO {
|
||||
|
||||
private String key;
|
||||
|
||||
private String value;
|
||||
|
||||
}
|
||||
+56
-22
@@ -15,18 +15,17 @@ import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -77,6 +76,14 @@ public class SarPublicIdeaAllController extends BaseController<SarPublicIdeaAll>
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation(value = "增加意见")
|
||||
@PostMapping("/saveBatch")
|
||||
public ResponseMessage saveBatch(@RequestBody List<SarPublicIdeaAll> sar){
|
||||
boolean flag=sarPublicIdeaAllImpl.saveBatch(sar);
|
||||
return Result.success("200",flag);
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除意见")
|
||||
@GetMapping("/deleteStand")
|
||||
public ResponseMessage deleteStand(DelStandDto delStandDto){
|
||||
@@ -94,30 +101,50 @@ public class SarPublicIdeaAllController extends BaseController<SarPublicIdeaAll>
|
||||
|
||||
@ApiOperation(value = "导出全部意见")
|
||||
@GetMapping("/tuallStand")
|
||||
public void getAllStand(HttpServletResponse response,String cid){
|
||||
public void getAllStand(HttpServletResponse response,@RequestParam(value = "cid")String cid,@RequestParam(value = "type",required = false)String type){
|
||||
try {
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
String fileName = URLEncoder.encode("意见详情", "UTF-8").replaceAll("\\+", "%20");
|
||||
String textName="";
|
||||
if ("1".equals(type)){
|
||||
textName= "流程意见详情";
|
||||
}else {
|
||||
textName="意见详情";
|
||||
}
|
||||
Map<String,String> map=new HashMap<>();
|
||||
map.put("1","上报");
|
||||
map.put("2","处理后上报");
|
||||
String fileName = URLEncoder.encode(textName, "UTF-8").replaceAll("\\+", "%20");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
List<SarPublicIdeaAll> data=new ArrayList<>();
|
||||
if (!StringUtils.isEmpty(cid)){
|
||||
QueryWrapper<SarPublicIdeaAll> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq(SarPublicIdeaAll.CID,cid);
|
||||
wrapper.orderByAsc("part_code");
|
||||
data=sarPublicIdeaAllDao.selectList(wrapper);
|
||||
data=sarPublicIdeaAllDao.getPublicAllIdea(cid,type);
|
||||
}
|
||||
List<GetExcelDto> standExcel=new ArrayList<>();
|
||||
List<GetExcelDto2> standExcel2=new ArrayList<>();
|
||||
for (SarPublicIdeaAll sarPublicIdeaAll:data){
|
||||
GetExcelDto getExcelDto=GetExcelDto.builder()
|
||||
.partCode(sarPublicIdeaAll.getPartCode())
|
||||
.oldText(sarPublicIdeaAll.getOldText())
|
||||
.newText(sarPublicIdeaAll.getNewText())
|
||||
.reason(sarPublicIdeaAll.getReason())
|
||||
.userName(sarPublicIdeaAll.getUserName())
|
||||
.deptName(sarPublicIdeaAll.getDeptName())
|
||||
.build();
|
||||
standExcel.add(getExcelDto);
|
||||
if ("1".equals(type)) {
|
||||
GetExcelDto2 getExcelDto = GetExcelDto2.builder()
|
||||
.partCode(sarPublicIdeaAll.getPartCode())
|
||||
.oldText(sarPublicIdeaAll.getOldText())
|
||||
.newText(sarPublicIdeaAll.getNewText())
|
||||
.reason(sarPublicIdeaAll.getReason())
|
||||
.userName(sarPublicIdeaAll.getUserName())
|
||||
.deptName(sarPublicIdeaAll.getDeptName())
|
||||
.state(map.get(sarPublicIdeaAll.getState()))
|
||||
.build();
|
||||
standExcel2.add(getExcelDto);
|
||||
}else {
|
||||
GetExcelDto getExcelDto = GetExcelDto.builder()
|
||||
.partCode(sarPublicIdeaAll.getPartCode())
|
||||
.oldText(sarPublicIdeaAll.getOldText())
|
||||
.newText(sarPublicIdeaAll.getNewText())
|
||||
.reason(sarPublicIdeaAll.getReason())
|
||||
.userName(sarPublicIdeaAll.getUserName())
|
||||
.deptName(sarPublicIdeaAll.getDeptName())
|
||||
.build();
|
||||
standExcel.add(getExcelDto);
|
||||
}
|
||||
}
|
||||
|
||||
List<List<String>> headList=new ArrayList<List<String>>();
|
||||
@@ -127,9 +154,16 @@ public class SarPublicIdeaAllController extends BaseController<SarPublicIdeaAll>
|
||||
headList.add(Lists.newArrayList("修改意见内容(包括理由或依据)","修改理由"));
|
||||
headList.add(Lists.newArrayList("提出部门"));
|
||||
headList.add(Lists.newArrayList("提出人"));
|
||||
|
||||
EasyExcel.write(response.getOutputStream(),GetExcelDto.class).head(headList).autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
||||
.doWrite(standExcel);
|
||||
if ("1".equals(type)){
|
||||
headList.add(Lists.newArrayList("处理意见"));
|
||||
}
|
||||
if ("1".equals(type)) {
|
||||
EasyExcel.write(response.getOutputStream(), GetExcelDto2.class).head(headList).autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
||||
.doWrite(standExcel2);
|
||||
}else {
|
||||
EasyExcel.write(response.getOutputStream(), GetExcelDto.class).head(headList).autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
||||
.doWrite(standExcel);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
response.reset();
|
||||
response.setContentType("application/json");
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.adc.da.slrs.sarStandIdea.dao;
|
||||
|
||||
import com.adc.da.slrs.sarStandIdea.entity.SarPublicIdeaAll;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -21,4 +22,10 @@ import java.util.List;
|
||||
public interface SarPublicIdeaAllDao extends BaseMapper<SarPublicIdeaAll> {
|
||||
|
||||
List<SarPublicIdeaAll> getPublicIdea(@Param("unique")String unique);
|
||||
|
||||
List<SarPublicIdeaAll> getAllDataByIdea(@Param("page")Integer page,@Param("size")Integer size, @Param("ideaId")String ideaId);
|
||||
|
||||
Integer getAllDataByIdeaCount( @Param("ideaId")String ideaId);
|
||||
|
||||
List<SarPublicIdeaAll> getPublicAllIdea(@Param("cid") String cid,@Param("type")String type);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.adc.da.slrs.sarStandIdea.entity;
|
||||
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* //用于导出
|
||||
*
|
||||
* @author ZhangZhiYuan
|
||||
* @date 2021-07-14
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@HeadRowHeight(20)
|
||||
@ColumnWidth(15)
|
||||
public class GetExcelDto2 {
|
||||
|
||||
// @ExcelProperty("章节编号")
|
||||
private String partCode;
|
||||
// @ExcelProperty("修改意见内容(包括理由或依据)")
|
||||
// private String content;
|
||||
private String oldText;
|
||||
|
||||
private String newText;
|
||||
|
||||
private String reason;
|
||||
// @ExcelProperty("提出部门")
|
||||
private String deptName;
|
||||
// @ExcelProperty("提出人")
|
||||
private String userName;
|
||||
|
||||
private String state;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -72,5 +72,8 @@ public class SarPublicIdea extends BaseEntity {
|
||||
@TableField("files_name")
|
||||
private String filesName;
|
||||
|
||||
@TableField("wkfiles")
|
||||
private String wkfiles;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -63,4 +63,16 @@ public class SarPublicIdeaAll extends BaseEntity {
|
||||
|
||||
public static final String CID = "cid";
|
||||
|
||||
@TableField("chapter_name")
|
||||
private String chapterName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String department;
|
||||
|
||||
@TableField("wk_flag")
|
||||
private String wkFlag;
|
||||
|
||||
@TableField("state")
|
||||
private String state;
|
||||
|
||||
}
|
||||
|
||||
+7
-4
@@ -48,10 +48,13 @@ public class SarPublicIdeaAllServiceImpl extends ServiceImpl<SarPublicIdeaAllDao
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
QueryWrapper<SarPublicIdeaAll> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("idea_id", detAllStandDto.getIdeaId());
|
||||
Page<SarPublicIdeaAll> page = new Page<>(detAllStandDto.getPage(), detAllStandDto.getSize());
|
||||
IPage<SarPublicIdeaAll> userIPage = sarPublicIdeaAllDao.selectPage(page, wrapper);
|
||||
List<SarPublicIdeaAll> sarPublicIdeaAlls=sarPublicIdeaAllDao.getAllDataByIdea(detAllStandDto.getPage(),detAllStandDto.getSize(),detAllStandDto.getIdeaId());
|
||||
Integer a=sarPublicIdeaAllDao.getAllDataByIdeaCount(detAllStandDto.getIdeaId());
|
||||
Page userIPage=new Page();
|
||||
userIPage.setTotal(a);
|
||||
userIPage.setRecords(sarPublicIdeaAlls);
|
||||
userIPage.setSize(detAllStandDto.getSize());
|
||||
userIPage.setCurrent(detAllStandDto.getPage());
|
||||
System.out.println("总条数" + userIPage.getTotal());
|
||||
System.out.println("总页数" + userIPage.getPages());
|
||||
List<SarPublicIdeaAll> list = userIPage.getRecords();
|
||||
|
||||
+25
-1
@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -53,6 +53,30 @@ public class SarStandItemsController extends BaseController<SarStandItems> {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "项目评估流程分解单查询")
|
||||
@GetMapping("/workflowFindItems")
|
||||
public ResponseMessage workflowFindItems( @RequestParam("ids") String ids,@RequestParam("types") String types){
|
||||
List<String> id=new ArrayList<>(Arrays.asList(ids.split(",")));
|
||||
List<String> type=new ArrayList<>(Arrays.asList(types.split(",")));
|
||||
Map<String,String> map=new HashMap<>();
|
||||
int i =0 ;
|
||||
for (String s:type) {
|
||||
if (null!=map.get(s)){
|
||||
map.put(s,map.get(s)+","+id.get(i));
|
||||
}else {
|
||||
map.put(s,id.get(i));
|
||||
}
|
||||
i++;
|
||||
}
|
||||
List<SarStandItemsDto> ItemDto = new ArrayList<>();
|
||||
map.entrySet().forEach(stringStringEntry -> {
|
||||
if (!"BDR".equals(stringStringEntry.getKey())){
|
||||
ItemDto.addAll(ServiceImpl.findAllItems(stringStringEntry.getKey(),stringStringEntry.getValue().split(",")));
|
||||
}
|
||||
});
|
||||
return Result.success("200",ItemDto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分解单查询")
|
||||
@GetMapping("/querySarItemAndInterpretation")
|
||||
public ResponseMessage querySarItemAndInterpretation(FindSarItemsPageReqDTO page){
|
||||
|
||||
+2
-2
@@ -25,11 +25,11 @@ public class FindSarItemsPageReqDTO extends BasePage {
|
||||
|
||||
@ApiModelProperty(value = "新车型实施日期")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date XCXSSRQ;
|
||||
private String XCXSSRQ;
|
||||
|
||||
@ApiModelProperty(value = "在产车实施日期")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date ZCCSSRQ;
|
||||
private String ZCCSSRQ;
|
||||
|
||||
@ApiModelProperty(value = "文件类型")
|
||||
private String fileType;
|
||||
|
||||
@@ -125,12 +125,12 @@ public class SarStandItems extends BaseEntity {
|
||||
@ApiModelProperty(value = "新车型实施日期")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField("XCXSSRQ")
|
||||
private Date xccssrq;
|
||||
private String xccssrq;
|
||||
|
||||
@ApiModelProperty(value = "在产车实施日期")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField("ZCCSSRQ")
|
||||
private Date zccssrq;
|
||||
private String zccssrq;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "符合性要求-符合性状态")
|
||||
|
||||
+17
-28
@@ -154,25 +154,9 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
|
||||
page.setPage(findStandDto.getPage());
|
||||
page.setPageSize(findStandDto.getSize());
|
||||
page.setUserId(null);
|
||||
List<SarStandardsInfo> pageInfo = null;
|
||||
try {
|
||||
pageInfo = sarStandardsInfoService.getSarStandardsInfoPageBak(page);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
List<String> standId = new ArrayList<>();
|
||||
for (SarStandardsInfo standardsInfo : pageInfo){
|
||||
if (standardsInfo.getAttrInfoCaseMap().get("FBGBJBD")!=null || standardsInfo.getAttrInfoCaseMap().get("fbgbjbd")!=null){
|
||||
standId.add(standardsInfo.getId());
|
||||
}
|
||||
}
|
||||
List<LawsDto> list = sarLawsAttrDetailedListDao.selectLawsByIdC((findStandDto.getPage()-1)*findStandDto.getSize(),findStandDto.getPage()*findStandDto.getSize(),standId,findStandDto.getStandName(), findStandDto.getStandType(),findStandDto.getFileType());
|
||||
|
||||
List<LawsDto> list=new ArrayList<>();
|
||||
if (standId==null || standId.size()==0){
|
||||
list = null;
|
||||
}else {
|
||||
list = sarLawsAttrDetailedListDao.selectLawsByIdC((findStandDto.getPage()-1)*findStandDto.getSize(),findStandDto.getPage()*findStandDto.getSize(),standId,findStandDto.getStandName(), findStandDto.getStandType(),findStandDto.getFileType());
|
||||
}
|
||||
IPage<LawsDto> page1=new Page<>();
|
||||
page1.setRecords(list);
|
||||
page1.setTotal(sarLawsAttrDetailedListDao.selectLawsByIdCount(standId,findStandDto.getStandName(),findStandDto.getStandType(),findStandDto.getFileType()).size());
|
||||
@@ -195,6 +179,7 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
|
||||
public List<SarStandItemsDto> findAllItems(String type,String[] ids){
|
||||
List<SarStandItemsDto> list=dao.selectAllItemsByIds(type,ids);
|
||||
List<SarStandItemsDto> res=new ArrayList<>();
|
||||
List<SarStandItemsDto> chinese=new ArrayList<>();
|
||||
if (null == list || list.isEmpty()){
|
||||
return list;
|
||||
}else {
|
||||
@@ -206,20 +191,24 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
|
||||
if (a>0){
|
||||
mark=mark.substring(0,a);
|
||||
}
|
||||
if (null != map.get(Integer.valueOf(mark))){
|
||||
map.get(Integer.valueOf(mark)).add(sarStandItemsDto);
|
||||
}else {
|
||||
integerList.add(Integer.valueOf(mark));
|
||||
List<SarStandItemsDto> middle=new ArrayList<>();
|
||||
middle.add(sarStandItemsDto);
|
||||
map.put(Integer.valueOf(mark),middle);
|
||||
}
|
||||
try {
|
||||
if (null != map.get(Integer.valueOf(mark))) {
|
||||
map.get(Integer.valueOf(mark)).add(sarStandItemsDto);
|
||||
} else {
|
||||
integerList.add(Integer.valueOf(mark));
|
||||
List<SarStandItemsDto> middle = new ArrayList<>();
|
||||
middle.add(sarStandItemsDto);
|
||||
map.put(Integer.valueOf(mark), middle);
|
||||
}
|
||||
}catch (Exception e){
|
||||
chinese.add(sarStandItemsDto);
|
||||
}
|
||||
});
|
||||
Collections.sort(integerList);
|
||||
integerList.forEach(integer -> {
|
||||
res.addAll(map.get(integer));
|
||||
});
|
||||
|
||||
res.addAll(chinese);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -231,7 +220,7 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
|
||||
|
||||
switch (page.getOrderBy()){
|
||||
case "itemsNum" : page.setOrderBy("ITEMS_NUM"); break;
|
||||
default:page.setOrderBy("ITEMS_NUM"); page.setOrder("DESC");
|
||||
default:page.setOrderBy("ITEMS_NUM"); page.setOrder("ASC");
|
||||
}
|
||||
|
||||
switch (page.getOrder()){
|
||||
@@ -240,7 +229,7 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
|
||||
}
|
||||
}else {
|
||||
page.setOrderBy("ITEMS_NUM");
|
||||
page.setOrder("DESC");
|
||||
page.setOrder("ASC");
|
||||
}
|
||||
|
||||
//分页查询的总数
|
||||
|
||||
+68
@@ -8,6 +8,7 @@ import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.ResponseDto;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.service.impl.SarStandProjectLibraryServiceImpl;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -122,6 +123,36 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
|
||||
pageres.setSize(list1.getSize());
|
||||
return Result.success("200",pageres);
|
||||
}
|
||||
|
||||
@GetMapping("/queryProjectUnderLine")
|
||||
@ApiOperation("查询产品线项目经理")
|
||||
public ResponseMessage queryProjectUnderLine(@RequestParam(defaultValue = "1", value = "current")int current,
|
||||
@RequestParam(defaultValue = "10", value = "PageSize") int pageSize,
|
||||
standDTO standDTO){
|
||||
List<String> strings=new ArrayList<>();
|
||||
if (!standDTO.getProductLine().isEmpty()){
|
||||
if (standDTO.getProductLine().contains(",")){
|
||||
strings.addAll(new ArrayList<>(Arrays.asList(standDTO.getProductLine().split(","))));
|
||||
}else {
|
||||
strings.add(standDTO.getProductLine());
|
||||
}
|
||||
}
|
||||
Page page=new Page();
|
||||
page.setCurrent(current);
|
||||
page.setSize(pageSize);
|
||||
QueryWrapper<SarStandProjectLibrary> queryWrapper=new QueryWrapper<>();
|
||||
if (null!=standDTO.getProjectNumber()) {
|
||||
queryWrapper.like("project_number", standDTO.getProjectNumber());
|
||||
}
|
||||
if (null!=standDTO.getProjectName()) {
|
||||
queryWrapper.like("project_name", standDTO.getProjectName());
|
||||
}
|
||||
queryWrapper.in("product_line",strings);
|
||||
queryWrapper.orderByAsc("product_line");
|
||||
// 创建一个新的list集合,用于存储去重后的元素
|
||||
IPage<SarStandProjectLibrary> pageres=sarStandProjectLibraryService.page(page,queryWrapper);
|
||||
return Result.success("200",pageres);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param current
|
||||
@@ -144,6 +175,29 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
|
||||
IPage<StandAttrInfoDto> list = sarStandProjectLibraryService.queryStandInfo(current,pageSize,id,cars);
|
||||
return Result.success("200",list);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param current
|
||||
* @param pageSize
|
||||
* @param id
|
||||
* @return
|
||||
* @author zj
|
||||
* date 2021-07-15
|
||||
**/
|
||||
@GetMapping("/queryStandInfoNew")
|
||||
@ApiOperation("查询标准信息")
|
||||
public ResponseMessage queryStandInfoNew(@RequestParam(defaultValue = "1", value = "current")int current, @RequestParam(defaultValue = "10", value = "PageSize") int pageSize,
|
||||
String id,String cars){
|
||||
// List<SarStandProjectLibrary> list = sarStandProjectLibraryService.queryStandId(id);
|
||||
// List<String> list1 = new ArrayList();
|
||||
// for(SarStandProjectLibrary s:list){
|
||||
// list1.add(s.getStandId());
|
||||
// }
|
||||
// System.out.println(list1);
|
||||
IPage<StandAttrInfoDto> list = sarStandProjectLibraryService.queryStandInfoNew(current,pageSize,id,cars);
|
||||
return Result.success("200",list);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
@@ -192,6 +246,20 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
|
||||
sarStandProjectLibraryService.batchInsert(list);
|
||||
return Result.success("200","新增成功",list);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param list
|
||||
* @return
|
||||
* @author zj
|
||||
* date 2021-07-15
|
||||
**/
|
||||
@PostMapping("/batchInsertAdd")
|
||||
@ApiOperation("调取标准")
|
||||
public ResponseMessage batchInsertAdd(@RequestBody List<StandProjectRelationDto> list){
|
||||
sarStandProjectLibraryService.batchInsertAdd(list);
|
||||
return Result.success("200","新增成功",list);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param standAttrInfoExcelDto
|
||||
|
||||
+2
@@ -29,6 +29,8 @@ public interface SarStandProjectLibraryDao extends BaseMapper<SarStandProjectLib
|
||||
List<String> getAllStands();
|
||||
List<String> getAllStand();
|
||||
List<SarStandProjectLibrary> updateByProjectId(@Param("id")String id, @Param("version")String version);
|
||||
List<SarStandProjectLibrary> updateByProjectIdBath(@Param("id")List<String> id, @Param("version")String version);
|
||||
void deleteByProjectId(@Param("projectId")String projectId);
|
||||
|
||||
List<String> selectListByids(@Param("ids") List<String> ids);
|
||||
}
|
||||
|
||||
@@ -8,4 +8,8 @@ public class standDTO {
|
||||
private String uname;
|
||||
|
||||
private String productLine;
|
||||
|
||||
private String projectName;
|
||||
|
||||
private String projectNumber;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user