Selaa lähdekoodia

fix: 财务批量结算校验是不是当月数据

lixuesong 1 vuosi sitten
vanhempi
commit
7134cafddd

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

@@ -653,12 +653,21 @@ public class WmPayOffController {
 
 		List<Map<String, String>> msgList = new ArrayList<>();
 
+		// 获取当日所在月份
+		LocalDateTime today = LocalDateTime.now();
+		int monthValue = today.getMonthValue();
+
 		for (WmScorePackageSettleInput input : inputList) {
 
 			if (StringUtils.isEmpty(input.getId()) || null == input.getSubjectLocation() || null == input.getInvoiceCategory() || StringUtils.isEmpty(input.getScorePackageName())) {
 				return R.failed("数据异常");
 			}
 
+			Optional<WmScorePackageSettleNote> checkMonthOpt = input.getNotes().stream().filter(note -> note.getSubTime() == null || note.getSubTime().getMonthValue() != monthValue).findAny();
+			if (checkMonthOpt.isPresent()) {
+				return R.failed("不支持结算非当月提交记录,请回退并重新提交后重试");
+			}
+
 			// 查询结算详情(用于拼接notes数据)
 			R<?> queryR = wmPayOffService.settleById(input.getId());