瀏覽代碼

Merge branch 'feat-20230710-mahpay'

李学松 2 年之前
父節點
當前提交
66cf10b71d
共有 15 個文件被更改,包括 494 次插入51 次删除
  1. 9 0
      db/v2.0/230710.sql
  2. 61 0
      hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/SysDeptSubController.java
  3. 28 1
      hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/WmDaAgentController.java
  4. 22 1
      hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/WmPayOffController.java
  5. 96 0
      hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/WmScorePackageController.java
  6. 7 0
      hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/WmScorePackageSettleNoteController.java
  7. 11 0
      hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/entity/WmDaAgent.java
  8. 5 0
      hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/entity/WmScorePackage.java
  9. 6 0
      hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/entity/WmScorePackageSettleNote.java
  10. 6 1
      hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/entity/input/WmScorePackageSettleInput.java
  11. 3 8
      hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/enums/GigTypeEnum.java
  12. 4 3
      hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/enums/SubjectLocation.java
  13. 125 19
      hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/WmPayOffServiceImpl.java
  14. 105 18
      hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/WmScorePackageSettleNoteServiceImpl.java
  15. 6 0
      hnqz-upms/hnqz-upms-biz/src/main/resources/mapper/WmScorePackageMapper.xml

+ 9 - 0
db/v2.0/230710.sql

@@ -0,0 +1,9 @@
+alter table wm_da_agent
+    add mah_settle_dept_id int null comment 'MAH结算-药企deptId';
+
+alter table wm_score_package
+    add mah_settle_dept_id int null comment 'MAH结算-药企deptId';
+
+create index wm_score_package_mah_settle_dept_id_index
+    on wm_score_package (mah_settle_dept_id);
+

+ 61 - 0
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/SysDeptSubController.java

@@ -6,9 +6,16 @@ import cn.hutool.core.util.ArrayUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.qunzhixinxi.hnqz.admin.api.entity.SysDeptRelation;
+import com.qunzhixinxi.hnqz.admin.entity.WmDaAgent;
+import com.qunzhixinxi.hnqz.admin.entity.WmDaDrugEnt;
 import com.qunzhixinxi.hnqz.admin.entity.dto.SettleConfigDTO;
 import com.qunzhixinxi.hnqz.admin.entity.input.DeptSubLimitAmountInput;
+import com.qunzhixinxi.hnqz.admin.enums.SubjectLocation;
 import com.qunzhixinxi.hnqz.admin.enums.SubjectTypeEnum;
+import com.qunzhixinxi.hnqz.admin.service.SysDeptRelationService;
+import com.qunzhixinxi.hnqz.admin.service.WmDaAgentService;
+import com.qunzhixinxi.hnqz.admin.service.WmDaDrugEntService;
 import com.qunzhixinxi.hnqz.common.core.util.R;
 import com.qunzhixinxi.hnqz.common.log.annotation.SysLog;
 import com.qunzhixinxi.hnqz.admin.entity.SysDeptSub;
@@ -24,6 +31,7 @@ import org.springframework.web.bind.annotation.*;
 import javax.validation.Valid;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 
 /**
@@ -39,6 +47,59 @@ import java.util.List;
 public class SysDeptSubController {
 
     private final  SysDeptSubService sysDeptSubService;
+	private final SysDeptRelationService sysDeptRelationService;
+	private final WmDaAgentService wmDaAgentService;
+	private final WmDaDrugEntService wmDaDrugEntService;
+
+	/**
+	 * 查询结算渠道(用于结算页面)
+	 *
+	 * @return 结果
+	 */
+	@GetMapping("/get-settle-subject")
+	public R getSettleSubejct() {
+		Integer deptId = SecurityUtils.getUser().getDeptId();
+		List<SysDeptSub> resultList = new ArrayList<>();
+
+		// 原有结算渠道
+		SysDeptSub sysDeptSub = new SysDeptSub();
+		sysDeptSub.setDeptId(deptId);
+		sysDeptSub.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
+		List<SysDeptSub> subList = sysDeptSubService.list(Wrappers.query(sysDeptSub));
+		if (CollUtil.isNotEmpty(subList)) {
+			subList.forEach(sub -> sub.setSubjectName(sub.getSubjectLocation().getDescription()));
+			resultList.addAll(subList);
+		}
+
+		// MAH结算渠道-拼接上级药企作为渠道名称
+		WmDaAgent daAgent = wmDaAgentService.getOne(Wrappers.<WmDaAgent>lambdaQuery()
+				.eq(WmDaAgent::getDeptId, deptId));
+		if(daAgent!= null) {
+            if (daAgent.getMahSettleDeptId() != null) {
+				// 查询上级药企
+				List<SysDeptRelation> deptRelations = sysDeptRelationService.list(Wrappers.<SysDeptRelation>lambdaQuery()
+						.eq(SysDeptRelation::getDescendant, deptId)
+						.ne(SysDeptRelation::getAncestor, deptId)
+						.ne(SysDeptRelation::getAncestor, 1));
+				if (CollUtil.isNotEmpty(deptRelations)) {
+					List<WmDaDrugEnt> drugEnts = wmDaDrugEntService.list(Wrappers.<WmDaDrugEnt>lambdaQuery()
+							.in(WmDaDrugEnt::getDeptId, deptRelations.stream().map(SysDeptRelation::getAncestor).collect(Collectors.toSet())));
+					drugEnts.forEach(drugEnt -> {
+						SysDeptSub newDeptSub = new SysDeptSub();
+						newDeptSub.setSubId(Integer.valueOf(drugEnt.getDeptId()));
+						newDeptSub.setDeptId(Integer.valueOf(drugEnt.getDeptId()));
+						newDeptSub.setSubjectLocation(SubjectLocation.MAH_SETTLE);
+						newDeptSub.setSubjectType(String.valueOf(SubjectLocation.MAH_SETTLE.getGigType().getCode()));
+						newDeptSub.setSubjectName(drugEnt.getEntname());
+						resultList.add(newDeptSub);
+					});
+                }
+
+			}
+        }
+
+		return R.ok(resultList);
+	}
 
 	/**
 	 * 查询结算渠道列表-无参

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

@@ -127,6 +127,7 @@ public class WmDaAgentController {
 		wmDaAgent.setDeptId(SecurityUtils.getUser().getDeptId() + "");
 		WmDaAgent wmDaAgent3 = wmDaAgentMapper.selectDeptId(wmDaAgent);
 		if (wmDaAgent3 != null) {
+			wmDaAgent3.setMahSettleFlag(wmDaAgent3.getMahSettleDeptId() != null);
 			wmDaAgentList.add(wmDaAgent3);
 		}
 		if (wmRelationList.size() > 0) {
@@ -136,7 +137,10 @@ public class WmDaAgentController {
 				WmDaAgent wmDaAgent1 = new WmDaAgent();
 				wmDaAgent1.setDeptId(String.valueOf(id));
 				WmDaAgent wmDaAgent2 = wmDaAgentMapper.selectDeptId(wmDaAgent1);
-				wmDaAgentList.add(wmDaAgent2);
+				if (wmDaAgent2 != null) {
+					wmDaAgent2.setMahSettleFlag(wmDaAgent2.getMahSettleDeptId() != null);
+					wmDaAgentList.add(wmDaAgent2);
+				}
 			}
 		}
 		//每页数据条数
@@ -845,4 +849,27 @@ public class WmDaAgentController {
 
 		return R.ok(wmDaAgentService.listByDept());
 	}
+
+	/**
+	 * MAH支付-权限配置
+	 *
+	 * @param wmDaAgent 参数
+	 * @return 结果
+	 */
+	@PostMapping("/mah-settle-config")
+	public R<?> mahSettleConfig(@RequestBody WmDaAgent wmDaAgent) {
+		if (wmDaAgent.getId() == null || wmDaAgent.getMahSettleFlag() == null) {
+			return R.failed("必填参数不能为空");
+		}
+
+		Integer mahSettleDeptId = null;
+		if (Boolean.TRUE.equals(wmDaAgent.getMahSettleFlag())) {
+			// 如果是允许结算,则保存当前药企deptId
+			mahSettleDeptId = SecurityUtils.getUser().getDeptId();
+		}
+
+		return R.ok(wmDaAgentService.update(Wrappers.<WmDaAgent>lambdaUpdate()
+				.eq(WmDaAgent::getId, wmDaAgent.getId())
+				.set(WmDaAgent::getMahSettleDeptId, mahSettleDeptId)));
+	}
 }

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

