Эх сурвалжийг харах

feat: 企业批量任务审核-sql调整

lixuesong 2 жил өмнө
parent
commit
ce85388771

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

@@ -280,7 +280,7 @@ public class WmReportController {
 	 * @return
 	 * @return
 	 */
 	 */
 	@GetMapping("/task-page-by-type")
 	@GetMapping("/task-page-by-type")
-	public R<?> taskPageByTaskType(Page<WmTaskVO> page, String taskTypeName, String entTaskStatus) {
+	public R<?> taskPageByTaskType(Page<WmTaskVO> page, String taskTypeName, String[] entTaskStatus) {
 
 
 		return wmReportService.taskPageByTaskType(page, taskTypeName, entTaskStatus);
 		return wmReportService.taskPageByTaskType(page, taskTypeName, entTaskStatus);
 	}
 	}

+ 2 - 2
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/entity/WmReport.java

@@ -162,8 +162,8 @@ public class WmReport extends Model<WmReport> {
 	private List<String> taskTypeIdList;
 	private List<String> taskTypeIdList;
 
 
 	/**
 	/**
-	 * 报告审批状态:1通过,2不通过
+	 * 报告审批状态:0待审核 1通过,2不通过
 	 */
 	 */
 	@TableField(exist = false)
 	@TableField(exist = false)
-	private String entTaskStatus;
+	private List<String> entTaskStatus;
 }
 }

+ 1 - 1
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/WmReportService.java

@@ -62,7 +62,7 @@ public interface WmReportService extends IService<WmReport> {
 	 * @param entTaskStatus
 	 * @param entTaskStatus
 	 * @return
 	 * @return
 	 */
 	 */
-	R<?> taskPageByTaskType(Page<WmTaskVO> page, String taskTypeName, String entTaskStatus);
+	R<?> taskPageByTaskType(Page<WmTaskVO> page, String taskTypeName, String[] entTaskStatus);
 
 
 
 
 }
 }

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

@@ -19,6 +19,7 @@ package com.qunzhixinxi.hnqz.admin.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.map.MapUtil;
 import cn.hutool.core.map.MapUtil;
+import cn.hutool.core.util.ArrayUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
@@ -68,6 +69,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeUnit;
@@ -516,7 +518,7 @@ public class WmReportServiceImpl extends ServiceImpl<WmReportMapper, WmReport> i
 	 * @return
 	 * @return
 	 */
 	 */
 	@Override
 	@Override
-	public R<?> taskPageByTaskType(Page<WmTaskVO> page, String taskTypeName, String entTaskStatus) {
+	public R<?> taskPageByTaskType(Page<WmTaskVO> page, String taskTypeName, String[] entTaskStatus) {
 
 
 		LambdaQueryWrapper<WmTaskType> queryWrapper = Wrappers.<WmTaskType>lambdaQuery()
 		LambdaQueryWrapper<WmTaskType> queryWrapper = Wrappers.<WmTaskType>lambdaQuery()
 				.eq(WmTaskType::getTaskTypeLevel, "1")
 				.eq(WmTaskType::getTaskTypeLevel, "1")
@@ -541,8 +543,8 @@ public class WmReportServiceImpl extends ServiceImpl<WmReportMapper, WmReport> i
 		WmReport queryReport = new WmReport();
 		WmReport queryReport = new WmReport();
 		queryReport.setDrugEntId(SecurityUtils.getUser().getDeptId());
 		queryReport.setDrugEntId(SecurityUtils.getUser().getDeptId());
 		queryReport.setTaskTypeIdList(baseTaskTypeList.stream().map(WmTaskType::getId).collect(Collectors.toList()));
 		queryReport.setTaskTypeIdList(baseTaskTypeList.stream().map(WmTaskType::getId).collect(Collectors.toList()));
-		if (StrUtil.isNotBlank(entTaskStatus)) {
-			queryReport.setEntTaskStatus(entTaskStatus);
+		if (ArrayUtil.isNotEmpty(entTaskStatus)) {
+			queryReport.setEntTaskStatus(Arrays.asList(entTaskStatus));
 		}
 		}
 		IPage<WmTaskVO> pages = wmTaskMapper.entTaskPageByTaskType(page, queryReport);
 		IPage<WmTaskVO> pages = wmTaskMapper.entTaskPageByTaskType(page, queryReport);
 
 

+ 17 - 15
hnqz-upms/hnqz-upms-biz/src/main/resources/mapper/WmTaskMapper.xml

@@ -1344,20 +1344,22 @@ FROM
 		<foreach collection="query.taskTypeIdList" item="item" index="index" separator="," open="(" close=")">
 		<foreach collection="query.taskTypeIdList" item="item" index="index" separator="," open="(" close=")">
 			#{item}
 			#{item}
 		</foreach>
 		</foreach>
-	  	<if test="query.entTaskStatus != null and query.entTaskStatus == 1">
-		  and (p.typeid = 0 and t.report_drug_approval_opinion = #{query.entTaskStatus}
-		  or p.typeid = 1 and t.report_drug_approval_opinion = #{query.entTaskStatus}
-		  or p.typeid = 2 and t.report_one_approval_opinion = #{query.entTaskStatus})
-	  	</if>
-		<if test="query.entTaskStatus != null and query.entTaskStatus == 2">
-			and (p.typeid = 0 and t.report_drug_approval_opinion = #{query.entTaskStatus}
-			or p.typeid = 1 and t.report_drug_approval_opinion = #{query.entTaskStatus}
-			or p.typeid = 2 and t.report_one_approval_opinion = #{query.entTaskStatus})
-		</if>
-		<if test="query.entTaskStatus != null and query.entTaskStatus == 0">
-		  and (p.typeid = 0 and t.report_drug_approval_opinion is null
-			or p.typeid = 1 and t.report_drug_approval_opinion is null
-			or p.typeid = 2 and t.report_one_approval_opinion is null)
-		</if>
+		<foreach collection="query.entTaskStatus" item="item" index="index" separator="or" open="and (" close=")">
+			<if test="item == 1">
+			  (p.typeid = 0 and t.report_drug_approval_opinion = #{item}
+			  or p.typeid = 1 and t.report_drug_approval_opinion = #{item}
+			  or p.typeid = 2 and t.report_one_approval_opinion = #{item})
+			</if>
+			<if test="item == 2">
+				(p.typeid = 0 and t.report_drug_approval_opinion = #{item}
+				or p.typeid = 1 and t.report_drug_approval_opinion = #{item}
+				or p.typeid = 2 and t.report_one_approval_opinion = #{item})
+			</if>
+			<if test="item == 0">
+			  (p.typeid = 0 and t.report_drug_approval_opinion is null
+				or p.typeid = 1 and t.report_drug_approval_opinion is null
+				or p.typeid = 2 and t.report_one_approval_opinion is null)
+			</if>
+		</foreach>
 	</select>
 	</select>
 </mapper>
 </mapper>