Bladeren bron

代码提交

wangchangsheng 1 jaar geleden
bovenliggende
commit
db4f21635f

+ 21 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/controller/OrganizationEvaluationController.java

@@ -4,6 +4,7 @@ package com.ims.eval.controller;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.ims.eval.config.CustomException;
 import com.ims.eval.entity.OrganizationEvaluation;
+import com.ims.eval.entity.dto.response.OrganizationEvaluationResDTO;
 import com.ims.eval.entity.dto.result.R;
 import com.ims.eval.service.IOrganizationEvaluationService;
 import io.swagger.annotations.ApiOperation;
@@ -12,6 +13,7 @@ import org.springframework.web.bind.annotation.*;
 
 import java.util.Arrays;
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -192,4 +194,23 @@ public class OrganizationEvaluationController {
 	}
 
 
+	/**
+	 *
+	 * @param id 目标责任书id
+	 * @return
+	 */
+	//@ImsPreAuth("eval:organizationEvaluation:view")
+	@GetMapping(value = "getByidAndInfo")
+	public R planValueList(
+		@RequestParam(value = "id", required = false) String  id,
+		@RequestParam(value = "dept", required = false) String dept) {
+		OrganizationEvaluationResDTO resDTO = organizationEvaluationService.getByidAndInfo(id, dept);
+		return R.ok().data(resDTO);
+	}
+
+
+
+
+
+
 }

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

@@ -2,6 +2,8 @@ package com.ims.eval.dao;
 
 import com.ims.eval.entity.OrganizationEvaluation;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ims.eval.entity.dto.response.OrganizationEvaluationResDTO;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * <p>
@@ -13,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface OrganizationEvaluationMapper extends BaseMapper<OrganizationEvaluation> {
 
+	OrganizationEvaluationResDTO selectById(@Param("id")String id);
+
 }

+ 19 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/entity/custom/IsOkAction.java

@@ -50,4 +50,23 @@ public class IsOkAction {
 	 */
 	private String iamCode;
 
+
+	/**
+	 * 流程key
+	 */
+	private String defKey;
+
+	/**
+	 * 业务id
+	 */
+	private String bizKey;
+
+	/**
+	 * 节点名称
+	 */
+	private String  taskName;
+
+
+
+
 }

+ 60 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/entity/custom/Opinion.java

@@ -0,0 +1,60 @@
+package com.ims.eval.entity.custom;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class Opinion {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * id
+	 */
+	private String id;
+
+	/**
+	 * 状态
+	 */
+	private String status;
+
+	/**
+	 * 时间
+	 */
+	private Date approveTime;
+
+	/**
+	 * 流程实例id
+	 */
+	private String taskName;
+
+	/**
+	 * 流程发起意见
+	 */
+	private String opinion;
+
+	/**
+	 * 驳回到的节点(自由驳回时生效)
+	 */
+	private String destination;
+
+	/**
+	 * 编码
+	 */
+	private String iamCode;
+
+
+	/**
+	 * 流程key
+	 */
+	private String defKey;
+
+	/**
+	 * 业务id
+	 */
+	private String bizKey;
+
+
+
+}

+ 17 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/entity/dto/response/OrganizationEvaluationResDTO.java

@@ -0,0 +1,17 @@
+package com.ims.eval.entity.dto.response;
+
+import com.ims.eval.entity.OrganizationEvaluation;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+import java.util.List;
+import java.util.Map;
+
+
+@Data
+@ApiModel(value = "考评明细响应类", description = "考评明细响应类")
+public class OrganizationEvaluationResDTO  extends OrganizationEvaluation {
+
+	//明细
+	Map<String, List<OrganizationEvaluationInfoResDTO>> map;
+}

+ 26 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/entity/flow/FlowResult.java

@@ -0,0 +1,26 @@
+package com.ims.eval.entity.flow;
+
+import lombok.Data;
+
+@Data
+public class FlowResult {
+	private static final long serialVersionUID = 6131673218827464899L;
+
+	/**
+	 * 本次调用是否成功
+	 */
+	private Boolean isOk;
+
+	/**
+	 * 操作提示信息
+	 */
+	private String msg;
+
+
+	/**
+	 * 状态码
+	 */
+	private String code;
+
+
+}

