From 78821214e29927469b7ca6a5c7ac1ff58cc9cdb7 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Wed, 2 Aug 2023 15:54:44 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=B1=A5=E8=81=8C=E8=AF=84=E4=BB=B7?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=93=E5=AE=B6ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/meeting/entity/domain/MeetingExpertJudge.java | 2 ++ .../com/ningdatech/pmapi/meeting/manage/MeetingExpertJudgeManage.java | 1 + 2 files changed, 3 insertions(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/MeetingExpertJudge.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/MeetingExpertJudge.java index 8eeb308..73de8bc 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/MeetingExpertJudge.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/MeetingExpertJudge.java @@ -30,6 +30,8 @@ public class MeetingExpertJudge implements Serializable { @ApiModelProperty("会议ID") private Long meetingId; + private Long expertId; + @ApiModelProperty("会议专家ID") private Long meetingExpertId; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingExpertJudgeManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingExpertJudgeManage.java index 323eda3..94d1dde 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingExpertJudgeManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingExpertJudgeManage.java @@ -63,6 +63,7 @@ public class MeetingExpertJudgeManage { throw BizException.wrap("履职评价已提交"); } MeetingExpertJudge entity = BeanUtil.copyProperties(req, MeetingExpertJudge.class); + entity.setExpertId(expert.getExpertId()); expertJudgeService.save(entity); } finally { distributedLock.releaseLock(key); From 0b142ec016aaf7986dee4826aa4769b508e23b13 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 16:18:49 +0800 Subject: [PATCH 2/5] =?UTF-8?q?debug=20=E9=87=8D=E5=A4=8Dmap=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/manage/ProjectLibManage.java | 4 ++++ .../pmapi/todocenter/manage/TodoCenterManage.java | 13 +++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index fa36c23..551c517 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -1125,6 +1125,10 @@ public class ProjectLibManage { projectApplication.setProjectVersion(version); projectApplication.setIsConstruct(isConstruct); + if(StringUtils.isNotBlank(application.getRelatedExistsApplication())){ + projectApplication.setApplicationName(null); + } + boolean result = projectApplicationService.save(projectApplication); // 保存应用关联的核心业务 List coreBusinessList = application.getCoreBusinessList(); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java index c8997dc..25c3b0f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java @@ -653,7 +653,10 @@ public class TodoCenterManage { List projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) .in(ProjectInst::getProjectId, projectIdList) .orderByDesc(ProjectInst::getProjectId)); - Map projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId()))); + Map projectInfoMap = projectInstList.stream() + .filter(p -> Objects.nonNull(p.getInstCode()) && + !TodoCenterConstant.Declared.NULL_INST_CODE.equals(p.getInstCode())) + .collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId()))); List instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList()); // 查出用户工作流 @@ -793,7 +796,10 @@ public class TodoCenterManage { List projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) .in(ProjectInst::getProjectId, projectIdList) .orderByDesc(ProjectInst::getProjectId)); - Map projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId()))); + Map projectInfoMap = projectInstList.stream() + .filter(p -> Objects.nonNull(p.getInstCode()) && + !TodoCenterConstant.Declared.NULL_INST_CODE.equals(p.getInstCode())) + .collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId()))); List instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList()); // 查出用户工作流 @@ -1153,6 +1159,9 @@ public class TodoCenterManage { !InstTypeEnum.DEPT_UNITED_REVIEW.getCode().equals(instType)) { projectApplication.setIsConstruct(Boolean.TRUE); } + if(StringUtils.isNotBlank(application.getRelatedExistsApplication())){ + projectApplication.setApplicationName(null); + } projectApplication.setProjectVersion(project.getVersion()); projectApplicationService.save(projectApplication); } From 8e7d07c15ab171b19980efb91367ef4287703295 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 3 Aug 2023 09:20:14 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A1=B9=E7=9B=AE=E7=BC=96=E5=8F=B7=E5=92=8C?= =?UTF-8?q?=E5=9C=B0=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/manage/ProjectLibManage.java | 6 +++++ .../projectlib/model/vo/ProjectLibListItemVO.java | 12 +++++++--- .../ningdatech/pmapi/password/PasswordTest.java | 26 ++++++++++++++++++++++ 3 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 pmapi/src/test/java/com/ningdatech/pmapi/password/PasswordTest.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 551c517..559ab06 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -126,6 +126,9 @@ public class ProjectLibManage { ProjectLibListItemVO item = new ProjectLibListItemVO(); item.setId(w.getId()); item.setProjectName(w.getProjectName()); + item.setProjectCode(w.getProjectCode()); + item.setArea(w.getArea()); + item.setAreaCode(w.getAreaCode()); item.setCreateOn(w.getCreateOn()); item.setDeclaredAmount(w.getDeclareAmount()); item.setStage(w.getStage()); @@ -157,6 +160,9 @@ public class ProjectLibManage { ProjectLibListItemVO item = new ProjectLibListItemVO(); item.setId(w.getId()); item.setProjectName(w.getProjectName()); + item.setProjectCode(w.getProjectCode()); + item.setArea(w.getArea()); + item.setAreaCode(w.getAreaCode()); item.setCreateOn(w.getCreateOn()); item.setDeclaredAmount(w.getDeclareAmount()); item.setStage(w.getStage()); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java index 375dc13..20bd972 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java @@ -39,6 +39,15 @@ public class ProjectLibListItemVO { @ApiModelProperty("项目ID") private Long id; + @ApiModelProperty("项目编号") + private String projectCode; + + @ApiModelProperty("区域") + private String area; + + @ApiModelProperty("区域Code") + private String areaCode; + @ApiModelProperty("项目名称") private String projectName; @@ -127,9 +136,6 @@ public class ProjectLibListItemVO { @ApiModelProperty("能否被预审申报") private Boolean canPreDeclared = Boolean.FALSE; - @ApiModelProperty("21位项目编号") - private String projectCode; - @ApiModelProperty("是否有上级条线主管部门 0没有 1有") private Integer isHigherSuperOrg; diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/password/PasswordTest.java b/pmapi/src/test/java/com/ningdatech/pmapi/password/PasswordTest.java new file mode 100644 index 0000000..dc34917 --- /dev/null +++ b/pmapi/src/test/java/com/ningdatech/pmapi/password/PasswordTest.java @@ -0,0 +1,26 @@ +package com.ningdatech.pmapi.password; + +import org.junit.Test; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.crypto.password.PasswordEncoder; + +/** + * @Classname PasswordTest + * @Description + * @Date 2023/8/2 17:39 + * @Author PoffyZhang + */ +public class PasswordTest { + + @Test + public void password(){ + String mingwen = "ELgaCeHteZA8VJK8"; + + String miwen = "$2a$10$MT82RbInrIkRVL/GRS01Vew8AO6ICngOpbAGbdkWgSnYFhog5n8.q"; + + String encode = new BCryptPasswordEncoder().encode(mingwen); + boolean matches = new BCryptPasswordEncoder().matches(mingwen, encode); + System.out.println(encode); + System.out.println(matches); + } +} From 6a7d416e19624e1bc657f5bcdc4c278e0c9a0652 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 3 Aug 2023 10:38:45 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=97=B4=E9=9A=94?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ningdatech/pmapi/staging/utils/ProjectStatusFlowUtil.java | 1 + 1 file changed, 1 insertion(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/staging/utils/ProjectStatusFlowUtil.java b/pmapi/src/main/java/com/ningdatech/pmapi/staging/utils/ProjectStatusFlowUtil.java index 4e9127d..293a4e7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/staging/utils/ProjectStatusFlowUtil.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/staging/utils/ProjectStatusFlowUtil.java @@ -31,6 +31,7 @@ public class ProjectStatusFlowUtil { * value: lambda表达式,最终会获取发起实例的函数 */ public ProjectStatusFlowUtil(){ + intervalTimeMap.put(0,60); intervalTimeMap.put(1,60 * 2); intervalTimeMap.put(2,60 * 6); intervalTimeMap.put(3,60 * 15); From a1d8bf52c7752b824e1752b888efe7019cf82c66 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Thu, 3 Aug 2023 10:46:15 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B1=A5=E8=81=8C?= =?UTF-8?q?=E8=AF=84=E4=BB=B7=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/MeetingExpertJudgeController.java | 4 +- .../entity/enumeration/ExpertJudgeEnum.java | 49 ++++++++++++++++++++++ .../meeting/entity/req/MeetingExpertJudgeReq.java | 34 +++++++++++---- .../meeting/manage/MeetingExpertJudgeManage.java | 13 ++++++ 4 files changed, 91 insertions(+), 9 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/enumeration/ExpertJudgeEnum.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingExpertJudgeController.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingExpertJudgeController.java index 5aaed94..2398c1f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingExpertJudgeController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingExpertJudgeController.java @@ -2,10 +2,12 @@ package com.ningdatech.pmapi.meeting.controller; import com.ningdatech.pmapi.meeting.entity.req.MeetingExpertJudgeReq; +import com.ningdatech.pmapi.meeting.entity.req.MeetingExpertJudgeReq.Basic; import com.ningdatech.pmapi.meeting.manage.MeetingExpertJudgeManage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; @@ -28,7 +30,7 @@ public class MeetingExpertJudgeController { @ApiOperation("保存履职评价") @PostMapping("/submit") - public void saveExpertJudge(@Valid @RequestBody MeetingExpertJudgeReq req) { + public void saveExpertJudge(@Validated(Basic.class) @RequestBody MeetingExpertJudgeReq req) { expertJudgeManage.saveExpertJudge(req); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/enumeration/ExpertJudgeEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/enumeration/ExpertJudgeEnum.java new file mode 100644 index 0000000..cfea76b --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/enumeration/ExpertJudgeEnum.java @@ -0,0 +1,49 @@ +package com.ningdatech.pmapi.meeting.entity.enumeration; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + *

+ * ExpertJudgeEnum + *

+ * + * @author WendyYang + * @since 2023/8/3 + **/ +public class ExpertJudgeEnum { + + private ExpertJudgeEnum() { + } + + @Getter + @AllArgsConstructor + public enum AttendStatus { + ON_TIME(1, "准时"), + BE_LATE(2, "迟到"), + ABSENT(3, "缺席"); + + private final Integer code; + private final String value; + + public boolean eq(Integer code) { + return this.code.equals(code); + } + } + + @Getter + @AllArgsConstructor + public enum Performance { + + POSITIVE(1, "积极"), + NEGATIVE(2, "消极"); + + private final Integer code; + private final String value; + + public boolean eq(Integer code) { + return this.code.equals(code); + } + } + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/MeetingExpertJudgeReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/MeetingExpertJudgeReq.java index e31da87..841c551 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/MeetingExpertJudgeReq.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/MeetingExpertJudgeReq.java @@ -7,6 +7,9 @@ import lombok.Data; import javax.validation.constraints.NotNull; import java.time.LocalDateTime; +import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertJudgeEnum; +import org.hibernate.validator.constraints.Range; + /** *

* MeetingExpertJudgeReq @@ -20,34 +23,41 @@ public class MeetingExpertJudgeReq { private Long id; - @NotNull(message = "会议ID不能为空") + @NotNull(message = "会议ID不能为空", groups = Basic.class) private Long meetingId; - @NotNull(message = "会议专家ID不能为空") + @NotNull(message = "会议专家ID不能为空", groups = Basic.class) private Long meetingExpertId; @ApiModelProperty("评分(1~10)") - @NotNull(message = "评分不能为空") + @NotNull(message = "评分不能为空", groups = Basic.class) + @Range(min = 1, max = 10, message = "评分范围为:1~10") private Integer score; + /** + * @see ExpertJudgeEnum.AttendStatus + */ @ApiModelProperty("是否参加:1 准时、2 迟到、3 缺席") - @NotNull(message = "是否参加不能为空") + @NotNull(message = "是否参加不能为空", groups = Basic.class) private Integer attended; + /** + * @see ExpertJudgeEnum.Performance + */ @ApiModelProperty("参与程度:1 积极、2 消极") - @NotNull(message = "参与度不能为空") + @NotNull(message = "参与度不能为空", groups = Attend.class) private Integer performance; @ApiModelProperty("是否提出建议:true 是、false 否") - @NotNull(message = "是否提出建议不能为空") + @NotNull(message = "是否提出建议不能为空", groups = Attend.class) private Boolean advised; @ApiModelProperty("是否早退:true 早退、false 未早退") - @NotNull(message = "是否早退不能为空") + @NotNull(message = "是否早退不能为空", groups = Attend.class) private Boolean leaveEarly; @ApiModelProperty("是否违规:true 是、false 否") - @NotNull(message = "是否违规不能为空") + @NotNull(message = "是否违规不能为空", groups = Attend.class) private Boolean brokeRule; @ApiModelProperty("违规内容") @@ -56,4 +66,12 @@ public class MeetingExpertJudgeReq { @JSONField(format = "yyyy-MM-dd HH:mm:ss") private LocalDateTime createOn; + //================================================================================================================== + + public interface Attend { + } + + public interface Basic { + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingExpertJudgeManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingExpertJudgeManage.java index 94d1dde..f16ff12 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingExpertJudgeManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingExpertJudgeManage.java @@ -4,19 +4,25 @@ import cn.hutool.core.bean.BeanUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.basic.exception.BizException; +import com.ningdatech.basic.util.CollUtils; +import com.ningdatech.basic.util.ValidUtil; import com.ningdatech.cache.lock.DistributedLock; import com.ningdatech.pmapi.meeting.entity.domain.Meeting; import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpertJudge; import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; +import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertJudgeEnum; import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatusEnum; import com.ningdatech.pmapi.meeting.entity.req.MeetingExpertJudgeReq; +import com.ningdatech.pmapi.meeting.entity.req.MeetingExpertJudgeReq.Attend; import com.ningdatech.pmapi.meeting.service.IMeetingExpertJudgeService; import com.ningdatech.pmapi.meeting.service.IMeetingExpertService; import com.ningdatech.pmapi.meeting.service.IMeetingService; import lombok.AllArgsConstructor; import org.springframework.stereotype.Component; +import java.util.Map; + /** *

* MeetingExpertJudgeManage @@ -46,6 +52,13 @@ public class MeetingExpertJudgeManage { throw BizException.wrap("履职评价失败,请重试"); } try { + if (!ExpertJudgeEnum.AttendStatus.ABSENT.eq(req.getAttended())) { + Map validMap = ValidUtil.valid(req, Attend.class); + if (!validMap.isEmpty()) { + String errMsg = CollUtils.joinByComma(validMap.values()); + throw BizException.wrap(errMsg); + } + } // 会议状态校验 Meeting meeting = meetingService.getById(req.getMeetingId()); if (meeting == null || MeetingStatusEnum.CANCELED.eq(meeting.getStatus())) {