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

Merge branch 'feat-20230329-mazhou' into temp-pre

李学松 2 жил өмнө
parent
commit
c9899a4f5b

+ 13 - 0
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/WmPayOffController.java

@@ -38,6 +38,7 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
@@ -202,6 +203,18 @@ public class WmPayOffController {
 		return wmPayOffService.settleById(input.getId());
 	}
 
+	/**
+	 * 多人承接-按积分值业务结算-查询
+	 *
+	 * @param taskIds 任务id
+	 * @return 待提交的信息
+	 */
+	@SysLog("多人承接-按积分值业务结算-查询")
+	@GetMapping("/settle-info-by-taskIds")
+	public R<?> settleInfoByTaskIds(@RequestParam("taskIds") String[] taskIds) {
+
+		return wmPayOffService.settleInfoByTaskIds(taskIds);
+	}
 
 	/**
 	 * 财务审核页面

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

@@ -70,7 +70,6 @@ import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalTime;
 import java.time.format.DateTimeFormatter;
-import java.time.temporal.TemporalAccessor;
 import java.time.temporal.TemporalAdjusters;
 import java.util.*;
 import java.util.concurrent.ExecutionException;
@@ -109,6 +108,7 @@ public class WmScorePackageController {
 	private final WmDaDrugEntMapper wmDaDrugEntMapper;
 	private final WmDaAgentMapper wmDaAgentMapper;
 	private final WmTeamService wmTeamService;
+	private final WmScorePackageSettleNoteMapper settleNoteMapper;
 	private final StringRedisTemplate redisTemplate;
 
 
@@ -2631,6 +2631,142 @@ public class WmScorePackageController {
 		return R.ok(wmScorePackagePage);
 	}
 
+	/**
+	 * 积分包列表(结算包管理列表、无团队限制)
+	 *
+	 * @param packageType1 多个逗号分隔
+	 * @param acceptUser 接单对象,模糊查询
+	 */
+	@ApiOperation(value = "分页查询", notes = "分页查询")
+	@GetMapping("/page-settle-package")
+	public R pageSettlePackage(@RequestParam(value = "current") Integer current,
+								 @RequestParam(value = "size") Integer size,
+								 @RequestParam(value = "packageType1") String packageType1,
+								 @RequestParam(value = "packageType2") Integer packageType2,
+								 @RequestParam(value = "scorePackageName", required = false) String scorePackageName,
+								 @RequestParam(value = "scorePackageStatus", required = false) Integer scorePackageStatus,
+								 @RequestParam(value = "typeid", required = false) String typeId,
+								 @RequestParam(value = "monthStart", required = false) String monthStart,
+								 @RequestParam(value = "monthEnd", required = false) String monthEnd,
+								 @RequestParam(value = "acceptUser", required = false) String acceptUser
+	) {
+
+		Integer sendDeptId = SecurityUtils.getUser().getDeptId();
+		Integer userId = SecurityUtils.getUser().getId();
+
+		LocalDateTime start = null;
+		LocalDateTime end = null;
+
+		if (StrUtil.isNotEmpty(monthStart) && StrUtil.isNotEmpty(monthEnd)) {
+			start = LocalDateTime.of(LocalDate.parse(monthStart + "-01", DatePattern.NORM_DATE_FORMATTER), LocalTime.MIN);
+			LocalDate e = LocalDate.parse(monthEnd + "-01", DatePattern.NORM_DATE_FORMATTER);
+			end = LocalDateTime.of(e.with(TemporalAdjusters.lastDayOfMonth()), LocalTime.MAX);
+
+		}
+
+		LambdaQueryWrapper<WmScorePackage> queryWrapper = Wrappers.<WmScorePackage>lambdaQuery()
+				.eq(WmScorePackage::getPackageType2, packageType2)
+				.like(StrUtil.isNotEmpty(scorePackageName), WmScorePackage::getScorePackageName, scorePackageName)
+				.eq(scorePackageStatus != null, WmScorePackage::getScorePackageStatus, scorePackageStatus)
+				.eq(WmScorePackage::getSendPackageDeptId, sendDeptId)
+				.between(start != null && end != null, WmScorePackage::getCreateTime, start, end);
+
+		List<String> packageType1List = StrUtil.split(packageType1, StrUtil.COMMA);
+		if (StrUtil.contains(packageType1, StrUtil.COMMA)) {
+			queryWrapper.in(WmScorePackage::getPackageType1, packageType1List);
+		} else {
+			queryWrapper.eq(WmScorePackage::getPackageType1, packageType1);
+		}
+
+
+		if (StringUtil.isEmpty(typeId)) {
+			queryWrapper.in(WmScorePackage::getTypeid, "3", "4");
+		} else {
+			List<String> split = StrUtil.split(typeId, StrUtil.COMMA);
+			queryWrapper.in(WmScorePackage::getTypeid, split);
+		}
+
+//		boolean onePersonScorePackageFlag = packageType1List.contains(PackageTypeEnum.TYPE1_SCOTE_PACKAGE.val())
+//				&& PackageTypeEnum.TYPE2_TASK_PACKAGE.val().equals(String.valueOf(packageType2));
+//		boolean multiPersonScorePackageFlag = packageType1List.contains(PackageTypeEnum.TYPE1_SCORE_AND_TASK_PACKAGE.val())
+//				&& PackageTypeEnum.TYPE2_SETTLE_PACKAGE.val().equals(String.valueOf(packageType2));
+//		if (onePersonScorePackageFlag || multiPersonScorePackageFlag) {
+//			// 如果是个人承接-按积分值/多人承接-按积分值,判断当前用户是否配置了团队负责人
+//			List<WmTeam> teamList = wmTeamService.list(Wrappers.<WmTeam>lambdaQuery()
+//					.eq(WmTeam::getDeptId, sendDeptId)
+//					.eq(WmTeam::getEnableFlag, EnableEnum.ENABLE.val())
+//					.eq(WmTeam::getDelFlag, DelEnum.NOT_DEL.val())
+//					.apply("FIND_IN_SET({0}, leader)", String.valueOf(userId)));
+//			if (CollectionUtil.isNotEmpty(teamList)) {
+//				// 如果配置了,则只查询所在团队下发的积分包
+//				List<String> teamIdList = teamList.stream().map(wmTeam -> String.valueOf(wmTeam.getId())).collect(Collectors.toList());
+//				queryWrapper.in(WmScorePackage::getPackageUserScope, teamIdList);
+//			}
+//		}
+
+		Page<WmScorePackage> wmScorePackagePage = null;
+		if (StrUtil.isNotBlank(acceptUser)) {
+			// 带有接单对象acceptUser模糊查询的查询
+			wmScorePackagePage = wmScorePackageMapper.listScorePackage(new Page<>(current, size), queryWrapper.orderByDesc(WmScorePackage::getCreateTime), acceptUser);
+		} else {
+			wmScorePackagePage = wmScorePackageMapper.selectPage(new Page<>(current, size), queryWrapper
+					.orderByDesc(WmScorePackage::getCreateTime));
+		}
+
+		List<WmScorePackage> pageRecords = wmScorePackagePage.getRecords();
+
+		if (CollUtil.isNotEmpty(pageRecords)) {
+//			List<Future<WmScorePackage>> futureList = new ArrayList<>(pageRecords.size());
+
+			for (WmScorePackage scorePackage : pageRecords) {
+				if (packageType2 == 2) {
+
+					int wsNum = settleNoteMapper.selectCount(Wrappers.<WmScorePackageSettleNote>lambdaQuery()
+							.eq(WmScorePackageSettleNote::getPackageId, scorePackage.getId())
+							.in(WmScorePackageSettleNote::getSettleNoteStatus, 2, 9));
+					int asNum = settleNoteMapper.selectCount(Wrappers.<WmScorePackageSettleNote>lambdaQuery()
+							.eq(WmScorePackageSettleNote::getPackageId, scorePackage.getId())
+							.eq(WmScorePackageSettleNote::getSettleNoteStatus, 1));
+					scorePackage.setWsTaskNum(wsNum);
+					scorePackage.setAsTaskNum(asNum);
+
+				}
+
+				if (PackageTypeEnum.TYPE1_HCP_PACKAGE.getName().equals(scorePackage.getPackageType1())) {
+					// 如果是患者教育,则转换积分值 '分'-> '元'
+					Integer score = scorePackage.getScore();
+					String userScore = scorePackage.getUserScore();
+					if (org.apache.commons.lang3.StringUtils.isNumeric(userScore)) {
+						scorePackage.setUserScore(String.format("%.2f", Integer.parseInt(userScore) / 100.0));
+					}
+				}
+
+				List<WmScoreTaskType> taskTypeList = wmScoreTaskTypeMapper.getScoreTaskTypeByScoreId(scorePackage.getId());
+				if (CollUtil.isNotEmpty(taskTypeList)) {
+					String taskTypes = taskTypeList.stream().map(
+							WmScoreTaskType::getTaskTypeName).collect(Collectors.joining(","));
+					scorePackage.setTaskTypes(taskTypes);
+				}
+			}
+
+//			List<WmScorePackage> finalRecords = new ArrayList<>(pageRecords.size());
+//			try {
+//				for (Future<WmScorePackage> future : futureList) {
+//					WmScorePackage wmScorePackage = future.get();
+//					finalRecords.add(wmScorePackage);
+//
+//				}
+//
+//				wmScorePackagePage.setRecords(finalRecords);
+//			} catch (ExecutionException | InterruptedException e) {
+//				log.error("获取分页信息失败", e);
+//				return R.failed("获取分页信息失败");
+//			}
+		}
+
+		return R.ok(wmScorePackagePage);
+	}
+
 	/**
 	 * 根据id查询积分包信息
 	 *

+ 25 - 0
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/WmScorePackageSettleNoteController.java

@@ -168,6 +168,18 @@ public class WmScorePackageSettleNoteController {
 		return wmScorePackageSettleNoteService.saveSettleInfo(note);
 	}
 
+	/**
+	 * 批量保存业务结算
+	 *
+	 * @param notes note列表
+	 * @return 结果
+	 */
+	@SysLog("批量保存业务结算")
+	@PostMapping("/batch-save-settle")
+	public R<?> batchSaveSettleInfo(@RequestBody List<WmScorePackageSettleNote> notes) {
+		return wmScorePackageSettleNoteService.batchSaveSettleInfo(notes);
+	}
+
 	/**
 	 * 提交结算申请
 	 *
@@ -181,6 +193,19 @@ public class WmScorePackageSettleNoteController {
 		return wmScorePackageSettleNoteService.subSettleInfo(note);
 	}
 
+	/**
+	 * 批量提交业务结算申请
+	 *
+	 * @param notes note列表
+	 * @return R
+	 */
+	@SysLog("批量提交业务结算申请")
+	@PostMapping("/batch-sub-settle")
+	public R<?> batchSubSettleInfo(@RequestBody List<WmScorePackageSettleNote> notes) {
+
+		return wmScorePackageSettleNoteService.batchSubSettleInfo(notes);
+	}
+
 	/**
 	 * 撤销结算申请
 	 *

+ 0 - 2
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/WmScorePackageStatusController.java

@@ -32,7 +32,6 @@ import com.qunzhixinxi.hnqz.admin.enums.EnableEnum;
 import com.qunzhixinxi.hnqz.admin.enums.PackageTypeEnum;
 import com.qunzhixinxi.hnqz.admin.service.WmScorePackageService;
 import com.qunzhixinxi.hnqz.admin.service.WmScorePackageStatusService;
-import com.qunzhixinxi.hnqz.admin.service.WmTaskService;
 import com.qunzhixinxi.hnqz.admin.service.WmTeamService;
 import com.qunzhixinxi.hnqz.common.core.util.R;
 import com.qunzhixinxi.hnqz.common.log.annotation.SysLog;
@@ -64,7 +63,6 @@ import java.util.stream.Collectors;
 public class WmScorePackageStatusController {
 
     private final  WmScorePackageStatusService wmScorePackageStatusService;
-	private final WmTaskService wmTaskService;
 	private final WmScorePackageService wmScorePackageService;
 	private final WmTeamService wmTeamService;
 

+ 30 - 0
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/WmTaskController.java

@@ -53,6 +53,8 @@ import com.qunzhixinxi.hnqz.admin.entity.XlsPackageInfo;
 import com.qunzhixinxi.hnqz.admin.entity.XlsTask;
 import com.qunzhixinxi.hnqz.admin.entity.dto.CommonEvidenceDTO;
 import com.qunzhixinxi.hnqz.admin.entity.model.excel.CommonTaskExcelModel;
+import com.qunzhixinxi.hnqz.admin.enums.DelEnum;
+import com.qunzhixinxi.hnqz.admin.enums.TaskStatusEnum;
 import com.qunzhixinxi.hnqz.admin.mapper.WmTaskMapper;
 import com.qunzhixinxi.hnqz.admin.service.ReportExportService;
 import com.qunzhixinxi.hnqz.admin.service.SysDeptService;
@@ -1150,6 +1152,34 @@ public class WmTaskController {
 		return wmTaskService.getWmTaskList(page, wmTask);
 	}
 
+	/**
+	 * 根据积分包id查询任务
+	 *
+	 * @param page       分页参数
+	 * @param packageId  积分包id
+	 * @param taskStatus 任务审核状态
+	 * @param realName   姓名
+	 * @return 分页结果
+	 */
+	@GetMapping("/list-score-package-task")
+	public R<?> listScorePackageTask(Page<WmTask> page, @RequestParam("packageId") String packageId,
+									 TaskStatusEnum taskStatus, @RequestParam(value = "taskUserId", required = false) String realName) {
+		QueryWrapper<WmTask> queryWrapper = Wrappers.query();
+		if (StrUtil.isNotBlank(realName)) {
+			queryWrapper.like("u.realname", realName);
+		}
+		if (taskStatus != null) {
+			queryWrapper.eq("t.task_status", taskStatus.val());
+		}
+		queryWrapper.eq("t.score_package_id", packageId);
+		queryWrapper.eq("t.del_flag", DelEnum.NOT_DEL.val());
+		queryWrapper.eq("t.real_flag", "0");
+		queryWrapper.orderByDesc("t.lookinto_date");
+		IPage<WmTask> taskIPage = wmTaskMapper.listWmTaskByWrapper(new Page<>(page.getCurrent(), page.getSize()), queryWrapper);
+
+		return R.ok(taskIPage);
+	}
+
 	/**
 	 * 任务审核
 	 *

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

@@ -32,6 +32,14 @@ public interface WmPayOffService extends IService<WmPayOff> {
 	 */
 	R<?> settleById(String pkgId);
 
