瀏覽代碼

Merge branch 'tmp' of googol/YY_BE_2 into master

屈桐 4 年之前
父節點
當前提交
05fc73ffb6

+ 1 - 1
hnqz-auth/src/main/resources/bootstrap.yml

@@ -1,5 +1,5 @@
 server:
-  port: 3000
+  port: @profiles.auth.port@
 
 spring:
   application:

+ 1 - 1
hnqz-gateway/src/main/resources/bootstrap.yml

@@ -1,5 +1,5 @@
 server:
-  port: 9999
+  port: @profiles.gateway.port@
 
 spring:
   application:

+ 30 - 1
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/WmDaAgentController.java

@@ -318,6 +318,35 @@ public class WmDaAgentController {
 						newOne.setBaseId(wmTaskType2.getId());
 						wmTaskTypeMapper.insert(newOne);
 					}
+				} else if (3 == sysDept.getLevel()) {
+					// 一级cso给二级cso配置积分规则
+					WmDaAgent level1DaAgent = wmDaAgentService.getOne(Wrappers.<WmDaAgent>lambdaQuery()
+							.eq(WmDaAgent::getDeptId, SecurityUtils.getUser().getDeptId()));
+					WmTaskTypeEntRef wmTaskTypeEntRef1 = new WmTaskTypeEntRef();
+					wmTaskTypeEntRef1.setDrugentId("");
+					wmTaskTypeEntRef1.setAgentId(wmDaAgent.getId());
+					wmTaskTypeEntRef1.setDeptId(wmDaAgent.getDeptId());
+					wmTaskTypeEntRefMapper.insert(wmTaskTypeEntRef1);
+
+					WmTaskType wmTaskTypeQ = new WmTaskType();
+					wmTaskTypeQ.setTaskTypeLevel("1");
+					wmTaskTypeQ.setStatus("0");
+					wmTaskTypeQ.setDelFlag("0");
+					List<WmTaskType> tempList = wmTaskTypeMapper.selectList(Wrappers.query(wmTaskTypeQ));
+
+					for (WmTaskType wmTaskType2 : tempList) {
+						WmTaskType newOne = wmTaskType2;
+						newOne.setId(null);
+						newOne.setLevel1Id(level1DaAgent.getId());
+						newOne.setTaskTypeLevel("2");
+						newOne.setTaskEntId(wmDaAgent.getId());
+						newOne.setRuleId(wmDaAgent.getId());
+						newOne.setDeptId(String.valueOf(wmDaAgent.getDeptId()));
+						newOne.setCreateTime(LocalDateTime.now());
+						newOne.setStatus("0");
+						newOne.setBaseId(wmTaskType2.getId());
+						wmTaskTypeMapper.insert(newOne);
+					}
 				}
 			}
 		}