+ 3 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/IDeptResponsibilityService.java

@@ -32,4 +32,7 @@ public interface IDeptResponsibilityService extends IService<DeptResponsibility>
 	List<Map> targetValueeport(String id, String dept, HttpServletRequest request);
 
 
+	boolean editState(String id,String state);
+
+
 }

+ 12 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/IOrganizationEvaluationService.java

@@ -1,11 +1,16 @@
 package com.ims.eval.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.ims.eval.entity.DeptResponsibility;
 import com.ims.eval.entity.OrganizationEvaluation;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.ims.eval.entity.dto.response.OrganizationEvaluationResDTO;
+import com.ims.eval.entity.dto.response.ResponsibilityIndicatorInfoResDTO;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.Arrays;
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -34,4 +39,11 @@ public interface IOrganizationEvaluationService extends IService<OrganizationEva
 	List<OrganizationEvaluation> list(String organizationId, String checkCycle, String year, String month);
 
 
+	boolean editState(String id, String state);
+
+
+	OrganizationEvaluationResDTO getByidAndInfo(String id, String dept);
+
+
+
 }

+ 65 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/custom/WorkflowService.java

@@ -5,8 +5,13 @@ import com.alibaba.fastjson.JSONObject;
 import com.ims.eval.config.ImaConfig;
 import com.ims.eval.entity.custom.DoAction;
 import com.ims.eval.entity.custom.IsOkAction;
+import com.ims.eval.entity.custom.Menu;
 import com.ims.eval.entity.custom.TodoTask;
+import com.ims.eval.entity.flow.FlowResult;
+import com.ims.eval.service.IDeptResponsibilityService;
+import com.ims.eval.service.IOrganizationEvaluationService;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.ibatis.annotations.Case;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.*;
 import org.springframework.stereotype.Service;
@@ -14,6 +19,7 @@ import org.springframework.web.client.RestTemplate;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.LinkedHashMap;
+import java.util.List;
 import java.util.Map;
 
 
@@ -35,6 +41,12 @@ public class WorkflowService {
 	@Autowired
 	private ImaConfig imaConfig;
 
+	@Autowired
+	private IDeptResponsibilityService deptResponsibilityService;
+
+	@Autowired
+	private IOrganizationEvaluationService organizationEvaluationService;
+
 
 
 	/**
@@ -117,6 +129,15 @@ public class WorkflowService {
 		ResponseEntity<String> responseEntity2 = restTemplate.exchange("http://10.65.78.23:8080/bpm/task/doAction", HttpMethod.POST,param,String.class);
 		log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
 		if(200== responseEntity2.getStatusCodeValue()){
+
+			FlowResult result = JSON.parseObject(responseEntity2.getBody()).toJavaObject(FlowResult.class);
+			if(result.getIsOk()){
+				boolean biz = updateWorkflowState(isOkAction.getInstanceId(),isOkAction.getDefKey(),isOkAction.getBizKey(),isOkAction.getTaskName());
+				if(biz){
+					log.info("状态修改成功");
+				}
+			}
+
 			return JSON.parseObject(responseEntity2.getBody());
 		}
 		return null;
@@ -148,4 +169,48 @@ public class WorkflowService {
 	}
 
 
+
+
+	/**
+	 * 获取流程意见
+	 * @param instId
+	 * @param iamCode
+	 * @param request
+	 * @return
+	 */
+	public JSONObject getOpinion(String instId,String iamCode, HttpServletRequest request){
+		HttpHeaders headers = new HttpHeaders();
+		headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
+		headers.add("Blade-Auth", request.getHeader("Blade-Auth"));
+		headers.add("code", request.getHeader("code"));
+
+		HttpEntity<Map> param = new HttpEntity<>(null, headers);
+		ResponseEntity<String> responseEntity2 = restTemplate.postForEntity("http://10.65.78.23:8080/bpm/instance/getOpinion??instId={1}&iamCode={2}",
+			param, String.class, instId, iamCode);
+
+		log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
+		if(200== responseEntity2.getStatusCodeValue()){
+			return JSON.parseObject(responseEntity2.getBody());
+		}
+		return null;
+	}
+
+	private boolean updateWorkflowState(String instanceId, String defKey, String bizKey,String taskName) {
+
+		switch (defKey) {
+			case "dwkpmbqd"://单位考评目标启动
+				deptResponsibilityService.editState(bizKey,taskName);
+				break;
+			case "yddwkplc"://月度单位考评流程
+				organizationEvaluationService.editState(bizKey,taskName);
+				break;
+			case "dwkpmbxd"://单位考评目标修订
+
+				break;
+		}
+		return true;
+
+	}
+
+
 }

