wangchangsheng 2 роки тому
батько
коміт
3c707c5a3a

+ 21 - 3
ims-service/ims-eval/src/main/java/com/ims/eval/controller/OrganizationEvaluationInfoController.java

@@ -1,12 +1,11 @@
 package com.ims.eval.controller;
 
 
-import com.alibaba.fastjson.JSONObject;
 import com.ims.eval.entity.OrganizationEvaluationInfo;
+import com.ims.eval.entity.dto.response.OrganizationEvaluationInfoResDTO;
 import com.ims.eval.entity.dto.result.R;
 import com.ims.eval.service.IOrganizationEvaluationInfoService;
 import com.ims.eval.util.ExcelUtil;
-import io.jsonwebtoken.Claims;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -14,7 +13,6 @@ import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
-import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.List;
@@ -58,6 +56,26 @@ public class OrganizationEvaluationInfoController {
 	}
 
 
+
+
+	/**
+	 * @param organizationEvaluationId 目标责任书id
+	 * @return
+	 */
+	//@ImsPreAuth("eval:organizationEvaluationInfo:view")
+	@GetMapping(value = "finishValueListNew")
+	public R finishValueListNew(
+		@RequestParam(value = "organizationEvaluationId", required = false) String organizationEvaluationId,
+		@RequestParam(value = "dept", required = false) String dept,
+		@RequestParam(value = "organizationShortName", required = false) String organizationShortName,
+		@RequestParam(value = "indicatorName", required = false) String indicatorName,
+		@RequestParam(value = "binSection", required = false) String binSection,
+		@RequestParam(value = "isQuantified", required = false) String isQuantified) {
+		List<OrganizationEvaluationInfoResDTO> list = organizationEvaluationInfoService.finishValueList(organizationEvaluationId, dept, organizationShortName,indicatorName,binSection,isQuantified,request);
+		return R.ok().data(list);
+	}
+
+
 	/**
 	 * 批量修改
 	 *

+ 10 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/dao/OrganizationEvaluationInfoMapper.java

@@ -27,6 +27,16 @@ public interface OrganizationEvaluationInfoMapper extends BaseMapper<Organizatio
 																	  @Param("optionCode") String optionCode,
 																	  @Param("organizationId") String organizationId);
 
+
+	List<OrganizationEvaluationInfoResDTO> selectListEvaluationInfoId2(@Param("organizationEvaluationId") String organizationEvaluationId,
+																	  @Param("dept") String dept,
+																	  @Param("organizationShortName") String organizationShortName,
+																	  @Param("indicatorName") String indicatorName,
+																	  @Param("binSection") String binSection,
+																	  @Param("isQuantified")String isQuantified,
+																	  @Param("optionCode") String optionCode,
+																	  @Param("organizationId") String organizationId);
+
 	List<OrganizationEvaluationInfo> selectByEvaluationInfoId(@Param("organizationEvaluationId") String organizationEvaluationId);
 
 

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

@@ -2,7 +2,7 @@ package com.ims.eval.service;
 
 import com.ims.eval.entity.OrganizationEvaluationInfo;
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.ims.eval.entity.dto.request.OrganizationEvaluationInfoUpdateDTO;
+import com.ims.eval.entity.dto.response.OrganizationEvaluationInfoResDTO;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.List;
@@ -24,4 +24,8 @@ public interface IOrganizationEvaluationInfoService extends IService<Organizatio
 
 	boolean saveBatchDto(List<OrganizationEvaluationInfo>  organizationEvaluationInfoList) throws Exception;
 
+
+	//公司名 指标名 业务属性
+	List<OrganizationEvaluationInfoResDTO> finishValueList(String organizationEvaluationId, String dept, String  organizationShortName, String indicatorName, String binSection, String isQuantified, HttpServletRequest request);
+
 }

+ 35 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/OrganizationEvaluationInfoServiceImpl.java

@@ -74,7 +74,7 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 		List<OrganizationEvaluationInfoResDTO> list = baseMapper.selectListEvaluationInfoId(organizationEvaluationId,dept,"",organizationId);//默认获取指定的怎目标
 		boolean finalUpdateMark = updateMark;
 		list.stream().forEach(i->{
-			i.setUpdateMark(i.getDeptName().equals(myuser.getDeptOrg().getShortName()));
+			i.setUpdateMark(true);
 		});
 		Map<String  ,List<OrganizationEvaluationInfoResDTO>> map  = list.stream().collect(Collectors.groupingBy(OrganizationEvaluationInfoResDTO::getIsQuantified));
 		map.put("quantifiedList", map.remove("是"));
@@ -96,6 +96,13 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 						info.setQuantifiedValue(Double.valueOf(entity.getNonQuantifiedValue()));
 					}
 				}
+
+				if("JCF".equals(info.getOptionCode())){//基础分
+					if(StringUtils.isNumber(entity.getNonQuantifiedValue())){
+						info.setQuantifiedValue(Double.valueOf(entity.getNonQuantifiedValue()));
+					}
+				}
+
 				info.setNonQuantifiedValue(entity.getNonQuantifiedValue());//非量化值
 				info.setUpdateTime(new Date());//更新时间
 				info.setUpdateBy(entity.getUpdateBy());//更新者
@@ -153,6 +160,33 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 		return true;
 	}
 
+	@Override
+	public List<OrganizationEvaluationInfoResDTO> finishValueList(String organizationEvaluationId, String dept, String organizationShortName, String indicatorName, String binSection,String isQuantified, HttpServletRequest request) {
+		MyuserResDTO myuser = userService.getSysUser(request);
+		if(null == myuser){
+			throw new CustomException("暂无权限");
+		}
+		String organizationId = "";
+		boolean updateMark = false;
+		if (null != myuser.getUnitOrg() && null != myuser.getUnitOrg().getParentIds()) {
+			String type = myuser.getUnitOrg().getType();
+			if (Constant.THREE.contains(type) || Constant.FOUR.contains(type)) {
+//				dept = myuser.getDeptName();
+				organizationId = myuser.getUnitId();
+			} else if (Constant.SUB_BRANCH.contains(type)) {
+				dept = "";
+			} else if (myuser.getLoginName().equals("admin")) {
+				dept = "";
+				updateMark= true;
+			} else {
+				throw new CustomException("暂无权限");
+			}
+		}
+		List<OrganizationEvaluationInfoResDTO> list = baseMapper.selectListEvaluationInfoId2(organizationEvaluationId,dept,organizationShortName,indicatorName,binSection,isQuantified,"",organizationId);//默认获取指定的怎目标
+
+		return list;
+	}
+
 
 	//todo  后续添加需要计算的指标项
 	public boolean calculateIdicatorItem(List<OrganizationEvaluationInfo> organizationEvaluationInfos){

+ 76 - 0
ims-service/ims-eval/src/main/resources/mappers/OrganizationEvaluationInfoMapper.xml

@@ -110,6 +110,82 @@
             </if>
         </where>
     </select>
+    <select id="selectListEvaluationInfoId2"
+            resultType="com.ims.eval.entity.dto.response.OrganizationEvaluationInfoResDTO">
+
+        select
+        ei.id,
+        oe.id organizationEvaluationId,
+        ei.indicator_id,
+        ei.is_quantified,
+        be.stage_name,
+        be.id binStage,
+        bn.id binSection,
+        bn.section_name,
+        oer.id organizationEvaluationRuleId,
+        oer.organization_name,
+        oer.organization_short_name,
+        dd.key_name deptName,
+        it.type_name,
+        i.indicator_name,
+        id.child_name,
+        id.option_name,
+        id.option_code,
+        ei.quantified_value,
+        ei.non_quantified_value,
+        i.unit,
+        ei.state
+        from
+        organization_evaluation_info ei
+        inner join organization_evaluation_rule oer on oer.id = ei.organization_evaluation_rule_id
+        inner join organization_evaluation oe on oe.id = ei.organization_evaluation_id
+        left join indicator i on ei.indicator_id = i.id
+        left join  evaluate_rule_info ri on ri.indicator_id = i.id and ei.evaluate_rule_info_id = ri.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 ei.indicator_dictionary_id = id.id
+        inner join data_dictionary dd on dd.data_key = i.dept
+        <where>
+
+            <if test="organizationEvaluationId !=null and organizationEvaluationId !=''">
+                and  ei.organization_evaluation_id  = #{organizationEvaluationId}
+            </if>
+
+            <if test="optionCode !=null and optionCode !=''">
+                and ei.option_code = #{optionCode}
+            </if>
+
+            <if test="dept !=null and dept !=''">
+                and  dd.key_name  like   CONCAT('%',#{dept},'%')
+            </if>
+
+            <if test="organizationShortName !=null and organizationShortName !=''">
+                and oer.organization_short_name  like   CONCAT('%',#{organizationShortName},'%')
+            </if>
+
+            <if test="indicatorName !=null and indicatorName !=''">
+                and  i.indicator_name  like   CONCAT('%',#{indicatorName},'%')
+            </if>
+
+            <if test="binSection !=null and binSection !=''">
+                and  bn.id = #{binSection}
+            </if>
+
+            <if test="isQuantified !=null and isQuantified !=''">
+                and  ei.is_quantified = #{isQuantified}
+            </if>
+
+            <if test="organizationId !=null and organizationId !=''">
+                and  oer.organization_id = #{organizationId}
+            </if>
+
+            and id.option_code not in ('CZ','CZMAX','CZMIN','LRGXKLMAX','LRGXKLMIN','DWQWLRMAX','DWQWLRMIN','WCLDF','LRGXKHMAX','LRGXKHMIN')
+        </where>
+
+        order by be.order_num,oer.organization_short_name,bn.order_num,ri.order_num,id.child_code,id.option_code,id.option_order asc
+
+    </select>
 
 
 </mapper>