@@ -751,7 +780,7 @@ public class WmDaAgentController {
 		List wmDaDrugEnts = null;
 		if (byId.getLevel() == 2) {
 			wmDaDrugEnts = wmDaAgentService.selectWmDaDrugEntByDeptId(byId.getDeptId());
-		} else if (byId.getLevel() == 3) {
+		} else if (byId.getLevel() == 3 || byId.getLevel() == 4) {
 			wmDaDrugEnts = wmDaAgentService.selectWmDaAgentByRelationId(byId.getDeptId());
 		}
 		return R.ok(wmDaDrugEnts);

+ 70 - 42
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/WmScorePackageController.java

@@ -17,6 +17,7 @@
 
 package com.qunzhixinxi.hnqz.admin.controller;
 
+import cn.hutool.core.collection.CollectionUtil;
 import com.alibaba.csp.sentinel.util.StringUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -25,18 +26,18 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qunzhixinxi.hnqz.admin.api.dto.UserDTO;
 import com.qunzhixinxi.hnqz.admin.api.entity.SysDept;
-import com.qunzhixinxi.hnqz.admin.api.entity.SysRole;
 import com.qunzhixinxi.hnqz.admin.api.entity.SysUser;
 import com.qunzhixinxi.hnqz.admin.api.vo.ErrorInfoVo;
 import com.qunzhixinxi.hnqz.admin.api.vo.UserVO;
 import com.qunzhixinxi.hnqz.admin.api.vo.WmScorePackageVO;
 import com.qunzhixinxi.hnqz.admin.entity.*;
+import com.qunzhixinxi.hnqz.admin.enums.DelEnum;
+import com.qunzhixinxi.hnqz.admin.enums.EnableEnum;
 import com.qunzhixinxi.hnqz.admin.enums.WmScoreTaskTypeEnum;
 import com.qunzhixinxi.hnqz.admin.mapper.*;
 import com.qunzhixinxi.hnqz.admin.service.*;
 import com.qunzhixinxi.hnqz.common.core.util.R;
 import com.qunzhixinxi.hnqz.common.log.annotation.SysLog;
-import com.qunzhixinxi.hnqz.common.security.annotation.Inner;
 import com.qunzhixinxi.hnqz.common.security.service.HnqzUser;
 import com.qunzhixinxi.hnqz.common.security.util.SecurityUtils;
 import io.swagger.annotations.Api;
@@ -55,7 +56,6 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
-import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 import java.io.InputStream;
 import java.math.BigDecimal;
@@ -64,7 +64,6 @@ import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
-import java.util.stream.Stream;
 
 
 /**
@@ -1400,6 +1399,10 @@ public class WmScorePackageController {
 			List<WmScorePackage> list = wmScorePackageService.selectByReRelatedService(wmScorePackage);
 			if (list.size() > 0) {
 				for (WmScorePackage wmScorePackage1 : list) {
+					if (wmScorePackage1.getKfpjf().equals(0)) {
+						// 过滤掉可分配积分值为0的积分包
+						continue;
+					}
 					Map<String, Object> map1 = new HashMap<>();
 					map1.put("relationScoreName", wmScorePackage1.getScorePackageName());
 					map1.put("id", wmScorePackage1.getId());
@@ -1416,6 +1419,10 @@ public class WmScorePackageController {
 			wmScorePackage.setDeptId(wmScorePackage.getRelatedService());
 			List<WmScorePackage> list = wmScorePackageService.selectByReRelatedService(wmScorePackage);
 			for (WmScorePackage wmScorePackage1 : list) {
+				if (wmScorePackage1.getKfpjf().equals(0)) {
+					// 过滤掉可分配积分值为0的积分包
+					continue;
+				}
 				Map<String, Object> map3 = new HashMap<>();
 				map3.put("id", wmScorePackage1.getId());
 				map3.put("relationScoreName", wmScorePackage1.getScorePackageName());
@@ -1457,7 +1464,8 @@ public class WmScorePackageController {
 			map2.put("kfpjf", "");
 //			wmDaDrugEnts = wmDaAgentService.selectByRelationId(Integer.valueOf(anId.getId()));
 //			wmDaDrugEnts = wmDaAgentService.selectWmDaAgentByDeptIds(anId.getDeptId());
-			List<WmDaAgent> list = wmDaAgentService.selectWmDaAgentByDeptIds(anId.getDeptId());
+//			List<WmDaAgent> list = wmDaAgentService.selectWmDaAgentByDeptIds(anId.getDeptId());
+			List<WmDaAgent> list = wmDaAgentService.listAgentByDeptRelation(Integer.parseInt(anId.getDeptId()));
 			for (int i = 0; i < list.size(); i++) {
 				if (Integer.parseInt(list.get(i).getEnableFlag()) == 0) {
 					wmDaDrugEnts.add(list.get(i));
@@ -1670,35 +1678,30 @@ public class WmScorePackageController {
 			}
 		} else if (sysDeptRuleId.getLevel() == 3) {
 			//一级cso规则ID
-			WmScorePackage wmScorePackageRule = new WmScorePackage();
-			wmScorePackageRule.setDelFlag("0");
-			List<WmScorePackage> wmScorePackageRuleList = wmScorePackageService.list(Wrappers.query(wmScorePackageRule));
-			for (WmScorePackage wm : wmScorePackageRuleList) {
-				if (wmScorePackage.getRelationScoreId().equals(wm.getId())) {
-					WmTaskType wmTaskType = new WmTaskType();
-					wmTaskType.setRuleId(wm.getRuleId());
-					List<WmTaskType> wmTaskTypeList = wmTaskTypeService.selectByRuleId(wmTaskType);
-					if (wmTaskTypeList.size() > 0) {
-						wmScorePackage.setRuleId(wm.getRuleId());
-						wmScorePackage.setDrugEntId(wm.getDrugEntId());
-					} else {
-						return R.failed("需要药企给下级cso分配积分规则");
-					}
-				} else if ("".equals(wmScorePackage.getRelationScoreId())) {
-					WmTaskType wmTaskType = new WmTaskType();
-					wmTaskType.setRuleId(wmScorePackage.getAcceptSug());
-					List<WmTaskType> wmTaskTypeList = wmTaskTypeService.selectByRuleId(wmTaskType);
-					if (wmTaskTypeList.size() > 0) {
-						wmScorePackage.setRuleId(wmScorePackage.getAcceptSug());
-						wmScorePackage.setDrugEntId("");
-					} else {
-						return R.failed("cso没有分配积分呢规则");
-					}
+			WmDaAgent daAgent = wmDaAgentService.getOne(Wrappers.<WmDaAgent>lambdaQuery()
+					.eq(WmDaAgent::getEnableFlag, EnableEnum.ENABLE.val())
+					.eq(WmDaAgent::getDelFlag, DelEnum.NOT_DEL.val())
+					.eq(WmDaAgent::getDeptId, String.valueOf(sysDeptRuleId.getDeptId())));
+			if (StringUtils.isNotBlank(wmScorePackage.getRelationScoreId())) {
+				// 关联了积分包的情况
+				WmScorePackage relationScorePackage = wmScorePackageService.getById(wmScorePackage.getRelationScoreId());
+				if (relationScorePackage != null) {
+					wmScorePackage.setRuleId(relationScorePackage.getRuleId());
+					wmScorePackage.setDrugEntId(relationScorePackage.getDrugEntId());
+				} else {
+					return R.failed("cso没有分配积分规则");
+				}
+			} else {
+				// 没有关联积分包的情况
+				List<WmTaskType> taskTypeList = wmTaskTypeService.list(Wrappers.<WmTaskType>lambdaQuery()
+						.eq(WmTaskType::getRuleId, daAgent.getId()));
+				if (CollectionUtil.isNotEmpty(taskTypeList)) {
+					wmScorePackage.setRuleId(daAgent.getId());
+					wmScorePackage.setDrugEntId("");
+				} else {
+					return R.failed("cso没有分配积分规则");
 				}
 			}
-		} else if (sysDeptRuleId.getLevel() == 3 && "".equals(wmScorePackage.getRelationScoreId())) {
-			wmScorePackage.setRuleId(wmScorePackage.getAcceptSug());
-			wmScorePackage.setDrugEntId("");
 		}
 
 		boolean isAnswer = wmScorePackageService.save(wmScorePackage);
@@ -2060,22 +2063,47 @@ public class WmScorePackageController {
 				}
 			} else if (sysDeptRuleId.getLevel() == 3) {
 				//一级cso规则ID
-				WmScorePackage wmScorePackageRule = new WmScorePackage();
-				wmScorePackageRule.setDelFlag("0");
-				List<WmScorePackage> wmScorePackageRuleList = wmScorePackageService.list(Wrappers.query(wmScorePackageRule));
-				for (WmScorePackage wm : wmScorePackageRuleList) {
-					if (wmScorePackage.getRelationScoreId().equals(wm.getId())) {
-						wmScorePackage.setRuleId(wm.getRuleId());
-						wmScorePackage.setDrugEntId(wm.getDrugEntId());
-					} else if (wmScorePackage.getRelationScoreId().equals("")) {
+//				WmScorePackage wmScorePackageRule = new WmScorePackage();
+//				wmScorePackageRule.setDelFlag("0");
+//				List<WmScorePackage> wmScorePackageRuleList = wmScorePackageService.list(Wrappers.query(wmScorePackageRule));
+//				for (WmScorePackage wm : wmScorePackageRuleList) {
+//					if (wmScorePackage.getRelationScoreId().equals(wm.getId())) {
+//						wmScorePackage.setRuleId(wm.getRuleId());
+//						wmScorePackage.setDrugEntId(wm.getDrugEntId());
+//					} else if (wmScorePackage.getRelationScoreId().equals("")) {
+//						wmScorePackage.setRuleId(wmScorePackage.getAcceptSug());
+//						wmScorePackage.setDrugEntId("");
+//					}
+//				}
+				//一级cso规则ID
+				WmDaAgent daAgent = wmDaAgentService.getOne(Wrappers.<WmDaAgent>lambdaQuery()
+						.eq(WmDaAgent::getEnableFlag, EnableEnum.ENABLE.val())
+						.eq(WmDaAgent::getDelFlag, DelEnum.NOT_DEL.val())
+						.eq(WmDaAgent::getDeptId, String.valueOf(sysDeptRuleId.getDeptId())));
+				if (StringUtils.isNotBlank(wmScorePackage.getRelationScoreId())) {
+					// 关联了积分包的情况
+					WmScorePackage relationScorePackage = wmScorePackageService.getById(wmScorePackage.getRelationScoreId());
+					if (relationScorePackage != null) {
+						wmScorePackage.setRuleId(relationScorePackage.getRuleId());
+						wmScorePackage.setDrugEntId(relationScorePackage.getDrugEntId());
+					} else {
+						return R.failed("cso没有分配积分规则");
+					}
+				} else {
+					// 没有关联积分包的情况
+					List<WmTaskType> taskTypeList = wmTaskTypeService.list(Wrappers.<WmTaskType>lambdaQuery()
+							.eq(WmTaskType::getRuleId, daAgent.getId()));
+					if (CollectionUtil.isNotEmpty(taskTypeList)) {
 						wmScorePackage.setRuleId(wmScorePackage.getAcceptSug());
 						wmScorePackage.setDrugEntId("");
+					} else {
+						return R.failed("cso没有分配积分规则");
 					}
 				}
-			} else if (sysDeptRuleId.getLevel() == 3 && "".equals(wmScorePackage.getRelationScoreId())) {
+			}/* else if (sysDeptRuleId.getLevel() == 3 && "".equals(wmScorePackage.getRelationScoreId())) {
 				wmScorePackage.setRuleId(wmScorePackage.getAcceptSug());
 				wmScorePackage.setDrugEntId("");
-			}
+			}*/
 
 
 			WmScorePackage queryWm = new WmScorePackage();

+ 8 - 0
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/mapper/WmDaAgentMapper.java

@@ -92,4 +92,12 @@ public interface WmDaAgentMapper extends DataScopeMapper<WmDaAgent> {
 	 * @return
 	 */
 	List<WmDaAgent> listAgentByDeptLevel(@Param("deptLevel") String deptLevel);
+
+	/**
+	 * 根据deptRelation查询
+	 *
+	 * @param deptId
+	 * @return
+	 */
+	List<WmDaAgent> listAgentByDeptRelation(@Param("deptId") Integer deptId);
 }

+ 8 - 0
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/WmDaAgentService.java

@@ -95,4 +95,12 @@ public interface WmDaAgentService extends IService<WmDaAgent> {
 	 * @return
 	 */
 	List<WmDaAgent> listAgentByDeptLevel(String deptLevel);
+
+	/**
+	 * 根据deptRelation查询
+	 *
+	 * @param deptId
+	 * @return
+	 */
+	List<WmDaAgent> listAgentByDeptRelation(Integer deptId);
 }

+ 11 - 0
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/WmDaAgentServiceImpl.java

@@ -824,6 +824,17 @@ public class WmDaAgentServiceImpl extends ServiceImpl<WmDaAgentMapper, WmDaAgent
 	public List<WmDaAgent> listAgentByDeptLevel(String deptLevel) {
 		return wmDaAgentMapper.listAgentByDeptLevel(deptLevel);
 	}
+
+	/**
+	 * 根据deptRelation查询
+	 *
+	 * @param deptId
+	 * @return
+	 */
+	@Override
+	public List<WmDaAgent> listAgentByDeptRelation(Integer deptId) {
+		return wmDaAgentMapper.listAgentByDeptRelation(deptId);
+	}
 //	@Override
 //	public List selectByCsoIds(Integer id) {
 //		return wmDaAgentMapper.selectByCsoIds(id);

+ 9 - 4
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/WmReportServiceImpl.java

@@ -24,19 +24,18 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qunzhixinxi.hnqz.admin.api.entity.SysDept;
+import com.qunzhixinxi.hnqz.admin.api.entity.SysUser;
 import com.qunzhixinxi.hnqz.admin.entity.WmReport;
 import com.qunzhixinxi.hnqz.admin.entity.WmScorePackage;
 import com.qunzhixinxi.hnqz.admin.entity.WmTask;
 import com.qunzhixinxi.hnqz.admin.enums.ReportEnum;
 import com.qunzhixinxi.hnqz.admin.mapper.WmReportMapper;
-import com.qunzhixinxi.hnqz.admin.service.SysDeptService;
-import com.qunzhixinxi.hnqz.admin.service.WmReportService;
-import com.qunzhixinxi.hnqz.admin.service.WmScorePackageService;
-import com.qunzhixinxi.hnqz.admin.service.WmTaskService;
+import com.qunzhixinxi.hnqz.admin.service.*;
 import com.qunzhixinxi.hnqz.common.core.util.R;
 import com.qunzhixinxi.hnqz.common.security.service.HnqzUser;
 import com.qunzhixinxi.hnqz.common.security.util.SecurityUtils;
 import lombok.AllArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -60,6 +59,7 @@ public class WmReportServiceImpl extends ServiceImpl<WmReportMapper, WmReport> i
 	private final WmTaskService wmTaskService;
 	private final WmReportMapper wmReportMapper;
 	private final SysDeptService sysDeptService;
+	private final SysUserService sysUserService;
 
 	@Override
 	public IPage<WmReport> getReportListPage(Page page, WmReport wmReport, String scoreId, String name){
@@ -293,6 +293,11 @@ public class WmReportServiceImpl extends ServiceImpl<WmReportMapper, WmReport> i
 //					map.put("reportApprovalOpinion",wmtask.getReportSecondApprovalOpinion());
 					map.put("reportApprovalOpinion",wmtask.getReportOneApprovalOpinion());
 				}
+				// 姓名
+				if (StringUtils.isNumeric(wmtask.getTaskUserId())) {
+					SysUser user = sysUserService.getById(Integer.parseInt(wmtask.getTaskUserId()));
+					map.put("taskUsername", user.getRealname());
+				}
 				return map;
 			}).collect(Collectors.toList());
 