+ 8 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/DeptResponsibilityServiceImpl.java

@@ -250,6 +250,14 @@ public class DeptResponsibilityServiceImpl extends ServiceImpl<DeptResponsibilit
 		return null;
 	}
 
+	@Override
+	public boolean editState(String id, String state) {
+		DeptResponsibility responsibility = baseMapper.selectById(id);
+		responsibility.setStage(state);
+		boolean b = super.saveOrUpdate(responsibility);
+		return b;
+	}
+
 	@Transactional
 	@Override
 	public boolean saveOrUpdate(DeptResponsibility entity) {

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

@@ -149,6 +149,7 @@ public class EvaluateReportServiceImpl extends ServiceImpl<EvaluateReportMapper,
 					reportInfo.setOrganizationName(rule.getOrganizationName());
 					reportInfo.setBinStage(rule1.getBinStage());
 					reportInfo.setScore(DoubleUtils.keepPrecision(scor,2));
+					reportInfo.setDiscountScore(1.0);
 					evaluateRuleInfoList.add(reportInfo);
 				}
 			}

+ 21 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/OrganizationEvaluationServiceImpl.java

@@ -10,6 +10,8 @@ import com.ims.eval.dao.ResponsibilityIndicatorInfoMapper;
 import com.ims.eval.entity.*;
 import com.ims.eval.dao.OrganizationEvaluationMapper;
 import com.ims.eval.entity.dto.response.IndicatorResDTO;
+import com.ims.eval.entity.dto.response.OrganizationEvaluationInfoResDTO;
+import com.ims.eval.entity.dto.response.OrganizationEvaluationResDTO;
 import com.ims.eval.service.*;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -466,6 +468,25 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
 		return list;
 	}
 
+	@Override
+	public boolean editState(String id, String state) {
+		OrganizationEvaluation evaluation = baseMapper.selectById(id);
+		evaluation.setStage(state);
+		boolean b = super.saveOrUpdate(evaluation);
+		return b;
+	}
+
+	@Override
+	public OrganizationEvaluationResDTO getByidAndInfo(String id, String dept) {
+		OrganizationEvaluationResDTO resDTO = baseMapper.selectById(id);
+		Map<String  ,List<OrganizationEvaluationInfoResDTO>> map  = organizationEvaluationInfoService.finishValueList(id,dept);
+		if(null != resDTO){
+			resDTO.setMap(map);
+		}
+		return resDTO;
+	}
+
+
 
 	@Transactional
 	@Override

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

@@ -66,10 +66,10 @@
                 and  dd.key_name = #{dept}
             </if>
 
-
+            and id.option_code not in ('CZ','CZMAX','CZMIN')
         </where>
 
-        order by ei.option_code desc
+        order by dd.key_name,id.child_name desc
 
     </select>
 

+ 14 - 0
ims-service/ims-eval/src/main/resources/mappers/OrganizationEvaluationMapper.xml

@@ -34,5 +34,19 @@
     <sql id="Base_Column_List">
         id, organization_evaluation_code, organization_name, organization_id, organization_type, check_cycle, year, month, organization_evaluation_rule_id, begin_date, end_date, stage, des, create_time, create_by, update_time, update_by, review_people, review_people_time, review_opinion, final_review_people, final_review_people_time, final_review_opinion, remark
     </sql>
+    <select id="selectById" resultType="com.ims.eval.entity.dto.response.OrganizationEvaluationResDTO">
+        SELECT
+        *
+        FROM
+        organization_evaluation o
+
+        <where>
+            <if test="id !=null and id !=''">
+                AND o.id = #{id}
+            </if>
+
+        </where>
+
+    </select>
 
 </mapper>