diff --git a/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareListController.java b/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareListController.java index a58bfe1..58f5756 100644 --- a/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareListController.java +++ b/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareListController.java @@ -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 mapList = pagination.getList(); - if (provideMode != 3) { - mapList.forEach(v -> { - v.put("receiveAddress",v.getString("receiveAddress2")); - }); - } + List 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; + } } diff --git a/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareProjectMangeController.java b/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareProjectMangeController.java index f28dd4e..cc0a30b 100644 --- a/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareProjectMangeController.java +++ b/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareProjectMangeController.java @@ -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 unionList = dao.query(Sys_union.class, Cnd.NEW()); + List 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); diff --git a/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareUserChooseController.java b/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareUserChooseController.java index eedf43e..c6fb5c6 100644 --- a/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareUserChooseController.java +++ b/src/main/java/io/v/nutz/zhgh/welfare/controller/WelfareUserChooseController.java @@ -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) diff --git a/src/main/java/io/v/nutz/zhgh/welfare/model/WelfareMemberUnionConfirm.java b/src/main/java/io/v/nutz/zhgh/welfare/model/WelfareMemberUnionConfirm.java new file mode 100644 index 0000000..e233a90 --- /dev/null +++ b/src/main/java/io/v/nutz/zhgh/welfare/model/WelfareMemberUnionConfirm.java @@ -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; +} diff --git a/src/main/java/io/v/nutz/zhgh/welfare/service/impl/WelfareSingleServiceImpl.java b/src/main/java/io/v/nutz/zhgh/welfare/service/impl/WelfareSingleServiceImpl.java index 22b812f..0ad120f 100644 --- a/src/main/java/io/v/nutz/zhgh/welfare/service/impl/WelfareSingleServiceImpl.java +++ b/src/main/java/io/v/nutz/zhgh/welfare/service/impl/WelfareSingleServiceImpl.java @@ -203,11 +203,14 @@ public class WelfareSingleServiceImpl extends ViServiceImpl 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")) { diff --git a/src/main/resources/views/mobile/welfare/list/receive.html b/src/main/resources/views/mobile/welfare/list/receive.html index f871108..15b275a 100644 --- a/src/main/resources/views/mobile/welfare/list/receive.html +++ b/src/main/resources/views/mobile/welfare/list/receive.html @@ -486,8 +486,8 @@ layout("/mobile/platform.html"){ }, methods: { addShopping(address) { - this.$set(this.projectInfo.welfareProjectSubjects[0].options[this.optionIndex], "receiveAddress", address) - this.projectInfo.welfareProjectSubjects[0].options[this.optionIndex].receiveAddress = address + this.$set(this.selectedOptions[this.optionIndex], "receiveAddress", address) + this.selectedOptions[this.optionIndex].receiveAddress = address this.shoppingPopup = false }, async onSearchShoppingAddress() { diff --git a/src/main/resources/views/platform/welfare/include/common.js b/src/main/resources/views/platform/welfare/include/common.js index e576dd5..d80faa3 100644 --- a/src/main/resources/views/platform/welfare/include/common.js +++ b/src/main/resources/views/platform/welfare/include/common.js @@ -106,7 +106,7 @@ let commonColumns = [ {prop: 'loginname', label: '工号', width: "100"}, {prop: 'username', label: '姓名', width: "80"}, {prop: 'sex', label: '性别', sortable: true, width: '100px', checked: 0}, - {prop: 'personType', label: '人员类型', sortable: true, width: "100"}, + // {prop: 'personType', label: '人员类型', sortable: true, width: "100"}, {prop: 'userState', label: '在职状态', sortable: true, width: "100"}, {prop: 'unionname', label: '所属工会', sortable: true}, {prop: 'unitname', label: '所属单位', sortable: true}, diff --git a/src/main/resources/views/platform/welfare/list/ListMange.html b/src/main/resources/views/platform/welfare/list/ListMange.html index 9b2e3f2..8d6646a 100644 --- a/src/main/resources/views/platform/welfare/list/ListMange.html +++ b/src/main/resources/views/platform/welfare/list/ListMange.html @@ -271,7 +271,13 @@ layout("/layouts/platform.html"){ 一键全部领取 - + 确认名单 + + + 取消确认 + - 添加 - + @@ -329,21 +335,9 @@ layout("/layouts/platform.html"){ style="height: 60px" v-if="row.userSign"> 暂无 -