Explorar el Código

feat: shegnuo quiz

shc hace 1 año
padre
commit
67977b26c1

+ 38 - 0
hnqz-upms/hnqz-upms-api/src/main/java/com/qunzhixinxi/hnqz/admin/api/dto/WmTaskDTO.java

@@ -0,0 +1,38 @@
+package com.qunzhixinxi.hnqz.admin.api.dto;
+
+import lombok.AccessLevel;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotEmpty;
+import java.util.Map;
+
+/**
+ * 任务相关DTO
+ *
+ * @author jimmy
+ * @version 1.0.0
+ * @date 2023-11-05 18:12
+ */
+@NoArgsConstructor(access = AccessLevel.NONE)
+public final class WmTaskDTO {
+
+	@Data
+	public static class OnOutPartyCreate {
+
+		@NotBlank(message = "任务类型ID必填")
+		private String taskTypeId;
+
+		@NotBlank(message = "积分包名称必填")
+		private String pkgName;
+
+		@NotBlank(message = "代表用户名必填")
+		private String username;
+
+		@NotEmpty(message = "三方结果必填")
+		private Map<String, Object> result;
+
+	}
+
+}

+ 39 - 6
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/ApiController.java

@@ -28,6 +28,7 @@ import com.qunzhixinxi.hnqz.admin.api.constant.UpmsType;
 import com.qunzhixinxi.hnqz.admin.api.dto.UserDTO;
 import com.qunzhixinxi.hnqz.admin.api.dto.WmPkgDTO;
 import com.qunzhixinxi.hnqz.admin.api.dto.WmQuizDTO;
+import com.qunzhixinxi.hnqz.admin.api.dto.WmTaskDTO;
 import com.qunzhixinxi.hnqz.admin.api.entity.SysDept;
 import com.qunzhixinxi.hnqz.admin.api.entity.SysDeptCsm;
 import com.qunzhixinxi.hnqz.admin.api.entity.SysDictItem;
