系统功能调整
This commit is contained in:
@@ -28,6 +28,7 @@ import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.vo.UserVO;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.flowable.bpmn.model.BpmnModel;
|
||||
import org.flowable.bpmn.model.UserTask;
|
||||
import org.flowable.common.engine.impl.identity.Authentication;
|
||||
@@ -108,6 +109,9 @@ public class BpmProcessInstanceServiceImpl implements IBpmProcessInstanceService
|
||||
|
||||
@Override
|
||||
public PageResult<HistoricProcessInstance> getProcessInstancePage(String userId, BpmProcessInstancePageParam bpmProcessInstancePageParam) {
|
||||
if (StrUtil.isNotBlank(bpmProcessInstancePageParam.getSearchValue()) && bpmProcessInstancePageParam.getSearchValue().contains("null")) {
|
||||
throw new BusinessException("搜索值中不能包含null");
|
||||
}
|
||||
// 通过 BpmProcessInstanceExtDO 表,先查询到对应的分页
|
||||
HistoricProcessInstanceQuery processInstanceQuery = historyService.createHistoricProcessInstanceQuery()
|
||||
.includeProcessVariables()
|
||||
@@ -123,6 +127,9 @@ public class BpmProcessInstanceServiceImpl implements IBpmProcessInstanceService
|
||||
if (StrUtil.isNotEmpty(bpmProcessInstancePageParam.getName())) {
|
||||
processInstanceQuery.processInstanceNameLike("%" + bpmProcessInstancePageParam.getName() + "%");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(bpmProcessInstancePageParam.getSearchValue())) {
|
||||
processInstanceQuery.processInstanceNameLike("%" + bpmProcessInstancePageParam.getSearchValue() + "%");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(bpmProcessInstancePageParam.getProcessDefinitionId())) {
|
||||
processInstanceQuery.processDefinitionId("%" + bpmProcessInstancePageParam.getProcessDefinitionId() + "%");
|
||||
}
|
||||
|
||||
@@ -128,6 +128,9 @@ public class BpmTaskServiceImpl implements IBpmTaskService {
|
||||
|
||||
@Override
|
||||
public PageResult<HistoricTaskInstance> getTaskDonePage(String userId, BpmTaskParam.BpmTaskQueryParam bpmTaskQueryParam) {
|
||||
if (StrUtil.isNotBlank(bpmTaskQueryParam.getSearchValue()) && bpmTaskQueryParam.getSearchValue().contains("null")) {
|
||||
throw new BusinessException("搜索值中不能包含null");
|
||||
}
|
||||
HistoricTaskInstanceQuery taskQuery = historyService.createHistoricTaskInstanceQuery()
|
||||
// 已完成
|
||||
.finished()
|
||||
|
||||
@@ -21,17 +21,17 @@ public class GenerateCode {
|
||||
|
||||
private static final String TARGET_DIR = "D://code";
|
||||
|
||||
private static final String DB_URL = "jdbc:mysql://127.0.0.1:3306/pqsinfo";
|
||||
private static final String DB_URL = "jdbc:mysql://192.168.1.24:13306/pqsinfo_zl";
|
||||
// private static final String DB_URL = "jdbc:oracle:thin:@192.168.1.170:1521:pqsbase";
|
||||
|
||||
private static final String USERNAME = "root";
|
||||
|
||||
private static final String PASSWORD = "123456";
|
||||
private static final String PASSWORD = "njcnpqs";
|
||||
|
||||
public static void main(String[] args) {
|
||||
List<Module> modules = Stream.of(
|
||||
new Module("xy", "com.njcn.supervision", "survey", Stream.of(
|
||||
"supervision_line_warning"
|
||||
"app_version"
|
||||
).collect(Collectors.toList()), "supervision_")
|
||||
).collect(Collectors.toList());
|
||||
generateJavaFile(modules);
|
||||
|
||||
@@ -174,16 +174,31 @@ public interface PatternRegex {
|
||||
*/
|
||||
String TYPE_REGEX = "^[0-9a-zA-Z\\u0391-\\uFFE5]{1,100}$";
|
||||
|
||||
/**
|
||||
* 描述32
|
||||
*/
|
||||
String DES32_REGEX = "^.{0,32}$";
|
||||
|
||||
/**
|
||||
* 描述64
|
||||
*/
|
||||
String DES64_REGEX = "^.{0,64}$";
|
||||
|
||||
/**
|
||||
* 描述100
|
||||
*/
|
||||
String DES100_REGEX = "^.{0,100}$";
|
||||
|
||||
/**
|
||||
* 描述200
|
||||
*/
|
||||
String DES200_REGEX = "^.{0,200}$";
|
||||
|
||||
/**
|
||||
* 描述400
|
||||
*/
|
||||
String DES400_REGEX = "^.{0,400}$";
|
||||
|
||||
/**
|
||||
* 描述500
|
||||
*/
|
||||
|
||||
@@ -69,4 +69,8 @@ public interface ValidMessage {
|
||||
|
||||
String DEVICE_VERSION_NOT_BLANK = "装置版本json文件不能为空,请检查deviceVersionFile参数";
|
||||
|
||||
String SEARCH_DATA_ERROR = "搜索值有特殊字符或者过长,请检查搜索参数";
|
||||
|
||||
String DATA_TOO_LONG = "参数过长,请检查参数";
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.njcn.web.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
@@ -16,6 +19,7 @@ public class BaseParam implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("搜索值")
|
||||
@Pattern(regexp = PatternRegex.ALL_CHAR_1_20, message = ValidMessage.SEARCH_DATA_ERROR)
|
||||
private String searchValue;
|
||||
|
||||
@ApiModelProperty("开始时间")
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package com.njcn.supervision.pojo.param.user;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.supervision.pojo.po.user.UserReportProjectPO;
|
||||
import com.njcn.supervision.pojo.po.user.UserReportSensitivePO;
|
||||
import com.njcn.supervision.pojo.po.user.UserReportSubstationPO;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -12,6 +13,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -78,6 +80,7 @@ public class UserReportParam {
|
||||
* 归口管理部门
|
||||
*/
|
||||
@ApiModelProperty(value = "归口管理部门")
|
||||
@Pattern(regexp = PatternRegex.DES32_REGEX, message = ValidMessage.DATA_TOO_LONG)
|
||||
private String responsibleDepartment;
|
||||
|
||||
/**
|
||||
@@ -90,6 +93,7 @@ public class UserReportParam {
|
||||
* 变电站
|
||||
*/
|
||||
@ApiModelProperty(value = "变电站")
|
||||
@Pattern(regexp = PatternRegex.DES32_REGEX, message = ValidMessage.DATA_TOO_LONG)
|
||||
private String substation;
|
||||
|
||||
/**
|
||||
@@ -102,6 +106,7 @@ public class UserReportParam {
|
||||
* 工程名称
|
||||
*/
|
||||
@ApiModelProperty(value = "工程名称")
|
||||
@Pattern(regexp = PatternRegex.DES32_REGEX, message = ValidMessage.DATA_TOO_LONG)
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
@@ -114,6 +119,7 @@ public class UserReportParam {
|
||||
* 预测评估结论
|
||||
*/
|
||||
@ApiModelProperty(value = "预测评估结论")
|
||||
@Pattern(regexp = PatternRegex.DES400_REGEX, message = ValidMessage.DATA_TOO_LONG)
|
||||
private String evaluationConclusion;
|
||||
|
||||
@ApiModelProperty("发起人自选审批人 Map")
|
||||
|
||||
@@ -32,6 +32,7 @@ public class UserReportProjectPO extends BaseEntity {
|
||||
* 用户协议容量
|
||||
*/
|
||||
@TableField(value = "agreement_capacity")
|
||||
|
||||
private Double agreementCapacity;
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.njcn.bpm.enums.BpmTaskStatusEnum;
|
||||
import com.njcn.bpm.pojo.dto.BpmInstanceInfo;
|
||||
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.utils.PubUtil;
|
||||
@@ -53,6 +54,7 @@ import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.user.pojo.vo.UserVO;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
@@ -69,6 +71,8 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.beans.PropertyDescriptor;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -293,6 +297,12 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
*/
|
||||
@Override
|
||||
public Page<UserReportVO> getUserReport(UserReportParam.UserReportQueryParam userReportQueryParam) {
|
||||
//正则校验
|
||||
Pattern pattern = Pattern.compile(PatternRegex.ALL_CHAR_1_20);
|
||||
Matcher matcher = pattern.matcher(userReportQueryParam.getProjectName());
|
||||
if (!Objects.equals(userReportQueryParam.getProjectName(),"") && !matcher.matches()) {
|
||||
throw new BusinessException(ValidMessage.SEARCH_DATA_ERROR);
|
||||
}
|
||||
QueryWrapper<UserReportVO> userReportVOQueryWrapper = new QueryWrapper<>();
|
||||
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
|
||||
userReportVOQueryWrapper.in("supervision_user_report.create_by", colleaguesIds)
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.njcn.system.service.SysDicTreePOService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -178,10 +179,13 @@ public class DictTreeController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/queryDictType")
|
||||
@ApiOperation("获取指标类型")
|
||||
@ApiImplicitParam(name = "lineId", value = "监测点id", required = true)
|
||||
public HttpResult<List<SysDicTreePO>> queryDictType(@RequestParam @Validated String lineId) {
|
||||
@ApiImplicitParams ({
|
||||
@ApiImplicitParam(name = "lineId", value = "监测点id", required = true),
|
||||
@ApiImplicitParam(name = "conType", value = "接线方式", required = true)
|
||||
})
|
||||
public HttpResult<List<SysDicTreePO>> queryDictType(@RequestParam @Validated String lineId, @RequestParam @Validated Integer conType) {
|
||||
String methodDescribe = getMethodDescribe("queryDictType");
|
||||
List<SysDicTreePO> result = sysDicTreePOService.queryDictType(lineId);
|
||||
List<SysDicTreePO> result = sysDicTreePOService.queryDictType(lineId,conType);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -64,5 +64,5 @@ public interface SysDicTreePOService extends IService<SysDicTreePO> {
|
||||
*/
|
||||
List<SysDicTreePO> queryByCodeList(String code);
|
||||
|
||||
List<SysDicTreePO> queryDictType(String lineId);
|
||||
List<SysDicTreePO> queryDictType(String lineId, Integer conType);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -177,7 +178,7 @@ public class SysDicTreePOServiceImpl extends ServiceImpl<SysDicTreePOMapper, Sys
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysDicTreePO> queryDictType(String lineId) {
|
||||
public List<SysDicTreePO> queryDictType(String lineId, Integer conType) {
|
||||
DictTreeVO vo = queryByCode("Statistical_Type");
|
||||
LambdaQueryWrapper<SysDicTreePO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SysDicTreePO::getPid,vo.getId())
|
||||
@@ -190,7 +191,14 @@ public class SysDicTreePOServiceImpl extends ServiceImpl<SysDicTreePOMapper, Sys
|
||||
}
|
||||
//通用指标
|
||||
else {
|
||||
queryWrapper.eq(SysDicTreePO::getType,2);
|
||||
//角型接线
|
||||
if (Objects.equals(conType,1)) {
|
||||
queryWrapper.in(SysDicTreePO::getType, Arrays.asList(2,4));
|
||||
}
|
||||
//其他接线方式
|
||||
else {
|
||||
queryWrapper.in(SysDicTreePO::getType,Arrays.asList(2,5));
|
||||
}
|
||||
}
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user