+ 11 - 2
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/WmTaskServiceImpl.java

@@ -18,6 +18,7 @@ package com.qunzhixinxi.hnqz.admin.service.impl;
 
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.lang.Assert;
+import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -246,6 +247,7 @@ public class WmTaskServiceImpl extends ServiceImpl<WmTaskMapper, WmTask> impleme
 		SysDept sysDept = sysDeptService.getById(SecurityUtils.getUser().getDeptId());
 		Integer total = 0;
 		if (sysDept.getLevel() == 3) {
+			// 一级CSO
 			if (packageId.contains(",")) {
 				strs1.addAll(Arrays.asList(packageId.split(",")));
 			} else {
@@ -314,6 +316,12 @@ public class WmTaskServiceImpl extends ServiceImpl<WmTaskMapper, WmTask> impleme
 				}
 			}
 		} else if (sysDept.getLevel() == 4) {
+			// 二级CSO
+			if (StringUtils.isNotBlank(wmScorePackage.getDrugEntId())) {
+				// 通过drugEntId为空,判断是否为药企发来的包,即药企->一级CSO->二级CSO的包
+				// 药企->一级CSO->二级CSO的大包,只能由一级CSO提交报告审批,二级CSO在任务中心中,点击生成报告按钮应提示没有权限
+				return R.ok(0);
+			}
 			wmTask.setExtIds(strs1);
 			wmTask.setTaskStatus(String.valueOf(3));
 			List<WmTask> taskList = new ArrayList<>();
@@ -377,6 +385,7 @@ public class WmTaskServiceImpl extends ServiceImpl<WmTaskMapper, WmTask> impleme
 				}
 			}
 		} else if (sysDept.getLevel() == 2) {
+			// 药企
 			wmTask.setExtIds(strs1);
 			wmTask.setTaskStatus(String.valueOf(3));
 			List<WmTask> taskList = new ArrayList<>();
@@ -1687,8 +1696,8 @@ public class WmTaskServiceImpl extends ServiceImpl<WmTaskMapper, WmTask> impleme
 			taskList.stream().forEach(task -> {
 				WmTaskContent wmTaskContent = task.getWmTaskContent();
 				// 如果是系统对接,则将药品temp10字段格式化
-				if (scorePackage != null && "1".equals(scorePackage.getSourceType()) && StringUtils.isNotBlank(wmTaskContent
-						.getTemp10())) {
+				if (scorePackage != null && "1".equals(scorePackage.getSourceType())
+						&& JSONUtil.isJsonArray(wmTaskContent.getTemp10())) {
 					JSONArray drugJsonArr = JSON.parseArray(wmTaskContent.getTemp10());
 					StringBuilder drugStr = new StringBuilder();
 					drugStr.append("\n");

+ 1 - 1
hnqz-upms/hnqz-upms-biz/src/main/resources/bootstrap.yml

@@ -1,5 +1,5 @@
 server:
-  port: 4000
+  port: @prefiles.upms.biz.port@
 
 spring:
   application:

+ 11 - 0
hnqz-upms/hnqz-upms-biz/src/main/resources/mapper/WmDaAgentMapper.xml

@@ -349,4 +349,15 @@
 		  AND d.level = #{deptLevel}
 	</select>
 
+	<!-- 根据deptRelation查询 -->
+	<select id="listAgentByDeptRelation" resultMap="wmDaAgentMap">
+		SELECT
+			*
+		FROM
+			wm_da_agent a
+				LEFT JOIN sys_dept_relation r ON r.descendant = a.dept_id
+		WHERE
+			r.ancestor = #{deptId, jdbcType=INTEGER}
+	</select>
+
 </mapper>

+ 26 - 20
hnqz-upms/hnqz-upms-biz/src/main/resources/mapper/WmScorePackageMapper.xml

@@ -298,6 +298,7 @@
 			</if>
 
 		</where>
+		order by id desc
 	</select>
 
 
@@ -879,26 +880,31 @@
 		relation_score_id = #{query.relationScoreId,jdbcType=VARCHAR}
 	</select>
 	<select id="finishRate" resultMap="wmScorePackageMap">
-select sum(ifnull(c.payScore,0)) pay_score ,sum(c.ysh) ysh
-from (
-select 0 as payScore, a.ysh  from (
-select score_package_id,sum(if(task_status=3,score,0)) ysh from wm_task where wm_task.score_package_id in
-    (
-    select id from wm_score_package where id=#{query.id}
-    union all
-    select id from wm_score_package where relation_score_id in (select id from wm_score_package where id=#{query.id})
-    union all
-    select id from wm_score_package   where relation_score_id in (
-select id from wm_score_package where relation_score_id in (select id from wm_score_package where id=#{query.id}))
-)
- and  wm_task.enable_flag=0 and wm_task.real_flag = '0' and score_package_id is not null and wm_task.del_flag=0
- group by score_package_id
- )a,wm_score_package b where a.score_package_id=b.id and  relation_score_id=#{query.id}
- union all
-select sum(score) as payScore,0 as ysh from wm_task  where report_drug_approval_opinion=1 and  (report_one_id in (select id from wm_report where report_status=6 and score_id=#{query.id})
-or report_second_id in (select id from wm_report where report_status=6 and score_id=#{query.id})
-or report_drug_id in (select id from wm_report where report_status=6 and score_id=#{query.id})
-)) c
+		select sum(ifnull(c.payScore,0)) pay_score ,sum(c.ysh) ysh
+		from (
+			select 0 as payScore, a.ysh  from (
+				select score_package_id,sum(if(task_status=3,score,0)) ysh from wm_task where wm_task.score_package_id in
+					(
+						select id from wm_score_package where id=#{query.id}
+						union all
+						select id from wm_score_package where relation_score_id in (select id from wm_score_package where id=#{query.id})
+						union all
+						select id from wm_score_package   where relation_score_id in (
+							select id from wm_score_package where relation_score_id in (select id from wm_score_package where id=#{query.id})
+						)
+					)
+				 and  wm_task.enable_flag=0 and wm_task.real_flag = '0' and score_package_id is not null and wm_task.del_flag=0
+				 group by score_package_id
+			 )a,wm_score_package b, wm_score_package c where a.score_package_id=b.id and b.relation_score_id=c.id and
+				(b.relation_score_id = #{query.id} or c.relation_score_id = #{query.id})
+			 union all
+				select sum(score) as payScore,0 as ysh from wm_task  where
+				    (report_drug_approval_opinion=1 or report_one_approval_opinion=1) and (report_one_id in (
+				    	select id from wm_report where report_status=6 and score_id=#{query.id})
+					or report_second_id in (select id from wm_report where report_status=6 and score_id=#{query.id})
+					or report_drug_id in (select id from wm_report where report_status=6 and score_id=#{query.id})
+				)
+		) c
 	</select>
 	<select id="getScorePackagekfpjf" resultMap="wmScorePackageMap">
 		select dd.* from (

+ 1 - 1
hnqz-visual/hnqz-daemon-quartz/src/main/resources/bootstrap.yml

@@ -1,5 +1,5 @@
 server:
-  port: 5007
+  port: @profiles.daemon.quartz.port@
 
 quartz:
   enabled: true

+ 25 - 2
pom.xml

@@ -260,6 +260,7 @@
 		</repository>
 	</repositories>
 
+
 	<profiles>
 		<profile>
 			<id>dev</id>
@@ -267,6 +268,10 @@
 				<!-- 环境标识,需要与配置文件的名称相对应 -->
 				<profiles.active>dev</profiles.active>
 				<profiles.namespace>639c1543-7221-46c9-a3ab-8993a6c44b19</profiles.namespace>
+				<profiles.auth.port>3000</profiles.auth.port>
+				<profiles.gateway.port>9999</profiles.gateway.port>
+				<prefiles.upms.biz.port>4000</prefiles.upms.biz.port>
+				<profiles.daemon.quartz.port>5007</profiles.daemon.quartz.port>
 			</properties>
 			<activation>
 				<!-- 默认环境 -->
@@ -277,7 +282,22 @@
 			<id>test</id>
 			<properties>
 				<profiles.active>test</profiles.active>
+				<profiles.namespace>842ded71-0bc3-41fe-8a64-460c9d091fdc</profiles.namespace>
+				<profiles.auth.port>3000</profiles.auth.port>
+				<profiles.gateway.port>9999</profiles.gateway.port>
+				<prefiles.upms.biz.port>4000</prefiles.upms.biz.port>
+				<profiles.daemon.quartz.port>5007</profiles.daemon.quartz.port>
+			</properties>
+		</profile>
+		<profile>
+			<id>pre</id>
+			<properties>
+				<profiles.active>pre</profiles.active>
 				<profiles.namespace>dad4fedb-3a24-4560-b6cf-d9aafa3adc71</profiles.namespace>
+				<profiles.auth.port>7001</profiles.auth.port>
+				<profiles.gateway.port>7002</profiles.gateway.port>
+				<prefiles.upms.biz.port>7003</prefiles.upms.biz.port>
+				<profiles.daemon.quartz.port>7004</profiles.daemon.quartz.port>
 			</properties>
 		</profile>
 		<profile>
@@ -285,8 +305,11 @@
 			<properties>
 				<profiles.active>pro</profiles.active>
 				<profiles.namespace>e2658ecc-4abf-418e-bd91-6e8366fd0912</profiles.namespace>
+				<profiles.auth.port>3000</profiles.auth.port>
+				<profiles.gateway.port>9999</profiles.gateway.port>
+				<prefiles.upms.biz.port>4000</prefiles.upms.biz.port>
+				<profiles.daemon.quartz.port>5007</profiles.daemon.quartz.port>
 			</properties>
 		</profile>
 	</profiles>
-
-</project>
+</project>