Explorar o código

调整履职计划

luojun %!s(int64=2) %!d(string=hai) anos
pai
achega
a84db817c0

+ 6 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/controller/ApiPlanController.java

@@ -5,6 +5,7 @@ import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.domain.R;
 import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.core.resumption.domain.AppPlan;
+import com.xunmei.core.resumption.domain.AppPlanToItem;
 import com.xunmei.core.resumption.service.AppPlanService;
 import com.xunmei.core.resumption.vo.appPlan.AppPlanVo;
 import com.xunmei.core.resumption.vo.appPlan.RuleItemVo;
@@ -115,7 +116,11 @@ public class ApiPlanController {
         return AjaxResult.success(app);
     }
 
-
+    @ApiOperation(value = "获取详情")
+    @GetMapping(value = "/getPointIds/{id}")
+    public AjaxResult getPointIds(@PathVariable  Long id){
+        return AjaxResult.success(appPlanService.selectItemIdsByPlanId(id));
+    }
 
     /**
      * 获取详情数据

+ 2 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/domain/AppPlan.java

@@ -60,7 +60,7 @@ public class AppPlan extends Model<AppPlan> implements Serializable {
     /**
      * 检查机构类型
      */
-    private Integer checkOrgType;
+//    private Integer checkOrgType;
     /**
      * 检查类型:0:机构类型,1:具体机构
      */
