Browse Source

报告修改提交

wangchangsheng 1 year ago
parent
commit
f59ae892b2
26 changed files with 875 additions and 176 deletions
  1. 1 1
      ims-service/ims-eval/src/main/java/com/ims/eval/controller/EvaluateReportInfoController.java
  2. 1 1
      ims-service/ims-eval/src/main/java/com/ims/eval/controller/OrganizationEvaluationInfoController.java
  3. 21 9
      ims-service/ims-eval/src/main/java/com/ims/eval/controller/YearOperatingCoefficientController.java
  4. 6 0
      ims-service/ims-eval/src/main/java/com/ims/eval/dao/EvaluateRuleMapper.java
  5. 9 1
      ims-service/ims-eval/src/main/java/com/ims/eval/dao/EvaluationScoreCountMapper.java
  6. 8 0
      ims-service/ims-eval/src/main/java/com/ims/eval/dao/MultipleBrandMapper.java
  7. 141 69
      ims-service/ims-eval/src/main/java/com/ims/eval/entity/EvaluateReportInfo.java
  8. 76 0
      ims-service/ims-eval/src/main/java/com/ims/eval/entity/dto/response/EvaluateRuleInfoResDTO.java
  9. 1 1
      ims-service/ims-eval/src/main/java/com/ims/eval/service/IEvaluateReportInfoService.java
  10. 4 0
      ims-service/ims-eval/src/main/java/com/ims/eval/service/IEvaluateRuleService.java
  11. 4 0
      ims-service/ims-eval/src/main/java/com/ims/eval/service/IEvaluationScoreCountService.java
  12. 2 0
      ims-service/ims-eval/src/main/java/com/ims/eval/service/IMultipleBrandService.java
  13. 4 0
      ims-service/ims-eval/src/main/java/com/ims/eval/service/IYearOperatingCoefficientService.java
  14. 66 33
      ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluateReportInfoServiceImpl.java
  15. 342 33
      ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluateReportServiceImpl.java
  16. 7 0
      ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluateRuleServiceImpl.java
  17. 25 0
      ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluatioinScoreCountServiceImpl.java
  18. 5 2
      ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/MultipleBrandServiceImpl.java
  19. 26 14
      ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/OrganizationEvaluationInfoServiceImpl.java
  20. 0 1
      ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/PartyBuildingMultiplierServiceImpl.java
  21. 20 0
      ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/YearOperatingCoefficientServiceImpl.java
  22. 1 1
      ims-service/ims-eval/src/main/java/com/ims/eval/util/ExcelUtil.java
  23. 5 10
      ims-service/ims-eval/src/main/resources/mappers/EvaluateReportInfoMapper.xml
  24. 32 0
      ims-service/ims-eval/src/main/resources/mappers/EvaluateRuleMapper.xml
  25. 31 0
      ims-service/ims-eval/src/main/resources/mappers/EvaluationScoreCountMapper.xml
  26. 37 0
      ims-service/ims-eval/src/main/resources/mappers/MultipleBrandMapper.xml

+ 1 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/controller/EvaluateReportInfoController.java

