南大三十年教职工疗休养
This commit is contained in:
@@ -40,9 +40,9 @@ public class SmsNcuServiceImpl implements SmsService {
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
private static final String SEND_MSG_URL = "";
|
||||
private static final String APP_ID = "";
|
||||
private static final String TEMPLATE_ID = "";
|
||||
private static final String SEND_MSG_URL = "https://poa.ncu.edu.cn/apis/messagecenter/v1/poaMessage/messageSend";
|
||||
private static final String APP_ID = "72e34a101d3011f1a74cbae5193504f4";
|
||||
private static final String TEMPLATE_ID = "MT1773223005000";
|
||||
|
||||
@Override
|
||||
public void sendSingleMessage(String loginName, String content) {
|
||||
|
||||
@@ -329,7 +329,7 @@ public class SysHomeController {
|
||||
rows.add(NutMap.NEW()
|
||||
.addv("id", "thirtyTeachTour-" + setting.getId())
|
||||
.addv("year", setting.getYear())
|
||||
.addv("title", setting.getYear() + "30年教龄疗休养")
|
||||
.addv("title", setting.getYear() + "服务南大三十年")
|
||||
.addv("imageUrl", imageUrl)
|
||||
.addv("href", "/platform/thirtyTeachTour/signup")
|
||||
.addv("startCorner", "rightTop")
|
||||
|
||||
+26
-10
@@ -79,9 +79,11 @@ public class ThirtyTeachTourBranchUserAssignmentController {
|
||||
@At
|
||||
@SaCheckPermission("thirtyTeachTour.branchUserAssignment.assign")
|
||||
public Result candidatePageData(PageForm pageForm, String settingId, String keyword, @Param("userIds") String userIds,
|
||||
Boolean retiringSoon) {
|
||||
String retiringSoon) {
|
||||
// 候选人员筛选下拉清空时应视为不筛选,避免空值在参数绑定中被误转换为 false。
|
||||
Boolean normalizedRetiringSoon = normalizeBooleanFilter(retiringSoon);
|
||||
return Result.success(tourUserAssignmentService.branchCandidatePage(pageForm, settingId, keyword,
|
||||
parseUserIds(userIds), retiringSoon));
|
||||
parseUserIds(userIds), normalizedRetiringSoon));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -137,7 +139,7 @@ public class ThirtyTeachTourBranchUserAssignmentController {
|
||||
@SaCheckPermission("thirtyTeachTour.branchUserAssignment.assign")
|
||||
@SLog(type = "tour", tag = "疗休养分工会人员分配", msg = "保存分工会人员分配")
|
||||
public Result doAssign(String settingId, String matterId, String periodId, String personType,
|
||||
@Param("userIds") String userIds, String photoFiles,
|
||||
@Param("userIds") String userIds, String photoFiles, String currentPeriodPhotoFiles,
|
||||
@Param("assignItems") String assignItems) {
|
||||
if (StrUtil.isNotBlank(assignItems)) {
|
||||
List<NutMap> parsedItems;
|
||||
@@ -160,7 +162,7 @@ public class ThirtyTeachTourBranchUserAssignmentController {
|
||||
}
|
||||
try {
|
||||
return Result.success(tourUserAssignmentService.assignBranchUsers(settingId, matterId, periodId, personType,
|
||||
buildAssignItems(parsedUserIds, photoFiles)));
|
||||
buildAssignItems(parsedUserIds, photoFiles, currentPeriodPhotoFiles)));
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
@@ -188,9 +190,10 @@ public class ThirtyTeachTourBranchUserAssignmentController {
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("thirtyTeachTour.branchUserAssignment.selectMatter")
|
||||
@SLog(type = "tour", tag = "疗休养分工会人员分配", msg = "选择分工会分配事项")
|
||||
public Result selectMatter(String id, String matterId, String photoFiles) {
|
||||
public Result selectMatter(String id, String matterId, String photoFiles, String currentPeriodPhotoFiles) {
|
||||
try {
|
||||
return Result.success(tourUserAssignmentService.selectCurrentBranchAssignmentMatter(id, matterId, photoFiles));
|
||||
return Result.success(tourUserAssignmentService.selectCurrentBranchAssignmentMatter(id, matterId,
|
||||
photoFiles, currentPeriodPhotoFiles));
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
@@ -203,9 +206,9 @@ public class ThirtyTeachTourBranchUserAssignmentController {
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("thirtyTeachTour.branchUserAssignment.assign")
|
||||
@SLog(type = "tour", tag = "疗休养分工会人员分配", msg = "上传分工会人员分配图片")
|
||||
public Result updatePhotoFiles(String id, String photoFiles) {
|
||||
public Result updatePhotoFiles(String id, String photoFiles, String currentPeriodPhotoFiles) {
|
||||
try {
|
||||
tourUserAssignmentService.updateCurrentBranchAssignmentPhotoFiles(id, photoFiles);
|
||||
tourUserAssignmentService.updateCurrentBranchAssignmentPhotoFiles(id, photoFiles, currentPeriodPhotoFiles);
|
||||
return Result.success();
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
@@ -278,15 +281,28 @@ public class ThirtyTeachTourBranchUserAssignmentController {
|
||||
return Lang.isEmpty(list) ? Collections.emptyList() : list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 候选人员布尔筛选兜底;true/false 转成布尔值,空字符串和 null 表示不追加查询条件。
|
||||
*/
|
||||
private Boolean normalizeBooleanFilter(String value) {
|
||||
if (StrUtil.isBlank(value)) {
|
||||
return null;
|
||||
}
|
||||
return Boolean.parseBoolean(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 兼容旧的 userIds 入参,把公共图片材料转换成按人员明细的统一 service 入参。
|
||||
*/
|
||||
private List<NutMap> buildAssignItems(List<String> userIds, String photoFiles) {
|
||||
private List<NutMap> buildAssignItems(List<String> userIds, String photoFiles, String currentPeriodPhotoFiles) {
|
||||
if (Lang.isEmpty(userIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<NutMap> list = new ArrayList<>();
|
||||
userIds.forEach(userId -> list.add(NutMap.NEW().addv("userId", userId).addv("photoFiles", photoFiles)));
|
||||
userIds.forEach(userId -> list.add(NutMap.NEW()
|
||||
.addv("userId", userId)
|
||||
.addv("photoFiles", photoFiles)
|
||||
.addv("currentPeriodPhotoFiles", currentPeriodPhotoFiles)));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
+51
-17
@@ -392,11 +392,17 @@ public class ThirtyTeachTourLedgerController {
|
||||
List<NutMap> rows = queryLedgerExportRows(startYear, endYear, keyword, unionId, lineId, travelPeriod,
|
||||
lineType, directFamilyOnly, overCostOnly);
|
||||
int imageColumnStartIndex = entities.size();
|
||||
int maxPhotoCount = maxPhotoCount(rows);
|
||||
log.info("三十年教龄疗休养台账导出图片列准备:rows={}, maxPhotoCount={}, appDomain={}",
|
||||
rows.size(), maxPhotoCount, Globals.AppDomain);
|
||||
int maxPhotoCount = maxPhotoCount(rows, "photoFiles");
|
||||
int maxCurrentPeriodPhotoCount = maxPhotoCount(rows, "currentPeriodPhotoFiles");
|
||||
int totalImageColumnCount = maxPhotoCount + maxCurrentPeriodPhotoCount;
|
||||
log.info("三十年教龄疗休养台账导出图片列准备:rows={}, beforePhotoMax={}, currentPeriodPhotoMax={}, appDomain={}",
|
||||
rows.size(), maxPhotoCount, maxCurrentPeriodPhotoCount, Globals.AppDomain);
|
||||
for (int i = 1; i <= maxPhotoCount; i++) {
|
||||
ExcelExportEntity imageEntity = new ExcelExportEntity("图片" + i, "photoCell" + i, 18);
|
||||
ExcelExportEntity imageEntity = new ExcelExportEntity("30年前图片" + i, "photoCell" + i, 18);
|
||||
entities.add(imageEntity);
|
||||
}
|
||||
for (int i = 1; i <= maxCurrentPeriodPhotoCount; i++) {
|
||||
ExcelExportEntity imageEntity = new ExcelExportEntity("当前时间段图片" + i, "photoCell" + (maxPhotoCount + i), 18);
|
||||
entities.add(imageEntity);
|
||||
}
|
||||
rows.forEach(row -> {
|
||||
@@ -404,7 +410,7 @@ public class ThirtyTeachTourLedgerController {
|
||||
row.put("familyCountText", (familyCount == null ? 0 : familyCount) + "人");
|
||||
row.put("joinedText", Boolean.TRUE.equals(row.getBoolean("joined")) ? "是" : "否");
|
||||
row.put("overCostReimbursedText", Boolean.TRUE.equals(row.getBoolean("overCostReimbursed")) ? "是" : "否");
|
||||
fillLedgerPhotoRowImages(row, maxPhotoCount);
|
||||
fillLedgerPhotoRowImages(row, maxPhotoCount, maxCurrentPeriodPhotoCount);
|
||||
});
|
||||
List<List<LedgerExportImage>> rowImages = snapshotLedgerRowImages(rows);
|
||||
|
||||
@@ -412,7 +418,7 @@ public class ThirtyTeachTourLedgerController {
|
||||
exportParams.setSheetName("疗休养台账");
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, rows);
|
||||
resizeLedgerPhotoRows(workbook, rowImages.size(), imageColumnStartIndex, maxPhotoCount);
|
||||
resizeLedgerPhotoRows(workbook, rowImages.size(), imageColumnStartIndex, totalImageColumnCount);
|
||||
int insertedPictureCount = insertLedgerPhotoImages(workbook, rowImages, imageColumnStartIndex);
|
||||
log.info("三十年教龄疗休养台账导出Excel图片写入完成:insertedPictureCount={}, workbookPictureCount={}",
|
||||
insertedPictureCount, workbook.getAllPictures().size());
|
||||
@@ -422,10 +428,10 @@ public class ThirtyTeachTourLedgerController {
|
||||
/**
|
||||
* 统计本次导出台账中最大的图片数量,用于动态生成图片1、图片2等横向列。
|
||||
*/
|
||||
private int maxPhotoCount(List<NutMap> rows) {
|
||||
private int maxPhotoCount(List<NutMap> rows, String fieldName) {
|
||||
int maxPhotoCount = 0;
|
||||
for (NutMap row : rows) {
|
||||
maxPhotoCount = Math.max(maxPhotoCount, splitPhotoFiles(row.getString("photoFiles", "")).size());
|
||||
maxPhotoCount = Math.max(maxPhotoCount, splitPhotoFiles(row.getString(fieldName, "")).size());
|
||||
}
|
||||
return maxPhotoCount;
|
||||
}
|
||||
@@ -433,14 +439,23 @@ public class ThirtyTeachTourLedgerController {
|
||||
/**
|
||||
* 将每条台账的图片材料解析为可写入 Excel 的图片对象,图片列文本保持为空,后续由 POI 手动插入图片。
|
||||
*/
|
||||
private void fillLedgerPhotoRowImages(NutMap row, int maxPhotoCount) {
|
||||
private void fillLedgerPhotoRowImages(NutMap row, int maxPhotoCount, int maxCurrentPeriodPhotoCount) {
|
||||
List<String> photoFiles = splitPhotoFiles(row.getString("photoFiles", ""));
|
||||
List<String> currentPeriodPhotoFiles = splitPhotoFiles(row.getString("currentPeriodPhotoFiles", ""));
|
||||
if (!photoFiles.isEmpty()) {
|
||||
log.info("三十年教龄疗休养台账图片字段读取:jobNo={}, userName={}, photoCount={}, photoFiles={}",
|
||||
log.info("三十年教龄疗休养台账30年前图片字段读取:jobNo={}, userName={}, photoCount={}, photoFiles={}",
|
||||
row.getString("jobNo", ""), row.getString("userName", ""), photoFiles.size(), row.getString("photoFiles", ""));
|
||||
}
|
||||
row.put("photoImages", resolveLedgerImages(row.getString("photoFiles", "")));
|
||||
for (int i = 1; i <= maxPhotoCount; i++) {
|
||||
if (!currentPeriodPhotoFiles.isEmpty()) {
|
||||
log.info("三十年教龄疗休养台账当前时间段图片字段读取:jobNo={}, userName={}, photoCount={}, photoFiles={}",
|
||||
row.getString("jobNo", ""), row.getString("userName", ""), currentPeriodPhotoFiles.size(), row.getString("currentPeriodPhotoFiles", ""));
|
||||
}
|
||||
// 图片对象按导出列顺序组装:先 30 年前图片,再当前时间段图片,确保同一教职工图片仍在同一行。
|
||||
List<LedgerExportImage> photoImages = new ArrayList<>();
|
||||
photoImages.addAll(resolveLedgerImages(row.getString("photoFiles", ""), 0));
|
||||
photoImages.addAll(resolveLedgerImages(row.getString("currentPeriodPhotoFiles", ""), maxPhotoCount));
|
||||
row.put("photoImages", photoImages);
|
||||
for (int i = 1; i <= maxPhotoCount + maxCurrentPeriodPhotoCount; i++) {
|
||||
row.put("photoCell" + i, "");
|
||||
}
|
||||
}
|
||||
@@ -508,16 +523,17 @@ public class ThirtyTeachTourLedgerController {
|
||||
List<LedgerExportImage> images = rowImages.get(rowIndex);
|
||||
for (int photoIndex = 0; photoIndex < images.size(); photoIndex++) {
|
||||
LedgerExportImage image = images.get(photoIndex);
|
||||
int imageColumnIndex = imageColumnStartIndex + image.columnOffset;
|
||||
int pictureIndex = workbook.addPicture(image.bytes, image.pictureType);
|
||||
ClientAnchor anchor = creationHelper.createClientAnchor();
|
||||
anchor.setCol1(imageColumnStartIndex + photoIndex);
|
||||
anchor.setCol1(imageColumnIndex);
|
||||
anchor.setRow1(excelRowIndex);
|
||||
anchor.setCol2(imageColumnStartIndex + photoIndex + 1);
|
||||
anchor.setCol2(imageColumnIndex + 1);
|
||||
anchor.setRow2(excelRowIndex + 1);
|
||||
drawing.createPicture(anchor, pictureIndex);
|
||||
insertedPictureCount++;
|
||||
log.info("三十年教龄疗休养台账图片写入Excel成功:rowIndex={}, photoIndex={}, fileId={}, bytes={}, pictureType={}",
|
||||
excelRowIndex, photoIndex + 1, image.fileId, image.bytes.length, image.pictureType);
|
||||
log.info("三十年教龄疗休养台账图片写入Excel成功:rowIndex={}, columnOffset={}, fileId={}, bytes={}, pictureType={}",
|
||||
excelRowIndex, image.columnOffset, image.fileId, image.bytes.length, image.pictureType);
|
||||
}
|
||||
}
|
||||
return insertedPictureCount;
|
||||
@@ -527,13 +543,20 @@ public class ThirtyTeachTourLedgerController {
|
||||
* 将台账图片字段解析成可插入 Excel 的图片对象,当前优先支持系统文件下载路径。
|
||||
*/
|
||||
private List<LedgerExportImage> resolveLedgerImages(String photoFiles) {
|
||||
return resolveLedgerImages(photoFiles, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将台账图片字段解析成可插入 Excel 的图片对象,并记录图片列偏移,支持多组图片列分区写入。
|
||||
*/
|
||||
private List<LedgerExportImage> resolveLedgerImages(String photoFiles, int columnOffsetStart) {
|
||||
List<LedgerExportImage> images = new ArrayList<>();
|
||||
List<String> photoPaths = splitPhotoFiles(photoFiles);
|
||||
for (int photoIndex = 0; photoIndex < photoPaths.size(); photoIndex++) {
|
||||
String originalPath = photoPaths.get(photoIndex);
|
||||
LedgerExportImage image = resolveLedgerImage(originalPath);
|
||||
if (image != null) {
|
||||
images.add(image);
|
||||
images.add(image.withColumnOffset(columnOffsetStart + photoIndex));
|
||||
} else {
|
||||
log.warn("三十年教龄疗休养台账图片解析失败:photoIndex={}, originalPath={}", photoIndex + 1, originalPath);
|
||||
}
|
||||
@@ -707,12 +730,22 @@ public class ThirtyTeachTourLedgerController {
|
||||
private final String originalPath;
|
||||
private final byte[] bytes;
|
||||
private final int pictureType;
|
||||
private final int columnOffset;
|
||||
|
||||
private LedgerExportImage(String fileId, String originalPath, byte[] bytes, int pictureType) {
|
||||
this(fileId, originalPath, bytes, pictureType, 0);
|
||||
}
|
||||
|
||||
private LedgerExportImage(String fileId, String originalPath, byte[] bytes, int pictureType, int columnOffset) {
|
||||
this.fileId = fileId;
|
||||
this.originalPath = originalPath;
|
||||
this.bytes = bytes;
|
||||
this.pictureType = pictureType;
|
||||
this.columnOffset = columnOffset;
|
||||
}
|
||||
|
||||
private LedgerExportImage withColumnOffset(int columnOffset) {
|
||||
return new LedgerExportImage(fileId, originalPath, bytes, pictureType, columnOffset);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -739,6 +772,7 @@ public class ThirtyTeachTourLedgerController {
|
||||
t.lineType,
|
||||
t.signupTime,
|
||||
t.photoFiles,
|
||||
t.currentPeriodPhotoFiles,
|
||||
IFNULL(f.familyCount, 0) AS familyCount,
|
||||
t.joined,
|
||||
t.overCostReimbursed
|
||||
|
||||
+3
-1
@@ -508,12 +508,14 @@ public class ThirtyTeachTourMySignupController {
|
||||
ledger.setJoined(oldLedger.getJoined());
|
||||
ledger.setReimbursed(oldLedger.getReimbursed());
|
||||
ledger.setSignupTime(defaultIfBlank(oldLedger.getSignupTime(), ledger.getSignupTime()));
|
||||
// 修改报名表单未必提交当前时间段图片,保留旧台账字段,避免回填人员分配时误清空。
|
||||
ledger.setCurrentPeriodPhotoFiles(defaultIfBlank(ledger.getCurrentPeriodPhotoFiles(), oldLedger.getCurrentPeriodPhotoFiles()));
|
||||
fillStaffInfo(ledger);
|
||||
|
||||
tourLedgerService.updateIgnoreNull(ledger);
|
||||
// 报名台账更新后,仅回填已存在的人员分配记录事项信息,不新增记录、不改变分配来源。
|
||||
tourUserAssignmentService.backfillExistingAssignmentAfterSignup(matter.getSettingId(), matter.getId(), SecurityUtil.getUserId(),
|
||||
ledger.getBoardingPlace(), ledger.getPhotoFiles());
|
||||
ledger.getBoardingPlace(), ledger.getPhotoFiles(), ledger.getCurrentPeriodPhotoFiles());
|
||||
tourLedgerFamilyService.clear(Cnd.where(ThirtyTeachTourLedgerFamily::getLedgerId, "=", ledger.getId()));
|
||||
tourLedgerDirectRelativeService.clear(Cnd.where(ThirtyTeachTourLedgerDirectRelative::getLedgerId, "=", ledger.getId()));
|
||||
if (Lang.isNotEmpty(familyList)) {
|
||||
|
||||
+25
-8
@@ -103,9 +103,13 @@ public class ThirtyTeachTourSchoolUserAssignmentController {
|
||||
@At
|
||||
@SaCheckPermission("thirtyTeachTour.schoolUserAssignment")
|
||||
public Result candidatePageData(PageForm pageForm, String settingId, String unionId, String keyword, @Param("userIds") String userIds,
|
||||
Boolean summerJoined, Boolean lastThirtyJoined, Boolean retiringSoon) {
|
||||
String summerJoined, String lastThirtyJoined, String retiringSoon) {
|
||||
// 候选人员筛选下拉清空时应视为不筛选,避免空值在参数绑定中被误转换为 false。
|
||||
Boolean normalizedSummerJoined = normalizeBooleanFilter(summerJoined);
|
||||
Boolean normalizedLastThirtyJoined = normalizeBooleanFilter(lastThirtyJoined);
|
||||
Boolean normalizedRetiringSoon = normalizeBooleanFilter(retiringSoon);
|
||||
return Result.success(tourUserAssignmentService.schoolCandidatePage(pageForm, settingId, unionId, keyword,
|
||||
parseUserIds(userIds), summerJoined, lastThirtyJoined, retiringSoon));
|
||||
parseUserIds(userIds), normalizedSummerJoined, normalizedLastThirtyJoined, normalizedRetiringSoon));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -151,7 +155,8 @@ public class ThirtyTeachTourSchoolUserAssignmentController {
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("thirtyTeachTour.schoolUserAssignment")
|
||||
@SLog(type = "tour", tag = "疗休养校工会人员分配", msg = "保存校工会人员分配")
|
||||
public Result doAssign(String settingId, String matterId, String personType, @Param("userIds") String userIds, String photoFiles) {
|
||||
public Result doAssign(String settingId, String matterId, String personType, @Param("userIds") String userIds,
|
||||
String photoFiles, String currentPeriodPhotoFiles) {
|
||||
List<String> parsedUserIds;
|
||||
try {
|
||||
parsedUserIds = parseUserIds(userIds);
|
||||
@@ -159,7 +164,8 @@ public class ThirtyTeachTourSchoolUserAssignmentController {
|
||||
return Result.error("人员参数错误");
|
||||
}
|
||||
try {
|
||||
return Result.success(tourUserAssignmentService.assignSchoolUsers(settingId, matterId, personType, parsedUserIds, photoFiles));
|
||||
return Result.success(tourUserAssignmentService.assignSchoolUsers(settingId, matterId, personType,
|
||||
parsedUserIds, photoFiles, currentPeriodPhotoFiles));
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
@@ -193,9 +199,10 @@ public class ThirtyTeachTourSchoolUserAssignmentController {
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("thirtyTeachTour.schoolUserAssignment")
|
||||
@SLog(type = "tour", tag = "疗休养校工会人员分配", msg = "选择校工会分配事项")
|
||||
public Result selectMatter(String id, String matterId, String photoFiles) {
|
||||
public Result selectMatter(String id, String matterId, String photoFiles, String currentPeriodPhotoFiles) {
|
||||
try {
|
||||
return Result.success(tourUserAssignmentService.selectSchoolAssignmentMatter(id, matterId, photoFiles));
|
||||
return Result.success(tourUserAssignmentService.selectSchoolAssignmentMatter(id, matterId,
|
||||
photoFiles, currentPeriodPhotoFiles));
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
@@ -208,9 +215,9 @@ public class ThirtyTeachTourSchoolUserAssignmentController {
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("thirtyTeachTour.schoolUserAssignment")
|
||||
@SLog(type = "tour", tag = "疗休养校工会人员分配", msg = "上传校工会人员分配图片")
|
||||
public Result updatePhotoFiles(String id, String photoFiles) {
|
||||
public Result updatePhotoFiles(String id, String photoFiles, String currentPeriodPhotoFiles) {
|
||||
try {
|
||||
tourUserAssignmentService.updateSchoolAssignmentPhotoFiles(id, photoFiles);
|
||||
tourUserAssignmentService.updateSchoolAssignmentPhotoFiles(id, photoFiles, currentPeriodPhotoFiles);
|
||||
return Result.success();
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
@@ -280,6 +287,16 @@ public class ThirtyTeachTourSchoolUserAssignmentController {
|
||||
return Lang.isEmpty(list) ? Collections.emptyList() : list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 候选人员布尔筛选兜底;true/false 转成布尔值,空字符串和 null 表示不追加查询条件。
|
||||
*/
|
||||
private Boolean normalizeBooleanFilter(String value) {
|
||||
if (StrUtil.isBlank(value)) {
|
||||
return null;
|
||||
}
|
||||
return Boolean.parseBoolean(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 定义人员分配导出字段,保持与页面列表核心字段一致并补充人员基础信息。
|
||||
*/
|
||||
|
||||
+5
-1
@@ -906,6 +906,8 @@ public class ThirtyTeachTourSignupController {
|
||||
ledger.setJoined(oldLedger.getJoined());
|
||||
ledger.setReimbursed(oldLedger.getReimbursed());
|
||||
ledger.setSignupTime(defaultIfBlank(oldLedger.getSignupTime(), ledger.getSignupTime()));
|
||||
// 修改报名时前端可能未提交当前时间段图片,沿用旧台账值,避免非图片字段修改导致材料丢失。
|
||||
ledger.setCurrentPeriodPhotoFiles(defaultIfBlank(ledger.getCurrentPeriodPhotoFiles(), oldLedger.getCurrentPeriodPhotoFiles()));
|
||||
}
|
||||
ledger.setOverCostReimbursed(Boolean.TRUE.equals(ledger.getOverCostReimbursed()));
|
||||
fillStaffInfo(ledger);
|
||||
@@ -920,7 +922,7 @@ public class ThirtyTeachTourSignupController {
|
||||
}
|
||||
// 报名台账落库后,仅回填已存在的人员分配记录事项信息,不新增记录、不改变分配来源。
|
||||
tourUserAssignmentService.backfillExistingAssignmentAfterSignup(matter.getSettingId(), matter.getId(), SecurityUtil.getUserId(),
|
||||
ledger.getBoardingPlace(), ledger.getPhotoFiles());
|
||||
ledger.getBoardingPlace(), ledger.getPhotoFiles(), ledger.getCurrentPeriodPhotoFiles());
|
||||
if (Lang.isNotEmpty(familyList)) {
|
||||
familyList.forEach(item -> {
|
||||
item.setLedgerId(ledger.getId());
|
||||
@@ -1740,6 +1742,8 @@ public class ThirtyTeachTourSignupController {
|
||||
ledger.setUnitName(defaultIfBlank(assignment.getString("unitName", ""), ledger.getUnitName()));
|
||||
ledger.setUnionId(defaultIfBlank(assignment.getString("unionId", ""), ledger.getUnionId()));
|
||||
ledger.setUnionName(defaultIfBlank(assignment.getString("unionName", ""), ledger.getUnionName()));
|
||||
// 当前时间段图片只来源于人员分配快照;报名提交时同步进台账,避免台账图片材料缺一类。
|
||||
ledger.setCurrentPeriodPhotoFiles(defaultIfBlank(assignment.getString("currentPeriodPhotoFiles", ""), ledger.getCurrentPeriodPhotoFiles()));
|
||||
}
|
||||
|
||||
private void fillLedgerContactFallback(ThirtyTeachTourLedger ledger, NutMap staff) {
|
||||
|
||||
+6
-1
@@ -127,10 +127,15 @@ public class ThirtyTeachTourLedger extends BaseModel implements Serializable {
|
||||
private String boardingPlace;
|
||||
|
||||
@Column
|
||||
@Comment("报名图片材料")
|
||||
@Comment("30年前图片材料")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String photoFiles;
|
||||
|
||||
@Column
|
||||
@Comment("当前时间段图片材料")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String currentPeriodPhotoFiles;
|
||||
|
||||
@Column
|
||||
@Comment("是否携带家属")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
|
||||
+6
-1
@@ -78,10 +78,15 @@ public class ThirtyTeachTourUserAssignment extends BaseModel implements Serializ
|
||||
private String boardingPlace;
|
||||
|
||||
@Column
|
||||
@Comment("报名图片材料")
|
||||
@Comment("30年前图片材料")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String photoFiles;
|
||||
|
||||
@Column
|
||||
@Comment("当前时间段图片材料")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String currentPeriodPhotoFiles;
|
||||
|
||||
@Column
|
||||
@Comment("出行时间段ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
|
||||
+25
-9
@@ -163,11 +163,11 @@ public interface ThirtyTeachTourUserAssignmentService extends BaseService<Thirty
|
||||
* @param userIds 待分配人员ID列表
|
||||
* @return 保存结果,包含实际分配数量、跳过数量和代报名台账写入数量
|
||||
*/
|
||||
NutMap assignSchoolUsers(String settingId, String matterId, String personType, List<String> userIds, String photoFiles);
|
||||
NutMap assignSchoolUsers(String settingId, String matterId, String personType, List<String> userIds, String photoFiles, String currentPeriodPhotoFiles);
|
||||
|
||||
/**
|
||||
* 保存校工会人员分配,支持每个候选人员单独选择分配线路。
|
||||
* assignItems 中每项包含 userId、matterId、photoFiles;matterId 为空时只保存人员分配,不写台账。
|
||||
* assignItems 中每项包含 userId、matterId、photoFiles、currentPeriodPhotoFiles;matterId 为空时只保存人员分配,不写台账。
|
||||
*
|
||||
* @param settingId 疗休养配置ID
|
||||
* @param assignItems 人员和分配线路明细
|
||||
@@ -183,7 +183,7 @@ public interface ThirtyTeachTourUserAssignmentService extends BaseService<Thirty
|
||||
* @param matterId 疗休养事项ID
|
||||
* @return 处理结果,包含台账写入数量
|
||||
*/
|
||||
NutMap selectSchoolAssignmentMatter(String id, String matterId, String photoFiles);
|
||||
NutMap selectSchoolAssignmentMatter(String id, String matterId, String photoFiles, String currentPeriodPhotoFiles);
|
||||
|
||||
/**
|
||||
* 给当前分工会已分配的正式人员补选分配路线,并按代报名写入疗休养台账。
|
||||
@@ -193,7 +193,7 @@ public interface ThirtyTeachTourUserAssignmentService extends BaseService<Thirty
|
||||
* @param matterId 疗休养事项ID
|
||||
* @return 处理结果,包含台账写入数量
|
||||
*/
|
||||
NutMap selectCurrentBranchAssignmentMatter(String id, String matterId, String photoFiles);
|
||||
NutMap selectCurrentBranchAssignmentMatter(String id, String matterId, String photoFiles, String currentPeriodPhotoFiles);
|
||||
|
||||
/**
|
||||
* 查询指定配置下已启用的出行时间段,供分工会人员分配弹窗按时间段选择正式名额。
|
||||
@@ -221,7 +221,7 @@ public interface ThirtyTeachTourUserAssignmentService extends BaseService<Thirty
|
||||
* @param matterId 疗休养事项ID,可为空
|
||||
* @param periodId 出行时间段ID,正式人员必填
|
||||
* @param personType 人员类型:FORMAL 正式人员,BACKUP 替补人员
|
||||
* @param assignItems 待分配人员明细,每项包含 userId、photoFiles
|
||||
* @param assignItems 待分配人员明细,每项包含 userId、photoFiles、currentPeriodPhotoFiles
|
||||
* @return 保存结果,包含实际分配数量、跳过数量、代报名台账写入数量和剩余名额
|
||||
*/
|
||||
NutMap assignBranchUsers(String settingId, String matterId, String periodId, String personType, List<NutMap> assignItems);
|
||||
@@ -289,6 +289,20 @@ public interface ThirtyTeachTourUserAssignmentService extends BaseService<Thirty
|
||||
*/
|
||||
int backfillExistingAssignmentAfterSignup(String settingId, String matterId, String userId, String boardingPlace, String photoFiles);
|
||||
|
||||
/**
|
||||
* 用户报名写入台账后,回填人员分配记录并同步两类图片材料。
|
||||
*
|
||||
* @param settingId 疗休养配置ID
|
||||
* @param matterId 疗休养事项ID
|
||||
* @param userId 报名用户ID
|
||||
* @param boardingPlace 用户报名时最终选择的乘车地点
|
||||
* @param photoFiles 30年前图片材料
|
||||
* @param currentPeriodPhotoFiles 当前时间段图片材料
|
||||
* @return 更新记录数
|
||||
*/
|
||||
int backfillExistingAssignmentAfterSignup(String settingId, String matterId, String userId, String boardingPlace,
|
||||
String photoFiles, String currentPeriodPhotoFiles);
|
||||
|
||||
/**
|
||||
* 用户取消报名删除台账后,清空该用户在同一疗休养配置下已存在人员分配记录的事项快照。
|
||||
* 仅清空事项、线路、旅行社字段,不删除记录,不修改 assignSource 和人员类型。
|
||||
@@ -337,17 +351,19 @@ public interface ThirtyTeachTourUserAssignmentService extends BaseService<Thirty
|
||||
* 更新校工会人员分配记录的图片材料,并同步该人员已存在的报名台账图片。
|
||||
*
|
||||
* @param id 人员分配记录ID
|
||||
* @param photoFiles 图片材料,多个文件以逗号分隔
|
||||
* @param photoFiles 30年前图片材料,多个文件以逗号分隔
|
||||
* @param currentPeriodPhotoFiles 当前时间段图片材料,多个文件以逗号分隔
|
||||
*/
|
||||
void updateSchoolAssignmentPhotoFiles(String id, String photoFiles);
|
||||
void updateSchoolAssignmentPhotoFiles(String id, String photoFiles, String currentPeriodPhotoFiles);
|
||||
|
||||
/**
|
||||
* 更新当前分工会人员分配记录的图片材料,并同步该人员已存在的报名台账图片。
|
||||
*
|
||||
* @param id 人员分配记录ID
|
||||
* @param photoFiles 图片材料,多个文件以逗号分隔
|
||||
* @param photoFiles 30年前图片材料,多个文件以逗号分隔
|
||||
* @param currentPeriodPhotoFiles 当前时间段图片材料,多个文件以逗号分隔
|
||||
*/
|
||||
void updateCurrentBranchAssignmentPhotoFiles(String id, String photoFiles);
|
||||
void updateCurrentBranchAssignmentPhotoFiles(String id, String photoFiles, String currentPeriodPhotoFiles);
|
||||
|
||||
/**
|
||||
* 删除指定来源的人员分配记录,避免校工会页面误删分工会分配的数据。
|
||||
|
||||
+68
-24
@@ -356,7 +356,8 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
}
|
||||
|
||||
@Override
|
||||
public NutMap assignSchoolUsers(String settingId, String matterId, String personType, List<String> userIds, String photoFiles) {
|
||||
public NutMap assignSchoolUsers(String settingId, String matterId, String personType, List<String> userIds,
|
||||
String photoFiles, String currentPeriodPhotoFiles) {
|
||||
List<String> distinctUserIds = normalizeUserIds(userIds);
|
||||
if (StrUtil.isBlank(settingId) || Lang.isEmpty(distinctUserIds)) {
|
||||
throw new IllegalArgumentException("请选择疗休养配置和分配人员");
|
||||
@@ -378,7 +379,7 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
userCnd.and("u.id", "in", distinctUserIds);
|
||||
userSql.setCondition(userCnd);
|
||||
List<NutMap> candidateUsers = listMap(userSql);
|
||||
fillCandidatePhotoFiles(candidateUsers, normalizePhotoFiles(photoFiles));
|
||||
fillCandidatePhotoFiles(candidateUsers, normalizePhotoFiles(photoFiles), normalizePhotoFiles(currentPeriodPhotoFiles));
|
||||
List<ThirtyTeachTourUserAssignment> assignments = candidateUsers.stream()
|
||||
.map(user -> buildSchoolAssignment(settingId, matterInfo, normalizedPersonType, user))
|
||||
.collect(Collectors.toList());
|
||||
@@ -408,6 +409,7 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
|
||||
Map<String, String> matterByUserId = new HashMap<>();
|
||||
Map<String, String> photoFilesByUserId = new HashMap<>();
|
||||
Map<String, String> currentPeriodPhotoFilesByUserId = new HashMap<>();
|
||||
List<String> userIds = assignItems.stream()
|
||||
.map(item -> item == null ? "" : item.getString("userId", ""))
|
||||
.filter(StrUtil::isNotBlank)
|
||||
@@ -423,6 +425,7 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
}
|
||||
matterByUserId.put(userId, item.getString("matterId", ""));
|
||||
photoFilesByUserId.put(userId, normalizePhotoFiles(item.getString("photoFiles")));
|
||||
currentPeriodPhotoFilesByUserId.put(userId, normalizePhotoFiles(item.getString("currentPeriodPhotoFiles")));
|
||||
});
|
||||
if (Lang.isEmpty(userIds)) {
|
||||
throw new IllegalArgumentException("请选择分配人员");
|
||||
@@ -446,7 +449,11 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
userCnd.and("u.id", "in", userIds);
|
||||
userSql.setCondition(userCnd);
|
||||
List<NutMap> candidateUsers = listMap(userSql);
|
||||
candidateUsers.forEach(user -> user.put("photoFiles", photoFilesByUserId.get(user.getString("userId", ""))));
|
||||
candidateUsers.forEach(user -> {
|
||||
String userId = user.getString("userId", "");
|
||||
user.put("photoFiles", photoFilesByUserId.get(userId));
|
||||
user.put("currentPeriodPhotoFiles", currentPeriodPhotoFilesByUserId.get(userId));
|
||||
});
|
||||
|
||||
List<ThirtyTeachTourUserAssignment> assignments = candidateUsers.stream()
|
||||
.map(user -> {
|
||||
@@ -474,7 +481,7 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
}
|
||||
|
||||
@Override
|
||||
public NutMap selectSchoolAssignmentMatter(String id, String matterId, String photoFiles) {
|
||||
public NutMap selectSchoolAssignmentMatter(String id, String matterId, String photoFiles, String currentPeriodPhotoFiles) {
|
||||
if (StrUtil.isBlank(id) || StrUtil.isBlank(matterId)) {
|
||||
throw new IllegalArgumentException("请选择人员分配记录和分配线路");
|
||||
}
|
||||
@@ -495,14 +502,16 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
if (matterInfo == null) {
|
||||
throw new IllegalArgumentException("分配线路不存在或未配置线路");
|
||||
}
|
||||
updateAssignmentMatterSnapshot(id, matterInfo, ThirtyTeachTourUserAssignment.ASSIGN_SOURCE_SCHOOL_UNION, photoFiles);
|
||||
updateAssignmentMatterSnapshot(id, matterInfo, ThirtyTeachTourUserAssignment.ASSIGN_SOURCE_SCHOOL_UNION,
|
||||
photoFiles, currentPeriodPhotoFiles);
|
||||
assignment.setPhotoFiles(normalizePhotoFiles(photoFiles));
|
||||
assignment.setCurrentPeriodPhotoFiles(normalizePhotoFiles(currentPeriodPhotoFiles));
|
||||
int ledgerCount = insertProxySignupLedgers(matterInfo, Collections.singletonList(fetchAssignmentUserSnapshot(assignment)));
|
||||
return NutMap.NEW().addv("ledgerCount", ledgerCount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NutMap selectCurrentBranchAssignmentMatter(String id, String matterId, String photoFiles) {
|
||||
public NutMap selectCurrentBranchAssignmentMatter(String id, String matterId, String photoFiles, String currentPeriodPhotoFiles) {
|
||||
if (StrUtil.isBlank(id) || StrUtil.isBlank(matterId)) {
|
||||
throw new IllegalArgumentException("请选择人员分配记录和分配路线");
|
||||
}
|
||||
@@ -525,9 +534,11 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
throw new IllegalArgumentException("当前线路不在报名时间内,不能选择");
|
||||
}
|
||||
assignment.setPhotoFiles(normalizePhotoFiles(photoFiles));
|
||||
assignment.setCurrentPeriodPhotoFiles(normalizePhotoFiles(currentPeriodPhotoFiles));
|
||||
List<NutMap> users = Collections.singletonList(fetchAssignmentUserSnapshot(assignment));
|
||||
checkProxySignupMaxGroupPeople(matterInfo, users);
|
||||
updateAssignmentMatterSnapshot(id, matterInfo, ThirtyTeachTourUserAssignment.ASSIGN_SOURCE_BRANCH_UNION, photoFiles);
|
||||
updateAssignmentMatterSnapshot(id, matterInfo, ThirtyTeachTourUserAssignment.ASSIGN_SOURCE_BRANCH_UNION,
|
||||
photoFiles, currentPeriodPhotoFiles);
|
||||
int ledgerCount = insertProxySignupLedgers(matterInfo, users);
|
||||
return NutMap.NEW().addv("ledgerCount", ledgerCount);
|
||||
}
|
||||
@@ -542,6 +553,7 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
throw new IllegalArgumentException("请选择疗休养配置和分配人员");
|
||||
}
|
||||
Map<String, String> photoFilesByUserId = new HashMap<>();
|
||||
Map<String, String> currentPeriodPhotoFilesByUserId = new HashMap<>();
|
||||
List<String> distinctUserIds = assignItems.stream()
|
||||
.map(item -> item == null ? "" : item.getString("userId", ""))
|
||||
.filter(StrUtil::isNotBlank)
|
||||
@@ -557,6 +569,7 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
}
|
||||
// 图片材料来自人员分配弹窗的行级暂存,按人员写入后续分配表和台账。
|
||||
photoFilesByUserId.put(userId, normalizePhotoFiles(item.getString("photoFiles")));
|
||||
currentPeriodPhotoFilesByUserId.put(userId, normalizePhotoFiles(item.getString("currentPeriodPhotoFiles")));
|
||||
});
|
||||
if (Lang.isEmpty(distinctUserIds)) {
|
||||
throw new IllegalArgumentException("请选择分配人员");
|
||||
@@ -604,7 +617,11 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
userCnd.and("u.id", "in", distinctUserIds);
|
||||
userSql.setCondition(userCnd);
|
||||
List<NutMap> candidateUsers = listMap(userSql);
|
||||
candidateUsers.forEach(user -> user.put("photoFiles", photoFilesByUserId.get(user.getString("userId", ""))));
|
||||
candidateUsers.forEach(user -> {
|
||||
String userId = user.getString("userId", "");
|
||||
user.put("photoFiles", photoFilesByUserId.get(userId));
|
||||
user.put("currentPeriodPhotoFiles", currentPeriodPhotoFilesByUserId.get(userId));
|
||||
});
|
||||
if (candidateUsers.size() > remainingQuota) {
|
||||
throw new IllegalArgumentException("选择人数超过当前分工会剩余名额");
|
||||
}
|
||||
@@ -888,6 +905,7 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
unionName,
|
||||
boardingPlace,
|
||||
photoFiles,
|
||||
currentPeriodPhotoFiles,
|
||||
periodId,
|
||||
periodName,
|
||||
personType,
|
||||
@@ -965,6 +983,12 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
|
||||
@Override
|
||||
public int backfillExistingAssignmentAfterSignup(String settingId, String matterId, String userId, String boardingPlace, String photoFiles) {
|
||||
return backfillExistingAssignmentAfterSignup(settingId, matterId, userId, boardingPlace, photoFiles, "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int backfillExistingAssignmentAfterSignup(String settingId, String matterId, String userId, String boardingPlace,
|
||||
String photoFiles, String currentPeriodPhotoFiles) {
|
||||
if (StrUtil.isBlank(settingId) || StrUtil.isBlank(matterId) || StrUtil.isBlank(userId)) {
|
||||
return 0;
|
||||
}
|
||||
@@ -980,7 +1004,8 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
.add("travelAgencyId", matterInfo.getString("travelAgencyId"))
|
||||
.add("travelAgencyName", matterInfo.getString("travelAgencyName"))
|
||||
.add("boardingPlace", StrUtil.blankToDefault(boardingPlace, matterInfo.getString("defaultBoardingPlace")))
|
||||
.add("photoFiles", normalizePhotoFiles(photoFiles)),
|
||||
.add("photoFiles", normalizePhotoFiles(photoFiles))
|
||||
.add("currentPeriodPhotoFiles", normalizePhotoFiles(currentPeriodPhotoFiles)),
|
||||
Cnd.where(ThirtyTeachTourUserAssignment::getSettingId, "=", settingId)
|
||||
.and(ThirtyTeachTourUserAssignment::getUserId, "=", userId)
|
||||
.and(ThirtyTeachTourUserAssignment::getDelFlag, "=", false));
|
||||
@@ -998,7 +1023,9 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
.add("lineName", null)
|
||||
.add("travelAgencyId", null)
|
||||
.add("travelAgencyName", null)
|
||||
.add("boardingPlace", null),
|
||||
.add("boardingPlace", null)
|
||||
.add("photoFiles", null)
|
||||
.add("currentPeriodPhotoFiles", null),
|
||||
Cnd.where(ThirtyTeachTourUserAssignment::getSettingId, "=", settingId)
|
||||
.and(ThirtyTeachTourUserAssignment::getUserId, "=", userId)
|
||||
.and(ThirtyTeachTourUserAssignment::getDelFlag, "=", false));
|
||||
@@ -1023,7 +1050,9 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
.add("lineName", null)
|
||||
.add("travelAgencyId", null)
|
||||
.add("travelAgencyName", null)
|
||||
.add("boardingPlace", null),
|
||||
.add("boardingPlace", null)
|
||||
.add("photoFiles", null)
|
||||
.add("currentPeriodPhotoFiles", null),
|
||||
cnd);
|
||||
}
|
||||
|
||||
@@ -1038,21 +1067,21 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSchoolAssignmentPhotoFiles(String id, String photoFiles) {
|
||||
public void updateSchoolAssignmentPhotoFiles(String id, String photoFiles, String currentPeriodPhotoFiles) {
|
||||
ThirtyTeachTourUserAssignment assignment = fetchAssignmentBySource(id, ThirtyTeachTourUserAssignment.ASSIGN_SOURCE_SCHOOL_UNION);
|
||||
if (assignment == null) {
|
||||
throw new IllegalArgumentException("人员分配记录不存在或无权限操作");
|
||||
}
|
||||
updateAssignmentPhotoFiles(assignment, photoFiles);
|
||||
updateAssignmentPhotoFiles(assignment, photoFiles, currentPeriodPhotoFiles);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCurrentBranchAssignmentPhotoFiles(String id, String photoFiles) {
|
||||
public void updateCurrentBranchAssignmentPhotoFiles(String id, String photoFiles, String currentPeriodPhotoFiles) {
|
||||
ThirtyTeachTourUserAssignment assignment = fetchCurrentBranchAssignment(id);
|
||||
if (assignment == null) {
|
||||
throw new IllegalArgumentException("人员分配记录不存在或无权限操作");
|
||||
}
|
||||
updateAssignmentPhotoFiles(assignment, photoFiles);
|
||||
updateAssignmentPhotoFiles(assignment, photoFiles, currentPeriodPhotoFiles);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1373,19 +1402,23 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
* 更新人员分配图片材料,并同步同一事项和工号下已生成的报名台账。
|
||||
* 未选择线路或尚未生成台账时,只更新人员分配表,保证主列表上传不会强制产生台账数据。
|
||||
*/
|
||||
private void updateAssignmentPhotoFiles(ThirtyTeachTourUserAssignment assignment, String photoFiles) {
|
||||
private void updateAssignmentPhotoFiles(ThirtyTeachTourUserAssignment assignment, String photoFiles, String currentPeriodPhotoFiles) {
|
||||
if (assignment == null || StrUtil.isBlank(assignment.getId())) {
|
||||
throw new IllegalArgumentException("人员分配记录不存在或无权限操作");
|
||||
}
|
||||
String normalizedPhotoFiles = normalizePhotoFiles(photoFiles);
|
||||
update(Chain.make("photoFiles", normalizedPhotoFiles),
|
||||
String normalizedCurrentPeriodPhotoFiles = normalizePhotoFiles(currentPeriodPhotoFiles);
|
||||
// 两类图片材料属于同一人员分配快照,上传时一起落库并同步已生成的台账。
|
||||
update(Chain.make("photoFiles", normalizedPhotoFiles)
|
||||
.add("currentPeriodPhotoFiles", normalizedCurrentPeriodPhotoFiles),
|
||||
Cnd.where(ThirtyTeachTourUserAssignment::getId, "=", assignment.getId())
|
||||
.and(ThirtyTeachTourUserAssignment::getDelFlag, "=", false));
|
||||
if (StrUtil.isBlank(assignment.getMatterId()) || StrUtil.isBlank(assignment.getLoginName())) {
|
||||
return;
|
||||
}
|
||||
dao().update(ThirtyTeachTourLedger.class,
|
||||
Chain.make("photoFiles", normalizedPhotoFiles),
|
||||
Chain.make("photoFiles", normalizedPhotoFiles)
|
||||
.add("currentPeriodPhotoFiles", normalizedCurrentPeriodPhotoFiles),
|
||||
Cnd.where(ThirtyTeachTourLedger::getMatterId, "=", assignment.getMatterId())
|
||||
.and(ThirtyTeachTourLedger::getJobNo, "=", assignment.getLoginName())
|
||||
.and(ThirtyTeachTourLedger::getDelFlag, "=", false));
|
||||
@@ -1426,7 +1459,9 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
.add("lineName", null)
|
||||
.add("travelAgencyId", null)
|
||||
.add("travelAgencyName", null)
|
||||
.add("boardingPlace", null),
|
||||
.add("boardingPlace", null)
|
||||
.add("photoFiles", null)
|
||||
.add("currentPeriodPhotoFiles", null),
|
||||
Cnd.where(ThirtyTeachTourUserAssignment::getId, "=", assignmentId)
|
||||
.and(ThirtyTeachTourUserAssignment::getDelFlag, "=", false));
|
||||
}
|
||||
@@ -1641,6 +1676,7 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
fillMatterSnapshot(assignment, matterInfo);
|
||||
// 图片材料来自人员分配/报名提交快照,不能放在事项快照方法中读取。
|
||||
assignment.setPhotoFiles(normalizePhotoFiles(user.getString("photoFiles")));
|
||||
assignment.setCurrentPeriodPhotoFiles(normalizePhotoFiles(user.getString("currentPeriodPhotoFiles")));
|
||||
assignment.setUserId(user.getString("userId"));
|
||||
assignment.setLoginName(user.getString("loginName"));
|
||||
assignment.setUserName(user.getString("userName"));
|
||||
@@ -1685,7 +1721,8 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
assignment.setPeriodName(period.getPeriodName());
|
||||
}
|
||||
|
||||
private void updateAssignmentMatterSnapshot(String id, NutMap matterInfo, String assignSource, String photoFiles) {
|
||||
private void updateAssignmentMatterSnapshot(String id, NutMap matterInfo, String assignSource,
|
||||
String photoFiles, String currentPeriodPhotoFiles) {
|
||||
// 补选事项时同时回写人员分配表事项快照,后续列表筛选无需再跨表追溯事项信息。
|
||||
update(Chain.make("matterId", matterInfo.getString("matterId"))
|
||||
.add("matterName", matterInfo.getString("matterName"))
|
||||
@@ -1694,7 +1731,8 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
.add("travelAgencyId", matterInfo.getString("travelAgencyId"))
|
||||
.add("travelAgencyName", matterInfo.getString("travelAgencyName"))
|
||||
.add("boardingPlace", matterInfo.getString("defaultBoardingPlace"))
|
||||
.add("photoFiles", normalizePhotoFiles(photoFiles)),
|
||||
.add("photoFiles", normalizePhotoFiles(photoFiles))
|
||||
.add("currentPeriodPhotoFiles", normalizePhotoFiles(currentPeriodPhotoFiles)),
|
||||
Cnd.where(ThirtyTeachTourUserAssignment::getId, "=", id)
|
||||
.and(ThirtyTeachTourUserAssignment::getAssignSource, "=", assignSource));
|
||||
}
|
||||
@@ -1807,6 +1845,7 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
if (Lang.isNotEmpty(users)) {
|
||||
NutMap user = users.get(0);
|
||||
user.put("photoFiles", assignment.getPhotoFiles());
|
||||
user.put("currentPeriodPhotoFiles", assignment.getCurrentPeriodPhotoFiles());
|
||||
return user;
|
||||
}
|
||||
// 视图中找不到人员时使用分配表快照兜底,保证补选事项不会因非关键字段缺失中断。
|
||||
@@ -1820,7 +1859,8 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
.addv("unitName", assignment.getUnitName())
|
||||
.addv("unionId", assignment.getUnionId())
|
||||
.addv("unionName", assignment.getUnionName())
|
||||
.addv("photoFiles", assignment.getPhotoFiles());
|
||||
.addv("photoFiles", assignment.getPhotoFiles())
|
||||
.addv("currentPeriodPhotoFiles", assignment.getCurrentPeriodPhotoFiles());
|
||||
}
|
||||
|
||||
private ThirtyTeachTourLedger buildProxySignupLedger(NutMap matterInfo, NutMap user) {
|
||||
@@ -1843,6 +1883,7 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
ledger.setTravelAgencyName(matterInfo.getString("travelAgencyName"));
|
||||
ledger.setBoardingPlace(matterInfo.getString("defaultBoardingPlace"));
|
||||
ledger.setPhotoFiles(normalizePhotoFiles(user.getString("photoFiles")));
|
||||
ledger.setCurrentPeriodPhotoFiles(normalizePhotoFiles(user.getString("currentPeriodPhotoFiles")));
|
||||
ledger.setHasFamily(false);
|
||||
ledger.setJoined(false);
|
||||
ledger.setReimbursed(false);
|
||||
@@ -1920,11 +1961,14 @@ public class ThirtyTeachTourUserAssignmentServiceImpl extends BaseServiceImpl<Th
|
||||
/**
|
||||
* 批量人员共用同一组上传图片时,将图片路径写入候选人快照,后续构建分配表和台账时直接读取。
|
||||
*/
|
||||
private void fillCandidatePhotoFiles(List<NutMap> candidateUsers, String photoFiles) {
|
||||
private void fillCandidatePhotoFiles(List<NutMap> candidateUsers, String photoFiles, String currentPeriodPhotoFiles) {
|
||||
if (Lang.isEmpty(candidateUsers)) {
|
||||
return;
|
||||
}
|
||||
candidateUsers.forEach(user -> user.put("photoFiles", photoFiles));
|
||||
candidateUsers.forEach(user -> {
|
||||
user.put("photoFiles", photoFiles);
|
||||
user.put("currentPeriodPhotoFiles", currentPeriodPhotoFiles);
|
||||
});
|
||||
}
|
||||
|
||||
private Pagination<NutMap> emptyPagination(PageForm pageForm) {
|
||||
|
||||
Reference in New Issue
Block a user