@@ -159,7 +159,7 @@ public class WmPayOffController {
 	@PostMapping("/settleSave")
 	public R<?> settleSave(@RequestBody WmScorePackageSettleInput input) {
 
-		if (CollectionUtils.isEmpty(input.getNotes()) || StringUtils.isEmpty(input.getId()) || null == input.getInvoiceCategory() || input.getSubjectLocation() == null) {
+		if (CollectionUtils.isEmpty(input.getNotes()) || StringUtils.isEmpty(input.getId()) || input.getSubjectLocation() == null) {
 
 			return R.failed("数据异常或人员结算渠道不存在,不能结算");
 		}
@@ -235,6 +235,27 @@ public class WmPayOffController {
 		return R.ok(wmScorePackageService.listPackageSettleList(page, input));
 	}
 
+	/**
+	 * 财务审核页面-用于MAH结算
+	 *
+	 * @param page  分页信息
+	 * @param input 参数
+	 * @return 分页结果
+	 */
+	@ApiOperation(value = "分页查询结算", notes = "分页查询结算")
+	@SysLog("分页查询结算")
+	@GetMapping("/listMahPackageSettleList")
+	public R<?> listMAHPackageSettleList(Page<WmScorePackageSettleOutput> page, WmScorePackageSettleInput input) {
+
+		input.setMahSettleDeptId(SecurityUtils.getUser().getDeptId());
+		input.setPackageFinishStatus("1");
+		input.setTypeid("4");
+		input.setSettleFlag("1");
+		Page<WmScorePackageSettleOutput> outputPage = wmScorePackageService.listPackageSettleList(page, input);
+		outputPage.getRecords().forEach(output -> output.setUserPhones(null));
+		return R.ok(outputPage);
+	}
+
 	/**
 	 * 结算包结算导出
 	 *

+ 96 - 0
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/WmScorePackageController.java

@@ -2916,6 +2916,8 @@ public class WmScorePackageController {
 			queryWrapper.in(WmScorePackage::getTypeid, split);
 		}
 
+		queryWrapper.ne(WmScorePackage::getLocation, SubjectLocation.MAH_SETTLE);
+
 		Page<WmScorePackage> wmScorePackagePage = wmScorePackageMapper.selectPage(new Page<>(current, size), queryWrapper
 				.orderByDesc(WmScorePackage::getCreateTime));
 
@@ -2973,6 +2975,100 @@ public class WmScorePackageController {
 		return R.ok(wmScorePackagePage);
 	}
 
+	/**
+	 * 积分包列表(结算包管理列表、无团队限制)-用于MAH结算
+	 *
+	 * @param packageType1 多个逗号分隔
+	 */
+	@GetMapping("/page-mah-settle-package")
+	public R pageMahSettlePackage(@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
+	) {
+
+		Integer sendDeptId = SecurityUtils.getUser().getDeptId();
+
+		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::getMahSettleDeptId, 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);
+		}
+
+		queryWrapper.eq(WmScorePackage::getLocation, SubjectLocation.MAH_SETTLE);
+
+		Page<WmScorePackage> wmScorePackagePage = wmScorePackageMapper.selectPage(new Page<>(current, size), queryWrapper
+				.orderByDesc(WmScorePackage::getCreateTime));
+
+		List<WmScorePackage> pageRecords = wmScorePackagePage.getRecords();
+
+		if (CollUtil.isNotEmpty(pageRecords)) {
+
+			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())) {
+					// 如果是患者教育,则转换积分值 '分'-> '元'
+					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);
+				}
+			}
+		}
+
+		return R.ok(wmScorePackagePage);
+	}
+
 	/**
 	 * 根据id查询积分包信息
 	 *

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

@@ -13,6 +13,7 @@ import com.qunzhixinxi.hnqz.admin.entity.model.excel.WmSettlePackageSettleExcelM
 import com.qunzhixinxi.hnqz.admin.entity.output.WmTaskSettleNoteOutput;
 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.service.WmScorePackageService;
 import com.qunzhixinxi.hnqz.admin.service.WmScorePackageSettleNoteService;
@@ -98,6 +99,9 @@ public class WmScorePackageSettleNoteController {
 				if (output.getSubjectLocation() != null) {
 					output.setSubjectLocationName(output.getSubjectLocation().getDescription());
 				}
+				if (SubjectLocation.MAH_SETTLE.equals(scorePackage.getLocation())) {
+					output.setUsername(null);
+				}
 			});
 			return R.ok(settlePage2);
 		}
@@ -107,6 +111,9 @@ public class WmScorePackageSettleNoteController {
 			if (output.getSubjectLocation() != null) {
 				output.setSubjectLocationName(output.getSubjectLocation().getDescription());
 			}
+			if (SubjectLocation.MAH_SETTLE.equals(scorePackage.getLocation())) {
+				output.setUsername(null);
+			}
 		});
 		return R.ok(settlePage);
 	}

+ 11 - 0
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/entity/WmDaAgent.java

@@ -184,6 +184,17 @@ public class WmDaAgent extends Model<WmDaAgent> {
 	@ApiModelProperty(value="结算主体类型")
 	private String[] subjectType;
 
+	/**
+	 * MAH结算-药企deptId
+	 */
+	private Integer mahSettleDeptId;
+
+	/**
+	 * 是否允许结算(选择“允许结算”时,相当于打开了MAH支付权限,该CSO结算时可以选择药企,走药企结算。)
+	 */
+	@TableField(exist = false)
+	private Boolean mahSettleFlag;
+
 	@ApiModelProperty(value="结算主体类型和通道")
 	@TableField(exist = false)
 	private Map<String, Integer> subjectTypeAndChannel;

+ 5 - 0
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/entity/WmScorePackage.java

