Browse Source

feat: 可靠性项目管理

NickOooo 3 weeks ago
parent
commit
b90b0a10c7

+ 5 - 24
nationrel-module-project-api/src/main/java/com/nationrel/modules/project/jar/dto/input/Rb0300142InitInput.java

@@ -1,5 +1,6 @@
 package com.nationrel.modules.project.jar.dto.input;
 
+import lombok.Data;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Component;
 
@@ -12,6 +13,7 @@ import java.io.Serializable;
  * @Author ted.liu
  * @CreateDate 2013-12-24
  */
+@Data
 @Component
 @Scope("prototype")
 public class Rb0300142InitInput implements Serializable {
@@ -31,31 +33,10 @@ public class Rb0300142InitInput implements Serializable {
      */
     private String staffId;
 
-    /**
-     * @return the selectType
-     */
-    public Integer getSelectType() {
-        return selectType;
-    }
+    private String projectId;
 
-    /**
-     * @param selectType the selectType to set
-     */
-    public void setSelectType(Integer selectType) {
-        this.selectType = selectType;
-    }
+    private String tgId;
 
-    /**
-     * @return the staffId
-     */
-    public String getStaffId() {
-        return staffId;
-    }
+    private String taskId;
 
-    /**
-     * @param staffId the staffId to set
-     */
-    public void setStaffId(String staffId) {
-        this.staffId = staffId;
-    }
 }

+ 5 - 54
nationrel-module-project-api/src/main/java/com/nationrel/modules/project/jar/dto/input/Rb0300142SaveInput.java

@@ -1,5 +1,6 @@
 package com.nationrel.modules.project.jar.dto.input;
 
+import lombok.Data;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Component;
 
@@ -13,6 +14,7 @@ import java.util.Date;
  * @Author ted.liu
  * @CreateDate 2013-12-24
  */
+@Data
 @Component
 @Scope("prototype")
 public class Rb0300142SaveInput implements Serializable {
@@ -42,60 +44,9 @@ public class Rb0300142SaveInput implements Serializable {
      */
     private Date startTime;
 
-    /**
-     * @return the selectType
-     */
-    public Integer getSelectType() {
-        return selectType;
-    }
-
-    /**
-     * @param selectType the selectType to set
-     */
-    public void setSelectType(Integer selectType) {
-        this.selectType = selectType;
-    }
-
-    /**
-     * @return the staffId
-     */
-    public String getStaffId() {
-        return staffId;
-    }
-
-    /**
-     * @param staffId the staffId to set
-     */
-    public void setStaffId(String staffId) {
-        this.staffId = staffId;
-    }
+    private String projectId;
+    private String tgId;
+    private String taskId;
 
-    /**
-     * @return the roleId
-     */
-    public String getRoleId() {
-        return roleId;
-    }
-
-    /**
-     * @param roleId the roleId to set
-     */
-    public void setRoleId(String roleId) {
-        this.roleId = roleId;
-    }
-
-    /**
-     * @return the startTime
-     */
-    public Date getStartTime() {
-        return startTime;
-    }
-
-    /**
-     * @param startTime the startTime to set
-     */
-    public void setStartTime(Date startTime) {
-        this.startTime = startTime;
-    }
 
 }

+ 5 - 24
nationrel-module-project-api/src/main/java/com/nationrel/modules/project/jar/dto/input/Rb0300143DeleteInput.java

@@ -1,5 +1,6 @@
 package com.nationrel.modules.project.jar.dto.input;
 
+import lombok.Data;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Component;
 
@@ -12,6 +13,7 @@ import java.io.Serializable;
  * @Author ted.liu
  * @CreateDate 2013-12-24
  */
+@Data
 @Component
 @Scope("prototype")
 public class Rb0300143DeleteInput implements Serializable {
@@ -31,31 +33,10 @@ public class Rb0300143DeleteInput implements Serializable {
      */
     private String staffId;
 
-    /**
-     * @return the selectType
-     */
-    public Integer getSelectType() {
-        return selectType;
-    }
+    private String projectId;
 
-    /**
-     * @param selectType the selectType to set
-     */
-    public void setSelectType(Integer selectType) {
-        this.selectType = selectType;
-    }
+    private String tgId;
 
-    /**
-     * @return the staffId
-     */
-    public String getStaffId() {
-        return staffId;
-    }
+    private String taskId;
 
-    /**
-     * @param staffId the staffId to set
-     */
-    public void setStaffId(String staffId) {
-        this.staffId = staffId;
-    }
 }

+ 2 - 1
nationrel-module-project-biz/src/main/java/com/nationrel/modules/project/controller/Rb0300143Controller.java

@@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
@@ -30,7 +31,7 @@ public class Rb0300143Controller {
 
     @AutoLog(value = "成员删除的业务方法")
     @Operation(summary="成员删除的业务方法")
-    @RequestMapping(value = "/delete", method = {RequestMethod.PUT,RequestMethod.POST})
+    @DeleteMapping(value = "/delete")
     public Result<?> delete(Rb0300143DeleteInput input) {
         Rb0300143DeleteOutput output = new Rb0300143DeleteOutput();
         try {

+ 24 - 17
nationrel-module-project-biz/src/main/java/com/nationrel/modules/project/jar/service/impl/Rb0300142InitServiceImpl.java

@@ -15,6 +15,7 @@ import com.nationrel.modules.project.jar.service.PmTgService;
 import com.nationrel.modules.project.jar.service.Rb0300142InitService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 
 import java.util.List;
 import java.util.Map;
@@ -63,53 +64,59 @@ public class Rb0300142InitServiceImpl implements Rb0300142InitService {
         switch (selectStaffType) {
             case 1:
                 // 获取当前项目成员信息
-                String projectId = StringUtil.parseString(SessionUtil.getAttribute(SessionKeys.RB03001_PROJECT_ID));
-                List<Map<String, Object>> pmProjectStaffs = pmProjectStaffMapper.selectPmProjectStaffsByProjectId(projectId, staffId);
-                output.setStaffMap(pmProjectStaffs.get(0));
+//                String projectId = input.getProjectId();
+               /* List<Map<String, Object>> pmProjectStaffs = pmProjectStaffMapper.selectPmProjectStaffsByProjectId(projectId, staffId);
+                if (CollectionUtils.isEmpty(pmProjectStaffs)) {
+                    throw new OptimisticLockException(MessageId.W009803);
+                }*/
 
                 // 成员角色取得并设置到输出
                 output.setRoles(pmProjectRoleMapper.selectRoleByResourceType(ReliaFlowConstants.RESOURCE_PROJECT_TYPE));
                 break;
             case 2:
-                String tgId = StringUtil.parseString(SessionUtil.getAttribute(SessionKeys.RB03002_TG_ID));
+                String tgId = input.getTgId();
 
                 // 检查TG是否存在
                 pmTgService.checkTgExist(tgId);
 
                 // 获取当前TG成员信息
-                List<Map<String, Object>> pmTgStaffs = pmTgStaffMapper.selectPmTgStaffsByTgId(tgId, staffId);
+//                List<Map<String, Object>> pmTgStaffs = pmTgStaffMapper.selectPmTgStaffsByTgId(tgId, staffId);
 
                 // 检查成员信息是否存在
-                if (pmTgStaffs == null || pmTgStaffs.size() <= 0) {
-                    throw new OptimisticLockException(MessageId.W009803);
-                }
+//                if (CollectionUtils.isEmpty(pmTgStaffs)) {
+//                    throw new OptimisticLockException(MessageId.W009803);
+//                }
 
                 // 保存version number 到session
-                Object versionNumber = pmTgStaffs.get(0).get(PmMapKeySet.KEY_S_PJ_VERSION_NO);
-                SessionUtil.setAttribute(SessionKeys.RB_PJ_TG_STAFF_VERSION, versionNumber);
+//                Object versionNumber = pmTgStaffs.get(0).get(PmMapKeySet.KEY_S_PJ_VERSION_NO);
+//                SessionUtil.setAttribute(SessionKeys.RB_PJ_TG_STAFF_VERSION, versionNumber);
 
                 // 设置成员信息到输出
-                output.setStaffMap(pmTgStaffs.get(0));
+//                output.setStaffMap(pmTgStaffs.get(0));
                 output.setRoles(pmProjectRoleMapper.selectRoleByResourceType(ReliaFlowConstants.RESOURCE_TG_TYPE));
                 break;
             case 3:
-                String tgIdTask = StringUtil.parseString(SessionUtil.getAttribute(SessionKeys.RB03002_TG_ID));
+                String tgIdTask = input.getTgId();
 
                 // 检查TG是否存在
                 pmTgService.checkTgExist(tgIdTask);
 
                 // 获取当前Task成员信息
-                String taskId = StringUtil.parseString(SessionUtil.getAttribute(SessionKeys.RB03003_TASK_ID));
+                String taskId = input.getTaskId();
 
                 // 检查任务是否存在
                 pmTaskService.checkTaskExist(taskId);
 
-                List<Map<String, Object>> pmTaskStaffs = pmTaskStaffMapper.selectPmTaskStaffsByTaskId(taskId, staffId);
-                output.setStaffMap(pmTaskStaffs.get(0));
+                /*List<Map<String, Object>> pmTaskStaffs = pmTaskStaffMapper.selectPmTaskStaffsByTaskId(taskId, staffId);
+                if (CollectionUtils.isEmpty(pmTaskStaffs)) {
+                    throw new OptimisticLockException(MessageId.W009803);
+                }*/
+
+//                output.setStaffMap(pmTaskStaffs.get(0));
 
                 // 保存version number 到session
-                Object versionNumberTask = pmTaskStaffs.get(0).get(PmMapKeySet.KEY_S_PJ_VERSION_NO);
-                SessionUtil.setAttribute(SessionKeys.RB_PJ_TASK_MEMBER_EDIT_VERSION, versionNumberTask);
+//                Object versionNumberTask = pmTaskStaffs.get(0).get(PmMapKeySet.KEY_S_PJ_VERSION_NO);
+//                SessionUtil.setAttribute(SessionKeys.RB_PJ_TASK_MEMBER_EDIT_VERSION, versionNumberTask);
 
                 // 成员角色取得并设置到输出
                 output.setRoles(pmProjectRoleMapper.selectRoleByResourceType(ReliaFlowConstants.RESOURCE_TASK_TYPE));

+ 8 - 8
nationrel-module-project-biz/src/main/java/com/nationrel/modules/project/jar/service/impl/Rb0300142SaveServiceImpl.java

@@ -74,7 +74,7 @@ public class Rb0300142SaveServiceImpl implements Rb0300142SaveService {
             case 1:
 
                 // 项目成员取得
-                String projectId = StringUtil.parseString(SessionUtil.getAttribute(SessionKeys.RB03001_PROJECT_ID));
+                String projectId = input.getProjectId();
                 String staffId = input.getStaffId();
                 PmProjectStaff pmProjectStaff = pmProjectStaffMapper.selectByPrimaryKey(projectId, staffId);
 
@@ -89,7 +89,7 @@ public class Rb0300142SaveServiceImpl implements Rb0300142SaveService {
             case 2:
 
                 // TG成员取得
-                String tgId = StringUtil.parseString(SessionUtil.getAttribute(SessionKeys.RB03002_TG_ID));
+                String tgId = input.getTgId();
 
                 // 1.检查TG是否存在
                 pmTgService.checkTgExist(tgId);
@@ -100,13 +100,13 @@ public class Rb0300142SaveServiceImpl implements Rb0300142SaveService {
                     throw new OptimisticLockException(MessageId.W009803);
                 } else {
 
-                    // 获取session中TG version number
+                    /*// 获取session中TG version number
                     Integer versionNumber = Integer.parseInt(SessionUtil.getAttribute(SessionKeys.RB_PJ_TG_STAFF_VERSION).toString());
 
                     // 3.检查version number 是否一致
                     if (!pmTgStaff.getVersionNo().equals(versionNumber)) {
                         throw new OptimisticLockException(MessageId.W009801);
-                    }
+                    }*/
                 }
 
                 // 保存TG成员信息到数据库
@@ -119,23 +119,23 @@ public class Rb0300142SaveServiceImpl implements Rb0300142SaveService {
                 break;
             case 3:
                 // TG成员取得
-                String tgIdTask = StringUtil.parseString(SessionUtil.getAttribute(SessionKeys.RB03002_TG_ID));
+                String tgIdTask = input.getTgId();
 
                 // 1.检查TG是否存在
                 pmTgService.checkTgExist(tgIdTask);
 
                 // task成员取得
-                String taskId = StringUtil.parseString(SessionUtil.getAttribute(SessionKeys.RB03003_TASK_ID));
+                String taskId = input.getTaskId();
 
                 // 2.检查任务是否存在
                 pmTaskService.checkTaskExist(taskId);
 
                 // 3.任务人员基本信息编辑排它处理
                 PmTaskStaff pmTaskStaff = pmTaskStaffMapper.selectByPrimaryKey(taskId, input.getStaffId());
-                Integer versionLock = Integer.parseInt(StringUtil.parseString(SessionUtil.getAttribute(SessionKeys.RB_PJ_TASK_MEMBER_EDIT_VERSION)));
+                /*Integer versionLock = Integer.parseInt(StringUtil.parseString(SessionUtil.getAttribute(SessionKeys.RB_PJ_TASK_MEMBER_EDIT_VERSION)));
                 if (pmTaskStaff == null || !versionLock.equals(pmTaskStaff.getVersionNo())) {
                     throw new OptimisticLockException(MessageId.W009801);
-                }
+                }*/
 
                 // 保存task成员信息到数据库
                 pmTaskStaff.setProjectRoleId(input.getRoleId());

+ 5 - 5
nationrel-module-project-biz/src/main/java/com/nationrel/modules/project/jar/service/impl/Rb0300143DeleteServiceImpl.java

@@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.Map;
 
@@ -70,7 +71,7 @@ public class Rb0300143DeleteServiceImpl implements Rb0300143DeleteService {
         switch (selectStaffType) {
             case 1:
                 // 项目成员删除
-                String projectId = StringUtil.parseString(SessionUtil.getAttribute(SessionKeys.RB03001_PROJECT_ID));
+                String projectId = input.getProjectId();
                 List<Map<String, String>> tgReferenceStaff = pmTgStaffMapper.searchTgReferenceStaff(projectId, staffId);
                 if (tgReferenceStaff.size() > 0) {
 
@@ -86,7 +87,7 @@ public class Rb0300143DeleteServiceImpl implements Rb0300143DeleteService {
                 }
                 break;
             case 2:
-                String tgId = StringUtil.parseString(SessionUtil.getAttribute(SessionKeys.RB03002_TG_ID));
+                String tgId = input.getTgId();
 
                 // 1.检查TG是否存在
                 pmTgService.checkTgExist(tgId);
@@ -113,12 +114,12 @@ public class Rb0300143DeleteServiceImpl implements Rb0300143DeleteService {
                 }
                 break;
             case 3:
-                String tgIdTask = StringUtil.parseString(SessionUtil.getAttribute(SessionKeys.RB03002_TG_ID));
+                String tgIdTask = input.getTgId();
 
                 // 1.检查TG是否存在
                 pmTgService.checkTgExist(tgIdTask);
 
-                String taskId = StringUtil.parseString(SessionUtil.getAttribute(SessionKeys.RB03003_TASK_ID));
+                String taskId = input.getTaskId();
 
                 // 2.检查任务是否存在
                 pmTaskService.checkTaskExist(taskId);
@@ -152,5 +153,4 @@ public class Rb0300143DeleteServiceImpl implements Rb0300143DeleteService {
         // 返回成功
         return result;
     }
-
 }