commit
This commit is contained in:
@@ -8,6 +8,7 @@ import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.afterturn.easypoi.excel.export.ExcelExportService;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
@@ -100,12 +101,13 @@ public class WelfareListController {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
CASE
|
||||
|
||||
|
||||
WHEN
|
||||
wus.selectUserId IS NOT NULL THEN
|
||||
1 ELSE 0
|
||||
END AS isChoose,
|
||||
wl.id,
|
||||
wl.unionid,
|
||||
wl.username,
|
||||
wl.loginname,
|
||||
wl.personType,
|
||||
@@ -115,8 +117,13 @@ public class WelfareListController {
|
||||
wl.listId,
|
||||
wus.userSign,
|
||||
wus.courierNumber,
|
||||
wus.receiveAddress,
|
||||
GROUP_CONCAT( DISTINCT wuso.optionName, '(', wus.receiveAddress, ')' ) AS receiveAddress2,
|
||||
GROUP_CONCAT(
|
||||
DISTINCT
|
||||
CONCAT(
|
||||
wuso.optionName,
|
||||
IF(wus.receiveAddress IS NOT NULL AND wus.receiveAddress != '', CONCAT('(', wus.receiveAddress, ')'), '')
|
||||
)
|
||||
) AS receiveAddress,
|
||||
GROUP_CONCAT( DISTINCT wuso.optionName, '(', wus.selectNum, '份)' ) AS gist_list
|
||||
FROM
|
||||
view_welfare_list wl
|
||||
@@ -161,11 +168,15 @@ public class WelfareListController {
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = welfareListService.list(pageForm, sql);
|
||||
List<NutMap> mapList = pagination.getList();
|
||||
if (provideMode != 3) {
|
||||
mapList.forEach(v -> {
|
||||
v.put("receiveAddress",v.getString("receiveAddress2"));
|
||||
});
|
||||
}
|
||||
List<WelfareMemberUnionConfirm> confirms = projectService.dao().query(WelfareMemberUnionConfirm.class, Cnd.where("projectId", "=", projectId));
|
||||
|
||||
mapList.forEach(v -> {
|
||||
if (StrUtil.isNotBlank(v.getString("unionid"))) {
|
||||
WelfareMemberUnionConfirm confirm = confirms.stream().filter(o -> o.getUnionId().equals(v.getString("unionid"))).findFirst().orElse(null);
|
||||
v.setv("isAudit", confirm != null ? confirm.getIsAudit() : "");
|
||||
v.setv("auditTime", confirm != null ? confirm.getAuditTime() : "");
|
||||
}
|
||||
});
|
||||
pagination.setList(mapList);
|
||||
return pagination;
|
||||
}
|
||||
@@ -514,7 +525,7 @@ public class WelfareListController {
|
||||
WHERE
|
||||
wpus.welfareId = @welfareId
|
||||
AND wpus.selectOptionId = @selectOptionId and wpus.selectNum!=0
|
||||
|
||||
|
||||
""").setParam("welfareId", projectId).setParam("selectOptionId", optionId);
|
||||
|
||||
// GROUP BY wpus.selectUserId,wpus.selectOptionId ORDER BY un.unioncode
|
||||
@@ -652,4 +663,23 @@ public class WelfareListController {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("welfare.list.mange")
|
||||
public Object doAuditUser(@Param(value = "projectId", required = false) String projectId,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "flag") Boolean flag) {
|
||||
if (flag) {
|
||||
welfareListService.dao().update(WelfareMemberUnionConfirm.class, Chain.make("isAudit", true)
|
||||
.add("auditTime", DateUtil.date()).add("auditUser", ShiroUtil.getUserId()),
|
||||
Cnd.where("projectId", "=", projectId).and("unionId", "=", unionId));
|
||||
} else {
|
||||
welfareListService.dao().update(WelfareMemberUnionConfirm.class, Chain.make("isAudit", null)
|
||||
.add("auditTime", null).add("auditUser", null),
|
||||
Cnd.where("projectId", "=", projectId).and("unionId", "=", unionId));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,15 +9,13 @@ import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.sys.models.Sys_home_activity;
|
||||
import io.v.nutz.sys.models.Sys_union;
|
||||
import io.v.nutz.sys.services.SysTaskService;
|
||||
import io.v.nutz.task.services.TaskPlatformService;
|
||||
import io.v.nutz.zhgh.data.model.MatchConditionStructure;
|
||||
import io.v.nutz.zhgh.data.service.MatchConditionStructureService;
|
||||
import io.v.nutz.zhgh.mobileHome.service.MobileHomeService;
|
||||
import io.v.nutz.zhgh.welfare.model.WelfareProject;
|
||||
import io.v.nutz.zhgh.welfare.model.WelfareProjectSubject;
|
||||
import io.v.nutz.zhgh.welfare.model.WelfareProjectSubjectOption;
|
||||
import io.v.nutz.zhgh.welfare.model.WelfareUserSelection;
|
||||
import io.v.nutz.zhgh.welfare.model.*;
|
||||
import io.v.nutz.zhgh.welfare.service.WelfareListService;
|
||||
import io.v.nutz.zhgh.welfare.service.WelfareProjectService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
@@ -39,6 +37,7 @@ import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
import org.nutz.trans.Trans;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -237,6 +236,21 @@ public class WelfareProjectMangeController {
|
||||
dao.update(project);
|
||||
|
||||
}
|
||||
|
||||
dao.clear(WelfareMemberUnionConfirm.class, Cnd.where("projectId","=",project.getId()));
|
||||
List<Sys_union> unionList = dao.query(Sys_union.class, Cnd.NEW());
|
||||
List<WelfareMemberUnionConfirm> confirmList = new ArrayList<>();
|
||||
for (Sys_union union : unionList) {
|
||||
WelfareMemberUnionConfirm confirm = new WelfareMemberUnionConfirm();
|
||||
confirm.setId(R.UU32());
|
||||
confirm.setProjectId(project.getId());
|
||||
confirm.setUnionId(union.getId());
|
||||
confirm.setIsAudit(false);
|
||||
confirmList.add(confirm);
|
||||
}
|
||||
dao.fastInsert(confirmList);
|
||||
|
||||
|
||||
Sys_home_activity sysHomeActivity = project.covertToSysHomeActivity();
|
||||
sysHomeActivity.setEnable(true);
|
||||
dao.insertOrUpdate(sysHomeActivity);
|
||||
|
||||
@@ -128,6 +128,12 @@ public class WelfareUserChooseController {
|
||||
@RequiresPermissions("welfare.user.choose")
|
||||
public Result confirmSelect(@Param("welfareUserSelections") WelfareUserSelection[] welfareUserSelections,
|
||||
String projectId) {
|
||||
|
||||
int count = simpleService.dao().count(WelfareList.class, Cnd.where("projectId", "=", projectId).and("userId", "=", ShiroUtil.getUserId()));
|
||||
if (count == 0) {
|
||||
return Result.error("您暂无权限!");
|
||||
}
|
||||
|
||||
//删除上次选择的
|
||||
simpleService.dao().clear(WelfareUserSelection.class,
|
||||
Cnd.where("welfareId", "=", projectId)
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package io.v.nutz.zhgh.welfare.model;
|
||||
|
||||
|
||||
import io.v.nutz.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
@Table
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class WelfareMemberUnionConfirm extends BaseModel {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("所属项目")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String projectId;
|
||||
|
||||
@Column
|
||||
@Comment("工会id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("是否确认")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean isAudit;
|
||||
|
||||
@Column
|
||||
@Comment("确认时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date auditTime;
|
||||
|
||||
@Column
|
||||
@Comment("操作人")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String auditUser;
|
||||
}
|
||||
@@ -203,11 +203,14 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
|
||||
boolean isThreeUnit = Globals.MyConfig.getBoolean("isThreeUnit");
|
||||
Sql welfareUnitSql = Sqls.create("""
|
||||
SELECT
|
||||
unit.*
|
||||
unit.*,
|
||||
wmuc.isAudit
|
||||
FROM
|
||||
welfare_unit unit
|
||||
LEFT JOIN welfare_member_union_confirm wmuc ON wmuc.projectId = @projectId
|
||||
AND wmuc.unionId = unit.welfareUnitId
|
||||
$condition
|
||||
""");
|
||||
""").setParam("projectId", projectId);
|
||||
CndPlus cnd = CndPlus.create();
|
||||
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionWelfareAdmin")) {
|
||||
|
||||
Reference in New Issue
Block a user