@@ -554,6 +554,11 @@ public class WmScorePackage extends Model<WmScorePackage> {
 	@ApiModelProperty(value = "关联药品的生产厂商列表")
 	private String[] drugProducerList;
 
+	/**
+	 * MAH结算-药企deptId
+	 */
+	private Integer mahSettleDeptId;
+
 	@AllArgsConstructor
 	public enum PackageStopStatus {
 		NOTHING(0, "不能操作"),

+ 6 - 0
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/entity/WmScorePackageSettleNote.java

@@ -209,6 +209,12 @@ public class WmScorePackageSettleNote extends Model<WmScorePackageSettleNote> {
 	@TableField(exist = false)
 	private LocalDateTime endSubTime;
 
+	/**
+	 * MAH结算-药企deptId
+	 */
+	@TableField(exist = false)
+	private Integer mahSettleDeptId;
+
 	/**
 	 * 获取发票类目
 	 * @Modify: start

+ 6 - 1
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/entity/input/WmScorePackageSettleInput.java

@@ -30,7 +30,7 @@ public class WmScorePackageSettleInput implements Serializable {
 	private String id;
 
 	// 发票类目
-	@NotNull(message = "发票类目必填")
+//	@NotNull(message = "发票类目必填")
 	private Integer invoiceCategory;
 
 	@NotBlank(message = "结算token必填")
@@ -87,6 +87,11 @@ public class WmScorePackageSettleInput implements Serializable {
 	// 税源地
 	private SubjectLocation subjectLocation;
 
+	/**
+	 * MAH结算-药企deptId
+	 */
+	private Integer mahSettleDeptId;
+
 	/**
 	 * 结算人员
 	 */

+ 3 - 8
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/enums/GigTypeEnum.java

@@ -24,8 +24,9 @@ public enum GigTypeEnum {
 	LANG_CHAO(5, "浪潮", "浪潮", LangChaoCertStatus.class),
 	HUI_QI_YUN(6, "汇企云", "汇企云", HuiQiYunCertStatus.class),
 	ZHONG_YI_YUN(7, "众蚁云", "众蚁云", ZhongYiYunCertStatus.class),
-	ZHONG_ZHI(8, "中智", "中智", ZhongZhiCertStatus.class);
-//	HAN_TANG(9, "汉唐", "汉唐", HanTangCertStatus.class);
+	ZHONG_ZHI(8, "中智", "中智", ZhongZhiCertStatus.class),
+
+	MAH_SETTLE(99, "MAH结算", "MAH结算", null);
 
 	@EnumValue
 	private int code;
@@ -79,9 +80,6 @@ public enum GigTypeEnum {
 			case ZHONG_YI_YUN:
 				certStatusStr = ZhongYiYunCertStatus.resolve(certStatus).name();
 				break;
-//			case HAN_TANG:
-//				certStatusStr = HanTangCertStatus.resolve(certStatus).name();
-//				break;
 			case ZHONG_ZHI:
 				certStatusStr = ZhongZhiCertStatus.resolve(certStatus).name();
 				break;
@@ -125,9 +123,6 @@ public enum GigTypeEnum {
 			case ZHONG_YI_YUN:
 				certStatusStr = ZhongYiYunCertStatus.resolve(certStatus).getMessage();
 				break;
-//			case HAN_TANG:
-//				 certStatusStr = HanTangCertStatus.resolve(certStatus).getMessage();
-//				break;
 			case ZHONG_ZHI:
 				certStatusStr = ZhongZhiCertStatus.resolve(certStatus).getMessage();
 				break;

+ 4 - 3
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/enums/SubjectLocation.java

@@ -45,11 +45,12 @@ public enum SubjectLocation {
 
 	// 众蚁云
 	ZHONG_YI_YUN("ZHONG_YI_YUN", GigTypeEnum.ZHONG_YI_YUN, "众蚁云", 11, "zhong_yi_yun_invoice"),
-	// 汉唐
-//	HAN_TANG("HAN_TANG", GigTypeEnum.HAN_TANG, "汉唐", 12),
 	// 中智
 	ZHONG_ZHI("ZHONG_ZHI", GigTypeEnum.ZHONG_ZHI, "中智", 12, "zhongzhi_invoice"),
-	ZHAO_YU("ZHAO_YU", GigTypeEnum.OLADING, "钉灵工-河南兆宇", 13, "olading_zhaoyu_invoice");
+	ZHAO_YU("ZHAO_YU", GigTypeEnum.OLADING, "钉灵工-河南兆宇", 13, "olading_zhaoyu_invoice"),
+
+
+	MAH_SETTLE("MAH_SETTLE", GigTypeEnum.MAH_SETTLE, "MAH结算", 99, "");
 
 	/**
 	 * 税源地类型

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

@@ -1,5 +1,6 @@
 package com.qunzhixinxi.hnqz.admin.service.impl;
 
+import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.IdUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONObject;
@@ -164,16 +165,16 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 
 				if (StrUtil.equals(PackageTypeEnum.TYPE1_SCOTE_PACKAGE.val(), wmScorePackage.getPackageType1())) {
 
-					note.setSettleAmount(StringUtils.isEmpty(status.getUserScore()) ? BigDecimal.ZERO : new BigDecimal(status.getUserScore(), mc));
+					note.setSettleAmount(StringUtils.isEmpty(status.getUserScore()) ? BigDecimal.ZERO : new BigDecimal(status.getUserScore(), MathContext.UNLIMITED));
 
 				} else if (PackageTypeEnum.TYPE1_HCP_PACKAGE.val().equals(wmScorePackage.getPackageType1())) {
 
 					// 如果是患者教育,则转换积分值 '分'->'元'
-					note.setSettleAmount(StringUtils.isEmpty(status.getUserScore()) ? BigDecimal.ZERO : new BigDecimal(status.getUserScore(), mc).divide(new BigDecimal("100"), mc));
+					note.setSettleAmount(StringUtils.isEmpty(status.getUserScore()) ? BigDecimal.ZERO : new BigDecimal(status.getUserScore(), MathContext.UNLIMITED).divide(new BigDecimal("100"), MathContext.UNLIMITED));
 
 				} else {
 
-					note.setSettleAmount(StringUtils.isEmpty(wmScorePackage.getUserScore()) ? BigDecimal.ZERO : new BigDecimal(wmScorePackage.getUserScore(), mc));
+					note.setSettleAmount(StringUtils.isEmpty(wmScorePackage.getUserScore()) ? BigDecimal.ZERO : new BigDecimal(wmScorePackage.getUserScore(), MathContext.UNLIMITED));
 
 				}
 
@@ -209,7 +210,7 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 
 		if (PackageTypeEnum.TYPE1_HCP_PACKAGE.val().equals(wmScorePackage.getPackageType1())) {
 			// 如果是患者教育,则转换积分值 '分'->'元'
-			wmScorePackage.setUserScore(new BigDecimal(wmScorePackage.getUserScore(), mc).divide(new BigDecimal("100"), mc).toString());
+			wmScorePackage.setUserScore(new BigDecimal(wmScorePackage.getUserScore(), MathContext.UNLIMITED).divide(new BigDecimal("100"), MathContext.UNLIMITED).toString());
 		}
 		resultMap.put("wsp", wmScorePackage);
 		resultMap.put("notes", notes);
@@ -231,7 +232,7 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 
 			if (PackageTypeEnum.TYPE1_HCP_PACKAGE.val().equals(wmScorePackage.getPackageType1())) {
 				// 如果是患者教育,则转换积分值 '分'->'元'
-				resultMap.put("finishScore", total.divide(new BigDecimal("100"), mc));
+				resultMap.put("finishScore", total.divide(new BigDecimal("100"), MathContext.UNLIMITED));
 			} else {
 				resultMap.put("finishScore", total.intValue());
 			}
@@ -370,8 +371,20 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 		List<WmScorePackageSettleNote> notes = input.getNotes();
 		SubjectLocation location = input.getSubjectLocation();
 
-		// 校验是否配置了结算限制
 		Integer deptId = SecurityUtils.getUser().getDeptId();
+		if (SubjectLocation.MAH_SETTLE.equals(input.getSubjectLocation())) {
+			// 默认在当前企业,取一个结算渠道
+			SysDeptSub condition = new SysDeptSub();
+			condition.setDeptId(deptId);
+			condition.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
+			List<SysDeptSub> deptSubs = sysDeptSubService.list(Wrappers.query(condition));
+			if (CollUtil.isEmpty(deptSubs)) {
+				return R.failed("结算渠道不存在");
+			}
+			location = deptSubs.get(0).getSubjectLocation();
+		}
+
+		// 校验是否配置了结算限制
 		SysDeptSub queryDeptSub = sysDeptSubService.getOne(Wrappers.<SysDeptSub>lambdaQuery()
 				.eq(SysDeptSub::getDeptId, SecurityUtils.getUser().getDeptId())
 				.eq(SysDeptSub::getSubjectLocation, location)
@@ -389,11 +402,12 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 		BigDecimal total = monitoringIndicatorService.settleMonitoringIndicator(notes, location);
 
 		LocalDateTime now = LocalDateTime.now();
+		SubjectLocation finalLocation = location;
 		notes.forEach(note -> {
 			note.setUpdateTime(now);
 			note.setSubTime(now);
-			note.setSubType(String.valueOf(location.getGigType().getCode()));
-			note.setSubjectLocation(input.getSubjectLocation());
+			note.setSubType(String.valueOf(finalLocation.getGigType().getCode()));
+			note.setSubjectLocation(finalLocation);
 			note.setInvoiceType(input.getInvoiceCategory());
 			note.setCategoryName(input.getCategoryName());
 			if (null == note.getId()) {
@@ -408,9 +422,12 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 		updateEntity.setSettleStatus(DingEnum.SETTLE_STATUS_WAIT.getType());
 		updateEntity.setScorePackageStatus("5");
 		updateEntity.setDescription(input.getDescription());
-		updateEntity.setSubType(String.valueOf(location.getGigType().getCode()));
+		updateEntity.setSubType(String.valueOf(input.getSubjectLocation().getGigType().getCode()));
 		updateEntity.setLocation(input.getSubjectLocation());
 		updateEntity.setSettlementDate(LocalDateTime.now());
+		if (SubjectLocation.MAH_SETTLE.equals(input.getSubjectLocation())) {
+			updateEntity.setMahSettleDeptId(input.getMahSettleDeptId());
+		}
 
 		if (PackageTypeEnum.TYPE2_SETTLE_PACKAGE.val().equals(wmScorePackage.getPackageType2())
 				&& !StrUtil.equals(PackageTypeEnum.TYPE1_SCORE_AND_TASK_PACKAGE.val(), wmScorePackage.getPackageType1())) {
@@ -441,7 +458,21 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 	public R<?> settleSave(WmScorePackageSettleInput input) {
 
 		List<WmScorePackageSettleNote> notes = input.getNotes();
-		SubjectLocation location = input.getSubjectLocation();
+		SubjectLocation location;
+
+		if (SubjectLocation.MAH_SETTLE.equals(input.getSubjectLocation())) {
+			// 默认在当前企业,取一个结算渠道
+			SysDeptSub condition = new SysDeptSub();
+			condition.setDeptId(SecurityUtils.getUser().getDeptId());
+			condition.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
+			List<SysDeptSub> deptSubs = sysDeptSubService.list(Wrappers.query(condition));
+			if (CollUtil.isEmpty(deptSubs)) {
+				return R.failed("结算渠道不存在");
+			}
+			location = deptSubs.get(0).getSubjectLocation();
+		} else {
+			location = input.getSubjectLocation();
+		}
 
 		// 校验人员信息
 		Set<Integer> userIds = notes.stream().map(WmScorePackageSettleNote::getUserId).map(Integer::valueOf).collect(Collectors.toSet());
@@ -455,7 +486,7 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 			note.setUpdateTime(now);
 			note.setSubTime(now);
 			note.setSubType(String.valueOf(location.getGigType().getCode()));
-			note.setSubjectLocation(input.getSubjectLocation());
+			note.setSubjectLocation(location);
 			note.setInvoiceType(input.getInvoiceCategory());
 			note.setCategoryName(input.getCategoryName());
 			if (null == note.getId()) {
@@ -469,6 +500,9 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 		updateEntity.setDescription(input.getDescription());
 		updateEntity.setSubType(String.valueOf(location.getGigType().getCode()));
 		updateEntity.setLocation(input.getSubjectLocation());
+		if (SubjectLocation.MAH_SETTLE.equals(input.getSubjectLocation())) {
+			updateEntity.setMahSettleDeptId(input.getMahSettleDeptId());
+		}
 
 		wmScorePackageService.updateById(updateEntity);
 		noteService.saveOrUpdateBatch(notes);
@@ -549,6 +583,14 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 
 		// 结算配置信息
 		HnqzUser operator = SecurityUtils.getUser();
+
+		if (SubjectLocation.MAH_SETTLE.equals(wmScorePackage.getLocation())) {
+			// MAH结算的情况-标记
+			input.setMahSettleDeptId(operator.getDeptId());
+		} else {
+			input.setMahSettleDeptId(null);
+		}
+
 		SysDeptSub sysDeptSub = sysDeptSubService.getDeptSub(operator.getDeptId(), location);
 		SysDept sysDept = sysDeptService.getById(sysDeptSub.getDeptId());
 		String taxCode = sysDept.getTaxCode();
@@ -624,10 +666,18 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 		for (WmScorePackageSettleNote note : notes) {
 			SysUser sysUser = sysUserMapper.selectById(note.getUserId());
 
+			Integer deptId;
+			// MAH结算校验原企业认证信息
+			if (input.getMahSettleDeptId() != null) {
+				deptId = sysUser.getDeptId();
+			} else {
+				deptId = operator.getDeptId();
+			}
+
 			SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery()
 					.eq(SysUserSub::getUserId, sysUser.getUserId())
 					.eq(SysUserSub::getSubjectLocation, input.getSubjectLocation())
-					.eq(SysUserSub::getDeptId, operator.getDeptId())
+					.eq(SysUserSub::getDeptId, deptId)
 			);
 
 			if (userSub == null) {
@@ -819,10 +869,18 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 		for (WmScorePackageSettleNote note : notes) {
 			SysUser sysUser = sysUserMapper.selectById(note.getUserId());
 
+			Integer deptId;
+			// MAH结算校验原企业认证信息
+			if (input.getMahSettleDeptId() != null) {
+				deptId = sysUser.getDeptId();
+			} else {
+				deptId = operator.getDeptId();
+			}
+
 			SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery()
 					.eq(SysUserSub::getUserId, sysUser.getUserId())
 					.eq(SysUserSub::getSubjectLocation, input.getSubjectLocation())
-					.eq(SysUserSub::getDeptId, operator.getDeptId())
+					.eq(SysUserSub::getDeptId, deptId)
 			);
 
 			if (userSub == null) {
@@ -1009,10 +1067,18 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 		for (WmScorePackageSettleNote note : notes) {
 			SysUser sysUser = sysUserMapper.selectById(note.getUserId());
 
+			Integer deptId;
+			// MAH结算校验原企业认证信息
+			if (input.getMahSettleDeptId() != null) {
+				deptId = sysUser.getDeptId();
+			} else {
+				deptId = operator.getDeptId();
+			}
+
 			SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery()
 					.eq(SysUserSub::getUserId, sysUser.getUserId())
 					.eq(SysUserSub::getSubjectLocation, input.getSubjectLocation())
-					.eq(SysUserSub::getDeptId, operator.getDeptId())
+					.eq(SysUserSub::getDeptId, deptId)
 			);
 
 			if (userSub == null) {
@@ -1208,10 +1274,18 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 		for (WmScorePackageSettleNote note : notes) {
 			SysUser sysUser = sysUserMapper.selectById(note.getUserId());
 
+			Integer deptId;
+			// MAH结算校验原企业认证信息
+			if (input.getMahSettleDeptId() != null) {
+				deptId = sysUser.getDeptId();
+			} else {
+				deptId = operator.getDeptId();
+			}
+
 			SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery()
 					.eq(SysUserSub::getUserId, sysUser.getUserId())
 					.eq(SysUserSub::getSubjectLocation, input.getSubjectLocation())
-					.eq(SysUserSub::getDeptId, operator.getDeptId())
+					.eq(SysUserSub::getDeptId, deptId)
 			);
 
 			if (userSub == null) {
@@ -1400,10 +1474,18 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 		for (WmScorePackageSettleNote note : notes) {
 			SysUser sysUser = sysUserMapper.selectById(note.getUserId());
 
+			Integer deptId;
+			// MAH结算校验原企业认证信息
+			if (input.getMahSettleDeptId() != null) {
+				deptId = sysUser.getDeptId();
+			} else {
+				deptId = operator.getDeptId();
+			}
+
 			SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery()
 					.eq(SysUserSub::getUserId, sysUser.getUserId())
 					.eq(SysUserSub::getSubjectLocation, input.getSubjectLocation())
-					.eq(SysUserSub::getDeptId, operator.getDeptId())
+					.eq(SysUserSub::getDeptId, deptId)
 			);
 
 			if (userSub == null) {
@@ -1586,10 +1668,18 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 		for (WmScorePackageSettleNote note : notes) {
 			SysUser sysUser = sysUserMapper.selectById(note.getUserId());
 
+			Integer deptId;
+			// MAH结算校验原企业认证信息
+			if (input.getMahSettleDeptId() != null) {
+				deptId = sysUser.getDeptId();
+			} else {
+				deptId = operator.getDeptId();
+			}
+
 			SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery()
 					.eq(SysUserSub::getUserId, sysUser.getUserId())
 					.eq(SysUserSub::getSubjectLocation, input.getSubjectLocation())
-					.eq(SysUserSub::getDeptId, operator.getDeptId())
+					.eq(SysUserSub::getDeptId, deptId)
 			);
 
 			if (userSub == null) {
@@ -1783,10 +1873,18 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 		for (WmScorePackageSettleNote note : notes) {
 			SysUser sysUser = sysUserMapper.selectById(note.getUserId());
 
+			Integer deptId;
+			// MAH结算校验原企业认证信息
+			if (input.getMahSettleDeptId() != null) {
+				deptId = sysUser.getDeptId();
+			} else {
+				deptId = operator.getDeptId();
+			}
+
 			SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery()
 					.eq(SysUserSub::getUserId, sysUser.getUserId())
 					.eq(SysUserSub::getSubjectLocation, input.getSubjectLocation())
-					.eq(SysUserSub::getDeptId, operator.getDeptId())
+					.eq(SysUserSub::getDeptId, deptId)
 			);
 
 			if (userSub == null) {
@@ -1925,10 +2023,18 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 		for (WmScorePackageSettleNote note : notes) {
 
 			SysUser sysUser = sysUserMapper.selectById(note.getUserId());
+
+			Integer deptId;
+			// MAH结算校验原企业认证信息
+			if (input.getMahSettleDeptId() != null) {
+				deptId = sysUser.getDeptId();
+			} else {
+				deptId = operator.getDeptId();
+			}
 			SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery()
 					.eq(SysUserSub::getUserId, sysUser.getUserId())
 					.eq(SysUserSub::getSubjectLocation, input.getSubjectLocation())
-					.eq(SysUserSub::getDeptId, operator.getDeptId())
+					.eq(SysUserSub::getDeptId, deptId)
 			);
 
 			if (userSub == null) {

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

@@ -35,6 +35,7 @@ import com.qunzhixinxi.hnqz.admin.entity.*;
 import com.qunzhixinxi.hnqz.admin.entity.input.SettleNoteStatusOutput;
 import com.qunzhixinxi.hnqz.admin.entity.output.SettleAmountMonitorOutput;
 import com.qunzhixinxi.hnqz.admin.entity.output.WmTaskSettleNoteOutput;
+import com.qunzhixinxi.hnqz.admin.enums.DelEnum;
 import com.qunzhixinxi.hnqz.admin.enums.GigTypeEnum;
 import com.qunzhixinxi.hnqz.admin.enums.SubjectLocation;
 import com.qunzhixinxi.hnqz.admin.enums.SubjectTypeEnum;
@@ -362,10 +363,35 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 			return R.failed(user.getRealname() + "人员结算渠道不存在,不能结算");
 		}
 
-		String subType = String.valueOf(note.getSubjectLocation().getGigType().getCode());
+		if (SubjectLocation.MAH_SETTLE.equals(note.getSubjectLocation())) {
+			// 默认在当前企业,取一个结算渠道
+			SysDeptSub condition = new SysDeptSub();
+			condition.setDeptId(user.getDeptId());
+			condition.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
+			List<SysDeptSub> deptSubs = sysDeptSubService.list(Wrappers.query(condition));
+			if (CollUtil.isEmpty(deptSubs)) {
+				return R.failed("结算渠道不存在");
+			}
+			SysDeptSub sysDeptSub = deptSubs.get(0);
+			location = deptSubs.get(0).getSubjectLocation();
+
+			// 默认取渠道对应的第一个发票类目 TODO
+			String invoiceType = sysDeptSub.getSubjectLocation().getInvoiceType();
+			// 查询发票类目对应的字典
+			List<SysDictItem> invoices = sysDictItemMapper.selectList(Wrappers.<SysDictItem>lambdaQuery()
+					.eq(SysDictItem::getType, invoiceType)
+					.eq(SysDictItem::getDelFlag, DelEnum.NOT_DEL.val()));
+			if (CollUtil.isEmpty(invoices)) {
+				return R.failed(user.getRealname() + "发票类目不存在,不能结算");
+			}
+			note.setInvoiceType(Integer.valueOf(invoices.get(0).getValue()));
+			note.setCategoryName(invoices.get(0).getLabel());
+		}
+
+		String subType = String.valueOf(location.getGigType().getCode());
 
 		SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery()
-				.eq(SysUserSub::getSubjectLocation, note.getSubjectLocation())
+				.eq(SysUserSub::getSubjectLocation, location)
 				.eq(SysUserSub::getDeptId, user.getDeptId())
 				.eq(SysUserSub::getUserId, user.getUserId())
 		);
@@ -375,8 +401,8 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 
 		SysDeptSub condition = new SysDeptSub();
 		condition.setDeptId(user.getDeptId());
-		condition.setSubjectType(subType);
-		condition.setSubjectLocation(note.getSubjectLocation());
+//		condition.setSubjectType(subType);
+		condition.setSubjectLocation(location);
 		condition.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
 		SysDeptSub sysDeptSub = sysDeptSubService.getOne(Wrappers.query(condition));
 
@@ -455,7 +481,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 			updateEntity = new WmScorePackageSettleNote();
 			updateEntity.setId(note.getId());
 			updateEntity.setSubType(subType);
-			updateEntity.setSubjectLocation(note.getSubjectLocation());
+			updateEntity.setSubjectLocation(location);
 			updateEntity.setInvoiceType(note.getInvoiceType());
 			updateEntity.setCategoryName(note.getCategoryName());
 			updateEntity.setSettleAmount(note.getSettleAmount());
@@ -469,12 +495,16 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 
 			WmScorePackage wmScorePackage = wmScorePackageMapper.selectById(settleNote.getPackageId());
 			wmScorePackage.setSettlementDate(LocalDateTime.now());
+			if (SubjectLocation.MAH_SETTLE.equals(note.getSubjectLocation())) {
+				wmScorePackage.setMahSettleDeptId(note.getMahSettleDeptId());
+				wmScorePackage.setLocation(note.getSubjectLocation());
+			}
 			wmScorePackageMapper.updateById(wmScorePackage);
 			return R.ok();
 		} else {
 			WmScorePackageSettleNote entity = new WmScorePackageSettleNote();
 			entity.setSubType(subType);
-			entity.setSubjectLocation(note.getSubjectLocation());
+			entity.setSubjectLocation(location);
 			entity.setInvoiceType(note.getInvoiceType());
 			entity.setCategoryName(note.getCategoryName());
 			entity.setSettleAmount(note.getSettleAmount());
@@ -493,6 +523,14 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 			entity.setIdCardNumber(user.getIdCardNumber());
 
 			this.baseMapper.insert(entity);
+
+			if (SubjectLocation.MAH_SETTLE.equals(note.getSubjectLocation())) {
+				// 更新 MAH结算-药企deptId
+				wmScorePackageMapper.update(null, Wrappers.<WmScorePackage>lambdaUpdate()
+						.eq(WmScorePackage::getId, note.getPackageId())
+						.set(WmScorePackage::getLocation, note.getSubjectLocation())
+						.set(WmScorePackage::getMahSettleDeptId, note.getMahSettleDeptId()));
+			}
 		}
 
 		return R.ok();
@@ -2234,6 +2272,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 		String gigTokenUrl = upmsConfig.getGigServiceUrl() + "/gig/operation/token?tenantId={tenantId}&action={action}&userId={userId}";
 		String gigSettleUrl = upmsConfig.getGigServiceUrl() + "/gig/operation/settlement";
 
+		StringBuilder noticeInfo = new StringBuilder();
 		try {
 			// 获取请求token
 			ResponseEntity<String> tokenResult = new RestTemplate().getForEntity(gigTokenUrl, String.class,
@@ -2314,19 +2353,24 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 						note.setSettleNoteStatus(DingEnum.NOTE_STATUS_SUBMIT.getType());
 						// 新增字段streamId
 						note.setStreamId(requestId);
+						noticeInfo.append(sysUser.getRealname()).append(":提交结算成功;");
 					} else {
 						note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+						noticeInfo.append(sysUser.getRealname()).append(":" + dataJsonObj.getStr("message"));
 						redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
 					}
 				} else {
 					note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
 					log.warn("中智结算提交成功 data 获取不到: {}", note.getSettleNo());
+					noticeInfo.append(sysUser.getRealname()).append(":提交结算成功,业务流水号获取不到,请联系管理员;");
+					redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
 				}
 			} else {
 				log.warn("中智结算提交失败: {}", note.getSettleNo());
 				note.setSubToGigTime(now);
 				note.setUpdateTime(now);
 				note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+				noticeInfo.append(sysUser.getRealname()).append(":结算提交失败-").append(settelObj.getStr("msg")).append(";");
 
 				log.info("认证状态异常,结算解锁settleNoteId:{}", note.getId());
 				redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
@@ -2339,6 +2383,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 			note.setSubToGigTime(now);
 			note.setUpdateTime(now);
 			note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+			noticeInfo.append(sysUser.getRealname()).append(":结算提交失败;");
 
 			log.info("认证状态异常,结算解锁settleNoteId:{}", note.getId());
 			redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
@@ -2346,7 +2391,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 
 		this.baseMapper.updateById(note);
 
-		return R.ok();
+		return R.ok(null, noticeInfo.toString());
 	}
 
 	/**
@@ -2377,6 +2422,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 		String gigTokenUrl = upmsConfig.getGigServiceUrl() + "/gig/operation/token?tenantId={tenantId}&action={action}&userId={userId}";
 		String gigSettleUrl = upmsConfig.getGigServiceUrl() + "/gig/operation/settlement";
 
+		StringBuilder noticeInfo = new StringBuilder();
 		try {
 			// 获取请求token
 			ResponseEntity<String> tokenResult = new RestTemplate().getForEntity(gigTokenUrl, String.class,
@@ -2451,12 +2497,15 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 						note.setSettleNoteStatus(DingEnum.NOTE_STATUS_SUBMIT.getType());
 						// 新增字段streamId
 						note.setStreamId(requestId);
+						noticeInfo.append(sysUser.getRealname()).append(":提交结算成功;");
 					} else {
 						note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+						noticeInfo.append(sysUser.getRealname()).append(":" + dataJsonObj.getStr("message"));
 						redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
 					}
 				} else {
 					note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+					noticeInfo.append(sysUser.getRealname()).append(":提交结算成功,业务流水号获取不到,请联系管理员;");
 					log.warn("众蚁云结算提交成功 data 获取不到: {}", note.getSettleNo());
 				}
 			} else {
@@ -2464,6 +2513,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 				note.setSubToGigTime(now);
 				note.setUpdateTime(now);
 				note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+				noticeInfo.append(sysUser.getRealname()).append(":结算提交失败-").append(settelObj.getStr("msg")).append(";");
 
 				log.info("认证状态异常,结算解锁settleNoteId:{}", note.getId());
 				redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
@@ -2476,6 +2526,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 			note.setSubToGigTime(now);
 			note.setUpdateTime(now);
 			note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+			noticeInfo.append(sysUser.getRealname()).append(":结算提交失败;");
 
 			log.info("认证状态异常,结算解锁settleNoteId:{}", note.getId());
 			redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
@@ -2483,7 +2534,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 
 		this.baseMapper.updateById(note);
 
-		return R.ok();
+		return R.ok(null, noticeInfo.toString());
 	}
 
 	/**
@@ -2515,6 +2566,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 		String gigTokenUrl = upmsConfig.getGigServiceUrl() + "/gig/operation/token?tenantId={tenantId}&action={action}&userId={userId}";
 		String gigSettleUrl = upmsConfig.getGigServiceUrl() + "/gig/operation/settlement";
 
+		StringBuilder noticeInfo = new StringBuilder();
 		try {
 			// 获取请求token
 			ResponseEntity<String> tokenResult = new RestTemplate().getForEntity(gigTokenUrl, String.class,
@@ -2598,12 +2650,15 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 						note.setSettleNoteStatus(DingEnum.NOTE_STATUS_SUBMIT.getType());
 						// 新增字段streamId
 						note.setStreamId(requestId);
+						noticeInfo.append(sysUser.getRealname()).append(":提交结算成功;");
 					} else {
 						note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+						noticeInfo.append(sysUser.getRealname()).append(":" + dataJsonObj.getStr("message"));
 						redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
 					}
 				} else {
 					note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+					noticeInfo.append(sysUser.getRealname()).append(":提交结算成功,业务流水号获取不到,请联系管理员;");
 					log.warn("汇企云结算提交成功 data 获取不到: {}", note.getSettleNo());
 					redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
 				}
@@ -2612,6 +2667,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 				note.setUpdateTime(now);
 				note.setSubToGigTime(now);
 				note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+				noticeInfo.append(sysUser.getRealname()).append(":结算提交失败-").append(settelObj.getStr("msg")).append(";");
 
 				log.info("认证状态异常,结算解锁settleNoteId:{}", note.getId());
 				redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
@@ -2624,6 +2680,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 			note.setUpdateTime(now);
 			note.setSubToGigTime(now);
 			note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+			noticeInfo.append(sysUser.getRealname()).append(":结算提交失败;");
 
 			log.info("认证状态异常,结算解锁settleNoteId:{}", note.getId());
 			redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
@@ -2631,7 +2688,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 
 		this.baseMapper.updateById(note);
 
-		return R.ok();
+		return R.ok(null, noticeInfo.toString());
 	}
 
 	/**
@@ -2663,6 +2720,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 		String gigTokenUrl = upmsConfig.getGigServiceUrl() + "/gig/operation/token?tenantId={tenantId}&action={action}&userId={userId}";
 		String gigSettleUrl = upmsConfig.getGigServiceUrl() + "/gig/operation/settlement";
 
+		StringBuilder noticeInfo = new StringBuilder();
 		try {
 			// 获取请求token
 			ResponseEntity<String> tokenResult = new RestTemplate().getForEntity(gigTokenUrl, String.class,
@@ -2735,9 +2793,11 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 				//data 获取不到
 				if (dataJsonObj == null) {
 					log.warn("浪潮结算提交成功 data 获取不到: {}", note.getSettleNo());
+					noticeInfo.append(sysUser.getRealname()).append(":提交结算成功,业务流水号获取不到,请联系管理员;");
 				}
 				if (!StrUtil.equals("200", dataJsonObj.getStr("code"))) {
 					log.info("浪潮提交成功 code 状态异常");
+					noticeInfo.append(sysUser.getRealname()).append(":提交结算成功,业务流水号获取不到,请联系管理员;");
 				}
 				note.setUpdateTime(now);
 				note.setSubToGigTime(now);
@@ -2746,8 +2806,10 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 					note.setSettleNoteStatus(DingEnum.NOTE_STATUS_SUBMIT.getType());
 					// 新增字段streamId
 					note.setStreamId(requestId);
+					noticeInfo.append(sysUser.getRealname()).append(":提交结算成功;");
 				} else {
 					note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+					noticeInfo.append(sysUser.getRealname()).append(":提交结算成功,业务流水号获取不到,请联系管理员;");
 					redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
 				}
 			} else {
@@ -2755,6 +2817,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 				note.setUpdateTime(now);
 				note.setSubToGigTime(now);
 				note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+				noticeInfo.append(sysUser.getRealname()).append(":结算提交失败-").append(settelObj.getStr("msg")).append(";");
 
 				log.info("认证状态异常,结算解锁settleNoteId:{}", note.getId());
 				redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
@@ -2767,6 +2830,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 			note.setUpdateTime(now);
 			note.setSubToGigTime(now);
 			note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+			noticeInfo.append(sysUser.getRealname()).append(":结算提交失败;");
 
 			log.info("认证状态异常,结算解锁settleNoteId:{}", note.getId());
 			redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
@@ -2774,7 +2838,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 
 		this.baseMapper.updateById(note);
 
-		return R.ok();
+		return R.ok(null, noticeInfo.toString());
 	}
 
 	private R settleBySinbaad(WmScorePackageSettleNote note,
@@ -2796,6 +2860,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 		String gigTokenUrl = upmsConfig.getGigServiceUrl() + "/gig/operation/token?tenantId={tenantId}&action={action}&userId={userId}";
 		String gigSettleUrl = upmsConfig.getGigServiceUrl() + "/gig/operation/settlement";
 
+		StringBuilder noticeInfo = new StringBuilder();
 		try {
 			// 获取请求token
 			ResponseEntity<String> tokenResult = new RestTemplate().getForEntity(gigTokenUrl, String.class,
@@ -2870,14 +2935,17 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 						note.setSettleNoteStatus(DingEnum.NOTE_STATUS_SUBMIT.getType());
 						// 新增字段streamId
 						note.setStreamId(requestId);
+						noticeInfo.append(sysUser.getRealname()).append(":提交结算成功;");
 					} else {
 						note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
 						log.warn("政企之星结算提交成功 requestId 获取不到: {}", note.getSettleNo());
+						noticeInfo.append(sysUser.getRealname()).append(":提交结算成功,业务流水号获取不到,请联系管理员;");
 						redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
 					}
 				} else {
 					note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
 					log.warn("政企之星结算提交成功 data 获取不到: {}", note.getSettleNo());
+					noticeInfo.append(sysUser.getRealname()).append(":提交结算成功,业务流水号获取不到,请联系管理员;");
 					redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
 				}
 			} else {
@@ -2885,6 +2953,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 				note.setUpdateTime(now);
 				note.setSubToGigTime(now);
 				note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+				noticeInfo.append(sysUser.getRealname()).append(":结算提交失败-").append(settelObj.getStr("msg")).append(";");
 
 				log.info("认证状态异常,结算解锁settleNoteId:{}", note.getId());
 				redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
@@ -2897,6 +2966,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 			note.setUpdateTime(now);
 			note.setSubToGigTime(now);
 			note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+			noticeInfo.append(sysUser.getRealname()).append(":结算提交失败;");
 
 			log.info("认证状态异常,结算解锁settleNoteId:{}", note.getId());
 			redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
@@ -2904,7 +2974,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 
 		this.baseMapper.updateById(note);
 
-		return R.ok();
+		return R.ok(null, noticeInfo.toString());
 	}
 
 	private R settleByOlading(WmScorePackageSettleNote note,
@@ -2926,6 +2996,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 		String gigTokenUrl = upmsConfig.getGigServiceUrl() + "/gig/operation/token?tenantId={tenantId}&action={action}&userId={userId}";
 		String gigSettleUrl = upmsConfig.getGigServiceUrl() + "/gig/operation/settlement";
 
+		StringBuilder noticeInfo = new StringBuilder();
 		try {
 			// 获取请求token
 			ResponseEntity<String> tokenResult = new RestTemplate().getForEntity(gigTokenUrl, String.class,
@@ -3005,6 +3076,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 				if (dataJsonObj == null) {
 					note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
 					log.warn("自由职家结算提交成功 data 获取不到: {}", note.getSettleNo());
+					noticeInfo.append(sysUser.getRealname()).append(":提交结算成功,业务流水号获取不到,请联系管理员;");
 					redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + ":note_id_" + note.getId());
 				} else {
 					String requestId = dataJsonObj.getStr("requestId");
@@ -3014,8 +3086,10 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 						note.setStreamId(requestId);
 						// 第三方任务id
 						note.setThirdTaskId(dataJsonObj.getStr("taskId"));
+						noticeInfo.append(sysUser.getRealname()).append(":提交结算成功;");
 					} else {
 						note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+						noticeInfo.append(sysUser.getRealname()).append(":提交结算成功,业务流水号获取不到,请联系管理员;");
 						redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
 					}
 				}
@@ -3024,6 +3098,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 				note.setSubToGigTime(now);
 				note.setUpdateTime(now);
 				note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+				noticeInfo.append(sysUser.getRealname()).append(":结算提交失败-").append(settelObj.getStr("msg")).append(";");
 
 				log.info("认证状态异常,结算解锁settleNoteId:{}", note.getId());
 				redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
@@ -3036,6 +3111,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 			note.setSubToGigTime(now);
 			note.setUpdateTime(now);
 			note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+			noticeInfo.append(sysUser.getRealname()).append(":结算提交失败;");
 
 			log.info("认证状态异常,结算解锁settleNoteId:{}", note.getId());
 			redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
@@ -3043,7 +3119,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 
 		this.baseMapper.updateById(note);
 
-		return R.ok();
+		return R.ok(null, noticeInfo.toString());
 	}
 
 
@@ -3097,25 +3173,31 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 
 		log.info("税邦云结算: {}", response);
 
-
+		StringBuilder noticeInfo = new StringBuilder();
 		if (response.success()) {
 			log.info("税邦云结算提交成功: {}", note.getSettleNo());
 			//streamId 获取不到
 			if (StringUtils.isEmpty(response.getMessage())) {
+				note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
 				log.info("税邦云结算提交成功 streamId 获取不到: {}", note.getSettleNo());
+				noticeInfo.append(sysUser.getRealname()).append(":提交结算成功,业务流水号获取不到,请联系管理员;");
+				redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
+			} else {
+				note.setSettleNoteStatus(DingEnum.NOTE_STATUS_SUBMIT.getType());
+				// 新增字段streamId
+				note.setStreamId(response.getMessage());
+				noticeInfo.append(sysUser.getRealname()).append(":提交结算成功;");
 			}
 			LocalDateTime now = LocalDateTime.now();
 			note.setSubToGigTime(now);
 			note.setUpdateTime(now);
-			note.setSettleNoteStatus(DingEnum.NOTE_STATUS_SUBMIT.getType());
-			// 新增字段streamId
-			note.setStreamId(response.getMessage());
 		} else {
 			log.info("税邦云结算提交失败: {}", note.getSettleNo());
 			LocalDateTime now = LocalDateTime.now();
 			note.setSubToGigTime(now);
 			note.setUpdateTime(now);
 			note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+			noticeInfo.append(sysUser.getRealname()).append(":结算提交失败-").append(response.getMessage()).append(";");
 
 			log.info("认证状态异常,结算解锁settleNoteId:{}", note.getId());
 			redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
@@ -3124,7 +3206,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 
 		this.baseMapper.updateById(note);
 
-		return R.ok();
+		return R.ok(Boolean.TRUE, noticeInfo.toString());
 	}
 
 	private R settleByRenLiJia(WmScorePackageSettleNote note, DingConfig config, WmScorePackage wmScorePackage,
@@ -3167,10 +3249,13 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 		note.setSubToGigTime(now);
 		note.setUpdateTime(now);
 
+		// 进入结算环节  noticeInfo 失败原因
+		StringBuilder noticeInfo = new StringBuilder();
 		//提交结算接口失败
 		if (!employPayResponse.isSuccess()) {
 			log.info("人力家接口调用失败,结算解锁settleNoteId:{}", note.getId());
 			redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
+			noticeInfo.append("结算对象-").append(sysUser.getRealname()).append(":提交结算失败").append(employPayResponse.getCode()).append(employPayResponse.getMsg());
 			note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
 
 		} else {
@@ -3179,6 +3264,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 			if (CollectionUtils.isNotEmpty(successResult)) {
 
 				log.info("结算对象-" + sysUser.getRealname() + ":提交结算成功;");
+				noticeInfo.append("结算对象-").append(sysUser.getRealname()).append(":提交结算成功;");
 				note.setSettleNoteStatus(DingEnum.NOTE_STATUS_SUBMIT.getType());
 			}
 
@@ -3190,13 +3276,14 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 				redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
 
 				log.info("结算对象-" + sysUser.getRealname() + ",结算失败:" + failResult.get(0).getCheckRemark() + ";");
+				noticeInfo.append("结算对象-").append(sysUser.getRealname()).append(",结算失败:").append(failResult.get(0).getCheckRemark()).append(";");
 				note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
 			}
 		}
 
 		this.baseMapper.updateById(note);
 
-		return R.ok();
+		return R.ok(Boolean.TRUE, noticeInfo.toString());
 	}
 
 	@Override

+ 6 - 0
hnqz-upms/hnqz-upms-biz/src/main/resources/mapper/WmScorePackageMapper.xml

@@ -1432,6 +1432,9 @@
 		FROM wm_score_package p, sys_dept d
 		WHERE
 		p.send_package_dept_id = d.dept_id
+		<if test="query.mahSettleDeptId != null">
+			AND p.mah_settle_dept_id = #{query.mahSettleDeptId}
+		</if>
 		<if test="query.sendPackageDeptId != null and query.sendPackageDeptId != ''">
 			AND p.send_package_dept_id= #{query.sendPackageDeptId}
 		</if>
@@ -1485,6 +1488,9 @@
 		left join wm_score_package_status ps on p.id = ps.package_id
 		left join sys_user su on ps.user_id = su.user_id
 		<where>
+			<if test="query.mahSettleDeptId != null">
+				AND p.mah_settle_dept_id = #{query.mahSettleDeptId}
+			</if>
 			<if test="query.sendPackageDeptId != null and query.sendPackageDeptId != ''">
 				AND p.send_package_dept_id= #{query.sendPackageDeptId}
 			</if>