+	/**
+	 * 多人承接-按积分值业务结算-查询
+	 *
+	 * @param taskIds 任务id
+	 * @return 结算信息
+	 */
+	R<?> settleInfoByTaskIds(String[] taskIds);
+
 	/**
 	 * 业务保存操作
 	 *

+ 16 - 0
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/WmScorePackageSettleNoteService.java

@@ -58,8 +58,24 @@ public interface WmScorePackageSettleNoteService extends IService<WmScorePackage
 
 	R saveSettleInfo(WmScorePackageSettleNote note);
 
+	/**
+	 * 批量业务结算保存
+	 *
+	 * @param noteList note列表
+	 * @return 结果
+	 */
+	R<?> batchSaveSettleInfo(List<WmScorePackageSettleNote> noteList);
+
 	R subSettleInfo(WmScorePackageSettleNote note);
 
+	/**
+	 * 批量业务结算提交
+	 *
+	 * @param noteList note列表
+	 * @return 结果
+	 */
+	R<?> batchSubSettleInfo(List<WmScorePackageSettleNote> noteList);
+
 	R revokeSettle(WmScorePackageSettleNote note);
 
 	/**

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

@@ -14,7 +14,9 @@ import com.qunzhixinxi.hnqz.admin.config.UpmsConfig;
 import com.qunzhixinxi.hnqz.admin.entity.*;
 import com.qunzhixinxi.hnqz.admin.entity.input.SettleNoteStatusOutput;
 import com.qunzhixinxi.hnqz.admin.entity.input.WmScorePackageSettleInput;
+import com.qunzhixinxi.hnqz.admin.enums.PackageStatusEnum;
 import com.qunzhixinxi.hnqz.admin.enums.PackageTypeEnum;
+import com.qunzhixinxi.hnqz.admin.enums.SettleStatusEnum;
 import com.qunzhixinxi.hnqz.admin.enums.SubjectLocation;
 import com.qunzhixinxi.hnqz.admin.enums.SubjectTypeEnum;
 import com.qunzhixinxi.hnqz.admin.mapper.SysUserMapper;
@@ -56,6 +58,7 @@ import java.math.RoundingMode;
 import java.time.LocalDateTime;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 
 /**
@@ -157,7 +160,7 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 				note.setPackageStatusId(String.valueOf(status.getId()));
 				note.setPackageId(status.getPackageId());
 
-				if ("1".equals(wmScorePackage.getPackageType1())) {
+				if (StrUtil.equals(PackageTypeEnum.TYPE1_SCOTE_PACKAGE.val(), wmScorePackage.getPackageType1())) {
 
 					note.setSettleAmount(StringUtils.isEmpty(status.getUserScore()) ? BigDecimal.ZERO : new BigDecimal(status.getUserScore(), mc));
 
@@ -235,6 +238,116 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 		return R.ok(resultMap);
 	}
 
+	/**
+	 * 多人承接-按积分值业务结算-查询
+	 *
+	 * @param taskIds 任务id
+	 * @return 结算信息
+	 */
+	@Override
+	public R<?> settleInfoByTaskIds(String[] taskIds) {
+		// 查询任务
+		List<WmTask> taskList = wmTaskService.listByIds(Arrays.asList(taskIds));
+		Set<String> taskIdSet = taskList.stream().map(WmTask::getScorePackageId).collect(Collectors.toSet());
+		if (taskIdSet.size() > 1) {
+			return R.failed("所选任务不属于同一个积分包");
+		}
+
+		String scorePackageId = taskList.get(0).getScorePackageId();
+		WmScorePackage wmScorePackage = wmScorePackageService.getById(scorePackageId);
+
+		// user-taskList map
+		Map<String, List<WmTask>> userTaskMap = taskList.stream().collect(Collectors.groupingBy(WmTask::getTaskUserId));
+
+		// 查询settleNote
+		List<WmScorePackageSettleNote> notes = noteService.list(Wrappers.<WmScorePackageSettleNote>lambdaQuery()
+				.in(WmScorePackageSettleNote::getTaskId, Arrays.asList(taskIds))
+				.eq(WmScorePackageSettleNote::getPackageId, scorePackageId));
+
+		// 查询user
+		Set<String> allUserIdSet = new HashSet<>();
+		allUserIdSet.addAll(userTaskMap.keySet());
+		allUserIdSet.addAll(notes.stream().map(WmScorePackageSettleNote::getUserId).collect(Collectors.toSet()));
+		List<SysUser> sysUsers = sysUserMapper.selectBatchIds(allUserIdSet);
+		Map<Integer, SysUser> userMap = sysUsers.stream().collect(Collectors.toMap(SysUser::getUserId, Function.identity()));
+
+		if (CollectionUtils.isEmpty(notes) || notes.size() < taskIds.length) {
+			// 查询领包记录
+			List<WmScorePackageStatus> statusList = wmScorePackageStatusService.list(Wrappers.<WmScorePackageStatus>lambdaQuery()
+					.eq(WmScorePackageStatus::getPackageId, scorePackageId)
+					.in(WmScorePackageStatus::getUserId, userTaskMap.keySet())
+					.eq(WmScorePackageStatus::getStatus, PackageStatusEnum.APPROVED.val()));
+			Map<String, WmScorePackageStatus> userPackageStatusMap = statusList.stream()
+					.collect(Collectors.toMap(WmScorePackageStatus::getUserId, Function.identity()));
+
+			for (String userId : userPackageStatusMap.keySet()) {
+				WmScorePackageSettleNote note = new WmScorePackageSettleNote();
+				note.setSettleNo(IdUtil.fastSimpleUUID());
+				note.setPackageId(scorePackageId);
+
+				// 计算每个人的总任务积分
+				List<WmTask> userTasks = userTaskMap.get(userId);
+				Integer userTotalScore = userTasks.stream().map(WmTask::getScore).reduce(0, Integer::sum);
+				note.setSettleAmount(BigDecimal.valueOf(userTotalScore));
+				note.setDiscount(BigDecimal.ONE);
+				note.setUserId(userId);
+				note.setSettleNoteStatus(Integer.valueOf(SettleStatusEnum.SETTLE_STATUS_NOTSETTLE.getVal()));
+
+				SysUser noteUser = userMap.get(Integer.parseInt(userId));
+				note.setRealName(noteUser.getRealname());
+				note.setIdCardNumber(noteUser.getIdCardNumber());
+				notes.add(note);
+			}
+			if (wmScorePackage.getLocation() != null) {
+				wmScorePackage.setSubjectLocation(wmScorePackage.getLocation().name());
+			}
+		} else {
+
+			notes.forEach(item -> {
+				SysUser user = userMap.get(Integer.parseInt(item.getUserId()));
+				item.setRealName(user.getRealname());
+				item.setIdCardNumber(user.getIdCardNumber());
+				if (item.getSubjectLocation() != null){
+					wmScorePackage.setSubjectLocation(item.getSubjectLocation().name());
+				}
+			});
+
+			if (StrUtil.isBlank(wmScorePackage.getSubjectLocation())){
+				return R.failed("结算积分包未勾选税源地");
+			}
+
+		}
+
+		Map<String, Object> resultMap = new HashMap<>(3);
+		resultMap.put("wsp", wmScorePackage);
+		resultMap.put("notes", notes);
+		// 显示实际完成积分值
+//		resultMap.put("finishScore", "0");
+
+//		if (PackageTypeEnum.TYPE1_SCOTE_PACKAGE.val().equals(wmScorePackage.getPackageType1()) || PackageTypeEnum.TYPE1_HCP_PACKAGE.val().equals(wmScorePackage.getPackageType1())) {
+//
+//			List<WmTask> tasks = wmTaskService.list(Wrappers.<WmTask>lambdaQuery()
+//					.eq(WmTask::getRealFlag, "0")
+//					.eq(WmTask::getScorePackageId, wmScorePackage.getId())
+//					.eq(WmTask::getTaskStatus, "3"));
+//
+//			BigDecimal total = BigDecimal.ZERO;
+//
+//			for (WmTask task : tasks) {
+//				total = total.add(new BigDecimal(task.getScore()));
+//			}
+//
+//			if (PackageTypeEnum.TYPE1_HCP_PACKAGE.val().equals(wmScorePackage.getPackageType1())) {
+//				// 如果是患者教育,则转换积分值 '分'->'元'
+//				resultMap.put("finishScore", total.divide(new BigDecimal("100"), mc));
+//			} else {
+//				resultMap.put("finishScore", total.intValue());
+//			}
+//		}
+
+		return R.ok(resultMap);
+	}
+
 	/**
 	 * 业务提交结算信息到财务
 	 *
@@ -295,7 +408,8 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 		updateEntity.setLocation(input.getSubjectLocation());
 		updateEntity.setSettlementDate(LocalDateTime.now());
 
-		if ("2".equals(wmScorePackage.getPackageType2())) {
+		if (PackageTypeEnum.TYPE2_SETTLE_PACKAGE.val().equals(wmScorePackage.getPackageType2())
+				&& !StrUtil.equals(PackageTypeEnum.TYPE1_SCORE_AND_TASK_PACKAGE.val(), wmScorePackage.getPackageType1())) {
 			updateEntity.setPackageFinishStatus("1");
 			updateEntity.setTaskAddFlag("0");
 		}

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

@@ -70,6 +70,7 @@ import org.springframework.http.HttpMethod;
 import org.springframework.http.MediaType;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.client.RestTemplate;
 
 import java.math.BigDecimal;
@@ -310,6 +311,19 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 		return R.ok();
 	}
 
+	/**
+	 * 批量业务结算保存
+	 *
+	 * @param noteList note列表
+	 * @return 结果
+	 */
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public R<?> batchSaveSettleInfo(List<WmScorePackageSettleNote> noteList) {
+		noteList.forEach(this::saveSettleInfo);
+		return R.ok();
+	}
+
 	@Override
 	public R subSettleInfo(WmScorePackageSettleNote note) {
 
@@ -459,6 +473,19 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 		return R.ok();
 	}
 
+	/**
+	 * 批量业务结算提交
+	 *
+	 * @param noteList note列表
+	 * @return 结果
+	 */
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public R<?> batchSubSettleInfo(List<WmScorePackageSettleNote> noteList) {
+		noteList.forEach(this::subSettleInfo);
+		return R.ok();
+	}
+
 	@Override
 	public R revokeSettle(WmScorePackageSettleNote note) {
 		WmScorePackageSettleNote updateEntity;