@@ -371,14 +372,11 @@ public class ApiController {
 					}
 					dictMap.put(config.getDictGroupName(), listMap);
 				} else if ("package_list".equals(config.getDictGroupName())) {
-					/**
-					 * 查询可以关联的积分包
-					 */
+					// 查询可以关联的积分包
 					List<Map<String, Object>> listMap = new ArrayList<>();
 					if (null == SecurityUtils.getUser()) {
 
 					} else {
-//						UserVO userVO = sysUserService.selectUserVoById(SecurityUtils.getUser().getId());
 						WmScorePackageStatus query = new WmScorePackageStatus();
 						query.setUserId(String.valueOf(SecurityUtils.getUser().getId()));
 						query.setStatus("2");
@@ -1081,7 +1079,7 @@ public class ApiController {
 	 */
 	@SysLog("获取积分规则")
 	@GetMapping("/getTaskTypeListByRuleId")
-	public R getTaskTypeListByRuleId(WmTaskType wmTaskType) {
+	public R<?> getTaskTypeListByRuleId(WmTaskType wmTaskType) {
 
 		if (StringUtils.isEmpty(wmTaskType.getRuleId())) {
 			return R.failed("积分规则ID不能为空");
@@ -1120,7 +1118,7 @@ public class ApiController {
 	 */
 	@SysLog("获取积分规则")
 	@GetMapping("/taskTypeScoreList")
-	public R taskTypeScoreList(WmTaskType wmTaskType) {
+	public R<?> taskTypeScoreList(WmTaskType wmTaskType) {
 		if (null == wmTaskType.getDurgentId()) {
 			return R.failed("药企ID不能为空");
 		}
@@ -1148,6 +1146,41 @@ public class ApiController {
 		return R.ok(wmTaskTypeService.list(Wrappers.query(wmTaskType)));
 	}
 
+	/**
+	 * 三方平台提交任务,无鉴权
+	 *
+	 * @param resource 结果内容
+	 * @return R
+	 */
+	@Inner(value = false)
+	@SysLog("三方平台提交任务,无鉴权")
+	@PostMapping("/task/content/create")
+	public R<?> saveTaskContent1(@RequestBody WmTaskDTO.OnOutPartyCreate resource) {
+
+		log.info("三方平台提交任务,入参:{}", resource);
+
+		if (StrUtil.isBlank(resource.getTaskTypeId())) {
+			return R.failed("任务类型不能为空");
+		}
+
+		if (StrUtil.isBlank(resource.getPkgName())) {
+			return R.failed("关联积分包不能为空");
+		}
+
+		if (StrUtil.isBlank(resource.getUsername())) {
+			return R.failed("代表手机号必填");
+		}
+
+		if (CollUtil.isEmpty(resource.getResult())) {
+			return R.failed("任务结果内容必填");
+		}
+
+		boolean succ = wmTaskContentService.saveTaskContent1(resource);
+
+		return succ ? R.ok("三方提交结果成功") : R.failed("三方提交结果失败");
+	}
+
+
 	/**
 	 * 新增任务内容表
 	 *

+ 9 - 17
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/WmTaskContentService.java

@@ -1,23 +1,7 @@
-/*
- *    Copyright (c) 2018-2025, hnqz All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: hnqz
- */
-
 package com.qunzhixinxi.hnqz.admin.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.qunzhixinxi.hnqz.admin.api.dto.WmTaskDTO;
 import com.qunzhixinxi.hnqz.admin.api.entity.WmTaskSubmissionRule;
 import com.qunzhixinxi.hnqz.admin.entity.WmTaskContent;
 import com.qunzhixinxi.hnqz.common.core.util.R;
@@ -48,4 +32,12 @@ public interface WmTaskContentService extends IService<WmTaskContent> {
 	 * @return 任务类型
 	 */
 	List<WmTaskSubmissionRule.SubmissionRule> getTaskSubmissionRule(String taskTypeId, String deptId);
+
+	/**
+	 * 三方提交任务
+	 *
+	 * @param resource 任务信息
+	 * @return 创建结果
+	 */
+	boolean saveTaskContent1(WmTaskDTO.OnOutPartyCreate resource);
 }

+ 254 - 46
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/WmTaskContentServiceImpl.java

@@ -1,19 +1,3 @@
-/*
- *    Copyright (c) 2018-2025, hnqz All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: hnqz
- */
 package com.qunzhixinxi.hnqz.admin.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
@@ -22,11 +6,14 @@ import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.ArrayUtil;
 import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.google.common.collect.ImmutableList;
 import com.qunzhixinxi.hnqz.admin.api.constant.UpmsType;
+import com.qunzhixinxi.hnqz.admin.api.dto.WmTaskDTO;
+import com.qunzhixinxi.hnqz.admin.api.entity.SysUser;
 import com.qunzhixinxi.hnqz.admin.api.entity.WmTaskSubmissionPercentRule;
 import com.qunzhixinxi.hnqz.admin.api.entity.WmTaskSubmissionRule;
 import com.qunzhixinxi.hnqz.admin.api.entity.WmTaskTypeSubCategory;
@@ -43,6 +30,7 @@ import com.qunzhixinxi.hnqz.admin.enums.PackageTypeEnum;
 import com.qunzhixinxi.hnqz.admin.mapper.WmDaHospitalMapper;
 import com.qunzhixinxi.hnqz.admin.mapper.WmTaskContentMapper;
 import com.qunzhixinxi.hnqz.admin.mapper.WmUserSignMapper;
+import com.qunzhixinxi.hnqz.admin.service.SysDeptService;
 import com.qunzhixinxi.hnqz.admin.service.SysPublicParamService;
 import com.qunzhixinxi.hnqz.admin.service.SysUserService;
 import com.qunzhixinxi.hnqz.admin.service.WmScorePackageService;
@@ -54,7 +42,9 @@ import com.qunzhixinxi.hnqz.admin.service.WmTaskSubmissionRuleService;
 import com.qunzhixinxi.hnqz.admin.service.WmTaskTypeService;
 import com.qunzhixinxi.hnqz.admin.service.WmTaskTypeSubCategoryService;
 import com.qunzhixinxi.hnqz.admin.util.HnqzUtils;
+import com.qunzhixinxi.hnqz.common.core.constant.CommonConstants;
 import com.qunzhixinxi.hnqz.common.core.constant.enums.CommonFlag;
+import com.qunzhixinxi.hnqz.common.core.exception.BizException;
 import com.qunzhixinxi.hnqz.common.core.util.R;
 import com.qunzhixinxi.hnqz.common.security.service.HnqzUser;
 import com.qunzhixinxi.hnqz.common.security.util.SecurityUtils;
@@ -62,7 +52,7 @@ import com.qunzhixinxi.hnqz.common.sequence.sequence.Sequence;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -77,14 +67,15 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
-import java.util.function.Function;
 import java.util.stream.Collectors;
 
 /**
  * 任务内容表
  *
- * @author gaoyanng
- * @date 2020-06-25 23:35:25
+ * @author gaoyang
+ * @author jimmy
+ * @version 1.0.0
+ * @date 2023-11-05 18:05
  */
 @Slf4j
 @Service
@@ -101,12 +92,16 @@ public class WmTaskContentServiceImpl extends ServiceImpl<WmTaskContentMapper, W
 	private final WmTaskTypeSubCategoryService taskTypeSubCategoryService;
 	private final WmTaskSubmissionRuleService taskSubmissionRuleService;
 	private final WmTaskSubmissionPercentRuleService wmTaskSubmissionPercentRuleService;
+	private final SysDeptService deptService;
 	private final Sequence taskSequence;
 
 
 	private static final DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
 
-	private static final String[] ingTypeIds = {"5", "6","8", "9", "10", "11", "33"};
+	private static final String[] ingTypeIds = {"5", "6", "8", "9", "10", "11", "33"};
+
+	@Value("${spring.profiles.active}")
+	private String active;
 
 	/**
 	 * 校验积分包
@@ -236,7 +231,6 @@ public class WmTaskContentServiceImpl extends ServiceImpl<WmTaskContentMapper, W
 		return rules.get(0).getRule();
 	}
 
-
 	/**
 	 * 会议、1对1专访、培训的校验
 	 *
@@ -293,11 +287,11 @@ public class WmTaskContentServiceImpl extends ServiceImpl<WmTaskContentMapper, W
 	/**
 	 * 医院信息修改
 	 *
-	 * @param hosId      医院id
-	 * @param userId     用户id
-	 * @param rules      校验规则
+	 * @param hosId  医院id
+	 * @param userId 用户id
+	 * @param rules  校验规则
 	 */
-	private void ctt_30( String hosId, Integer userId, List<WmTaskSubmissionRule.SubmissionRule> rules) {
+	private void ctt_30(String hosId, Integer userId, List<WmTaskSubmissionRule.SubmissionRule> rules) {
 
 		int hosUpperLimit = 0;
 		int userUpperLimit = 0;
@@ -436,31 +430,13 @@ public class WmTaskContentServiceImpl extends ServiceImpl<WmTaskContentMapper, W
 			}
 		}
 
-		// 医院信息收集、医院信息修改两类任务做的任务总积分不得大于积分包值的60%(积分包值小于5000不做限制)
-//		if ("15".equals(wmTaskContent.getTemp30()) || "30".equals(wmTaskContent.getTemp30())) {
-//			if (scorePackage.getScore() > 5000) {
-//				List<WmTask> wmTaskList = wmTaskService.list(Wrappers.<WmTask>lambdaQuery()
-//						.eq(WmTask::getRealFlag, "0")
-//						.eq(WmTask::getDelFlag, DelEnum.NOT_DEL.val())
-//						.in(WmTask::getScorePackageId, scorePackage.getId())
-//						.in(WmTask::getTaskTypeId, "15", "30")
-//						.ne(WmTask::getTaskStatus, "4"));
-//				if (CollectionUtil.isNotEmpty(wmTaskList)) {
-//					int totalScore = scorePackage.getScore();
-//					int partScore = wmTaskList.stream().mapToInt(WmTask::getScore).sum();
-//					if (partScore * 1.0 / totalScore > 0.6) {
-//						throw new RuntimeException("医院信息收集、医院信息修改两类任务总积分不得大于积分包值的60%");
-//					}
-//				}
-//			}
-//		}
 		// 校验任务百分比限制规则(如果积分包值大于【任务配置】-【百分比限制】配置的起始值,
 		// 且【任务配置】-【百分比限制】所选的任务类型对应的任务总完成积分值>积分包值*【任务配置】-【百分比限制】配置的百分比,则校验不通过)
 		log.info("当前提交任务类型id:{}", taskTypeId);
-		if (!ArrayUtil.contains(ingTypeIds, taskTypeId)){
+		if (!ArrayUtil.contains(ingTypeIds, taskTypeId)) {
 
 			List<String> toCheckTaskTypeIds;
-			if ("15".equals(taskTypeId) || "30".equals(taskTypeId)){
+			if ("15".equals(taskTypeId) || "30".equals(taskTypeId)) {
 				toCheckTaskTypeIds = new ArrayList<>(2);
 				toCheckTaskTypeIds.add("15");
 				toCheckTaskTypeIds.add("30");
@@ -903,4 +879,236 @@ public class WmTaskContentServiceImpl extends ServiceImpl<WmTaskContentMapper, W
 		return R.ok(resultMap);
 	}
 
+
+	/**
+	 * 三方提交任务
+	 *
+	 * @param resource 任务信息
+	 * @return 创建结果
+	 */
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public boolean saveTaskContent1(WmTaskDTO.OnOutPartyCreate resource) {
+
+		final String pkgName = resource.getPkgName();
+		final String username = resource.getUsername();
+		final String taskTypeId = resource.getTaskTypeId();
+
+		Integer deptId = "pro".equals(active) ? 1611890636 : 1611890564;
+
+		log.info("根据环境获取企业ID,active: [{}], deptId: [{}]", active, deptId);
+
+
+		// 获取积分包
+		WmScorePackage tWmScorePackage = wmScorePackageService.getOne(Wrappers.<WmScorePackage>lambdaQuery().eq(WmScorePackage::getDeptId, deptId).eq(WmScorePackage::getScorePackageName, pkgName));
+
+		if (tWmScorePackage == null) {
+			log.error("当前企业不存在,名为[{}]的积分包", pkgName);
+			throw new BizException("积分包不存在");
+		}
+
+		// 校验
+		SysUser user = sysUserService.getOne(Wrappers.<SysUser>lambdaQuery().eq(SysUser::getDeptId, deptId).eq(SysUser::getUsername, username)
+				.eq(SysUser::getDelFlag, CommonConstants.STATUS_NORMAL)
+				.eq(SysUser::getLockFlag, CommonConstants.STATUS_NORMAL)
+		);
+
+		if (user == null) {
+			log.error("当前企业不存在,手机号为[{}]的人员", username);
+			throw new BizException("人员不存在");
+		}
+
+		UserVO sysU = sysUserService.selectUserVoById(user.getUserId());
+
+
+		// 校验超过60周岁,不能做任务
+		Map<String, String> checkResult = sysUserService.checkSixtyYearsOld(sysU);
+		if (CollUtil.isNotEmpty(checkResult) && checkResult.containsKey("OVER")) {
+			log.error("当前人员超过60周岁");
+			throw new BizException(checkResult.get("OVER"));
+		}
+
+		List<WmScorePackageStatus> statusList = checkPackageStatus(sysU.getUserId(), tWmScorePackage.getId());
+
+		// 查询任务类型启用状态
+		List<WmTaskSubmissionPercentRule> rules = wmTaskSubmissionPercentRuleService.list(Wrappers.<WmTaskSubmissionPercentRule>lambdaQuery()
+				.eq(WmTaskSubmissionPercentRule::getDeptId, user.getDeptId())
+				.eq(WmTaskSubmissionPercentRule::getSubCategory, UpmsType.TaskSubCategory2.TASK_TYPE_CONFIG));
+		if (CollUtil.isEmpty(rules)) {
+			log.error("当前企业未开启该任务");
+			throw new BizException("当前企业未开启该任务!");
+		}
+
+		String[] taskTypeIds = rules.get(0).getRule().getTaskTypeIds();
+		if (!ArrayUtil.contains(taskTypeIds, taskTypeId)) {
+			log.error("当前企业未开启该任务");
+			throw new BizException("当前企业未开启该任务!");
+		}
+
+		// 检验分值 3W
+		this.limitScore(sysU.getUserId(), deptId, tWmScorePackage.getPackageType1());
+
+		// 保存详情
+		WmTaskContent taskContent = new WmTaskContent();
+		taskContent.setTemp29(JSONUtil.toJsonStr(resource.getResult()));
+		taskContent.setTemp30(taskTypeId);
+		taskContent.setTemp32(tWmScorePackage.getId());
+		boolean save = this.save(taskContent);
+
+		WmScorePackageStatus scorePackageStatus = statusList.get(0);
+		if (save) {
+
+			WmTask wmTask = new WmTask();
+			wmTask.setTaskFrom("1");
+			LocalDateTime now = LocalDateTime.now();
+			wmTask.setUpdateTime(now);
+			wmTask.setCreateTime(now);
+			wmTask.setTaskUserId(String.valueOf(sysU.getUserId()));
+			wmTask.setLookintoDate(now);
+			wmTask.setDrugEntId(tWmScorePackage.getDrugEntId());
+			wmTask.setTaskTypeId(taskTypeId);
+
+			WmTaskType wmTaskType = new WmTaskType();
+			wmTaskType.setRuleId(tWmScorePackage.getRuleId());
+			WmTaskType wmTaskType1 = wmTaskTypeService.getById(taskTypeId);
+			wmTaskType.setTaskTypeName(wmTaskType1.getTaskTypeName());
+			int score = wmTaskTypeService.getWmTaskTypeByEnt(wmTaskType);
+
+
+			// 校验任务类型是否启用
+			WmTaskType _baseTaskType = wmTaskTypeService.getById(taskTypeId);
+			WmTaskType queryTaskType = new WmTaskType();
+			queryTaskType.setRuleId(tWmScorePackage.getRuleId());
+			queryTaskType.setTaskTypeName(_baseTaskType.getTaskTypeName());
+			queryTaskType.setDelFlag("0");
+			List<WmTaskType> deptTaskTypes = wmTaskTypeService.list(Wrappers.query(queryTaskType));
+			if (CollUtil.isEmpty(deptTaskTypes)) {
+				throw new BizException(_baseTaskType.getTaskTypeName() + "任务类型不存在");
+			}
+			if (EnableEnum.DISABLE.val().equals(deptTaskTypes.get(0).getEnableFlag())) {
+				throw new BizException(_baseTaskType.getTaskTypeName() + "任务类型已停用");
+			}
+
+			log.info("获取任务得分:{}", score);
+
+			if (score < 0) {
+				throw new BizException("获取任务积分失败");
+			}
+			wmTask.setScore(score);
+
+			log.warn("获取积分包ID:{}", tWmScorePackage);
+			wmTask.setScorePackageId(tWmScorePackage.getId());
+			wmTask.setTaskRuleId(tWmScorePackage.getTaskRuleId());
+
+			wmTask.setTaskContentId(String.valueOf(taskContent.getId()));
+
+			if (HnqzUtils.isZbRole(sysU.getRoleList(), 5)) {
+				wmTask.setTaskUserType("5");
+			}
+
+			if (HnqzUtils.isZbRole(sysU.getRoleList(), 6)) {
+				wmTask.setTaskUserType("6");
+			}
+
+			wmTask.setDeptId(deptId.toString());
+			wmTask.setSubmitStatus("0");
+
+			// 不需要平台管理员审核的直接提交上级审核  taskStatus = 2 已提交 否则 taskStatus = 1 待提交
+			wmTask.setRealFlag("0");
+			wmTask.setTaskStatus("2");
+
+			wmTask.setTaskNumber(taskSequence.nextNo());
+			//保存任务
+			boolean isSave = wmTaskService.save(wmTask);
+
+			//判断任务是否完成
+			if (isSave) {
+				WmScorePackage wmScorePackage1 = wmScorePackageService.getById(tWmScorePackage.getId());
+				if (null != wmScorePackage1) {
+					WmTask taskQuery = new WmTask();
+					taskQuery.setScorePackageId(tWmScorePackage.getId());
+					QueryWrapper<WmTask> taskQueryWrapper = Wrappers.query(taskQuery);
+
+					// 查询出 审核通过和审核中的任务
+					taskQueryWrapper.lambda()
+							.ne(WmTask::getTaskStatus, "4")
+							.eq(WmTask::getRealFlag, "0");
+					List<WmTask> wmTaskList = wmTaskService.list(taskQueryWrapper);
+
+					// 判断定量还是定额 1- 定额   2-定量
+					if (StrUtil.equals(PackageTypeEnum.TYPE1_SCOTE_PACKAGE.val(), wmScorePackage1.getPackageType1())) {
+
+						int totalCount = 0;
+						for (WmTask wmtask : wmTaskList) {
+							totalCount += wmtask.getScore();
+						}
+
+						if (totalCount >= wmScorePackage1.getScore()) {
+							wmScorePackage1.setTaskAddFlag("0");
+							scorePackageStatus.setTaskAddFlag("0");
+							wmScorePackageStatusService.updateById(scorePackageStatus);
+						}
+					} else if (StrUtil.equals(PackageTypeEnum.TYPE1_SCORE_AND_TASK_PACKAGE.val(), wmScorePackage1.getPackageType1())) {
+						// 多人积分包处理
+						int totalCount = 0;
+						for (WmTask wmtask : wmTaskList) {
+							totalCount += wmtask.getScore();
+						}
+
+						if (totalCount >= wmScorePackage1.getScore()) {
+							wmScorePackage1.setTaskAddFlag("0");
+							List<WmScorePackageStatus> packageStatusList = wmScorePackageStatusService.list(Wrappers.<WmScorePackageStatus>lambdaQuery()
+									.eq(WmScorePackageStatus::getStatus, "2")
+									.eq(WmScorePackageStatus::getTaskAddFlag, "1")
+									.eq(WmScorePackageStatus::getPackageId, tWmScorePackage.getId()));
+							if (CollUtil.isNotEmpty(packageStatusList)) {
+								packageStatusList.forEach(packageStatus -> {
+									WmScorePackageStatus updatePackageStatus = new WmScorePackageStatus();
+									updatePackageStatus.setId(packageStatus.getId());
+									updatePackageStatus.setTaskAddFlag("0");
+									updatePackageStatus.setUpdateTime(LocalDateTime.now());
+									wmScorePackageStatusService.updateById(updatePackageStatus);
+								});
+							}
+						}
+					} else if ("2".equals(wmScorePackage1.getPackageType1()) || "3".equals(wmScorePackage1.getPackageType1())) {
+						score = 0;
+
+						List<WmTask> userTaskList = wmTaskList.stream().filter(item ->
+								item.getTaskUserId().equals(sysU.getUserId() + "")).collect(Collectors.toList());
+
+						if (userTaskList.size() >= scorePackageStatus.getTaskNum()) {
+							scorePackageStatus.setTaskAddFlag("0");
+							wmScorePackageStatusService.updateById(scorePackageStatus);
+
+							// 改变大包状态
+							WmScorePackageStatus queryAll = new WmScorePackageStatus();
+							queryAll.setPackageId(tWmScorePackage.getId());
+							queryAll.setStatus("2");
+							queryAll.setTaskAddFlag("0");
+							List<WmScorePackageStatus> statusAll = wmScorePackageStatusService.
+									list(Wrappers.query(queryAll));
+							if (new BigDecimal(wmScorePackage1.getUserNum())
+									.compareTo(new BigDecimal(statusAll.size())) <= 0) {
+								wmScorePackage1.setTaskAddFlag("0");
+							}
+						}
+
+					}
+
+					wmScorePackage1.setIsConduct("1");
+					wmScorePackageService.updateById(wmScorePackage1);
+
+				}
+
+			} else {
+				throw new BizException("任务保存失败");
+			}
+		} else {
+			throw new BizException("任务详情保存失败");
+		}
+
+		return true;
+	}
+
 }