Browse Source

目标责任书明细

wangchangsheng 2 years ago
parent
commit
8514826f4f

+ 6 - 5
ims-service/ims-eval/src/main/java/com/ims/eval/controller/ResponsibilityIndicatorInfoController.java

@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -36,15 +37,15 @@ public class ResponsibilityIndicatorInfoController {
 
 	/**
 	 *
-	 * @param deptResponsibilityId 目标责任书id
+	 * @param deptResponsibilityIds 目标责任书id
 	 * @return
 	 */
 	//@ImsPreAuth("eval:responsibilityIndicatorInfo:view")
-	@GetMapping(value = "listBy")
-	public R listByresponsibilityId(
-				  @RequestParam(value = "deptResponsibilityId", required = false) String deptResponsibilityId,
+	@GetMapping(value = "planValueList")
+	public R listByresponsibilityIds(
+				  @RequestParam(value = "deptResponsibilityIds", required = false) List<String> deptResponsibilityIds,
 				  @RequestParam(value = "dept", required = false) String dept) {
-		List<ResponsibilityIndicatorInfo> list = responsibilityIndicatorInfoService.listByresponsibilityId(deptResponsibilityId, dept);
+		Map list = responsibilityIndicatorInfoService.listByresponsibilityId(deptResponsibilityIds, dept);
 		return R.ok().data(list);
 	}
 

+ 5 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/dao/ResponsibilityIndicatorInfoMapper.java

@@ -2,6 +2,8 @@ package com.ims.eval.dao;
 
 import com.ims.eval.entity.ResponsibilityIndicatorInfo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ims.eval.entity.dto.response.ResponsibilityIndicatorInfoResDTO;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -18,6 +20,8 @@ import java.util.List;
 public interface ResponsibilityIndicatorInfoMapper extends BaseMapper<ResponsibilityIndicatorInfo> {
 
 
-	List<ResponsibilityIndicatorInfo> listByresponsibilityId(String deptResponsibilityId, String dept);
+	List<ResponsibilityIndicatorInfoResDTO> listByresponsibilityId(@Param("deptResponsibilityIds") List<String> deptResponsibilityIds,
+																   @Param("dept") String dept,
+																   @Param("optionCode") String optionCode);
 
 }

+ 91 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/entity/dto/response/ResponsibilityIndicatorInfoResDTO.java

@@ -0,0 +1,91 @@
+package com.ims.eval.entity.dto.response;
+
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+
+@Data
+@ApiModel(value = "目标责任书明细响应类", description = "目标责任书明细响应类")
+public class ResponsibilityIndicatorInfoResDTO {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键id
+	 */
+	private String id;
+
+	/**
+	 * 指标ID
+	 */
+	private String indicatorId;
+
+	/**
+	 * 能否量化
+	 */
+	private String isQuantified;
+
+	/**
+	 * 业务阶段
+	 */
+	private String stageName;
+
+	/**
+	 * 业务板块
+	 */
+	private String sectionName;
+
+	/**
+	 * 组织名
+	 */
+	private String organizationName;
+
+	/**
+	 * 责任部门
+	 */
+	private String deptName;
+
+
+	/**
+	 * 指标类别
+	 */
+	private String typeName;
+
+	/**
+	 * 指标名
+	 */
+	private String indicatorName;
+
+	/**
+	 * 指标子名
+	 */
+	private String childName;
+
+	/**
+	 * 指标项
+	 */
+	private String optionName;
+
+	/**
+	 * 指标项Code
+	 */
+	private String optionCode;
+
+	/**
+	 * 量化值
+	 */
+	private double quantifiedValue;
+
+	/**
+	 * 非量化值
+	 */
+	private String nonQuantifiedValue;
+
+	/**
+	 * 指标单位
+	 */
+	private String unit;
+
+
+}

+ 3 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/service/IResponsibilityIndicatorInfoService.java

@@ -2,8 +2,10 @@ package com.ims.eval.service;
 
 import com.ims.eval.entity.ResponsibilityIndicatorInfo;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.ims.eval.entity.dto.response.ResponsibilityIndicatorInfoResDTO;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -18,6 +20,6 @@ import java.util.List;
 public interface IResponsibilityIndicatorInfoService extends IService<ResponsibilityIndicatorInfo> {
 
 
-	List<ResponsibilityIndicatorInfo>listByresponsibilityId(String deptResponsibilityId, String dept);
+	Map<String  ,List<ResponsibilityIndicatorInfoResDTO>> listByresponsibilityId(List<String> deptResponsibilityIds, String dept);
 
 }

+ 13 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/DeptResponsibilityServiceImpl.java

@@ -150,6 +150,18 @@ public class DeptResponsibilityServiceImpl extends ServiceImpl<DeptResponsibilit
 		if (null == oriResponsibility) {
 			throw new CustomException("此目标责任书不存在");
 		}
+
+		QueryWrapper<ResponsibilityIndicatorInfo> infoqw =  new QueryWrapper<>();
+		infoqw.lambda().eq(ResponsibilityIndicatorInfo::getDeptResponsibilityId,id);
+		int infcount = responsibilityIndicatorInfoService.count(infoqw);
+		if (infcount>0) {
+			throw new CustomException("编号"+oriResponsibility.getResponsibilityCode()+"的责任书已启动;不允许重复操作");
+		}
+
+		oriResponsibility.setStage("流程启动");
+		baseMapper.updateById(oriResponsibility);
+
+
 		//获取指定部门的规则
 		OrganizationEvaluationRule evaluationRule = organizationEvaluationRuleService.getById(oriResponsibility.getOrganizationEvaluationRuleId());
 		if (null == evaluationRule) {
@@ -259,7 +271,7 @@ public class DeptResponsibilityServiceImpl extends ServiceImpl<DeptResponsibilit
 			oriList = list(evaluationRule.getOrganizationId(), evaluationRule.getEvaluationCycle(), entity.getYear(), entity.getMonth());
 			responsibilityCode.append(entity.getYear()).append("_").append(entity.getMonth()).append("_");
 		}
-		responsibilityCode.append(evaluationRule.getOrganizationId()).append("_");
+		responsibilityCode.append(evaluationRule.getOrganizationId());
 
 
 		if (null != entity && (null == entity.getId() || "".equals(entity.getId().trim()))) {

+ 1 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/OrganizationEvaluationRuleServiceImpl.java

@@ -165,6 +165,7 @@ public class OrganizationEvaluationRuleServiceImpl extends ServiceImpl<Organizat
 		QueryWrapper<OrganizationEvaluationRule> qw = new QueryWrapper<>();
 		qw.lambda().eq(OrganizationEvaluationRule::getOrganizationId, entity.getOrganizationId());
 		qw.lambda().eq(OrganizationEvaluationRule::getEvaluationCycle, entity.getEvaluationCycle());
+		qw.lambda().eq(OrganizationEvaluationRule::getDelFlag, false);
 		List<OrganizationEvaluationRule> list = baseMapper.selectList(qw);
 		if (null != list && list.size() > 0) {
 			throw new CustomException("已存在同期考评配置");

+ 14 - 3
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/ResponsibilityIndicatorInfoServiceImpl.java

@@ -1,12 +1,18 @@
 package com.ims.eval.service.impl;
 
+import com.ims.eval.entity.DataDictionary;
 import com.ims.eval.entity.ResponsibilityIndicatorInfo;
 import com.ims.eval.dao.ResponsibilityIndicatorInfoMapper;
+import com.ims.eval.entity.dto.request.IndicatorDictionaryDTO;
+import com.ims.eval.entity.dto.response.ResponsibilityIndicatorInfoResDTO;
 import com.ims.eval.service.IResponsibilityIndicatorInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -24,8 +30,13 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
 
 
 	@Override
-	public List<ResponsibilityIndicatorInfo> listByresponsibilityId(String deptResponsibilityId, String dept) {
-		List<ResponsibilityIndicatorInfo> list = baseMapper.listByresponsibilityId(deptResponsibilityId,dept);
-		return list;
+	public Map<String  ,List<ResponsibilityIndicatorInfoResDTO>> listByresponsibilityId(List<String> deptResponsibilityIds, String dept) {
+		List<ResponsibilityIndicatorInfoResDTO> list = baseMapper.listByresponsibilityId(deptResponsibilityIds,dept,"JHZ");
+
+		Map<String  ,List<ResponsibilityIndicatorInfoResDTO>> map  = list.stream().collect(Collectors.groupingBy(ResponsibilityIndicatorInfoResDTO::getIsQuantified));
+		map.put("quantifiedList", map.remove("是"));
+		map.put("nonQuantifiedList", map.remove("否"));
+		return map;
+
 	}
 }

+ 43 - 1
ims-service/ims-eval/src/main/resources/mappers/ResponsibilityIndicatorInfoMapper.xml

@@ -24,7 +24,49 @@
         id, dept_responsibility_id, indicator_id, indicator_dictionary_id, option_code, is_quantified, quantified_value, non_quantified_value, create_time, create_by, update_time, update_by, remark
     </sql>
 
-    <select id="listByresponsibilityId" resultType="com.ims.eval.entity.ResponsibilityIndicatorInfo">
+    <select id="listByresponsibilityId" resultType="com.ims.eval.entity.dto.response.ResponsibilityIndicatorInfoResDTO">
+
+        select
+        ri.id,
+        ri.indicator_id,
+        ri.is_quantified,
+        be.stage_name,
+        bn.section_name,
+        dr.organization_name,
+        dd.key_name deptName,
+        it.type_name,
+        i.indicator_name,
+        id.child_name,
+        id.option_name,
+        id.option_code,
+        ri.quantified_value,
+        ri.non_quantified_value,
+        i.unit
+        from
+            responsibility_indicator_info ri
+            inner join dept_responsibility dr on dr.id = ri.dept_responsibility_id
+            left join indicator i on ri.indicator_id = i.id
+            left join bin_stage be on i.bin_stage = be.id
+            left join bin_section bn on i.bin_section = bn.id
+            left join indicator_type it on i.indicator_type_id = it.id
+            left join indicator_dictionary id on ri.indicator_dictionary_id = id.id
+            inner join data_dictionary dd on dd.data_key = i.dept
+        <where>
+            ri.dept_responsibility_id in  <foreach item="item" collection="deptResponsibilityIds" separator="," open="(" close=")" index="">'${item}'</foreach>
+
+            <if test="optionCode !=null and optionCode !=''">
+                and id.option_code = #{optionCode}
+            </if>
+
+            <if test="dept !=null and dept !=''">
+                and  dd.key_name = #{dept}
+            </if>
+
+
+        </where>
+
+            order by id.option_code desc
+
 
     </select>