@@ -72,6 +72,7 @@ public class AppPlan extends Model<AppPlan> implements Serializable {
     /**
      * 计划状态:0:启用,1禁用
      */
+
     private Integer planStatus;
 
     /**

+ 13 - 5
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/AppPlanService.java

@@ -14,12 +14,14 @@ public interface AppPlanService extends IService<AppPlan> {
 
     /**
      * 获取分页数据
+     *
      * @return
      */
-   Page<AppPlan> selectPage(AppPlanVo info);
+    Page<AppPlan> selectPage(AppPlanVo info);
+
+    List<Long> selectItemIdsByPlanId(Long id);
 
     /**
-     *
      * @param plan_id
      * @return
      */
@@ -29,13 +31,15 @@ public interface AppPlanService extends IService<AppPlan> {
 
     /**
      * 获取规范
+     *
      * @param info
      * @return
      */
-    List<Map<String,Object>> findByOrg(RuleRequestVo info);
+    List<Map<String, Object>> findByOrg(RuleRequestVo info);
 
     /**
      * 检查要点分页
+     *
      * @param info
      * @return
      */
@@ -43,14 +47,16 @@ public interface AppPlanService extends IService<AppPlan> {
 
     /**
      * 新增或者修改
+     *
      * @param app
      * @author 高雄
      * @time 2022/5/5 16:38
      */
-    void saveOrUpdatePlan(AppPlanVo app)throws Exception;
+    void saveOrUpdatePlan(AppPlanVo app) throws Exception;
 
     /**
      * 获取计划详情数据
+     *
      * @param id
      * @return
      */
@@ -58,13 +64,15 @@ public interface AppPlanService extends IService<AppPlan> {
 
     /**
      * 删除计划
+     *
      * @param id
      * @throws Exception
      */
-    void deleted(Long id)throws Exception;
+    void deleted(Long id) throws Exception;
 
     /**
      * 获取履职计划对于的履职角色
+     *
      * @param id
      * @return
      */

+ 21 - 11
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppPlanServiceImpl.java

@@ -52,6 +52,10 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
     @Autowired
     private SysResumptionMapper sysResumptionMapper;
 
+    @Override
+    public List<Long> selectItemIdsByPlanId(Long id) {
+        return appPlanToItemMapper.selectItemIdsByPlanId(id);
+    }
 //    @Autowired
 //    private ResumptionService resumptionService;
 
@@ -104,8 +108,8 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
             String name = (String) redisTemplate.opsForValue().get(key);
             ruleItemVo.setSafeTypeText(name);
 
-            if(ObjectUtil.isNotNull(ruleItemVo.getBusinessType())){
-                key="dict_config_point_business_type_"+ruleItemVo.getBusinessType() ;
+            if (ObjectUtil.isNotNull(ruleItemVo.getBusinessType())) {
+                key = "dict_config_point_business_type_" + ruleItemVo.getBusinessType();
                 name = (String) redisTemplate.opsForValue().get(key);
                 ruleItemVo.setBusinessTypeText(name);
             }
@@ -154,7 +158,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
             AppPlanToItem item = null;
             for (RuleItemVo ruleItemVo : itemList) {
                 item = new AppPlanToItem();
-                item.setItemId(ruleItemVo.getId());
+                item.setItemId(ruleItemVo.getItemId());
                 item.setPlanId(id);
                 item.setPointScan(ruleItemVo.isPointScan());
                 item.setRequired(ruleItemVo.isRequired());
@@ -224,7 +228,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
             AppPlanToItem item = null;
             for (RuleItemVo ruleItemVo : itemList) {
                 item = new AppPlanToItem();
-                item.setItemId(ruleItemVo.getId());
+                item.setItemId(ruleItemVo.getItemId());
                 item.setPlanId(id);
                 item.setPointScan(ruleItemVo.isPointScan());
                 item.setRequired(ruleItemVo.isRequired());
@@ -278,8 +282,8 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
             String key = "dict_config_check_type_" + ruleItemVo.getSafeType();
             String name = (String) redisTemplate.opsForValue().get(key);
             ruleItemVo.setSafeTypeText(name);
-            if(ObjectUtil.isNotNull(ruleItemVo.getBusinessType())){
-                key="dict_config_point_business_type_"+ruleItemVo.getBusinessType() ;
+            if (ObjectUtil.isNotNull(ruleItemVo.getBusinessType())) {
+                key = "dict_config_point_business_type_" + ruleItemVo.getBusinessType();
                 name = (String) redisTemplate.opsForValue().get(key);
                 ruleItemVo.setBusinessTypeText(name);
             }
@@ -304,7 +308,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
         /**
          * 验证计划是否被应用
          */
-        Long num = sysResumptionMapper.selectCount(new QueryWrapper<SysResumption>().eq("planId",id));
+        Long num = sysResumptionMapper.selectCount(new QueryWrapper<SysResumption>().eq("plan_id", id));
         if (num > 0) {
             throw new RuntimeException("计划已生成任务,不能删除!");
         }
@@ -346,7 +350,9 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
         plan.setPlanStatus(app.getPlanStatus());
         plan.setOrgType(app.getExecOrgType());
         plan.setId(app.getId());
+        plan.setPlanType(app.getPlanType());
         plan.setNotResumptionOnRest(app.getNotResumptionOnRest());
+        plan.setExecOrgType(app.getExecOrgType());
 
         return plan;
     }
@@ -355,16 +361,20 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 //        LoginUser loginUser = SecurityUtils.getLoginUser();
         AppPlan plan = new AppPlan();
         plan.setCheckType(app.getExecType());
-        plan.setCheckOrgType(app.getOrgType());
+//        plan.setCheckOrgType(app.getOrgType());
+        plan.setPlanCreateOrgId(app.getPlanCreateOrgId());
+        plan.setPlanCreateOrgName(app.getPlanCreateOrgName());
         Date time = new Date();
-        if(app.getId()==null){
+        if (app.getId() == null) {
             plan.setCreateTime(time);
         }
         plan.setUpdateTime(time);
         plan.setModifiedName(SecurityUtils.getUsername());
         plan.setModifiedBy(SecurityUtils.getUserId());
-        plan.setExecOrgType(app.getOrgType());
+        plan.setExecOrgType(app.getExecOrgType());
         plan.setExecType(app.getExecType());
+        plan.setPlanType(app.getPlanType());
+        plan.setCount(app.getCount());
 
         plan.setDescription(app.getNote());
         plan.setPlanCycle(app.getPlanCycle());
@@ -372,7 +382,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
         plan.setPlanName(app.getPlanName());
 
         plan.setPlanStatus(app.getPlanStatus());
-        plan.setPlanType(0);
+        plan.setDescription(app.getNote());
 
         plan.setId(app.getId());
         plan.setNotResumptionOnRest(app.getNotResumptionOnRest());

+ 11 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/appPlan/AppPlanVo.java

@@ -31,11 +31,13 @@ public class AppPlanVo extends PageDto {
     /**
      * 计划状态
      */
+    @JsonSerialize(using = ToStringSerializer.class)
     private Integer planStatus;
 
     /**
      * 计划周期
      */
+    @JsonSerialize(using = ToStringSerializer.class)
     private Integer planCycle;
 
     /**
@@ -46,21 +48,30 @@ public class AppPlanVo extends PageDto {
     /**
      * 执行时刻
      */
+    @JsonSerialize(using = ToStringSerializer.class)
     private Integer planExec;
 
     /**
      * 执行机构类型
      */
     private Integer orgType;
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Integer planType;
 
     /**
      * 执行机构id
      */
+    @JsonSerialize(using = ToStringSerializer.class)
     private List<Long> orgList;
     /**
      * 执行类型
      */
     private Integer execType;
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Integer execOrgType;
+    private String count;
+    private String planCreateOrgId;
+    private String planCreateOrgName;
 
     /**
      * 备注

+ 1 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/appPlan/RuleItemVo.java

@@ -27,6 +27,7 @@ public class RuleItemVo {
     /**
      * 检查项Id
      */
+    @JsonSerialize(using = ToStringSerializer.class)
     private Long itemId;
     /**
      * 检查项描述

+ 2 - 2
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/AppPlanMapper.xml

@@ -126,7 +126,7 @@
 
 
     <select id="selectByPlanId" resultType="com.xunmei.core.resumption.vo.appPlan.RuleItemVo">
-        SELECT a.id,
+        SELECT a.item_id,
                b.name as item_name,
                b.desc as item_desc,
 --                b.item_num,
@@ -139,7 +139,7 @@
                d.name  as ruleName,
                a.business_type as businessType
         FROM (SELECT item_id, point_scan, required FROM sys_plan_to_item WHERE plan_id = #{planId}) h
-                 LEFT JOIN core_resumption_rule_point a ON h.item_id = a.id
+                 LEFT JOIN core_resumption_rule_point a ON h.item_id = a.item_id
                  LEFT JOIN core_resumption_rule_item b ON a.item_id = b.id
                  LEFT JOIN sys_area c ON a.area_id = c.id
                  LEFT JOIN core_resumption_rule d on b.rule_id = d.id