@@ -38,7 +38,7 @@ public class EvaluateReportInfoController {
 	 */
 	//@ImsPreAuth("eval:dataDictionary:view")
 	@GetMapping(value = "list")
-	public R list(@RequestParam(value = "evaluateReportId", required = true) String evaluateReportId) {
+	public R list(@RequestParam(value = "evaluateReportId", required = true) String evaluateReportId) throws Exception {
 		Map<String,List<Map>> list = evaluateReportInfoService.mapByReportId(evaluateReportId);
 		return R.ok().data(list);
 	}

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

@@ -145,7 +145,7 @@ public class OrganizationEvaluationInfoController {
 //
 
 	@PostMapping(value = "/calculation")
-	@ApiOperation(value = "批量新增(修改)", notes = "批量新增(修改)")
+	@ApiOperation(value = "计算得分", notes = "计算得分")
 	public R calculation(@RequestParam(value = "id", required = false)String id,
 						  @RequestParam(value = "indicatorId", required = false) String indicatorId ,
 						  @RequestParam(value = "organizationEvaluationId", required = false) String organizationEvaluationId,

+ 21 - 9
ims-service/ims-eval/src/main/java/com/ims/eval/controller/YearOperatingCoefficientController.java

@@ -3,19 +3,13 @@ package com.ims.eval.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.ims.eval.config.CustomException;
-import com.ims.eval.entity.Indicator;
-import com.ims.eval.entity.OrganizationEvaluationInfo;
-import com.ims.eval.entity.YearGroupCoefficient;
 import com.ims.eval.entity.YearOperatingCoefficient;
-import com.ims.eval.entity.dto.request.IndicatorDictionaryDTO;
-import com.ims.eval.entity.dto.request.YearGroupCoefficientDTO;
 import com.ims.eval.entity.dto.result.R;
-import com.ims.eval.service.IIndicatorDictionaryService;
-import com.ims.eval.service.IIndicatorService;
-import com.ims.eval.service.IYearGroupCoefficientService;
+
 import com.ims.eval.service.IYearOperatingCoefficientService;
 import com.ims.eval.util.ExcelUtil;
 import io.swagger.annotations.ApiOperation;
+import lombok.extern.log4j.Log4j2;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
@@ -25,7 +19,6 @@ import java.io.InputStream;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Date;
 import java.util.List;
 
 /**
@@ -36,6 +29,7 @@ import java.util.List;
  * @author wang
  * @since 2023-03-17
  */
+@Log4j2
 @RestController
 @RequestMapping("//year-operating-coefficient")
 public class YearOperatingCoefficientController {
@@ -149,8 +143,11 @@ public class YearOperatingCoefficientController {
 	@ResponseBody
 	public R importAlertrule(@RequestParam("file") MultipartFile file, HttpServletRequest request) {
 
+
+
 		if (!file.isEmpty()) {
 			try {
+				String id = request.getParameter("id");
 				//获取原始的文件名
 				String originalFilename = file.getOriginalFilename();
 				//获取文件类型
@@ -166,6 +163,7 @@ public class YearOperatingCoefficientController {
 				SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 				for (String[] str : strings) {
 					YearOperatingCoefficient y = new YearOperatingCoefficient();
+					y.setYearGroupCoefficientId(id);
 					y.setId(str[0]);
 					y.setOrganizationName(str[1]);
 					y.setZzc(Double.parseDouble(str[2]));
@@ -190,10 +188,24 @@ public class YearOperatingCoefficientController {
 					return R.error().data("保存失败!");
 				}
 			} catch (Exception e) {
+				log.info("错误",e);
 				return R.customError(e.getMessage()).data("失败!");
+
 			}
 		}
 		return R.customError("上传文件为空!");
 	}
 
+
+
+	@GetMapping(value = "/getListByOrganizationId")
+	public R getListByOrganizationId(
+		@RequestParam(value = "organizationId", required = false) String organizationId,
+		@RequestParam(value = "binSection", required = false) String binSection,
+		@RequestParam(value = "year", required = false) String year) {
+		List<YearOperatingCoefficient> list = yearOperatingCoefficientService.getListByOrganizationId(organizationId, binSection,year);
+		return R.ok().data(list);
+	}
+
+
 }

+ 6 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/dao/EvaluateRuleMapper.java

@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ims.eval.entity.EvaluateRule;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ims.eval.entity.dto.response.EvaluateRuleInfoResDTO;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  * <p>
  * 考评规则表 Mapper 接口
@@ -21,4 +24,7 @@ public interface EvaluateRuleMapper extends BaseMapper<EvaluateRule> {
 										@Param("binSection") String binSection,
 										@Param("binStage") String binStage);
 
+
+	List <EvaluateRuleInfoResDTO> selectListInIdsInfos(List<String> ids, String binSection, String binStage);
+
 }

+ 9 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/dao/EvaluationScoreCountMapper.java

@@ -24,4 +24,12 @@ public interface EvaluationScoreCountMapper extends BaseMapper<EvaluationScoreCo
 
 
 	List<Map<String, Object>> selectEvaluationList(String binSection, String binStage, String type, String condition, String year, String month);
-}
+
+
+	List<EvaluationScoreCount> selectEvaluationScoreCountList(@Param("organizationEvaluationId")String organizationEvaluationId,
+															  @Param("organizationEvaluationRuleId")String organizationEvaluationRuleId,
+															  @Param("indicatorIds")List<String> indicatorIds,
+															  @Param("stageCode") List<String> stageCode);
+
+
+	}

+ 8 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/dao/MultipleBrandMapper.java

@@ -32,4 +32,12 @@ public interface MultipleBrandMapper extends BaseMapper<MultipleBrand> {
 											   @Param("year") String year,
 											   @Param("month") String month);
 
+	List<MultipleBrand> selectMultipleBranList2(@Param("organizationId") String organizationId,
+											   @Param("parentId") String parentId,
+											   @Param("binSection") String  binSection,
+											   @Param("checkCycle") String  checkCycle,
+											   @Param("year") String year,
+											   @Param("month") String month);
+
+
 }

+ 141 - 69
ims-service/ims-eval/src/main/java/com/ims/eval/entity/EvaluateReportInfo.java

@@ -4,6 +4,7 @@ import java.math.BigDecimal;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
+
 import java.time.LocalDateTime;
 import java.util.Date;
 
@@ -13,8 +14,8 @@ import lombok.EqualsAndHashCode;
 /**
  * <p>
  * 考评报告明细
-
-
+ *
+ *
  * </p>
  *
  * @author wang
@@ -24,73 +25,144 @@ import lombok.EqualsAndHashCode;
 @EqualsAndHashCode(callSuper = true)
 public class EvaluateReportInfo extends Model {
 
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 主键id
-     */
-    private String id;
-
-    /**
-     * 考评报告id
-     */
-    private String evaluateReportId;
-
-    /**
-     * 考评组织ID
-     */
-    private String organizationId;
-
-    /**
-     * 考评组织名称
-     */
-    private String organizationName;
-
-    /**
-     * 业务阶段
-     */
-    private String binStage;
-
-	/**
-	 * 业务阶段
-	 */
-	@TableField(exist = false)
-	private String binStageName;
-
-    /**
-     * 分数
-     */
-    private double score;
-
-    /**
-     * 折算分数
-     */
-    private double discountScore;
-
-    /**
-     * 创建时间
-     */
-    private Date createTime;
-
-    /**
-     * 创建者
-     */
-    private String createBy;
-
-    /**
-     * 更新时间
-     */
-    private Date updateTime;
-
-    /**
-     * 更新者
-     */
-    private String updateBy;
-
-    /**
-     * 备注
-     */
-    private String remark;
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键id
+	 */
+	private String id;
+
+
+	/**
+	 * 考评报告id
+	 */
+	private String evaluateReportId;
+
+
+	/**
+	 * 考评组织ID
+	 */
+	private String organizationId;
+
+	/**
+	 * 考评组织名称
+	 */
+	private String organizationName;
+
+	/**
+	 * 生产经营得分
+	 */
+	private double scjyScore;
+
+	/**
+	 * 前期得分
+	 */
+	private double qqScore;
+
+	/**
+	 * 基建得分
+	 */
+	private double jjScore;
+
+	/**
+	 * 加分项
+	 */
+	private double addScore;
+
+	/**
+	 * 减分项
+	 */
+	private double subScore;
+
+	/**
+	 * 加减分合计
+	 */
+	private double addSubScore;
+
+	/**
+	 * 综合得分
+	 */
+	private double zhScore;
+
+	/**
+	 * 经营业绩系数
+	 */
+	private double jyyjXs;
+
+	/**
+	 * 关键业绩得分
+	 */
+	private double gjyjXs;
+
+	/**
+	 * 党建考核乘数
+	 */
+	private double djkhCs;
+
+	/**
+	 * 分数
+	 */
+	private double score;
+
+	/**
+	 * 折算分数
+	 */
+	private double discountScore;
+
+	/**
+	 * 备注
+	 */
+	private String remark;
+
+
+
+
+
+
+
+//--------------------------------------------------
+//	/**
+//	 * 列标题
+//	 */
+//	private String title;
+//
+//
+//	/**
+//	 * 业务阶段
+//	 */
+//	private String binStage;
+//
+//	/**
+//	 * 业务阶段
+//	 */
+//	@TableField(exist = false)
+//	private String binStageName;
+//
+//	/**
+//	 * 创建时间
+//	 */
+//	private Date createTime;
+//
+//	/**
+//	 * 创建者
+//	 */
+//	private String createBy;
+//
+//	/**
+//	 * 更新时间
+//	 */
+//	private Date updateTime;
+//
+//	/**
+//	 * 更新者
+//	 */
+//	private String updateBy;
+//
+//
+//	/**
+//	 * 描述
+//	 */
+//	private String des;
 
 
 }

+ 76 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/entity/dto/response/EvaluateRuleInfoResDTO.java

@@ -0,0 +1,76 @@
+package com.ims.eval.entity.dto.response;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.ims.eval.entity.EvaluateRuleInfo;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class EvaluateRuleInfoResDTO  extends EvaluateRuleInfo {
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 规则名称
+	 */
+	private String ruleName;
+
+	/**
+	 * 业务版块
+	 */
+
+	private String binSection;
+
+	/**
+	 * 业务版块name
+	 */
+	@TableField(exist = false)
+	private String binSectionName;
+
+	/**
+	 * 业务阶段
+	 */
+	private String binStage;
+
+	/**
+	 * 业务阶段name
+	 */
+	@TableField(exist = false)
+	private String binStageName;
+
+
+	/**
+	 * 描述
+	 */
+	private String des;
+
+	/**
+	 * 创建时间
+	 */
+	private Date createTime;
+
+	/**
+	 * 创建者
+	 */
+	private String createBy;
+
+	/**
+	 * 创建者名称
+	 */
+	private String createName;
+
+	/**
+	 * 更新时间
+	 */
+	private Date updateTime;
+
+	/**
+	 * 更新者
+	 */
+	private String updateBy;
+
+	/**
+	 * 是否启用
+	 */
+	private Boolean enable;
+}

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

@@ -19,7 +19,7 @@ import java.util.Map;
  */
 public interface IEvaluateReportInfoService extends IService<EvaluateReportInfo> {
 
-	Map<String,List<Map>> mapByReportId(String evaluateReportId);
+	Map<String,List<Map>> mapByReportId(String evaluateReportId) throws Exception;
 
 	List<EvaluateReportInfo> listByReportId(String evaluateReportId);
 

+ 4 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/IEvaluateRuleService.java

@@ -3,6 +3,7 @@ package com.ims.eval.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.ims.eval.entity.EvaluateRule;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.ims.eval.entity.dto.response.EvaluateRuleInfoResDTO;
 
 import java.util.List;
 
@@ -25,4 +26,7 @@ public interface IEvaluateRuleService extends IService<EvaluateRule> {
 
 	List<EvaluateRule> listAll(List<String> ids);
 
+	List<EvaluateRuleInfoResDTO> getListInIdsInfos(List<String> ids, String binSection, String binStage);
+
+
 }

+ 4 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/IEvaluationScoreCountService.java

@@ -25,6 +25,10 @@ public interface IEvaluationScoreCountService extends IService<EvaluationScoreCo
 
 	List<EvaluationScoreCount> getEvaluationScoreCountList(String organizationEvaluationId,String organizationEvaluationRuleId,String indicatorId);
 
+	List<EvaluationScoreCount> getEvaluationScoreCountList(String organizationEvaluationId,String organizationEvaluationRuleId,List<String> indicatorIds);
+
+	List<EvaluationScoreCount> getEvaluationScoreCountList(String organizationEvaluationId,String organizationEvaluationRuleId,List<String> indicatorIds,List<String> stageCode);
+
 }
 
 

+ 2 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/IMultipleBrandService.java

@@ -20,4 +20,6 @@ public interface IMultipleBrandService extends IService<MultipleBrand> {
 
 	List<MultipleBrand> getMultipleBranList(String id , String parentId,String  binSection,String  checkCycle,String year,String month);
 
+	List<MultipleBrand> getMultipleBranList2(String organizationId,String parentId,String  binSection,String  checkCycle,String year,String month);
+
 }

+ 4 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/IYearOperatingCoefficientService.java

@@ -20,4 +20,8 @@ public interface IYearOperatingCoefficientService extends IService<YearOperating
 
 	List<YearOperatingCoefficient> listAll(String id, String organizationName, String organizationId, String yearGroupCoefficientId, String binSection, String year);
 
+
+	List<YearOperatingCoefficient> getListByOrganizationId( String organizationId, String binSection, String year);
+
+
 }

+ 66 - 33
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluateReportInfoServiceImpl.java

@@ -1,20 +1,19 @@
 package com.ims.eval.service.impl;
 
+import com.ims.eval.entity.EvaluateReport;
 import com.ims.eval.entity.EvaluateReportInfo;
 import com.ims.eval.dao.EvaluateReportInfoMapper;
-import com.ims.eval.entity.IndicatorDictionary;
-import com.ims.eval.entity.dto.request.IndicatorDictionaryDTO;
-import com.ims.eval.entity.dto.response.ResponsibilityIndicatorInfoResDTO;
 import com.ims.eval.service.IEvaluateReportInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.apache.xmlbeans.impl.jam.mutable.MPackage;
+import com.ims.eval.service.IEvaluateReportService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -29,50 +28,80 @@ import java.util.stream.Collectors;
 @Service
 public class EvaluateReportInfoServiceImpl extends ServiceImpl<EvaluateReportInfoMapper, EvaluateReportInfo> implements IEvaluateReportInfoService {
 
-	@Override
-	public Map<String,List<Map>> mapByReportId(String evaluateReportId) {
 
 
+	@Autowired
+	private IEvaluateReportService evaluateReportService;
+	@Override
+	public Map<String,List<Map>> mapByReportId(String evaluateReportId) throws IllegalAccessException {
 		Map<String,List<Map>> datemap = new LinkedHashMap<>();
-		List<EvaluateReportInfo> list = baseMapper.selectListByReportId(evaluateReportId);
-		List<Map> listmap = new ArrayList<>();
 
-		List<Map> listtitle = new ArrayList<>();
-		list.stream().collect(Collectors.groupingBy(EvaluateReportInfo::getOrganizationId));
 
-		Map<String, List<EvaluateReportInfo>> map = list.stream().collect(Collectors.groupingBy(ord -> ord.getOrganizationId() + "," + ord.getOrganizationName()));
+		Map<String ,String> title = new LinkedHashMap();
+		title.put("p-organizationName","考评组织名称");
+		title.put("p-scjyScore","生产经营得分");
+		title.put("p-qqScore","前期得分");
+		title.put("p-jjScore","基建得分");
+		title.put("y-addScore","加分项");
+		title.put("y-subScore","减分项");
+		title.put("n-addSubScore","加减分合计");
+		title.put("p-zhScore","综合得分");
+		title.put("n-jyyjXs","经营业绩系数");
+		title.put("n-gjyjXs","关键业绩得分");
+		title.put("n-djkhCs","党建考核乘数");
+		title.put("n-score","最终得分");
+		title.put("p-remark","备注");
+
+		EvaluateReport evaluateReport = 	evaluateReportService.getById(evaluateReportId);
 
-		map.forEach((k, v) -> {
-			String[] zb = k.split(",");
-			if(listtitle.size()<=0){
-				Map title = new LinkedHashMap();
-				title.put("nameZh","单位");
-				title.put("nameEh","organizationId");
-				listtitle.add(title);
 
-				for (EvaluateReportInfo info : v) {
-					Map title2 = new LinkedHashMap();
-					title2.put("nameZh",info.getBinStageName());
-					title2.put("nameEh",info.getBinStage());
-					listtitle.add(title2);
+		List<Map> titles = new ArrayList<>();
+		for (String key:title.keySet()){
+			if(key.startsWith("p-")){
+				Map title0 = new LinkedHashMap();
+				title0.put("nameZh",title.get(key));
+				title0.put("nameEh",key.replace("p-",""));
+				titles.add(title0);
+			}
+			if("NDKP".equals(evaluateReport.getCheckCycle())){
+				if(key.startsWith("n-")){
+					Map title1 = new LinkedHashMap();
+					title1.put("nameZh",title.get(key));
+					title1.put("nameEh",key.replace("n-",""));
+					titles.add(title1);
 				}
+			}
+
+
+			if(key.startsWith("y-")){
 				Map title2 = new LinkedHashMap();
-				title2.put("nameZh","备注");
-				title2.put("nameEh","remark");
-				datemap.put("title",listtitle);
+				title2.put("nameZh",title.get(key));
+				title2.put("nameEh",key.replace("y-",""));
+				titles.add(title2);
 			}
+		}
 
+
+
+		datemap.put("title",titles);
+		List<EvaluateReportInfo> list = baseMapper.selectListByReportId(evaluateReportId);
+
+		List<Map> listmap = new ArrayList<>();
+		for(EvaluateReportInfo i: list){
+			Field[] fields = i.getClass().getDeclaredFields();
 			Map m = new LinkedHashMap();
-			m.put("organizationId", zb[1]);
-			for (EvaluateReportInfo info : v) {
-				double c = info.getScore() * info.getDiscountScore();
-				m.put(info.getBinStage(), c);
+			for(Field f : fields){
+				f.setAccessible(true);
+				m.put(f.getName(),f.get(i));
+
 			}
 			listmap.add(m);
-		});
-
+		}
 		datemap.put("body",listmap);
+
+
 		return datemap;
+
 	}
 
 	@Override
@@ -80,4 +109,8 @@ public class EvaluateReportInfoServiceImpl extends ServiceImpl<EvaluateReportInf
 		List<EvaluateReportInfo> list = baseMapper.selectListByReportId(evaluateReportId);
 		return list;
 	}
+
+
+
+
 }

+ 342 - 33
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluateReportServiceImpl.java

@@ -9,6 +9,7 @@ import com.ims.eval.cache.CacheContext;
 import com.ims.eval.config.CustomException;
 import com.ims.eval.entity.*;
 import com.ims.eval.dao.EvaluateReportMapper;
+import com.ims.eval.entity.dto.response.EvaluateRuleInfoResDTO;
 import com.ims.eval.service.*;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -41,28 +42,35 @@ public class EvaluateReportServiceImpl extends ServiceImpl<EvaluateReportMapper,
 	private IEvaluateRuleService evaluateRuleService;
 
 
-
 	@Autowired
 	private IEvaluationScoreCountService evaluationScoreCountService;
 
 	@Autowired
 	private IEvaluateReportInfoService evaluateReportInfoService;
 
+	@Autowired
+	private IMultipleBrandService multipleBrandService;
+
 
 	@Autowired
 	private CacheContext cache;
 
+	@Autowired
+	private IYearOperatingCoefficientService yearOperatingCoefficientService;
+
+
+	@Autowired
+	private  IPartyBuildingMultiplierService partyBuildingMultiplierService;
 	//考评结果报告
 	//按照业务类型生成
 	//业务阶综合展示
 
-	@Transactional
-	@Override
-	public boolean generateEvaluateReport(String organizationEvaluationId,boolean backroll) {
+
+	public boolean generateEvaluateReport1(String organizationEvaluationId, boolean backroll) {
 
 
 		//业务ai扮酷
-		List<BinSection> sections =CacheContext.bsnList;
+		List<BinSection> sections = CacheContext.bsnList;
 
 		EvaluateReport evaluateReport = new EvaluateReport();
 		OrganizationEvaluation evaluation = organizationEvaluationService.getById(organizationEvaluationId);
@@ -76,19 +84,26 @@ public class EvaluateReportServiceImpl extends ServiceImpl<EvaluateReportMapper,
 			throw new CustomException("组织考评id为空");
 		}
 
+		String month = "";
 		//获取单位配置规则
 		List<String> evaluationRuleIds = Arrays.asList(evaluationRuleId.split(","));
-		for(BinSection bi : sections){
+		for (BinSection bi : sections) {
 
 			StringBuilder reportName = new StringBuilder();
 			if ("NDKP".equals(evaluation.getCheckCycle())) {
 				reportName.append("年度-");
+				month = "";
+				evaluateReport.setMonth("-");
 			}
 			if ("JDKP".equals(evaluation.getCheckCycle())) {
 				reportName.append("季度-");
+				evaluateReport.setMonth(evaluation.getMonth());
+
 			}
 			if ("YDKP".equals(evaluation.getCheckCycle())) {
 				reportName.append("月度-");
+				month = evaluation.getMonth();
+				evaluateReport.setMonth(evaluation.getMonth());
 			}
 			reportName.append(bi.getSectionName());
 			if ("DWKP".equals(evaluation.getOrganizationType())) {
@@ -106,12 +121,12 @@ public class EvaluateReportServiceImpl extends ServiceImpl<EvaluateReportMapper,
 			evaluateReport.setOrganizationType(evaluation.getOrganizationType());
 			evaluateReport.setCheckCycle(evaluation.getCheckCycle());
 			evaluateReport.setYear(evaluation.getYear());
-			evaluateReport.setMonth(evaluation.getMonth());
+
 			evaluateReport.setCreateTime(new Date());
 			evaluateReport.setCreateBy("");//人员
 
-			List<EvaluateReport> oriReports  = list(evaluation.getId(),bi.getId());
-			if(oriReports.size()>0 && !backroll){
+			List<EvaluateReport> oriReports = list(evaluation.getId(), bi.getId());
+			if (oriReports.size() > 0 && !backroll) {
 				throw new CustomException("综合考核评分汇总已生成");
 			} else {
 				for (EvaluateReport r : oriReports) {
@@ -131,45 +146,337 @@ public class EvaluateReportServiceImpl extends ServiceImpl<EvaluateReportMapper,
 			}
 			boolean b = super.saveOrUpdate(evaluateReport);
 
-			if(!b){
+			if (!b) {
 				throw new CustomException("综合考核评分汇总表存储失败");
 			}
 
-			List<OrganizationEvaluationRule> ruleList = organizationEvaluationRuleService.getOrganizationEvaluationRuleByIds(evaluationRuleIds,bi.getId());
+			List<OrganizationEvaluationRule> ruleList = organizationEvaluationRuleService.getOrganizationEvaluationRuleByIds(evaluationRuleIds, bi.getId());
 			//各板块明细存储
 			List<EvaluateReportInfo> evaluateRuleInfoList = new ArrayList<>();
-			//遍历各单位考评规则
-			for(OrganizationEvaluationRule rule :ruleList){
-
-				//获取考评股则
-				List<String> evaluateRuleIdList = Arrays.asList(rule.getEvaluateRuleId().split(","));
-				rule.getId();//单位考评规则
-				List<EvaluateRule> evaluateRuleList = evaluateRuleService.listByIds(evaluateRuleIdList);
-				for(EvaluateRule rule1 : evaluateRuleList){
-					List<EvaluationScoreCount> scoreCount =  evaluationScoreCountService.getListByEvaluationRuleId(organizationEvaluationId,rule.getId(),rule1.getBinStage());
-					double scor =  scoreCount.stream().mapToDouble(EvaluationScoreCount::getScore).sum();
-					EvaluateReportInfo reportInfo =  new EvaluateReportInfo();
-					reportInfo.setEvaluateReportId(evaluateReport.getId());
-					reportInfo.setOrganizationId(rule.getOrganizationId());
-					reportInfo.setOrganizationName(rule.getOrganizationName());
-					reportInfo.setBinStage(rule1.getBinStage());
-					reportInfo.setScore(DoubleUtils.keepPrecision(scor,2));
-					reportInfo.setDiscountScore(1.0);
-					evaluateRuleInfoList.add(reportInfo);
+			for (OrganizationEvaluationRule rule : ruleList) {
+
+				StringBuilder remark = new StringBuilder();
+				//生产95%基建5%前期0%
+				remark.append("生产").append(rule.getScjyWeight() * 100).append("%");
+				remark.append("基建").append(rule.getJjWeight() * 100).append("%");
+				remark.append("前期").append(rule.getQqWeight() * 100).append("%");
+
+
+				//存储多块牌子数据
+				List<MultipleBrand> brands = multipleBrandService.getMultipleBranList2(rule.getOrganizationId(), "0", bi.getId(), evaluation.getCheckCycle(), evaluation.getYear(), month);
+
+				Double totalProfit = 0.00;//累加收入
+				Double spMultiply = 0.00;//收入
+				Double score;//分数
+				if (null != brands && brands.size() > 0) {
+					for (MultipleBrand mb : brands) {
+						//累加收入
+						totalProfit = totalProfit + mb.getProfit();
+						//累加收入和分数的积
+						spMultiply = spMultiply + mb.getProfit() * mb.getScore();
+
+						List<MultipleBrand> parentBrands = multipleBrandService.getMultipleBranList2("", mb.getOrganizationId(), bi.getId(), evaluation.getCheckCycle(), evaluation.getYear(), month);
+						for (MultipleBrand pb : parentBrands) {
+							//累加收入
+							totalProfit = totalProfit + pb.getProfit();
+							spMultiply = spMultiply + mb.getProfit() * mb.getScore();
+						}
+
+					}
+					score = spMultiply / totalProfit;
+				} else {
+					List<String> evaluateRuleIds = Arrays.asList(rule.getEvaluateRuleId().split(","));
+					List<EvaluateRuleInfoResDTO> evaluateRuleList = evaluateRuleService.getListInIdsInfos(evaluateRuleIds, bi.getId(), "");
+					List<String> indicatorIds = evaluateRuleList.stream().map(EvaluateRuleInfoResDTO::getIndicatorId).collect(Collectors.toList());
+					List<EvaluationScoreCount> scoreCount = evaluationScoreCountService.getEvaluationScoreCountList(organizationEvaluationId, rule.getId(), indicatorIds);
+					score = scoreCount.stream().mapToDouble(EvaluationScoreCount::getScore).sum();
 				}
+
+
+				EvaluateReportInfo reportInfo = new EvaluateReportInfo();
+				reportInfo.setEvaluateReportId(evaluateReport.getId());
+				reportInfo.setOrganizationId(rule.getOrganizationId());
+				reportInfo.setOrganizationName(rule.getOrganizationName());
+
+				List<EvaluationScoreCount> scoreCount = evaluationScoreCountService.getEvaluationScoreCountList(organizationEvaluationId, rule.getId(), null, null);
+				score = scoreCount.stream().mapToDouble(EvaluationScoreCount::getScore).sum();
+
+				reportInfo.setScore(DoubleUtils.keepPrecision(score, 2));
+				reportInfo.setDiscountScore(1.0);
+				reportInfo.setRemark(remark.toString());
+				evaluateRuleInfoList.add(reportInfo);
+
+				//加分项
+				EvaluateReportInfo addInfo = new EvaluateReportInfo();
+				addInfo.setEvaluateReportId(evaluateReport.getId());
+				addInfo.setOrganizationId(rule.getOrganizationId());
+				addInfo.setOrganizationName(rule.getOrganizationName());
+				addInfo.setScore(DoubleUtils.keepPrecision(score, 2));
+				addInfo.setDiscountScore(1.0);
+				addInfo.setRemark(remark.toString());
+				evaluateRuleInfoList.add(addInfo);
+				//减分项
+				EvaluateReportInfo subInfo = new EvaluateReportInfo();
+				subInfo.setEvaluateReportId(evaluateReport.getId());
+				subInfo.setOrganizationId(rule.getOrganizationId());
+				subInfo.setOrganizationName(rule.getOrganizationName());
+				subInfo.setScore(DoubleUtils.keepPrecision(score, 2));
+				subInfo.setDiscountScore(1.0);
+				subInfo.setRemark(remark.toString());
+				evaluateRuleInfoList.add(subInfo);
+
+
 			}
-			for(EvaluateReportInfo info:evaluateRuleInfoList){
+
+			for (EvaluateReportInfo info : evaluateRuleInfoList) {
 				b = evaluateReportInfoService.saveOrUpdate(info);
-				if(!b){
+				if (!b) {
 					throw new CustomException("综合考核评分汇总明细存储失败");
 				}
 			}
 
+
 		}
 
 		return true;
 	}
 
+
+//	@Transactional
+	@Override
+	public boolean generateEvaluateReport(String organizationEvaluationId, boolean backroll) {
+
+
+		//业务
+		List<BinSection> sections = CacheContext.bsnList;
+
+		OrganizationEvaluation evaluation = organizationEvaluationService.getById(organizationEvaluationId);
+		if (null == evaluation) {
+			throw new CustomException("没有此靠考评");
+		}
+		//获取到对应组织考评规则
+		String evaluationRuleId = evaluation.getOrganizationEvaluationRuleId();
+		if (null == evaluationRuleId || evaluationRuleId.length() <= 0) {
+			throw new CustomException("组织考评id为空");
+		}
+		String month = "";
+		//获取单位配置规则
+		List<String> evaluationRuleIds = Arrays.asList(evaluationRuleId.split(","));
+		for (BinSection bi : sections) {
+
+
+
+			EvaluateReport evaluateReport = new EvaluateReport();
+			StringBuilder reportName = new StringBuilder();
+			if ("NDKP".equals(evaluation.getCheckCycle())) {
+				if("FD".equals(bi.getSectionCode()) || "GD".equals(bi.getSectionCode())){
+					continue;
+				}
+				reportName.append("年度-");
+				month = "";
+				evaluateReport.setMonth("-");
+			}
+			if ("JDKP".equals(evaluation.getCheckCycle())) {
+				if("FD".equals(bi.getSectionCode()) || "GD".equals(bi.getSectionCode())){
+					continue;
+				}
+				reportName.append("季度-");
+				evaluateReport.setMonth(evaluation.getMonth());
+
+			}
+			if ("YDKP".equals(evaluation.getCheckCycle())) {
+				if("XNYFG".equals(bi.getSectionCode()) || "ZHZC".equals(bi.getSectionCode())||
+					"GCGS".equals(bi.getSectionCode()) || "TJGS".equals(bi.getSectionCode())||
+					"QQ".equals(bi.getSectionCode()) || "JJ".equals(bi.getSectionCode())||
+					"GD".equals(bi.getSectionCode())){
+					continue;
+				}
+				reportName.append("月度-");
+				month = evaluation.getMonth();
+				evaluateReport.setMonth(evaluation.getMonth());
+			}
+			reportName.append(bi.getSectionName());
+			if ("DWKP".equals(evaluation.getOrganizationType())) {
+				reportName.append("单位");
+			}
+			if ("BNMKP".equals(evaluation.getOrganizationType())) {
+				reportName.append("部门");
+			}
+			reportName.append("综合考核评分汇总表");
+
+			evaluateReport.setEvaluateReportName(reportName.toString());
+			evaluateReport.setOrganizationEvaluationId(evaluation.getId());
+			evaluateReport.setBinSection(bi.getId());
+			evaluateReport.setBinSectionName(bi.getSectionName());
+			evaluateReport.setOrganizationType(evaluation.getOrganizationType());
+			evaluateReport.setCheckCycle(evaluation.getCheckCycle());
+			evaluateReport.setYear(evaluation.getYear());
+
+			evaluateReport.setCreateTime(new Date());
+			evaluateReport.setCreateBy("");//人员
+			List<EvaluateReport> oriReports = list(evaluation.getId(), bi.getId());
+			if (oriReports.size() > 0 && !backroll) {
+				for(EvaluateReport er : oriReports){
+					List<EvaluateReportInfo> rlist = evaluateReportInfoService.listByReportId(er.getId());
+
+					boolean rlistb =  evaluateReportInfoService.removeByIds(rlist.stream().map(EvaluateReportInfo::getId).collect(Collectors.toList()));
+					if (!rlistb) {
+						throw new CustomException("综合考核评分汇总计算失败");
+					}
+				}
+				boolean oriReportsb = this.removeByIds(oriReports.stream().map(EvaluateReport::getId).collect(Collectors.toList()));
+				if (!oriReportsb) {
+					throw new CustomException("综合考核评分汇总计算失败");
+				}
+				//throw new CustomException("综合考核评分汇总已生成");
+			} else {
+				for (EvaluateReport r : oriReports) {
+					boolean b = super.removeById(r.getId());
+					if (!b) {
+						throw new CustomException("综合考核评分汇总重算失败");
+					}
+					List<EvaluateReportInfo> infolist = evaluateReportInfoService.listByReportId(r.getId());
+					if (null != infolist && infolist.size() > 0) {
+						List<String> infolistIds = infolist.stream().map(EvaluateReportInfo::getId).collect(Collectors.toList());
+						b = evaluateReportInfoService.removeByIds(infolistIds);
+						if (!b) {
+							throw new CustomException("综合考核评分汇总重算失败");
+						}
+					}
+				}
+			}
+			boolean b = super.saveOrUpdate(evaluateReport);
+
+			if (!b) {
+				throw new CustomException("综合考核评分汇总表存储失败");
+			}
+
+
+			//获取当前模块得公司
+			List<OrganizationEvaluationRule> ruleList = organizationEvaluationRuleService.getOrganizationEvaluationRuleByIds(evaluationRuleIds, bi.getId());
+			//各板块明细存储
+			List<EvaluateReportInfo> evaluateRuleInfoList = new ArrayList<>();
+			for (OrganizationEvaluationRule rule : ruleList) {
+
+
+
+				StringBuilder remark = new StringBuilder();
+				//生产95%基建5%前期0%
+				remark.append("生产").append(rule.getScjyWeight() * 100).append("%");
+				remark.append("基建").append(rule.getJjWeight() * 100).append("%");
+				remark.append("前期").append(rule.getQqWeight() * 100).append("%");
+
+
+				//存储多块牌子数据
+				List<MultipleBrand> brands = multipleBrandService.getMultipleBranList2(rule.getOrganizationId(), "0", bi.getId(), evaluation.getCheckCycle(), evaluation.getYear(), month);
+
+				Double totalProfit = 0.00;//累加收入
+				Double spMultiply = 0.00;//收入
+				Double scjyScore = 0.0;//分数
+				if (null != brands && brands.size() > 0) {
+					for (MultipleBrand mb : brands) {
+						//累加收入
+						totalProfit = totalProfit + mb.getProfit();
+						//累加收入和分数的积
+						spMultiply = spMultiply + mb.getProfit() * mb.getScore();
+
+						List<MultipleBrand> parentBrands = multipleBrandService.getMultipleBranList2("", mb.getOrganizationId(), bi.getId(), evaluation.getCheckCycle(), evaluation.getYear(), month);
+						for (MultipleBrand pb : parentBrands) {
+							//累加收入
+							totalProfit = totalProfit + pb.getProfit();
+							spMultiply = spMultiply + mb.getProfit() * mb.getScore();
+						}
+
+					}
+					scjyScore = spMultiply / totalProfit;
+				}
+
+				EvaluateReportInfo reportInfo = new EvaluateReportInfo();
+				reportInfo.setEvaluateReportId(evaluateReport.getId());
+				reportInfo.setOrganizationId(rule.getOrganizationId());
+				reportInfo.setOrganizationName(rule.getOrganizationShortName());
+
+				//生产经营得分
+				if(scjyScore>0){
+					reportInfo.setScjyScore(DoubleUtils.keepPrecision(scjyScore, 2));
+				}else {
+					List<EvaluationScoreCount> scjyScoreCount = evaluationScoreCountService.getEvaluationScoreCountList(organizationEvaluationId, rule.getId(), null, Arrays.asList("SCJY".split(",")));
+					scjyScore = scjyScoreCount.stream().mapToDouble(EvaluationScoreCount::getScore).sum();
+					reportInfo.setScjyScore(DoubleUtils.keepPrecision(scjyScore, 2));
+				}
+
+				//前期得分
+				List<EvaluationScoreCount> qqScoreCount = evaluationScoreCountService.getEvaluationScoreCountList(organizationEvaluationId, rule.getId(), null, Arrays.asList("QQXM".split(",")));
+				Double qqScore = qqScoreCount.stream().mapToDouble(EvaluationScoreCount::getScore).sum();
+				reportInfo.setQqScore(DoubleUtils.keepPrecision(qqScore, 2));
+
+				//基建得分
+				List<EvaluationScoreCount> jjScoreCount = evaluationScoreCountService.getEvaluationScoreCountList(organizationEvaluationId, rule.getId(), null, Arrays.asList("JJXM".split(",")));
+				Double jjScore = jjScoreCount.stream().mapToDouble(EvaluationScoreCount::getScore).sum();
+				reportInfo.setJjScore(DoubleUtils.keepPrecision(jjScore, 2));
+
+
+				List<EvaluationScoreCount> addSubScoreCount = evaluationScoreCountService.getEvaluationScoreCountList(organizationEvaluationId, rule.getId(), null, Arrays.asList("ZDZX,GLSX".split(",")));
+				Double addSubScore = addSubScoreCount.stream().mapToDouble(EvaluationScoreCount::getScore).sum();
+				//加分项
+				double addScore = addSubScoreCount.stream().filter(a->a.getScore()>0).collect(Collectors.toList()).stream().mapToDouble(EvaluationScoreCount::getScore).sum();
+				reportInfo.setAddScore(DoubleUtils.keepPrecision(addScore, 2));
+
+				//减分项
+				double subScore = addSubScoreCount.stream().filter(a->a.getScore()<0).collect(Collectors.toList()).stream().mapToDouble(EvaluationScoreCount::getScore).sum();
+				reportInfo.setSubScore(DoubleUtils.keepPrecision(subScore, 2));
+
+				//加减分合计
+				reportInfo.setAddSubScore(DoubleUtils.keepPrecision(addSubScore, 2));
+
+				//综合得分
+				//经营分*比例 + 基建分*比例 + 前期分*比例 + 加减分合计
+				Double zhScore = scjyScore*rule.getScjyWeight() + qqScore*rule.getQqWeight() + jjScore*rule.getJjWeight() + addSubScore;
+				reportInfo.setZhScore(DoubleUtils.keepPrecision(zhScore, 2));
+				//年度
+				if("NDKP".equals(rule.getEvaluationCycle())){
+
+					List<YearOperatingCoefficient> list = yearOperatingCoefficientService.getListByOrganizationId(rule.getOrganizationId(), rule.getBinSection(),evaluation.getYear());
+					if(null != list && list.size()>0){
+						//经营业绩系数
+						reportInfo.setJyyjXs((null != list && list.size()>0) ? list.get(0).getK(): 1);
+						//关键业绩得分
+						//综合得分*经营业绩系数 +加扣分
+						double gjyjXs = zhScore * list.get(0).getK() + addSubScore;
+						reportInfo.setGjyjXs(gjyjXs);
+					}else {
+						//经营业绩系数
+						reportInfo.setJyyjXs(1);
+						//关键业绩系数
+						reportInfo.setGjyjXs(1);
+					}
+					List<PartyBuildingMultiplier> multiplierList = partyBuildingMultiplierService.listByParam(null, rule.getOrganizationId(), null, evaluation.getYear());
+					if(null != multiplierList && multiplierList.size()>0){
+						//党建考核乘数
+						reportInfo.setDjkhCs(Double.valueOf(multiplierList.get(0).getMultiplier()));
+					}else {
+						//党建考核乘数
+						reportInfo.setDjkhCs(1);
+					}
+				}else {
+					reportInfo.setScore(DoubleUtils.keepPrecision(zhScore, 2));
+					reportInfo.setDiscountScore(1.0);
+				}
+				reportInfo.setRemark(remark.toString());
+				evaluateRuleInfoList.add(reportInfo);
+			}
+
+			for (EvaluateReportInfo info : evaluateRuleInfoList) {
+				b = evaluateReportInfoService.saveOrUpdate(info);
+				if (!b) {
+					throw new CustomException("综合考核评分汇总明细存储失败");
+				}
+			}
+		}
+		return true;
+	}
+
+
 	@Override
 	public IPage<EvaluateReport> list(Integer pageNum, Integer pageSize, String id, String evaluateReportName, String binSection, String organizationEvaluationId, String organizationType, String checkCycle, String year, String month) {
 		Page<Indicator> page = new Page<>(pageNum, pageSize);
@@ -190,13 +497,15 @@ public class EvaluateReportServiceImpl extends ServiceImpl<EvaluateReportMapper,
 	public List<EvaluateReport> list(String organizationEvaluationId, String binSection) {
 		QueryWrapper<EvaluateReport> qw = new QueryWrapper<>();
 		if (StringUtils.isNotEmpty(organizationEvaluationId)) {
-			qw.lambda().eq(EvaluateReport::getOrganizationEvaluationId,organizationEvaluationId);
+			qw.lambda().eq(EvaluateReport::getOrganizationEvaluationId, organizationEvaluationId);
 		}
 		if (StringUtils.isNotEmpty(binSection)) {
-			qw.lambda().eq(EvaluateReport::getBinSection,binSection);
+			qw.lambda().eq(EvaluateReport::getBinSection, binSection);
 		}
 		List<EvaluateReport> list = baseMapper.selectList(qw);
 		return list;
 	}
+
+
 }
 

+ 7 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluateRuleServiceImpl.java

@@ -8,6 +8,7 @@ import com.ims.eval.cache.CacheContext;
 import com.ims.eval.config.CustomException;
 import com.ims.eval.entity.EvaluateRule;
 import com.ims.eval.dao.EvaluateRuleMapper;
+import com.ims.eval.entity.dto.response.EvaluateRuleInfoResDTO;
 import com.ims.eval.service.IEvaluateRuleService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
@@ -124,6 +125,12 @@ public class EvaluateRuleServiceImpl extends ServiceImpl<EvaluateRuleMapper, Eva
 	}
 
 	@Override
+	public List<EvaluateRuleInfoResDTO> getListInIdsInfos(List<String> ids, String binSection, String binStage) {
+		List<EvaluateRuleInfoResDTO> list = baseMapper.selectListInIdsInfos(ids,binSection,binStage);
+		return list;
+	}
+
+	@Override
 	public boolean saveOrUpdate(EvaluateRule entity) {
 
 		if (null != entity && (null == entity.getId() || "".equals(entity.getId().trim()))) {

+ 25 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluatioinScoreCountServiceImpl.java

@@ -121,4 +121,29 @@ public class EvaluatioinScoreCountServiceImpl extends ServiceImpl<EvaluationScor
 		return list;
 	}
 
+	@Override
+	public List<EvaluationScoreCount> getEvaluationScoreCountList(String organizationEvaluationId, String organizationEvaluationRuleId, List<String> indicatorIds) {
+
+
+		QueryWrapper<EvaluationScoreCount> qw = new QueryWrapper();
+
+		if (StringUtils.isNotEmpty(organizationEvaluationId)) {
+			qw.lambda().eq(EvaluationScoreCount::getOrganizationEvaluationId,organizationEvaluationId);
+		}
+		if (StringUtils.isNotEmpty(organizationEvaluationRuleId)) {
+			qw.lambda().eq(EvaluationScoreCount::getOrganizationEvaluationRuleId,organizationEvaluationRuleId);
+		}
+		if (null !=indicatorIds && indicatorIds.size()>0) {
+			qw.lambda().in(EvaluationScoreCount::getIndicatorId,indicatorIds);
+		}
+
+		List<EvaluationScoreCount> list = baseMapper.selectList(qw);
+		return list;
+	}
+
+	@Override
+	public List<EvaluationScoreCount> getEvaluationScoreCountList(String organizationEvaluationId, String organizationEvaluationRuleId, List<String> indicatorIds, List<String> stageCode) {
+		List<EvaluationScoreCount>  list = baseMapper.selectEvaluationScoreCountList( organizationEvaluationId,  organizationEvaluationRuleId,  indicatorIds,  stageCode);
+		return list;
+	}
 }

+ 5 - 2
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/MultipleBrandServiceImpl.java

@@ -41,8 +41,11 @@ public class MultipleBrandServiceImpl extends ServiceImpl<MultipleBrandMapper, M
 		return list;
 	}
 
-
-
+	@Override
+	public List<MultipleBrand> getMultipleBranList2( String organizationId, String parentId, String binSection, String checkCycle, String year, String month) {
+		List<MultipleBrand> list  = baseMapper.selectMultipleBranList2(organizationId,parentId,binSection,checkCycle,year,month);
+		return list;
+	}
 
 
 	/**

+ 26 - 14
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/OrganizationEvaluationInfoServiceImpl.java

@@ -72,13 +72,13 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 				OrganizationEvaluationInfo info = baseMapper.selectById(entity.getId());
 
 				info.setQuantifiedValue(entity.getQuantifiedValue());//量化值
-				if("JKF".equals(info.getOptionCode())){//加扣分
+				if(entity.getIsQuantified().equals("否") && "JKF".equals(info.getOptionCode())){//加扣分
 					if(StringUtils.isNumber(entity.getNonQuantifiedValue())){
 						info.setQuantifiedValue(Double.valueOf(entity.getNonQuantifiedValue()));
 					}
 				}
 
-				if("JCF".equals(info.getOptionCode())){//基础分
+				if(entity.getIsQuantified().equals("否") && "JCF".equals(info.getOptionCode())){//基础分
 					if(StringUtils.isNumber(entity.getNonQuantifiedValue())){
 						info.setQuantifiedValue(Double.valueOf(entity.getNonQuantifiedValue()));
 					}
@@ -111,6 +111,18 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 					addinfo.setChildCode(d.getChildCode());
 					addinfo.setIsQuantified(entity.getIsQuantified());
 					addinfo.setQuantifiedValue(entity.getQuantifiedValue());
+
+					if(entity.getIsQuantified().equals("否") && "JKF".equals(d.getOptionCode())){//加扣分
+						if(StringUtils.isNumber(entity.getNonQuantifiedValue())){
+							addinfo.setQuantifiedValue(Double.valueOf(entity.getNonQuantifiedValue()));
+						}
+					}
+
+					if(entity.getIsQuantified().equals("否") && "JCF".equals(d.getOptionCode())){//基础分
+						if(StringUtils.isNumber(entity.getNonQuantifiedValue())){
+							addinfo.setQuantifiedValue(Double.valueOf(entity.getNonQuantifiedValue()));
+						}
+					}
 					addinfo.setNonQuantifiedValue(entity.getNonQuantifiedValue());
 					addinfo.setState("-1");//初始状态
 					addinfo.setCreateTime(new Date());
@@ -124,18 +136,18 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 			}
 
 		}
-
-		OrganizationEvaluationInfo organizationEvaluationInfo = baseMapper.selectById(organizationEvaluationInfoList.get(0).getId());
-		//查询本次考评所有考评指标明细
-		List<OrganizationEvaluationInfo> organizationEvaluationInfos = baseMapper.selectByEvaluationInfoId(organizationEvaluationInfo.getOrganizationEvaluationId());
-
-		//调用需要计算指标项的方法
-		boolean calculate = calculateIdicatorItem(organizationEvaluationInfos);
-
-		//调用计算存储最大值,最小值的方法
-		if (calculate){
-			iCalculateIndicatorItemInfoService.saveIndicatorInfo(organizationEvaluationInfos);
-		}
+//废弃方法
+//		OrganizationEvaluationInfo organizationEvaluationInfo = baseMapper.selectById(organizationEvaluationInfoList.get(0).getId());
+//		//查询本次考评所有考评指标明细
+//		List<OrganizationEvaluationInfo> organizationEvaluationInfos = baseMapper.selectByEvaluationInfoId(organizationEvaluationInfo.getOrganizationEvaluationId());
+//
+//		//调用需要计算指标项的方法
+//		boolean calculate = calculateIdicatorItem(organizationEvaluationInfos);
+//
+//		//调用计算存储最大值,最小值的方法
+//		if (calculate){
+//			iCalculateIndicatorItemInfoService.saveIndicatorInfo(organizationEvaluationInfos);
+//		}
 
 
 		return true;

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

@@ -53,7 +53,6 @@ public class PartyBuildingMultiplierServiceImpl extends ServiceImpl<PartyBuildin
 	@Override
 	public List<PartyBuildingMultiplier> listByParam(String id, String departId, String sectionId, String year) {
 
-		List<PartyBuildingMultiplierDto> list = new ArrayList<>();
 
 		QueryWrapper<PartyBuildingMultiplier> qw = new QueryWrapper<>();
 

+ 20 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/YearOperatingCoefficientServiceImpl.java

@@ -89,4 +89,24 @@ public class YearOperatingCoefficientServiceImpl extends ServiceImpl<YearOperati
 
 		return list;
 	}
+
+	@Override
+	public List<YearOperatingCoefficient> getListByOrganizationId(String organizationId, String binSection, String year) {
+
+		QueryWrapper<YearOperatingCoefficient> qw = new QueryWrapper<>();
+
+		if (StringUtils.isNotEmpty(organizationId)) {
+			qw.lambda().eq(YearOperatingCoefficient::getOrganizationId, organizationId);
+		}
+		if (StringUtils.isNotEmpty(binSection)) {
+			qw.lambda().eq(YearOperatingCoefficient::getBinSection, binSection);
+		}
+		if (StringUtils.isNotEmpty(year)) {
+			qw.lambda().eq(YearOperatingCoefficient::getYear, year);
+		}
+		List<YearOperatingCoefficient> list = baseMapper.selectList( qw);
+
+		return list;
+
+	}
 }

+ 1 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/util/ExcelUtil.java

@@ -57,7 +57,7 @@ public class ExcelUtil {
                     continue;
                 }
 
-                int rowSize = sheet.getRow(0).getLastCellNum();
+                int rowSize = sheet.getRow(startRows).getLastCellNum();
                 String[] values = new String[rowSize];
                 boolean hasValue = false;
                 for (int columnIndex = 0; columnIndex < rowSize; columnIndex++) {

+ 5 - 10
ims-service/ims-eval/src/main/resources/mappers/EvaluateReportInfoMapper.xml

@@ -8,11 +8,6 @@
         <result column="evaluate_report_id" property="evaluateReportId" />
         <result column="organization_id" property="organizationId" />
         <result column="organization_name" property="organizationName" />
-        <result column="bin_stage" property="binStage" />
-        <result column="create_time" property="createTime" />
-        <result column="create_by" property="createBy" />
-        <result column="update_time" property="updateTime" />
-        <result column="update_by" property="updateBy" />
         <result column="remark" property="remark" />
     </resultMap>
 
@@ -23,13 +18,13 @@
     <select id="selectListByReportId" resultType="com.ims.eval.entity.EvaluateReportInfo">
 
      select
-     ri.*,
-     b.stage_name binStageName
-     from  evaluate_report_info ri
-     LEFT JOIN bin_stage b on b.id = ri.bin_stage
+        ri.*
+        from  evaluate_report_info ri
+        LEFT JOIN evaluate_report er on er.id = ri.evaluate_report_id
+
      <where>
          <if test="evaluateReportId !=null and evaluateReportId !=''">
-             AND ri.evaluate_report_id = #{evaluateReportId}
+             AND er.id = #{evaluateReportId}
          </if>
      </where>
     </select>

+ 32 - 0
ims-service/ims-eval/src/main/resources/mappers/EvaluateRuleMapper.xml

@@ -52,5 +52,37 @@
             </where>
 
     </select>
+    <select id="selectListInIdsInfos" resultType="com.ims.eval.entity.dto.response.EvaluateRuleInfoResDTO">
+            SELECT
+            ri.*,
+            r.bin_section,
+            r.bin_stage,
+            r.rule_name,
+            r.enable,
+            b.stage_name binStageName,
+            bs.section_name binSectionName
+            FROM
+            evaluate_rule r
+			inner join evaluate_rule_info ri on r.id = ri.evaluate_rule_id
+            LEFT JOIN bin_stage b  ON r.bin_stage = b.id
+            LEFT JOIN bin_section bs  ON r.bin_section = bs.id
+        <where>
+
+            <if test="ids !=null">
+                AND r.id in
+                <foreach item="item" collection="ids" separator="," open="(" close=")" index="">'${item}'</foreach>
+            </if>
+
+            <if test="binSection !=null and binSection !=''">
+                AND r.bin_section = #{binSection}
+            </if>
+
+            <if test="binStage !=null and binStage !=''">
+                AND r.bin_stage = #{binStage}
+            </if>
+
+        </where>
+
+    </select>
 
 </mapper>

+ 31 - 0
ims-service/ims-eval/src/main/resources/mappers/EvaluationScoreCountMapper.xml

@@ -88,4 +88,35 @@
 
     </select>
 
+    <select id="selectEvaluationScoreCountList" resultType="com.ims.eval.entity.EvaluationScoreCount">
+        select c.*,i.indicator_name,o.organization_name,b.section_name,s.stage_name,d.key_name
+        from evaluation_score_count c
+        LEFT JOIN indicator i on  c.indicator_id = i.id
+        LEFT JOIN organization_evaluation_rule o on  c.organization_evaluation_rule_id = o.id
+        left join bin_section b on b.id = i.bin_section
+        left join bin_stage s on s.id = i.bin_stage
+        left join data_dictionary d on d.data_key = i.dept_id
+
+        <where>
+            <if test="organizationEvaluationId !=null and organizationEvaluationId !=''">
+                AND c.organization_evaluation_id = #{organizationEvaluationId}
+            </if>
+            <if test="organizationEvaluationRuleId !=null and organizationEvaluationRuleId !=''">
+                AND c.organization_evaluation_rule_id = #{organizationEvaluationRuleId}
+            </if>
+
+            <if test="indicatorIds !=null ">
+                AND c.indicator_id  in
+                <foreach item="item" collection="indicatorIds" separator="," open="(" close=")" index="">'${item}'</foreach>
+            </if>
+
+            <if test="stageCode !=null ">
+                AND s.stage_code in
+                <foreach item="item" collection="stageCode" separator="," open="(" close=")" index="">'${item}'</foreach>
+            </if>
+
+
+        </where>
+    </select>
+
 </mapper>

+ 37 - 0
ims-service/ims-eval/src/main/resources/mappers/MultipleBrandMapper.xml

@@ -78,6 +78,43 @@
             </where>
 
     </select>
+    <select id="selectMultipleBranList2" resultType="com.ims.eval.entity.MultipleBrand">
+
+        select
+        *,
+        b.section_name binsectionname
+        from
+        multiple_brand
+        m left join bin_section b on m.bin_section = b.id
+        <where>
+
+
+            <if test="organizationId !=null and organizationId !=''">
+                AND m.organization_id = #{organizationId}
+            </if>
+
+            <if test="parentId !=null and parentId !=''">
+                AND m.parent_id  = #{parentId}
+            </if>
+
+            <if test="binSection !=null and binSection !=''">
+                AND m.bin_section  = #{binSection}
+            </if>
+
+            <if test="checkCycle !=null and checkCycle !=''">
+                AND m.check_cycle  = #{checkCycle}
+            </if>
+
+            <if test="year !=null and year !=''">
+                AND m.year  = #{year}
+            </if>
+
+            <if test="month !=null and month !=''">
+                AND m.month  = #{month}
+            </if>
+        </where>
+
+    </select>
 
 
 </mapper>