From be6fa5aee1ffc3ce2b9a13ac29d71adabc638165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=A3=E4=BA=9B=E8=8A=B1=E5=84=BF?= <1156921458@qq.com> Date: Tue, 10 Jun 2025 10:33:38 +0800 Subject: [PATCH] .. --- pom.xml | 2 +- .../controller/WelfareCommonController.java | 33 + .../controller/WelfareListController.java | 186 +-- .../controller/WelfareMineController.java | 126 +- .../WelfareProjectMangeController.java | 45 +- ....java => WelfareStatisticsController.java} | 133 +- .../WelfareUserChooseController.java | 24 +- .../WelfareUserSelectController.java | 103 ++ .../H5WelfareUserChooseController.java | 33 - .../H5WelfareUserSelectController.java | 38 + .../app/zhgh/welfare/model/WelfareList.java | 47 +- .../zhgh/welfare/model/WelfareProject.java | 13 +- .../model/WelfareProjectSubjectOption.java | 15 +- .../welfare/model/WelfareUserSelection.java | 7 + .../param/WelfareFilterUserPageForm.java | 58 + .../welfare/param/WelfareListPageForm.java | 58 + .../welfare/service/WelfareListService.java | 22 + .../service/WelfareProjectService.java | 30 +- .../welfare/service/WelfareSingleService.java | 9 +- .../service/WelfareStatisticsService.java | 57 + .../service/impl/WelfareListServiceImpl.java | 165 +++ .../impl/WelfareProjectServiceImpl.java | 144 +-- .../impl/WelfareSingleServiceImpl.java | 21 +- .../impl/WelfareStatisticsServiceImpl.java | 248 ++++ .../ProjectMange/welfareOptionTable.js | 224 ---- .../welfare/addressManage/addressDialog.js | 89 +- .../zhgh/welfare/mine/CourierNumberInfo.js | 73 -- .../platform/zhgh/welfare/mine/index.html | 210 +--- .../platform/zhgh/welfare/mine/selectView.js | 517 ++++++++ .../zhgh/welfare/projectMange/filterUser.js | 235 ++++ .../{ProjectMange => projectMange}/index.html | 223 ++-- .../welfare/projectMange/welfareOption.js | 192 +++ .../projectMange/welfareOptionTable.js | 226 ++++ .../platform/zhgh/welfare/select/index.html | 196 +++ .../zhgh/welfare/select/optionSelect.js | 1057 ++++++++++++++++ .../zhgh/welfare/statistics/index.html | 314 +---- .../zhgh/welfare/statistics/selectedUser.js | 94 ++ .../zhgh/welfare/statistics/unSelectedUser.js | 84 ++ .../zhgh/welfare/userChoose/chooseWelfare.js | 348 +++--- .../zhgh/welfare/userChoose/index.html | 2 +- .../zhgh/welfare/welfareUser/addUser.js | 250 ++++ .../zhgh/welfare/welfareUser/index.html | 392 +++--- .../platform/zhghh5/welfare/mine/list.html | 376 ++---- .../zhghh5/welfare/mine/selectView.js | 512 ++++++++ .../platform/zhghh5/welfare/select/index.html | 1096 +++++++++++++++++ .../platform/zhghh5/welfare/select/list.html | 154 +++ .../zhghh5/welfare/select/success.html | 111 ++ .../zhghh5/welfare/userChoose/index.html | 68 +- .../zhghh5/welfare/userChoose/list.html | 74 +- 49 files changed, 6528 insertions(+), 2206 deletions(-) create mode 100644 src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareCommonController.java rename src/main/java/com/budwk/app/zhgh/welfare/controller/{WelfareSingleController.java => WelfareStatisticsController.java} (60%) create mode 100644 src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareUserSelectController.java delete mode 100644 src/main/java/com/budwk/app/zhgh/welfare/h5Controller/H5WelfareUserChooseController.java create mode 100644 src/main/java/com/budwk/app/zhgh/welfare/h5Controller/H5WelfareUserSelectController.java create mode 100644 src/main/java/com/budwk/app/zhgh/welfare/param/WelfareFilterUserPageForm.java create mode 100644 src/main/java/com/budwk/app/zhgh/welfare/param/WelfareListPageForm.java create mode 100644 src/main/java/com/budwk/app/zhgh/welfare/service/WelfareStatisticsService.java create mode 100644 src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareStatisticsServiceImpl.java delete mode 100644 src/main/resources/views/platform/zhgh/welfare/ProjectMange/welfareOptionTable.js delete mode 100644 src/main/resources/views/platform/zhgh/welfare/mine/CourierNumberInfo.js create mode 100644 src/main/resources/views/platform/zhgh/welfare/mine/selectView.js create mode 100644 src/main/resources/views/platform/zhgh/welfare/projectMange/filterUser.js rename src/main/resources/views/platform/zhgh/welfare/{ProjectMange => projectMange}/index.html (75%) create mode 100644 src/main/resources/views/platform/zhgh/welfare/projectMange/welfareOption.js create mode 100644 src/main/resources/views/platform/zhgh/welfare/projectMange/welfareOptionTable.js create mode 100644 src/main/resources/views/platform/zhgh/welfare/select/index.html create mode 100644 src/main/resources/views/platform/zhgh/welfare/select/optionSelect.js create mode 100644 src/main/resources/views/platform/zhgh/welfare/statistics/selectedUser.js create mode 100644 src/main/resources/views/platform/zhgh/welfare/statistics/unSelectedUser.js create mode 100644 src/main/resources/views/platform/zhgh/welfare/welfareUser/addUser.js create mode 100644 src/main/resources/views/platform/zhghh5/welfare/mine/selectView.js create mode 100644 src/main/resources/views/platform/zhghh5/welfare/select/index.html create mode 100644 src/main/resources/views/platform/zhghh5/welfare/select/list.html create mode 100644 src/main/resources/views/platform/zhghh5/welfare/select/success.html diff --git a/pom.xml b/pom.xml index b23379a..d3ebecc 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 jar com.budwk - zhgh_njupt + zhgh_njnu 5.6.0-plus diff --git a/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareCommonController.java b/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareCommonController.java new file mode 100644 index 0000000..f4c1ba5 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareCommonController.java @@ -0,0 +1,33 @@ +package com.budwk.app.zhgh.welfare.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.budwk.app.base.result.Result; +import com.budwk.app.zhgh.welfare.service.WelfareListService; +import com.budwk.app.zhgh.welfare.service.WelfareProjectService; +import io.swagger.annotations.ApiOperation; +import org.nutz.ioc.loader.annotation.Inject; +import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.mvc.annotation.At; +import org.nutz.mvc.annotation.Ok; + +import javax.validation.Valid; + +@IocBean +@Ok("json:full") +@At("/platform/welfare/common") +public class WelfareCommonController { + + @Inject + private WelfareProjectService projectService; + @Inject + private WelfareListService welfareListService; + + + @At + @SaCheckPermission("welfare") + @ApiOperation("获取项目信息") + public Result projectInfo(@Valid String id){ + return Result.success(projectService.projectInfo(id)); + } + +} diff --git a/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareListController.java b/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareListController.java index aadf7a8..7c513ee 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareListController.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareListController.java @@ -6,6 +6,7 @@ import cn.hutool.json.JSONUtil; import com.alibaba.excel.EasyExcel; import com.budwk.app.base.annotation.SLog; import com.budwk.app.base.constant.RoleConstant; +import com.budwk.app.base.page.Pagination; import com.budwk.app.base.param.PageForm; import com.budwk.app.base.result.Result; import com.budwk.app.base.utils.CommonDownloadUtil; @@ -16,7 +17,10 @@ import com.budwk.app.web.commons.auth.utils.SecurityUtil; import com.budwk.app.zhgh.welfare.mode.WelfareUserTemp; import com.budwk.app.zhgh.welfare.model.WelfareList; import com.budwk.app.zhgh.welfare.model.WelfareUserSelection; +import com.budwk.app.zhgh.welfare.param.WelfareFilterUserPageForm; +import com.budwk.app.zhgh.welfare.param.WelfareListPageForm; import com.budwk.app.zhgh.welfare.service.WelfareListService; +import com.budwk.app.zhgh.welfare.service.WelfareProjectService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.poi.ss.formula.functions.T; @@ -58,7 +62,8 @@ public class WelfareListController { @Inject private WelfareListService welfareListService; - + @Inject + private WelfareProjectService welfareProjectService; @At("") @Ok("beetl:/platform/zhgh/welfare/welfareUser/index.html") @@ -69,169 +74,38 @@ public class WelfareListController { @At @SaCheckPermission("welfare.list.mange") - public Result pageData(PageForm pageForm, - String projectId, - String optionId, - String month, - String courierNumber, - String unionId, - String unitIds, - String personTypes, - String userStates, - String sex - ) { - Sql sql = Sqls.create(""" - SELECT - CASE - - WHEN - wus.selectUserId IS NOT NULL THEN - 1 ELSE 0 - END AS isChoose, - wl.projectId, - vu.id, - vu.username, - vu.loginname, - wl.personType, - wl.userState, - un.`name` unionname, - it.`name` unitname, - wl.id listId, - wus.userSign, - wus.courierNumber, - wus.receiveAddress, - GROUP_CONCAT( DISTINCT wuso.optionName, '(', wus.selectNum, '份)' ) AS gist_list - FROM - welfare_list wl - LEFT JOIN vw_user vu ON vu.id = wl.userId - LEFT JOIN sys_union un ON un.id = wl.welfareUnitId - LEFT JOIN sys_unit it ON it.id = wl.welfareSecondLevelUnitId - LEFT JOIN welfare_project_user_selection wus ON wus.welfareId = wl.projectId - AND wus.selectUserId = wl.userId - LEFT JOIN welfare_project_subject_option wuso ON wus.selectOptionId = wuso.id - LEFT JOIN welfare_courier_number wcn ON wcn.selectUserId = wl.id - AND wcn.welfareId = wl.projectId - LEFT JOIN welfare_project wp ON wp.id = wus.welfareId - $condition - """); - Cnd cnd = Cnd.NEW(); -// cnd.and("vu.welfareMember", "=", 1); - cnd.and("wl.projectId", "=", projectId); - cnd.andEX("wus.selectOptionId", "=", optionId); - cnd.andEX("wl.welfareUnitId", "=", unionId); - - if (Lang.isNotEmpty(unitIds)) { - String[] unitArray = Json.fromJsonAsArray(String.class, unitIds); - cnd.andEX("wl.welfareSecondLevelUnitId", "in", unitArray); - } - if (Lang.isNotEmpty(personTypes)) { - String[] personTypeArray = Json.fromJsonAsArray(String.class, personTypes); - cnd.andEX("wl.personType", "in", personTypeArray); - } - - if (Lang.isNotEmpty(userStates)) { - String[] userStateArray = Json.fromJsonAsArray(String.class, userStates); - cnd.andEX("wl.userState", "in", userStateArray); - } - - cnd.andEX("vu.sex", "=", sex); - - cnd.andEX("wcn.courierNumber", "=", courierNumber); - - cnd.groupBy("wl.id"); - cnd.asc("it.unitcode"); - cnd.asc("vu.loginname"); - - if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) { - cnd.and("wl.welfareUnitId", "=", SecurityUtil.getUnionId()); - } - - if (StrUtil.isNotBlank(pageForm.getSearchKeyword()) && StrUtil.isNotBlank(pageForm.getSearchName())) { - cnd.and(Cnd.likeEX(pageForm.getSearchName(), pageForm.getSearchKeyword())); - - } - sql.setCondition(cnd); - return Result.success(welfareListService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql)); + @Ok("json:{dateFormat:'yyyy-MM-dd'}") + public Result pageData(@Valid @Param("pageForm") WelfareListPageForm pageForm) { + Pagination pagination = welfareListService.pageData(pageForm); + return Result.success(pagination); } @At @Aop(TransAop.READ_COMMITTED) + @ApiOperation("查询福利会员") @SaCheckPermission("welfare.list.mange") @SLog(tag = "福利名单管理", msg = "管理员删除某个福利会员") public Result delete(String projectId, String userId, String id) { welfareListService.delete(id); - welfareListService.dao().clear(WelfareUserSelection.class, - Cnd.where("welfareId", "=", projectId) - .and("selectUserId", "=", userId)); + welfareListService.dao().clear(WelfareUserSelection.class, Cnd.where("welfareId", "=", projectId).and("selectUserId", "=", userId)); return Result.success(); } - /** - * @param projectId - * @param optionId - * @param response - * @author zhf - * @description 导出报销表 - */ @At - @Ok("void") @SaCheckPermission("welfare.list.mange") - public void doExcelByOptionId(@Valid String projectId, @Valid String optionId, HttpServletResponse response) { - welfareListService.doExcelByOptionId(projectId, optionId, response); - + @ApiOperation("分页查询非福利会员") + @Ok("json:{dateFormat:'yyyy-MM-dd'}") + public Result notWelfareUserPageData(@Valid @Param("pageForm") WelfareFilterUserPageForm pageForm){ + return Result.success(welfareListService.notWelfareUserPageData(pageForm)); } - /** - * 导出各套餐选择数据 - * - * @param projectId - */ @At - @Ok("void") @SaCheckPermission("welfare.list.mange") - public void exportSelectData(String projectId, HttpServletResponse response) { - welfareListService.exportSelectData(projectId, null, response); - - } - - - /** - * 导入快递单号 - * - * @param file excel文件 - */ - @At - @Ok("json") - @Aop(TransAop.READ_COMMITTED) - @SaCheckPermission("welfare.list.mange") - @AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"}) - public Result importCourierNumber(@Param("file") TempFile file, - @Param("projectId") String projectId, - @Param("optionId") String optionId) { - - - return welfareListService.importCourierNumber(file, projectId, optionId); - - - } - - - /** - * @param editWelfareData - * @param welfareOptions - * @return com.budwk.app.base.result.Result - * @author zhf - * @description 管理员帮助修改福利套餐 - */ - @At - @Aop(TransAop.READ_COMMITTED) - @SaCheckPermission("welfare.list.mange") - @SLog(tag = "福利名单管理", msg = "管理员帮助修改福利套餐") - public Result doEditWelfareData(@Param("editWelfareData") @Valid String editWelfareData, - @Param("welfareOptions") @Valid String welfareOptions) { - welfareListService.doEditWelfareData(editWelfareData, welfareOptions); + @ApiOperation("添加用户到福利名单") + public Result addWelfareUser(@Valid @Param("pageForm") WelfareFilterUserPageForm pageForm){ + welfareListService.addWelfareUser(pageForm); return Result.success(); } @@ -239,11 +113,11 @@ public class WelfareListController { @Ok("void") @SaCheckPermission("welfare.list.mange") public void downloadImport(HttpServletResponse response) { - try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();){ + try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();) { EasyExcel.write(byteArrayOutputStream, WelfareUserTemp.class) .sheet("福利名单导入模版") .doWrite(ArrayList::new); - CommonDownloadUtil.download("福利名单导入模版.xlsx",byteArrayOutputStream.toByteArray() ,response); + CommonDownloadUtil.download("福利名单导入模版.xlsx", byteArrayOutputStream.toByteArray(), response); } catch (Exception e) { e.printStackTrace(); } @@ -299,22 +173,4 @@ public class WelfareListController { } return Result.success("导入成功"); } - - @At - @SaCheckPermission("welfare.list.mange") - @ApiOperation("根据福利id查询不在这个福利名单中的用户") - public Result selectNotWelfareList(@Valid String id, PageForm pageForm) { - return Result.success(welfareListService.selectNotWelfareList(id, pageForm)); - } - - @At - @ApiOperation("通过用户id把当前福利加入到名单中") - @SaCheckPermission("welfare.list.mange") - public Result doWelfareListUser(String[] ids, @Valid String id) { - if (Lang.isEmpty(ids)) { - return Result.error(); - } - welfareListService.doWelfareListUser(ids, id); - return Result.success(); - } } diff --git a/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareMineController.java b/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareMineController.java index c1b5d3a..d082fef 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareMineController.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareMineController.java @@ -40,16 +40,8 @@ import java.util.stream.Collectors; @At("/platform/welfare/mine") public class WelfareMineController { - - @At("") - @Ok("beetl:/platform/zhgh/welfare/mine/index.html") - @SaCheckPermission("welfare.mine") - public void index() { - } - @Inject private WelfareListService welfareListService; - @Inject private WelfareProjectService welfareProjectService; @Inject @@ -57,6 +49,12 @@ public class WelfareMineController { @Inject private ExpressSelectUtil expressSelectUtil; + @At("") + @Ok("beetl:/platform/zhgh/welfare/mine/index.html") + @SaCheckPermission("welfare.mine") + public void index() { + } + @At @SaCheckPermission("welfare.mine") public Result pageData(PageForm pageForm, @@ -69,7 +67,7 @@ public class WelfareMineController { WHEN wus.selectUserId IS NOT NULL THEN 1 ELSE 0 END AS isChoose, - GROUP_CONCAT(DISTINCT wuso.optionName,wus.selectNum) AS gist_list, + GROUP_CONCAT(DISTINCT wuso.optionName ,'(',wus.selectNum,'份)') AS gist_list, wus.receiveAddress, wl.userId FROM @@ -79,7 +77,7 @@ public class WelfareMineController { AND wus.selectUserId = @selectUserId LEFT JOIN welfare_project_subject_option wuso ON wus.selectOptionId = wuso.id $condition - """); + """); sql.setParam("selectUserId", SecurityUtil.getUserId()); Cnd cnd = Cnd.NEW(); cnd.and("wp.isDisabled", "=", 0); @@ -89,21 +87,6 @@ public class WelfareMineController { cnd.groupBy("wl.id"); sql.setCondition(cnd); Pagination pagination = welfareListService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); - List list = pagination.getList(); - for (NutMap nutMap : list) { - String gistList = nutMap.getString("gist_list"); - if (StrUtil.isNotBlank(gistList)) { - String[] giftArray = gistList.split(","); - List gifts = Arrays.stream(giftArray).map(gift -> { - String num = gift.substring(gift.length() - 1); - String name = gift.substring(0, gift.length() - 1); - return NutMap.NEW().addv("name", name).addv("num", num); - }).collect(Collectors.toList()); - nutMap.put("gifts", gifts); - } else { - nutMap.put("gifts", new ArrayList<>()); - } - } return Result.success(pagination); } @@ -149,97 +132,4 @@ public class WelfareMineController { } - @At - @SaCheckPermission("welfare.mine") - public Result courierNumberInfo(String welfareId, String userId) { -//查询的时候去触发福利最新信息 - List welfareCourierNumberList = welfareListService.dao().query(WelfareCourierNumber.class, Cnd.where("welfareId", "=", welfareId).and("selectUserId", "=", userId)); - for (WelfareCourierNumber courierNumber : welfareCourierNumberList) { - //如果有上次查询的时间 - - if (Lang.isNotEmpty(courierNumber.getSelectExpressDate()) && DateUtil.offsetHour(courierNumber.getSelectExpressDate(), 2).getTime() > new Date().getTime()) { - //还在有效期内 - continue; - } - - if (Lang.isNotEmpty(courierNumber.getLogisticsTrace()) && List.of("AGENT_SIGN", "SIGN").contains(courierNumber.getLogisticsTrace().getLogisticsStatus())) { - //签收了 - continue; - } - - if (Lang.isEmpty(courierNumber.getCourierNumber())) { - //没快递单号 - continue; - } - - WelfareUserSelection userSelection = welfareListService.dao().fetch(WelfareUserSelection.class, Cnd.where("welfareId", "=", welfareId).and("selectUserId", "=", userId)); - - //需要去查询最新的物流信息 - String receiveAddress = userSelection.getReceiveAddress(); - String mobile = receiveAddress.substring(receiveAddress.length() - 11); - - NutMap expressInfo = expressSelectUtil.getExpressInfo(courierNumber.getCourierNumber(), mobile); - WelfareUserSelection.LogisticsTrace logisticsTrace = new WelfareUserSelection.LogisticsTrace(); - logisticsTrace.setTheLastTime(expressInfo.getTime("theLastTime")); - logisticsTrace.setTheLastMessage(expressInfo.getString("theLastMessage")); - logisticsTrace.setLogisticsStatusDesc(expressInfo.getString("logisticsStatusDesc")); - logisticsTrace.setLogisticsStatus(expressInfo.getString("logisticsStatus")); - List logisticsTraceDetailList = expressInfo.getAsList("logisticsTraceDetailList", NutMap.class); - logisticsTrace.setLogisticsTraceDetailList(logisticsTraceDetailList); - - welfareListService.dao().update(WelfareCourierNumber.class, - Chain.make("logisticsTrace", logisticsTrace) - .add("selectExpressDate", new Date()), - Cnd.where("id", "=", courierNumber.getId())); - } - - Sql sql = Sqls.create(""" - SELECT - wpso.optionName, - wpso.imgUrl, - wcn.courierNumber, - wcn.logisticsTrace - FROM - welfare_courier_number wcn - LEFT JOIN welfare_project_subject_option wpso ON wpso.id = wcn.selectOptionId - WHERE - wcn.welfareId = @welfareId - AND wcn.selectUserId = @userId - ORDER BY wpso.optionSort - """); - sql.setParam("welfareId", welfareId); - sql.setParam("userId", userId); - List list = welfareListService.listMap(sql); - - for (NutMap nutMap : list) { - nutMap.put("logisticsTrace", nutMap.getAs("logisticsTrace", WelfareUserSelection.LogisticsTrace.class)); - } - List mapList = sql.getList(NutMap.class); - - Map> listMap = mapList.stream().collect(Collectors.groupingBy(v -> v.getString("optionName"))); - return Result.success(listMap); - } - - - @At - @SaCheckPermission("welfare.mine") - public Result finOneWelfareEvaluate(String projectId, String optionId) { - WelfareEvaluate welfareEvaluate = welfareProjectService.dao().fetch(WelfareEvaluate.class, - Cnd.where("userId", "=", SecurityUtil.getUserId()) - .and("projectId", "=", projectId).and("optionId", "=", optionId)); - return Result.success(welfareEvaluate); - } - - @At - @SaCheckPermission("welfare.mine") - public Result doEvaluate(WelfareEvaluate welfareEvaluate) { - welfareEvaluate.setUserId(SecurityUtil.getUserId()); - welfareEvaluate.setUserName(SecurityUtil.getUserUsername()); - welfareEvaluate.setLoginName(SecurityUtil.getUserLoginname()); - welfareEvaluate.setApplyDate(new Date()); - welfareProjectService.insert(welfareEvaluate); - return Result.success(); - } - - } diff --git a/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareProjectMangeController.java b/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareProjectMangeController.java index 8aafc11..87fbaa9 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareProjectMangeController.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareProjectMangeController.java @@ -1,11 +1,14 @@ package com.budwk.app.zhgh.welfare.controller; import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.StrUtil; import com.budwk.app.base.annotation.SLog; +import com.budwk.app.base.page.Pagination; import com.budwk.app.base.param.PageForm; import com.budwk.app.base.result.Result; import com.budwk.app.sys.models.Sys_home_activity; import com.budwk.app.zhgh.welfare.model.WelfareProject; +import com.budwk.app.zhgh.welfare.param.WelfareFilterUserPageForm; import com.budwk.app.zhgh.welfare.service.WelfareListService; import com.budwk.app.zhgh.welfare.service.WelfareProjectService; import org.nutz.aop.interceptor.ioc.TransAop; @@ -21,6 +24,8 @@ import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Param; +import javax.validation.Valid; + /** * @ClassName WelfareProjectMangeController * @Description TODO @@ -34,7 +39,7 @@ public class WelfareProjectMangeController { @At("") - @Ok("beetl:/platform/zhgh/welfare/ProjectMange/index.html") + @Ok("beetl:/platform/zhgh/welfare/projectMange/index.html") @SaCheckPermission("welfare.project.mange") public void index() { } @@ -42,7 +47,7 @@ public class WelfareProjectMangeController { @Inject private WelfareProjectService projectService; @Inject - private WelfareListService listService; + private WelfareListService welfareListService; @At @@ -70,7 +75,11 @@ public class WelfareProjectMangeController { @SLog(tag = "福利", msg = "新增/编辑了福利") @SaCheckPermission("welfare.project.mange") public Result save(@Param("data") WelfareProject project) { - projectService.save(project); + if (StrUtil.isNotBlank(project.getId())) { + projectService.updateProject(project); + } else { + projectService.saveProject(project); + } return Result.success(); } @@ -106,19 +115,33 @@ public class WelfareProjectMangeController { return Result.success(); } - - @At - @SaCheckPermission("welfare.project.mange") - public Result createList(String id, boolean created) { - projectService.createList(id, created); - return Result.success(); - } - @At @SaCheckPermission("welfare.mine") public Result getWelfareList(Integer year) { return Result.success(projectService.getWelfareList(year)); } + /** + * 生成福利名单用户查询 + */ + @At + @SaCheckPermission("welfare.project.mange") + @Ok("json:{dateFormat:'yyyy-MM-dd'}") + public Result filterUserPageData(@Valid @Param("pageForm") WelfareFilterUserPageForm pageForm) { + Pagination pagination = welfareListService.notWelfareUserPageData(pageForm); + return Result.success(pagination); + } + + /** + * 添加福利名单用户 + * + * @return + */ + @At + @SaCheckPermission("welfare.project.mange") + public Result addWelfareUser(@Valid @Param("pageForm") WelfareFilterUserPageForm pageForm) { + welfareListService.addWelfareUser(pageForm); + return Result.success(); + } } diff --git a/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareSingleController.java b/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareStatisticsController.java similarity index 60% rename from src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareSingleController.java rename to src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareStatisticsController.java index 041a87c..3835349 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareSingleController.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareStatisticsController.java @@ -1,20 +1,37 @@ package com.budwk.app.zhgh.welfare.controller; +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.StrUtil; import com.budwk.app.base.annotation.SLog; +import com.budwk.app.base.page.Pagination; +import com.budwk.app.base.param.PageForm; import com.budwk.app.base.result.Result; import com.budwk.app.base.utils.CommonDownloadUtil; import com.budwk.app.sys.models.Sys_union; import com.budwk.app.zhgh.welfare.model.WelfareProject; import com.budwk.app.zhgh.welfare.service.WelfareListService; import com.budwk.app.zhgh.welfare.service.WelfareSingleService; +import com.budwk.app.zhgh.welfare.service.WelfareStatisticsService; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; import org.apache.poi.ss.usermodel.Workbook; import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.dao.Cnd; +import org.nutz.dao.Dao; +import org.nutz.dao.FieldFilter; +import org.nutz.dao.Sqls; +import org.nutz.dao.sql.Sql; +import org.nutz.dao.util.Daos; +import org.nutz.dao.util.cri.SqlExpressionGroup; import org.nutz.ioc.aop.Aop; import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.lang.util.NutMap; import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Param; @@ -23,70 +40,94 @@ import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.BufferedOutputStream; import java.net.URLEncoder; +import java.util.ArrayList; import java.util.List; +import java.util.Optional; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; -/** - * @ClassName WelfareSingleController - * @Description 查询统计 - * @Author zhf - * @Date 2024/8/14 13:49 - */ @IocBean @Ok("json:full") -@At("/platform/welfare/project/statistics/single") -public class WelfareSingleController { +@At("/platform/welfare/statistics") +@Slf4j +@Api(tags = "福利统计") +public class WelfareStatisticsController { + + @Inject + private Dao dao; + @Inject + private WelfareSingleService welfareSingleService; + @Inject + private WelfareListService welfareListService; + @Inject + private WelfareStatisticsService welfareStatisticsService; @At("") @Ok("beetl:/platform/zhgh/welfare/statistics/index.html") - @SaCheckPermission("welfare.project.statistics.single") + @SaCheckPermission("welfare.statistics") public void index() { } - @Inject - private WelfareSingleService welfareSingleService; - - @Inject - private WelfareListService welfareListService; - @At - @SaCheckPermission("welfare.project.statistics.single") + @SaCheckPermission("welfare.statistics") public Result pageData(String projectId, String unionId) { return Result.success(welfareSingleService.pageData(projectId, unionId)); } - /** - * @param projectId - * @param unionId - * @param pageNumber - * @param pageSize - * @return com.budwk.app.base.result.Result - * @author zhf - * @description 查询已选择的人 - */ + @At - @SaCheckPermission("welfare.project.statistics.single") - public Result receivePageData(String projectId, String unionId, Integer pageNumber, Integer pageSize) { - return Result.success(welfareSingleService.receivePageData(projectId, unionId, pageNumber, pageSize)); + @SaCheckPermission("welfare.statistics") + @ApiOperation("查询某分工会已选择人员") + public Result selectedUnionUserPageData(@Valid PageForm pageForm, String projectId, String unionId) { + Pagination pagination = welfareStatisticsService.selectedUnionUserPageData(pageForm, projectId, unionId); + return Result.success(pagination); } - /** - * @param projectId - * @param unionId - * @param pageNumber - * @param pageSize - * @return com.budwk.app.base.result.Result - * @author zhf - * @description 查询未选择的人 - */ @At - @SaCheckPermission("welfare.project.statistics.single") - public Result unclaimedData(String projectId, String unionId, Integer pageNumber, Integer pageSize) { - return Result.success(welfareSingleService.unclaimedData(projectId, unionId, pageNumber, pageSize)); + @Ok("void") + @SaCheckPermission("welfare.statistics") + @ApiOperation("导出某分工会已选择人员") + public void exportSelectedUnionUser(String projectId, String unionId, HttpServletResponse response) { + welfareStatisticsService.exportSelectedUnionUser(projectId,unionId,response); } + @At + @SaCheckPermission("welfare.statistics") + @ApiOperation("查询某分工会未选择人员") + public Result unSelectedUnionUserPageData(@Valid PageForm pageForm, String projectId, String unionId) { + Pagination pagination = welfareStatisticsService.unSelectedUnionUserPageData(pageForm, projectId, unionId); + return Result.success(pagination); + } + + @At + @Ok("void") + @SaCheckPermission("welfare.statistics") + @ApiOperation("导出某分工会未选择人员") + public void exportUnSelectedUnionUser(String projectId, String unionId, HttpServletResponse response) { + welfareStatisticsService.exportUnSelectedUnionUser(projectId,unionId,response); + } + + @At + @Ok("void") + @SaCheckPermission("welfare.statistics") + @ApiOperation("导出各分工会选择情况") + public void exportUnionExcel(String projectId, HttpServletResponse response) { + welfareStatisticsService.exportUnionExcel(projectId,response); + } + + + @At + @Ok("void") + @SaCheckPermission("welfare.statistics") + @ApiOperation("按福利选项导出") + public void exportByWelfareOptions(String projectId,HttpServletResponse response){ + welfareStatisticsService.exportByWelfareOptions(projectId,response); + } + + + + /** * @param projectId @@ -97,7 +138,7 @@ public class WelfareSingleController { */ @At @Ok("void") - @SaCheckPermission("welfare.project.statistics.single") + @SaCheckPermission("welfare.statistics") public void exportReceiveDetailByUnionIdWord(String projectId, String unionId, HttpServletResponse response) { WelfareProject welfareProject = welfareSingleService.dao().fetch(WelfareProject.class, projectId); Sys_union sysUnion = welfareSingleService.dao().fetch(Sys_union.class, Cnd.where("id", "=", unionId)); @@ -120,7 +161,7 @@ public class WelfareSingleController { */ @At @Ok("void") - @SaCheckPermission("welfare.project.statistics.single") + @SaCheckPermission("welfare.statistics") public void exportReceiveDetailByUnionId(String projectId, String unionId, Boolean flag, HttpServletResponse response) { welfareSingleService.exportReceiveDetailByUnionId(projectId, unionId, flag, response); @@ -129,7 +170,7 @@ public class WelfareSingleController { @At @Ok("void") - @SaCheckPermission("welfare.project.statistics.single") + @SaCheckPermission("welfare.statistics") public void allExportReceiveDetailByUnionIdWord(String projectId, HttpServletResponse response) { try { WelfareProject welfareProject = welfareSingleService.dao().fetch(WelfareProject.class, projectId); @@ -157,20 +198,20 @@ public class WelfareSingleController { @At @Ok("void") - @SaCheckPermission("welfare.project.statistics.single") + @SaCheckPermission("welfare.statistics") public void exportSelectData(String projectId, String unionId, HttpServletResponse response) { welfareListService.exportSelectData(projectId, unionId, response); } @At @Ok("void") - @SaCheckPermission("welfare.project.statistics.single") + @SaCheckPermission("welfare.statistics") public void exportSummary(String projectId, String unionId, HttpServletResponse response) { welfareSingleService.exportSummary(projectId, unionId, response); } @At - @SaCheckPermission("welfare.project.statistics.single") + @SaCheckPermission("welfare.statistics") @Aop(TransAop.READ_COMMITTED) @SLog(tag = "福利统计", msg = "管理员代选福利") @ApiOperation("管理员代选福利") diff --git a/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareUserChooseController.java b/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareUserChooseController.java index 578c26f..356f3e0 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareUserChooseController.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareUserChooseController.java @@ -9,9 +9,11 @@ import com.budwk.app.base.service.BaseService; import com.budwk.app.web.commons.auth.utils.SecurityUtil; import com.budwk.app.zhgh.welfare.model.WelfareList; import com.budwk.app.zhgh.welfare.model.WelfareUserSelection; +import io.swagger.annotations.ApiOperation; import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.dao.Chain; import org.nutz.dao.Cnd; +import org.nutz.dao.Dao; import org.nutz.dao.Sqls; import org.nutz.dao.sql.Sql; import org.nutz.ioc.aop.Aop; @@ -22,6 +24,7 @@ import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Param; import java.util.Date; +import java.util.List; /** * @ClassName WelfareUserChooseController @@ -34,6 +37,10 @@ import java.util.Date; @At("/platform/welfare/userChoose") public class WelfareUserChooseController { + @Inject + private Dao dao; + @Inject + private BaseService baseService; @At("") @Ok("beetl:/platform/zhgh/welfare/userChoose/index.html") @@ -41,14 +48,9 @@ public class WelfareUserChooseController { public void index() { } - @Inject - private BaseService baseService; - - @At @SaCheckPermission("welfare.user.choose") public Result pageData(PageForm pageForm, Integer year) { - Sql sql = Sqls.create(""" SELECT wp.*, @@ -84,8 +86,7 @@ public class WelfareUserChooseController { @Aop(TransAop.READ_COMMITTED) @SLog(type = "welfare", tag = "选择福利", msg = "福利") @SaCheckPermission("welfare.user.choose") - public Result confirmSelect(@Param("welfareUserSelections") WelfareUserSelection[] welfareUserSelections, - String projectId) { + public Result confirmSelect(@Param("welfareUserSelections") WelfareUserSelection[] welfareUserSelections, String projectId) { //删除上次选择的 baseService.dao().clear(WelfareUserSelection.class, Cnd.where("welfareId", "=", projectId) @@ -105,4 +106,13 @@ public class WelfareUserChooseController { return Result.success("选择成功"); } + @At + @SaCheckPermission("welfare.user.choose") + @ApiOperation("获取用户选择信息") + public Result getUserSelection(String projectId) { + List list = dao.query(WelfareUserSelection.class, Cnd.where(WelfareUserSelection::getWelfareId, "=", projectId).and(WelfareUserSelection::getSelectUserId, "=", SecurityUtil.getUserId())); + return Result.success(list); + } + + } diff --git a/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareUserSelectController.java b/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareUserSelectController.java new file mode 100644 index 0000000..da6dd59 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareUserSelectController.java @@ -0,0 +1,103 @@ +package com.budwk.app.zhgh.welfare.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.budwk.app.base.annotation.SLog; +import com.budwk.app.base.page.Pagination; +import com.budwk.app.base.param.PageForm; +import com.budwk.app.base.result.Result; +import com.budwk.app.web.commons.auth.utils.SecurityUtil; +import com.budwk.app.zhgh.welfare.model.WelfareList; +import com.budwk.app.zhgh.welfare.model.WelfareUserSelection; +import com.budwk.app.zhgh.welfare.service.WelfareProjectService; +import io.swagger.annotations.ApiOperation; +import org.nutz.aop.interceptor.ioc.TransAop; +import org.nutz.dao.Chain; +import org.nutz.dao.Cnd; +import org.nutz.dao.Dao; +import org.nutz.dao.Sqls; +import org.nutz.dao.sql.Sql; +import org.nutz.ioc.aop.Aop; +import org.nutz.ioc.loader.annotation.Inject; +import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.mvc.annotation.At; +import org.nutz.mvc.annotation.Ok; +import org.nutz.mvc.annotation.Param; + +import java.util.Date; +import java.util.List; + +@IocBean +@Ok("json:full") +@At("/platform/welfare/userSelect") +public class WelfareUserSelectController { + + @Inject + private Dao dao; + @Inject + private WelfareProjectService welfareProjectService; + + @At("") + @Ok("beetl:/platform/zhgh/welfare/select/index.html") + @SaCheckPermission("welfare.user.select") + public void index() { + } + + @At + @SaCheckPermission("welfare.user.select") + @ApiOperation("获取用户选择列表分页") + public Result pageData(PageForm pageForm, Integer year) { + Sql sql = Sqls.create(""" + SELECT + wp.*, + CASE + WHEN wus.selectUserId IS NOT NULL THEN 1 + ELSE 0 + END AS isChoose, + wus.selectTime, + GROUP_CONCAT(DISTINCT wuso.optionName ,'(',wus.selectNum,'份)') AS gist_list, + wus.receiveAddress + FROM + welfare_project wp + LEFT JOIN welfare_project_user_selection wus ON wp.id = wus.welfareId AND wus.selectUserId = @selectUserId + INNER JOIN welfare_list wl ON wp.id = wl.projectId AND wl.userId = @selectUserId + LEFT JOIN welfare_project_subject_option wuso ON wus.selectOptionId = wuso.id + $condition + """); + sql.setParam("selectUserId", SecurityUtil.getUserId()); + + Cnd cnd = Cnd.NEW(); + cnd.and("wp.provideMode", "in", "2,3"); + cnd.andEX("YEAR(wp.choiceTimeStart)", "in", year); + cnd.and("wp.isDisabled", "=", 0); + cnd.groupBy("wp.id"); + cnd.desc("YEAR(wp.choiceTimeStart)"); + sql.setCondition(cnd); + Pagination pagination = welfareProjectService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return Result.success(pagination); + } + + @At + @Aop(TransAop.READ_COMMITTED) + @SLog(type = "welfare", tag = "选择福利", msg = "福利") + @SaCheckPermission("welfare.user.select") + public Result confirmSelect(@Param("selections") WelfareUserSelection[] selections, String projectId) { + //删除上次选择的 + dao.clear(WelfareUserSelection.class, Cnd.where(WelfareUserSelection::getWelfareId, "=", projectId).and(WelfareUserSelection::getSelectUserId, "=", SecurityUtil.getUserId())); + for (WelfareUserSelection welfareUserSelection : selections) { + welfareUserSelection.setWelfareId(projectId); + welfareUserSelection.setSelectUserId(SecurityUtil.getUserId()); + welfareUserSelection.setSelectTime(new Date()); + } + dao.insert(selections); + return Result.success("选择成功"); + } + + @At + @SaCheckPermission("welfare.user.select") + @ApiOperation("获取用户选择信息") + public Result getUserSelection(String projectId) { + List list = dao.query(WelfareUserSelection.class, Cnd.where(WelfareUserSelection::getWelfareId, "=", projectId).and(WelfareUserSelection::getSelectUserId, "=", SecurityUtil.getUserId())); + return Result.success(list); + } + +} diff --git a/src/main/java/com/budwk/app/zhgh/welfare/h5Controller/H5WelfareUserChooseController.java b/src/main/java/com/budwk/app/zhgh/welfare/h5Controller/H5WelfareUserChooseController.java deleted file mode 100644 index 29deb33..0000000 --- a/src/main/java/com/budwk/app/zhgh/welfare/h5Controller/H5WelfareUserChooseController.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.budwk.app.zhgh.welfare.h5Controller; - -import cn.dev33.satoken.annotation.SaCheckPermission; -import org.nutz.ioc.loader.annotation.IocBean; -import org.nutz.mvc.annotation.At; -import org.nutz.mvc.annotation.Ok; - -/** - * @ClassName H5WelfareUserChooseController - * @Description TODO - * @Author zhf - * @Date 2024/9/26 9:21 - */ -@IocBean -@Ok("json:full") -@At("/platform/h5/welfare/userChoose") -public class H5WelfareUserChooseController { - - - @At - @Ok("beetl:/platform/zhghh5/welfare/userChoose/list.html") - @SaCheckPermission("hs.welfare.user.choose") - public void list() { - } - - @At - @Ok("beetl:/platform/zhghh5/welfare/userChoose/index.html") - @SaCheckPermission("hs.welfare.user.choose") - public void index() { - - } - -} diff --git a/src/main/java/com/budwk/app/zhgh/welfare/h5Controller/H5WelfareUserSelectController.java b/src/main/java/com/budwk/app/zhgh/welfare/h5Controller/H5WelfareUserSelectController.java new file mode 100644 index 0000000..e5981e6 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/welfare/h5Controller/H5WelfareUserSelectController.java @@ -0,0 +1,38 @@ +package com.budwk.app.zhgh.welfare.h5Controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.mvc.annotation.At; +import org.nutz.mvc.annotation.Ok; + +/** + * @ClassName H5WelfareUserChooseController + * @Description TODO + * @Author zhf + * @Date 2024/9/26 9:21 + */ +@IocBean +@Ok("json:full") +@At("/platform/h5/welfare/userSelect") +public class H5WelfareUserSelectController { + + @At + @Ok("beetl:/platform/zhghh5/welfare/select/list.html") + @SaCheckPermission("hs.welfare.user.select") + public void list() { + } + + @At + @Ok("beetl:/platform/zhghh5/welfare/select/index.html") + @SaCheckPermission("hs.welfare.user.select") + public void index() { + + } + + @At + @Ok("beetl:/platform/zhghh5/welfare/select/success.html") + @SaCheckPermission("hs.welfare.user.select") + public void success() { + } + +} diff --git a/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareList.java b/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareList.java index af14309..75a9bdd 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareList.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareList.java @@ -2,6 +2,7 @@ package com.budwk.app.zhgh.welfare.model; import com.budwk.app.base.model.BaseModel; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import org.nutz.dao.entity.annotation.*; import org.nutz.dao.interceptor.annotation.PrevInsert; @@ -15,6 +16,7 @@ import java.io.Serializable; * @date: 2021/2/1 * @since 1.0 */ +@EqualsAndHashCode(callSuper = true) @Table("welfare_list") @TableIndexes({ @Index(name = "INDEX_WELFARE_LIST_USER_ID", fields = {"userId"}, unique = false), @@ -22,9 +24,9 @@ import java.io.Serializable; }) @Data @Accessors(chain = true) -public class WelfareList extends BaseModel implements Serializable { +public class WelfareList extends BaseModel{ + @Name - @Column @Comment("ID") @ColDefine(type = ColType.VARCHAR, width = 32) @PrevInsert(uu32 = true) @@ -45,6 +47,37 @@ public class WelfareList extends BaseModel implements Serializable { @ColDefine(type = ColType.VARCHAR, width = 32) private String welfareUnitId; + @Column + @Comment("福利单位名称") + @ColDefine(type = ColType.VARCHAR, width = 100) + private String welfareUnitName; + + @Column + @Comment("福利分工会ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String welfareUnionId; + + @Column + @Comment("福利分工会名称") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String welfareUnionName; + + @Column + @Comment("人员类型") + @ColDefine(type = ColType.VARCHAR) + private String personType; + + @Column + @Comment("在职状态") + @ColDefine(type = ColType.VARCHAR) + private String userState; + + @Column + @Comment("聘用方式") + @ColDefine(type = ColType.VARCHAR) + private String preparedBy; + + @Deprecated @Column @Comment("福利二级单位ID") @ColDefine(type = ColType.VARCHAR, width = 32) @@ -60,14 +93,4 @@ public class WelfareList extends BaseModel implements Serializable { @ColDefine(type = ColType.BOOLEAN) private Boolean isAutoSelect; - @Column - @Comment("人员类型") - @ColDefine(type = ColType.VARCHAR) - private String personType; - - @Column - @Comment("在职状态") - @ColDefine(type = ColType.VARCHAR) - private String userState; - } diff --git a/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareProject.java b/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareProject.java index 7afe83d..5819ac1 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareProject.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareProject.java @@ -25,9 +25,7 @@ import java.util.List; @Accessors(chain = true) @Table @Comment("福利项目") -public class WelfareProject extends BaseModel implements Serializable, SysHomeConvert { - - private static final long serialVersionUID = 1L; +public class WelfareProject extends BaseModel implements SysHomeConvert { @Column @Name @@ -176,12 +174,15 @@ public class WelfareProject extends BaseModel implements Serializable, SysHomeCo @ColDefine(type = ColType.VARCHAR, width = 32) private String conditionStructureId; - /* @One(field = "conditionStructureId") - private MatchConditionStructure conditionStructure;*/ - @Many(field = "projectId") private List welfareProjectSubjects; + /** + * 套餐选项 + */ + @Many(field = "welfareId") + private List options; + @Column @Comment("题目ID") @ColDefine(type = ColType.VARCHAR, width = 32) diff --git a/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareProjectSubjectOption.java b/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareProjectSubjectOption.java index e7e72ca..eb6de1d 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareProjectSubjectOption.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareProjectSubjectOption.java @@ -27,10 +27,15 @@ public class WelfareProjectSubjectOption extends BaseModel implements Serializab private String id; @Column - @Comment("所属题目") + @Comment("所属福利") @ColDefine(type = ColType.VARCHAR, width = 32) private String subjectId; + @Column + @Comment("所属福利") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String welfareId; + @Column @Comment("选项类型") @ColDefine(type = ColType.VARCHAR, width = 50) @@ -54,13 +59,21 @@ public class WelfareProjectSubjectOption extends BaseModel implements Serializab @Column @Comment("没选系统自动选") @ColDefine(type = ColType.BOOLEAN) + @Default("0") private Boolean isDefaultOption; @Column @Comment("默认选项") @ColDefine(type = ColType.BOOLEAN) + @Default("0") private Boolean isSystemDefault; + @Column + @Comment("是否快递") + @ColDefine(type = ColType.BOOLEAN) + @Default("0") + private Boolean isExpressDelivery; + @Column @Comment("图片地址") @ColDefine(type = ColType.VARCHAR, width = 100) diff --git a/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareUserSelection.java b/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareUserSelection.java index 3e9bda3..c21af9c 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareUserSelection.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareUserSelection.java @@ -2,6 +2,7 @@ package com.budwk.app.zhgh.welfare.model; import com.budwk.app.base.model.BaseModel; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import org.nutz.dao.entity.annotation.*; import org.nutz.dao.interceptor.annotation.PrevInsert; @@ -16,6 +17,7 @@ import java.util.List; * @Description TODO * @createTime 2022年01月12日 17:07:00 */ +@EqualsAndHashCode(callSuper = true) @Data @Accessors(chain = true) @Table("welfare_project_user_selection") @@ -78,6 +80,11 @@ public class WelfareUserSelection extends BaseModel implements Serializable { @ColDefine(type = ColType.INT) private Integer selectNum; + @Column + @Comment("手机号") + @ColDefine(type = ColType.VARCHAR, width = 11) + private String mobile; + @Column @Comment("物流信息") @ColDefine(type = ColType.MYSQL_JSON) diff --git a/src/main/java/com/budwk/app/zhgh/welfare/param/WelfareFilterUserPageForm.java b/src/main/java/com/budwk/app/zhgh/welfare/param/WelfareFilterUserPageForm.java new file mode 100644 index 0000000..1bd27b0 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/welfare/param/WelfareFilterUserPageForm.java @@ -0,0 +1,58 @@ +package com.budwk.app.zhgh.welfare.param; + +import com.budwk.app.base.param.PageForm; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +@EqualsAndHashCode(callSuper = true) +@Data +@ApiModel("用户生成福利名单分页查询参数") +public class WelfareFilterUserPageForm extends PageForm { + + @ApiModelProperty("福利项目id") + private String projectId; + + @ApiModelProperty("姓名") + private String userName; + + @ApiModelProperty("工号") + private String loginName; + + @ApiModelProperty("性别") + private String sex; + + @ApiModelProperty("出生日期") + private Date birthday; + + @ApiModelProperty("出生月份") + private String[] birthMonths; + + @ApiModelProperty("工会id") + private String unionId; + + @ApiModelProperty("工会名称") + private String unionName; + + @ApiModelProperty("单位id") + private String[] unitIds; + + @ApiModelProperty("单位名称") + private String unitName; + + @ApiModelProperty("人员类型") + private String[] personTypes; + + @ApiModelProperty("聘用方式") + private String[] preparedBys; + + @ApiModelProperty("在职状态") + private String[] userStates; + + @ApiModelProperty("是否会员") + private Boolean isMember; + +} diff --git a/src/main/java/com/budwk/app/zhgh/welfare/param/WelfareListPageForm.java b/src/main/java/com/budwk/app/zhgh/welfare/param/WelfareListPageForm.java new file mode 100644 index 0000000..f16777e --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/welfare/param/WelfareListPageForm.java @@ -0,0 +1,58 @@ +package com.budwk.app.zhgh.welfare.param; + +import com.budwk.app.base.param.PageForm; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +@EqualsAndHashCode(callSuper = true) +@Data +@ApiModel(description = "福利名单分页查询参数") +public class WelfareListPageForm extends PageForm { + + @ApiModelProperty("年份") + private Integer year; + + @ApiModelProperty("福利项目id") + private String projectId; + + @ApiModelProperty("姓名") + private String userName; + + @ApiModelProperty("工号") + private String loginName; + + @ApiModelProperty("性别") + private String sex; + + @ApiModelProperty("出生日期") + private Date birthday; + + @ApiModelProperty("出生月份") + private String[] birthMonths; + + @ApiModelProperty("工会id") + private String unionId; + + @ApiModelProperty("工会名称") + private String unionName; + + @ApiModelProperty("单位id") + private String[] unitIds; + + @ApiModelProperty("单位名称") + private String unitName; + + @ApiModelProperty("人员类型") + private String[] personTypes; + + @ApiModelProperty("聘用方式") + private String[] preparedBys; + + @ApiModelProperty("在职状态") + private String[] userStates; + +} diff --git a/src/main/java/com/budwk/app/zhgh/welfare/service/WelfareListService.java b/src/main/java/com/budwk/app/zhgh/welfare/service/WelfareListService.java index d3d2b5f..0a23c79 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/service/WelfareListService.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/service/WelfareListService.java @@ -5,6 +5,8 @@ import com.budwk.app.base.param.PageForm; import com.budwk.app.base.result.Result; import com.budwk.app.base.service.BaseService; import com.budwk.app.zhgh.welfare.model.WelfareList; +import com.budwk.app.zhgh.welfare.param.WelfareFilterUserPageForm; +import com.budwk.app.zhgh.welfare.param.WelfareListPageForm; import org.nutz.mvc.upload.TempFile; import javax.servlet.http.HttpServletResponse; @@ -23,4 +25,24 @@ public interface WelfareListService extends BaseService { Pagination selectNotWelfareList(String id, PageForm pageForm); void doWelfareListUser(String[] ids,String id); + + /** + * 分页查询 + * @param pageForm + * @return + */ + Pagination pageData(WelfareListPageForm pageForm); + + /** + * 查询非福利会员用户 + * @param pageForm + * @return + */ + Pagination notWelfareUserPageData(WelfareFilterUserPageForm pageForm); + + /** + * 添加福利会员用户 + * @param pageForm + */ + void addWelfareUser(WelfareFilterUserPageForm pageForm); } diff --git a/src/main/java/com/budwk/app/zhgh/welfare/service/WelfareProjectService.java b/src/main/java/com/budwk/app/zhgh/welfare/service/WelfareProjectService.java index 488434c..3f1a2ab 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/service/WelfareProjectService.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/service/WelfareProjectService.java @@ -1,7 +1,9 @@ package com.budwk.app.zhgh.welfare.service; +import com.budwk.app.base.page.Pagination; import com.budwk.app.base.service.BaseService; import com.budwk.app.zhgh.welfare.model.WelfareProject; +import com.budwk.app.zhgh.welfare.param.WelfareFilterUserPageForm; import org.nutz.lang.util.NutMap; import java.util.List; @@ -17,13 +19,35 @@ public interface WelfareProjectService extends BaseService { */ WelfareProject projectInfo(String projectId); + /** + * 保存项目信息 + * @param project + */ + void saveProject(WelfareProject project); - void save(WelfareProject project); + /** + * 修改项目信息 + * @param project + */ + void updateProject(WelfareProject project); + /** + * 删除项目信息 + * @param id + */ void deleteWelfare(String id); - + /** + * 创建福利名单 + * @param projectId + * @param created + */ void createList(String projectId, boolean created); - List getWelfareList(Integer year); + /** + * 项目列表 + * @param year + * @return + */ + List getWelfareList(Integer year); } diff --git a/src/main/java/com/budwk/app/zhgh/welfare/service/WelfareSingleService.java b/src/main/java/com/budwk/app/zhgh/welfare/service/WelfareSingleService.java index e82226b..047dc1b 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/service/WelfareSingleService.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/service/WelfareSingleService.java @@ -9,8 +9,13 @@ import java.util.List; public interface WelfareSingleService extends BaseService { - NutMap pageData(String projectId, - String unionId); + /** + * 查询各分工会已选未选的人数 + * @param projectId + * @param unionId + * @return + */ + NutMap pageData(String projectId, String unionId); List getOptionByProjectId(String projectId); diff --git a/src/main/java/com/budwk/app/zhgh/welfare/service/WelfareStatisticsService.java b/src/main/java/com/budwk/app/zhgh/welfare/service/WelfareStatisticsService.java new file mode 100644 index 0000000..0bc9fb2 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/welfare/service/WelfareStatisticsService.java @@ -0,0 +1,57 @@ +package com.budwk.app.zhgh.welfare.service; + +import com.budwk.app.base.page.Pagination; +import com.budwk.app.base.param.PageForm; +import com.budwk.app.base.service.BaseService; +import com.budwk.app.zhgh.welfare.model.WelfareProject; + +import javax.servlet.http.HttpServletResponse; + +public interface WelfareStatisticsService extends BaseService { + + /** + * 查询某分工会已选择人员 + * @param pageForm + * @param projectId + * @param unionId + */ + Pagination selectedUnionUserPageData(PageForm pageForm, String projectId, String unionId); + + /** + * 导出某分工会已选择人员 + * @param projectId + * @param unionId + * @param response + */ + void exportSelectedUnionUser(String projectId, String unionId, HttpServletResponse response); + + /** + * Pagination + * @param pageForm + * @param projectId + * @param unionId + */ + Pagination unSelectedUnionUserPageData(PageForm pageForm, String projectId, String unionId); + + /** + * 导出某分工会未选择人员 + * @param projectId + * @param unionId + * @param response + */ + void exportUnSelectedUnionUser(String projectId, String unionId, HttpServletResponse response); + + /** + * 导出各分工会选择情况 + * @param projectId + * @param response + */ + void exportUnionExcel(String projectId, HttpServletResponse response); + + /** + * 按福利选项导出 + * @param projectId + * @param response + */ + void exportByWelfareOptions(String projectId, HttpServletResponse response); +} diff --git a/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareListServiceImpl.java b/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareListServiceImpl.java index 10a16b2..d3c0ab9 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareListServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareListServiceImpl.java @@ -21,7 +21,10 @@ import com.budwk.app.web.commons.auth.utils.AuthUtil; import com.budwk.app.web.commons.auth.utils.SecurityUtil; import com.budwk.app.zhgh.welfare.mode.CourierNumberExcelMode; import com.budwk.app.zhgh.welfare.model.*; +import com.budwk.app.zhgh.welfare.param.WelfareFilterUserPageForm; +import com.budwk.app.zhgh.welfare.param.WelfareListPageForm; import com.budwk.app.zhgh.welfare.service.WelfareListService; +import lombok.extern.slf4j.Slf4j; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.nutz.dao.Chain; @@ -47,6 +50,7 @@ import java.util.stream.Collectors; * @Date 2024/8/12 17:42 */ @IocBean(args = {"refer:dao"}) +@Slf4j public class WelfareListServiceImpl extends BaseServiceImpl implements WelfareListService { public WelfareListServiceImpl(Dao dao) { super(dao); @@ -373,4 +377,165 @@ public class WelfareListServiceImpl extends BaseServiceImpl impleme }).collect(Collectors.toList()); insert(welfareLists); } + + + @Override + public Pagination pageData(WelfareListPageForm pageForm) { + Sql sql = Sqls.create(""" + SELECT + t1.*, + t2.loginname, + t2.username, + t2.sex, + t2.birthday + FROM + `welfare_list` t1 + LEFT JOIN sys_user t2 ON t2.id = t1.userId + $condition + """); + Cnd cnd = Cnd.NEW(); + if (StrUtil.isNotBlank(pageForm.getUserName())) { + cnd.where().andLike("t2.username", pageForm.getUserName()); + } + if (StrUtil.isNotBlank(pageForm.getLoginName())) { + cnd.where().andLike("t2.loginname", pageForm.getLoginName()); + } + cnd.andEX("t2.sex", "=", pageForm.getSex()); + cnd.andEX("t2.birthday", "=", pageForm.getBirthday()); + if (pageForm.getBirthMonths() != null && pageForm.getBirthMonths().length > 0) { + cnd.andEX("MONTH(t2.birthday)", "in", pageForm.getBirthMonths()); + } + cnd.andEX("t1.welfareUnitId", "in", pageForm.getUnitIds()); + cnd.andEX("t1.welfareUnionId", "=", pageForm.getUnionId()); + cnd.andEX("t1.personType", "in", pageForm.getPersonTypes()); + cnd.andEX("t1.preparedBy", "in", pageForm.getPreparedBys()); + cnd.andEX("t1.userState", "in", pageForm.getUserStates()); + + sql.setCondition(cnd); + Pagination pagination = listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return pagination; + } + + @Override + public Pagination notWelfareUserPageData(WelfareFilterUserPageForm pageForm) { + Sql sql = Sqls.create(""" + SELECT + id, + loginname, + username, + sex, + birthday, + personType, + preparedBy, + userState, + unitId, + unitName, + unionId, + unionName, + member + FROM + vw_user + $condition + """); + Cnd cnd = Cnd.NEW(); + if (StrUtil.isNotBlank(pageForm.getUserName())) { + cnd.where().andLike("username", pageForm.getUserName()); + } + if (StrUtil.isNotBlank(pageForm.getLoginName())) { + cnd.where().andLike("loginname", pageForm.getLoginName()); + } + cnd.andEX("sex", "=", pageForm.getSex()); + cnd.andEX("birthday", "=", pageForm.getBirthday()); + if (pageForm.getBirthMonths() != null && pageForm.getBirthMonths().length > 0) { + cnd.andEX("MONTH(birthday)", "in", pageForm.getBirthMonths()); + } + cnd.andEX("unionId", "=", pageForm.getUnionId()); + cnd.andEX("unitId", "in", pageForm.getUnitIds()); + cnd.andEX("personType", "in", pageForm.getPersonTypes()); + cnd.andEX("preparedBy", "in", pageForm.getPreparedBys()); + cnd.andEX("userState", "in", pageForm.getUserStates()); + + if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { + cnd.asc("unionCode"); + cnd.asc("unitCode"); + cnd.asc("sex"); + } else { + cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy())); + } + + cnd.and("id", "not in", Sqls.create("select userId from `welfare_list` where projectId = @projectId").setParam("projectId", pageForm.getProjectId())); + + sql.setCondition(cnd); + return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + } + + @Override + public void addWelfareUser(WelfareFilterUserPageForm pageForm) { + Sql sql = Sqls.create(""" + SELECT + id, + loginname, + username, + sex, + birthday, + personType, + preparedBy, + userState, + unitId, + unitName, + unionId, + unionName, + member + FROM + vw_user + $condition + """); + Cnd cnd = Cnd.NEW(); + if (StrUtil.isNotBlank(pageForm.getUserName())) { + cnd.where().andLike("username", pageForm.getUserName()); + } + if (StrUtil.isNotBlank(pageForm.getLoginName())) { + cnd.where().andLike("loginname", pageForm.getLoginName()); + } + cnd.andEX("sex", "=", pageForm.getSex()); + cnd.andEX("birthday", "=", pageForm.getBirthday()); + if (pageForm.getBirthMonths() != null && pageForm.getBirthMonths().length > 0) { + cnd.andEX("MONTH(birthday)", "in", pageForm.getBirthMonths()); + } + cnd.andEX("unionId", "=", pageForm.getUnionId()); + cnd.andEX("unitId", "in", pageForm.getUnitIds()); + cnd.andEX("personType", "in", pageForm.getPersonTypes()); + cnd.andEX("preparedBy", "in", pageForm.getPreparedBys()); + cnd.andEX("userState", "in", pageForm.getUserStates()); + + if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { + cnd.asc("unionCode"); + cnd.asc("unitCode"); + cnd.asc("sex"); + } else { + cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy())); + } + + cnd.and("id", "not in", Sqls.create("select userId from `welfare_list` where projectId = @projectId").setParam("projectId", pageForm.getProjectId())); + + sql.setCondition(cnd); + List list = listMap(sql); + + // 插入到福利名单表中 + List welfareList = list.stream().map(user -> { + WelfareList wl = new WelfareList(); + wl.setProjectId(pageForm.getProjectId()); + wl.setUserId(user.getString("id")); + wl.setWelfareUnitId(user.getString("unionId")); + wl.setWelfareUnitName(user.getString("unitName")); + wl.setWelfareUnionId(user.getString("unionId")); + wl.setWelfareUnionName(user.getString("unionName")); + wl.setPersonType(user.getString("personType")); + wl.setPreparedBy(user.getString("preparedBy")); + wl.setUserState(user.getString("userState")); + return wl; + }).toList(); + log.info("选择用户生成福利名单,筛选条件:{},筛选结果条数:{}", Json.toJson(pageForm), welfareList.size()); + dao().insert(welfareList); + } } diff --git a/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareProjectServiceImpl.java b/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareProjectServiceImpl.java index 71bf2c1..1687d6d 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareProjectServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareProjectServiceImpl.java @@ -3,22 +3,30 @@ package com.budwk.app.zhgh.welfare.service.impl; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import com.budwk.app.base.page.Pagination; import com.budwk.app.base.service.impl.BaseServiceImpl; +import com.budwk.app.base.utils.PageUtil; import com.budwk.app.sys.models.Sys_home_activity; import com.budwk.app.sys.models.Sys_user; import com.budwk.app.web.commons.auth.utils.SecurityUtil; import com.budwk.app.zhgh.welfare.model.*; +import com.budwk.app.zhgh.welfare.param.WelfareFilterUserPageForm; import com.budwk.app.zhgh.welfare.service.WelfareProjectService; +import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.dao.Chain; import org.nutz.dao.Cnd; import org.nutz.dao.Dao; import org.nutz.dao.Sqls; import org.nutz.dao.sql.Sql; import org.nutz.dao.util.cri.Static; +import org.nutz.ioc.aop.Aop; import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.json.Json; import org.nutz.lang.Lang; import org.nutz.lang.random.R; import org.nutz.lang.util.NutMap; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.Date; @@ -33,99 +41,51 @@ import java.util.stream.Collectors; */ @IocBean(args = {"refer:dao"}) public class WelfareProjectServiceImpl extends BaseServiceImpl implements WelfareProjectService { + private static final Logger log = LoggerFactory.getLogger(WelfareProjectServiceImpl.class); + public WelfareProjectServiceImpl(Dao dao) { super(dao); } @Override public WelfareProject projectInfo(String projectId) { - WelfareProject project = fetchLinks(dao().fetch(WelfareProject.class, Cnd.where("id", "=", projectId)), "welfareProjectSubjects"); - List welfareProjectSubjects = project.getWelfareProjectSubjects(); - Sql sqlo = Sqls.create(""" - SELECT - optionName - FROM - welfare_project_subject_option - WHERE - id IN ( SELECT selectOptionId FROM welfare_project_user_selection WHERE selectUserId = @userid AND welfareId = @welfareId ) - ORDER BY - optionSort ASC - """); - sqlo.setParam("userid", SecurityUtil.getUserId()); - sqlo.setParam("welfareId", project.getId()); - List optionNameList = listMap(sqlo); - if (Lang.isNotEmpty(optionNameList)) { - project.setGift(optionNameList.stream().map(x -> x.getString("optionName")).collect(Collectors.joining("、"))); - } - if (Lang.isNotEmpty(welfareProjectSubjects)) { - fetchLinks(welfareProjectSubjects, "options", Cnd.NEW().asc("optionSort")); - } + WelfareProject project = fetch(projectId); + fetchLinks(project, "options"); return project; } @Override - public void save(WelfareProject project) { - if (StrUtil.isBlank(project.getId())) { - project.setYear(DateUtil.thisYear()); - WelfareProject insertProject = insertWith(project, "welfareProjectSubjects"); - if (Lang.isNotEmpty(insertProject.getWelfareProjectSubjects())) { - insertProject.getWelfareProjectSubjects().forEach(v -> { - insertLinks(v, "options"); - }); - } - } else { - dao().clear(WelfareProjectSubjectOption.class, Cnd.NEW().and(new Static("subjectId in (select id from welfare_project_subject where projectId = '%s')".formatted(project.getId())))); - dao().clear(WelfareProjectSubject.class, Cnd.where("projectId", "=", project.getId())); - - update(project); - - List newSubject = project.getWelfareProjectSubjects(); - - if (Lang.isNotEmpty(newSubject)) { - newSubject.forEach(v -> { - if (v.getId() == null) { - v.setId(R.UU32()); - v.setProjectId(project.getId()); - } - - Chain chain = Chain.make("id", v.getId()); - chain.add("projectId", v.getProjectId()); - chain.add("subjectName", v.getSubjectName()); - chain.add("subjectType", v.getSubjectType()); - dao().insert(WelfareProjectSubject.class, chain); - - List options = v.getOptions(); - options.forEach(o -> { - if (o.getId() == null) { - o.setId(R.UU32()); - o.setSubjectId(v.getId()); - } - Chain optionChain = Chain.make("id", o.getId()); - optionChain.add("subjectId", o.getSubjectId()); - optionChain.add("optionName", o.getOptionName()); - optionChain.add("optionNameId", o.getOptionNameId()); - optionChain.add("optionType", o.getOptionType()); - optionChain.add("isDefaultOption", o.getIsDefaultOption()); - optionChain.add("isSystemDefault", o.getIsSystemDefault()); - optionChain.add("optionSort", o.getOptionSort()); - optionChain.add("imgUrl", o.getImgUrl()); - optionChain.add("description", o.getDescription()); - optionChain.add("shoppingId", o.getShoppingId()); - optionChain.add("shoppingName", o.getShoppingName()); - optionChain.add("supplier", o.getSupplier()); - optionChain.add("simpleDesc", o.getSimpleDesc()); - dao().insert(WelfareProjectSubjectOption.class, optionChain); - }); - }); - } - update(project); - } + @Aop(TransAop.READ_COMMITTED) + public void saveProject(WelfareProject project) { + // 插入项目 + project.setYear(DateUtil.thisYear()); + insertWith(project, "options"); + // 更新首页活动 Sys_home_activity sysHomeActivity = project.covertToSysHomeActivity(); dao().insertOrUpdate(sysHomeActivity); } @Override + @Aop(TransAop.READ_COMMITTED) + public void updateProject(WelfareProject project) { + // 更新项目 + update(project); + + // 新增或更新选项 + for (WelfareProjectSubjectOption option : project.getOptions()) { + option.setWelfareId(project.getId()); + dao().insertOrUpdate(option); + } + + // 更新首页活动 + Sys_home_activity sysHomeActivity = project.covertToSysHomeActivity(); + dao().insertOrUpdate(sysHomeActivity); + + } + + @Override + @Aop(TransAop.READ_COMMITTED) public void deleteWelfare(String id) { WelfareProjectSubject welfareProjectSubject = dao().fetch(WelfareProjectSubject.class, Cnd.where("projectId", "=", id)); dao().clear(WelfareProjectSubject.class, Cnd.where("projectId", "=", id)); @@ -204,28 +164,12 @@ public class WelfareProjectServiceImpl extends BaseServiceImpl i } @Override - public List getWelfareList(Integer year) { - List projectList = query(Cnd.NEW().andEX("year", "=", year).desc("choiceTimeStart")); - List maps = new ArrayList<>(); - projectList.forEach(v -> { - NutMap map = new NutMap(); - map.setv("id", v.getId()); - map.setv("name", v.getName()); - map.setv("provideMode", v.getProvideMode()); - map.setv("signMode", v.getSignMode()); - map.setv("isCheckBox", v.getIsCheckBox()); - map.setv("multiSelectNum", v.getMultiSelectNum()); - map.setv("choiceTimeStart", v.getChoiceTimeStart()); - map.setv("choiceTimeEnd", v.getChoiceTimeEnd()); - map.setv("singleOptionSupportMultipleSelection", v.getSingleOptionSupportMultipleSelection()); - WelfareProjectSubject subject = dao().fetch(WelfareProjectSubject.class, Cnd.where("projectId", "=", v.getId())); - if(ObjectUtil.isNotNull(subject)){ - List optionList = dao().query(WelfareProjectSubjectOption.class, Cnd.where("subjectId", "=", subject.getId())); - map.setv("optionList", optionList); - } - maps.add(map); - }); - return maps; + public List getWelfareList(Integer year) { + List list = dao().query(WelfareProject.class, Cnd.NEW().andEX("year", "=", year).desc(WelfareProject::getChoiceTimeStart)); + for (WelfareProject project : list) { + dao().fetchLinks(project, "options"); + } + return list; } private void joinWelfareList(List users, String projectId) { @@ -242,4 +186,6 @@ public class WelfareProjectServiceImpl extends BaseServiceImpl i } dao().insert(lists); } + + } diff --git a/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareSingleServiceImpl.java b/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareSingleServiceImpl.java index 4c45bea..512a8db 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareSingleServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareSingleServiceImpl.java @@ -51,9 +51,7 @@ public class WelfareSingleServiceImpl extends BaseServiceImpl implements Welfare @Override public NutMap pageData(String projectId, String unionId) { Cnd cnd = Cnd.NEW(); - if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), - RoleConstant.SCHOOL_UNION_ADMIN.name(), - RoleConstant.SCHOOL_UNION_WELFARE_ADMIN.name())) { + if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_WELFARE_ADMIN.name())) { cnd.and("id", "=", SecurityUtil.getUnionId()); } cnd.andEX("id", "=", unionId); @@ -62,13 +60,13 @@ public class WelfareSingleServiceImpl extends BaseServiceImpl implements Welfare sqlUnion.setCondition(cnd); List sysUnions = listMap(sqlUnion); - Sql sqlViewList = Sqls.create("SELECT * FROM welfare_list where projectId=@projectId and welfareUnitId is not null").setParam("projectId", projectId); + Sql sqlViewList = Sqls.create("SELECT * FROM welfare_list where projectId=@projectId and welfareUnionId is not null").setParam("projectId", projectId); List viewMap = listMap(sqlViewList); //循环每个分工会 sysUnions.forEach(v -> { //找出这个分工会的人数 - List collect = viewMap.stream().filter(view -> view.getString("welfareUnitId").equals(v.getString("id"))).collect(Collectors.toList()); + List collect = viewMap.stream().filter(view -> view.getString("welfareUnionId").equals(v.getString("id"))).toList(); v.addv("teacherSum", collect.size()); }); @@ -81,10 +79,7 @@ public class WelfareSingleServiceImpl extends BaseServiceImpl implements Welfare for (NutMap wUnit : sysUnions) { //该分工会选择数据 List thisUnionSelectionList; - thisUnionSelectionList = userSelectionList.stream().filter(x -> - x.getString("unionId").equals(wUnit.getString("id")) && - x.getString("welfareId").equals(projectId)).collect(Collectors.toList()); -// + thisUnionSelectionList = userSelectionList.stream().filter(x -> x.getString("unionId").equals(wUnit.getString("id")) && x.getString("welfareId").equals(projectId)).toList(); optionList.forEach(o -> { int count = 0; count = userSelectionList.stream().filter(x -> @@ -94,9 +89,9 @@ public class WelfareSingleServiceImpl extends BaseServiceImpl implements Welfare wUnit.put(o.getString("optionName"), count); }); //已选人数 - wUnit.put("totalCount", thisUnionSelectionList.stream().map(v -> v.getString("selectUserId")).distinct().count()); + wUnit.put("selectedNum", thisUnionSelectionList.stream().map(v -> v.getString("selectUserId")).distinct().count()); //未选人数 - wUnit.put("unselectedTeacherSum", wUnit.getInt("teacherSum") - wUnit.getInt("totalCount")); + wUnit.put("unSelectedNum", wUnit.getInt("teacherSum") - wUnit.getInt("totalCount")); } //表格列数据 @@ -105,8 +100,8 @@ public class WelfareSingleServiceImpl extends BaseServiceImpl implements Welfare optionList.forEach(v -> { labelList.add(NutMap.NEW().addv("label", v.getString("optionName")).addv("prop", v.getString("optionName"))); }); - labelList.add(NutMap.NEW().addv("label", "参加人数").addv("prop", "totalCount")); - labelList.add(NutMap.NEW().addv("label", "未选人数").addv("prop", "unselectedTeacherSum")); + labelList.add(NutMap.NEW().addv("label", "已选人数").addv("prop", "selectedNum")); + labelList.add(NutMap.NEW().addv("label", "未选人数").addv("prop", "unSelectedNum")); return NutMap.NEW().addv("tableList", sysUnions).addv("tableColumn", labelList); } diff --git a/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareStatisticsServiceImpl.java b/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareStatisticsServiceImpl.java new file mode 100644 index 0000000..2870c8e --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareStatisticsServiceImpl.java @@ -0,0 +1,248 @@ +package com.budwk.app.zhgh.welfare.service.impl; + +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; +import cn.hutool.core.util.StrUtil; +import com.budwk.app.base.page.Pagination; +import com.budwk.app.base.param.PageForm; +import com.budwk.app.base.service.impl.BaseServiceImpl; +import com.budwk.app.base.utils.CommonDownloadUtil; +import com.budwk.app.sys.models.Sys_union; +import com.budwk.app.zhgh.welfare.model.WelfareProject; +import com.budwk.app.zhgh.welfare.model.WelfareProjectSubjectOption; +import com.budwk.app.zhgh.welfare.service.WelfareStatisticsService; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.usermodel.Workbook; +import org.nutz.dao.Cnd; +import org.nutz.dao.Dao; +import org.nutz.dao.FieldFilter; +import org.nutz.dao.Sqls; +import org.nutz.dao.sql.Sql; +import org.nutz.dao.util.Daos; +import org.nutz.dao.util.cri.SqlExpressionGroup; +import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.lang.util.NutMap; + +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +@IocBean(args = {"refer:dao"}) +@Slf4j +public class WelfareStatisticsServiceImpl extends BaseServiceImpl implements WelfareStatisticsService { + public WelfareStatisticsServiceImpl(Dao dao) { + super(dao); + } + + @Override + public Pagination selectedUnionUserPageData(PageForm pageForm, String projectId, String unionId) { + Sql sql = Sqls.create(""" + SELECT + u.loginname AS loginName, + u.username AS userName, + wl.welfareUnitName, + wl.welfareUnionName, + wpus.mobile, + GROUP_CONCAT(DISTINCT wpso.optionName, '(', wpus.selectNum, '份)') selectOptionName + FROM + welfare_project_user_selection wpus + LEFT JOIN welfare_list wl on wl.userId = wpus.selectUserId AND wl.projectId = wpus.welfareId + LEFT JOIN sys_user u ON u.id = wpus.selectUserId + LEFT JOIN welfare_project_subject_option wpso ON wpso.id = wpus.selectOptionId + $condition + """); + Cnd cnd = Cnd.NEW(); + cnd.and("wl.welfareUnionId", "=", unionId); + cnd.and("wpus.welfareId", "=", projectId); + cnd.groupBy("u.loginname"); + cnd.desc("wl.welfareUnionName").desc("wl.welfareUnitName").desc("wpus.selectOptionId"); + + if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) { + SqlExpressionGroup seg = new SqlExpressionGroup(); + seg.orLike("u.loginname", pageForm.getSearchKeyword()); + seg.orLike("u.username", pageForm.getSearchKeyword()); + } + sql.setCondition(cnd); + Pagination pagination = listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return pagination; + } + + @Override + public void exportSelectedUnionUser(String projectId, String unionId, HttpServletResponse response) { + Sql sql = Sqls.create(""" + SELECT + u.loginname AS loginName, + u.username AS userName, + wl.welfareUnitName, + wl.welfareUnionName, + wpus.mobile, + GROUP_CONCAT(DISTINCT wpso.optionName, '(', wpus.selectNum, '份)') selectOptionName + FROM + welfare_project_user_selection wpus + LEFT JOIN welfare_list wl on wl.userId = wpus.selectUserId AND wl.projectId = wpus.welfareId + LEFT JOIN sys_user u ON u.id = wpus.selectUserId + LEFT JOIN welfare_project_subject_option wpso ON wpso.id = wpus.selectOptionId + $condition + """); + + Cnd cnd = Cnd.NEW(); + cnd.and("wl.welfareUnionId", "=", unionId); + cnd.and("wpus.welfareId", "=", projectId); + cnd.groupBy("u.loginname"); + cnd.desc("wl.welfareUnionName").desc("wl.welfareUnitName").desc("wpus.selectOptionId"); + sql.setCondition(cnd); + List list = listMap(sql); + + // 项目名称 + Dao projectDao = Daos.ext(dao(), FieldFilter.create(WelfareProject.class, "name")); + WelfareProject welfareProject = projectDao.fetch(WelfareProject.class, projectId); + String projectName = welfareProject.getName(); + + // 分工会名称 + Sys_union union = dao().fetch(Sys_union.class, unionId); + String unionName = Optional.ofNullable(union).map(Sys_union::getName).orElse(""); + + // excel列 + List entities = new ArrayList<>(); + entities.add(new ExcelExportEntity("工号", "loginName", 20)); + entities.add(new ExcelExportEntity("姓名", "userName", 20)); + entities.add(new ExcelExportEntity("单位", "welfareUnitName", 20)); + entities.add(new ExcelExportEntity("工会", "welfareUnionName", 20)); + entities.add(new ExcelExportEntity("手机号", "mobile", 20)); + entities.add(new ExcelExportEntity("所选福利", "selectOptionName", 20)); + + // 设置导出参数 + ExportParams exportParams = new ExportParams(); + exportParams.setType(ExcelType.XSSF); + // 导出Excel并下载 + try (Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, list)) { + CommonDownloadUtil.download(projectName + unionName + "已选择人员.xlsx", workbook, response); + } catch (Exception e) { + log.error("导出Excel失败", e); + } + } + + @Override + public Pagination unSelectedUnionUserPageData(PageForm pageForm, String projectId, String unionId) { + Sql sql = Sqls.create(""" + SELECT + u.loginname AS loginName, + u.username AS userName, + wl.welfareUnitName, + wl.welfareUnionName + FROM + `welfare_list` wl + LEFT JOIN welfare_project_user_selection wpus ON wl.userId = wpus.selectUserId + AND wpus.welfareId = @projectId + LEFT JOIN sys_user u ON u.id = wl.userId + WHERE + wl.projectId = @projectId + AND wl.welfareUnionId = @unionId + AND wpus.selectUserId IS NULL + GROUP BY + u.loginname + ORDER BY + wl.welfareUnionName DESC, + wl.welfareUnitName DESC + """); + sql.setParam("projectId", projectId); + sql.setParam("unionId", unionId); + Pagination pagination = listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return pagination; + } + + @Override + public void exportUnSelectedUnionUser(String projectId, String unionId, HttpServletResponse response) { + Sql sql = Sqls.create(""" + SELECT + u.loginname AS loginName, + u.username AS userName, + wl.welfareUnitName, + wl.welfareUnionName + FROM + `welfare_list` wl + LEFT JOIN welfare_project_user_selection wpus ON wl.userId = wpus.selectUserId + AND wpus.welfareId = @projectId + LEFT JOIN sys_user u ON u.id = wl.userId + WHERE + wl.projectId = @projectId + AND wl.welfareUnionId = @unionId + AND wpus.selectUserId IS NULL + GROUP BY + u.loginname + ORDER BY + wl.welfareUnionName DESC, + wl.welfareUnitName DESC + """); + sql.setParam("projectId", projectId); + sql.setParam("unionId", unionId); + List list = listMap(sql); + + // 项目名称 + Dao projectDao = Daos.ext(dao(), FieldFilter.create(WelfareProject.class, "name")); + WelfareProject welfareProject = projectDao.fetch(WelfareProject.class, projectId); + String projectName = welfareProject.getName(); + + // 分工会名称 + Sys_union union = dao().fetch(Sys_union.class, unionId); + String unionName = Optional.ofNullable(union).map(Sys_union::getName).orElse(""); + + // excel列 + List entities = new ArrayList<>(); + entities.add(new ExcelExportEntity("工号", "loginName", 20)); + entities.add(new ExcelExportEntity("姓名", "userName", 20)); + entities.add(new ExcelExportEntity("单位", "welfareUnitName", 20)); + entities.add(new ExcelExportEntity("工会", "welfareUnionName", 20)); + + // 设置导出参数 + ExportParams exportParams = new ExportParams(); + exportParams.setType(ExcelType.XSSF); + // 导出Excel并下载 + try (Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, list)) { + CommonDownloadUtil.download(projectName + unionName + "未选择人员.xlsx", workbook, response); + } catch (Exception e) { + log.error("导出Excel失败", e); + } + } + + + @Override + public void exportUnionExcel(String projectId, HttpServletResponse response) { + Sql sql = Sqls.create(""" + SELECT + u.loginname AS loginName, + u.username AS userName, + wl.welfareUnitName, + wl.welfareUnionName, + wpus.mobile, + GROUP_CONCAT(DISTINCT wpso.optionName, '(', wpus.selectNum, '份)') selectOptionName + FROM + welfare_project_user_selection wpus + LEFT JOIN welfare_list wl on wl.userId = wpus.selectUserId AND wl.projectId = wpus.welfareId + LEFT JOIN sys_user u ON u.id = wpus.selectUserId + LEFT JOIN welfare_project_subject_option wpso ON wpso.id = wpus.selectOptionId + $condition + """); + Cnd cnd = Cnd.NEW(); + cnd.and("wpus.welfareId", "=", projectId); + cnd.groupBy("u.loginname"); + cnd.desc("wl.welfareUnionName").desc("wl.welfareUnitName").desc("wpus.selectOptionId"); + sql.setCondition(cnd); + List list = listMap(sql); + + List entities = new ArrayList<>(); + entities.add(new ExcelExportEntity("分工会", "loginName", 20)); + } + + + @Override + public void exportByWelfareOptions(String projectId, HttpServletResponse response) { + List options = dao().query(WelfareProjectSubjectOption.class, Cnd.where(WelfareProjectSubjectOption::getWelfareId, "=", projectId)); + + + + } +} diff --git a/src/main/resources/views/platform/zhgh/welfare/ProjectMange/welfareOptionTable.js b/src/main/resources/views/platform/zhgh/welfare/ProjectMange/welfareOptionTable.js deleted file mode 100644 index e043b9f..0000000 --- a/src/main/resources/views/platform/zhgh/welfare/ProjectMange/welfareOptionTable.js +++ /dev/null @@ -1,224 +0,0 @@ -let WELFARE_OPTION_TABLE = { - template: ` -
- - - - - - -
- - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - 添加福利 - -
-
-
-
- -
-
- - - - - 取 消 - 确 定 - - -
-`, - watch: { - subject(val) { - } - }, - props: { - subject: { - type: Array, - default: [] - } - }, - data() { - return { - descRichTextContent: "", - files: [], - shoppingTypeOptions: null, - richTextDialog: false, - subjectIndex: 0, - optionIndex: 0, - imgPopover: false, - idx: null, - oidx: null, - - } - }, - methods: { - deleteRow(options, row, index) { - options.splice(index, 1) - const shoppingTypeOption = this.shoppingTypeOptions.find(v => v.id === row.optionNameId) - shoppingTypeOption.disabled = false - }, - addSubject(type) { - let subject = { - subjectName: '题目' + (this.subject.length + 1), - subjectType: type, - options: [ - {optionName: '选项一', imgUrl: null}, - {optionName: '选项一', imgUrl: null} - ] - } - this.subject.push(subject) - }, - validate(fn) { - if (this._validate()) { - return false - } - return true - - }, - _validate() { - return this.subject.some(v => { - if (!v.subjectName) return true - return v.options.some(x => { - if (!x.optionName) return true - }) - }) - }, - openDescRichText(description, sIdx, oIdx) { - this.descRichTextContent = description - this.richTextDialog = true - this.subjectIndex = sIdx - this.optionIndex = oIdx - }, - saveRichText() { - this.subject[this.subjectIndex]['options'][this.optionIndex].description = this.descRichTextContent - this.richTextDialog = false - }, - } -} - -/**/ diff --git a/src/main/resources/views/platform/zhgh/welfare/addressManage/addressDialog.js b/src/main/resources/views/platform/zhgh/welfare/addressManage/addressDialog.js index 65e6d0b..611fcab 100644 --- a/src/main/resources/views/platform/zhgh/welfare/addressManage/addressDialog.js +++ b/src/main/resources/views/platform/zhgh/welfare/addressManage/addressDialog.js @@ -1,35 +1,30 @@ let ADDRESS_DIALOG = { - template: ` - + template: /*language=HTML*/ ` + - - - + + :options="dzOptions" + :props="{ expandTrigger: 'hover' }" + @change="handleChange" + clearable + placeholder="请选择地址信息" + style="width: 100%" + v-model="formData.addressList"> - - + :rules="{required:true,message: '请填写您的详细地址', trigger: 'blur'}" + label="详细地址" + prop="addressDetail"> - - + :rules="{required:true,message: '请填写收货人姓名', trigger: 'blur'}" + label="收货人姓名" + prop="userName"> - - + :rules="{required:true,message: '请填写手机号码', trigger: 'blur'}" + label="手机号码" + prop="tel"> - - - + - - 取 消 - 保存 - - -`, + + 取 消 + 保存 + + + `, mixins: [initTableMixins], data() { return { dzOptions: chengShiList, - dialogVisible: false, + dialogVisible: false } }, methods: { @@ -101,16 +90,16 @@ let ADDRESS_DIALOG = { doSaveUserAddress() { this.$refs["addForm"].validate(async (valid) => { if (valid) { - const resp = await this.$axios.post("/platform/welfare/addressManage/doSaveUserAddress", {data: JSON.stringify(this.formData)}) + const resp = await this.$axios.post("/platform/welfare/addressManage/doSaveUserAddress", { data: JSON.stringify(this.formData) }) if (resp.code === 0) { this.$message({ message: resp.msg, - type: 'success' - }); + type: "success" + }) this.$emit("select_user_address") this.dialogVisible = false } else { - this.$message.error(resp.msg); + this.$message.error(resp.msg) } } }) @@ -121,7 +110,7 @@ let ADDRESS_DIALOG = { row.addressList.push(province.value) const city = province.children.find(p => p.label === row.city) row.addressList.push(city.value) - if (row.county){ + if (row.county) { const county = city.children.find(p => p.label === row.county) if (county) { row.addressList.push(county.value) @@ -130,7 +119,7 @@ let ADDRESS_DIALOG = { this.formData = row this.dialogVisible = true - }, + } } } diff --git a/src/main/resources/views/platform/zhgh/welfare/mine/CourierNumberInfo.js b/src/main/resources/views/platform/zhgh/welfare/mine/CourierNumberInfo.js deleted file mode 100644 index e088dc8..0000000 --- a/src/main/resources/views/platform/zhgh/welfare/mine/CourierNumberInfo.js +++ /dev/null @@ -1,73 +0,0 @@ -let COURIER_NUMBER_INFO = { - template: ` - - - -
-
- 此套餐有多个快递单号 -
- -
-
- 快递单号 - {{ item.courierNumber || '暂无' }} -
- -
- - - {{ timeline.desc }} - - -
- -
-
-
-
-
-
-
- 暂无数据 -
-
- `, - data() { - return { - dialogVisible: false, - courierNumberInfoData: [], - activeName: null, - loading: true - } - }, - methods: { - async openView(welfareId, userId) { - this.dialogVisible = true - this.loading = true - const { code, data, msg } = await this.$axios.post("/platform/welfare/mine/courierNumberInfo", { welfareId, userId }) - this.loading = false - if (code === 0) { - if (data == null || data.length === 0) { - this.dialogVisible = false - this.$message.warning("您还没有选择福利套餐") - return - } - this.courierNumberInfoData = data - const keys = Object.keys(this.courierNumberInfoData) - this.activeName = keys && keys[0] - } else { - this.$message.warning(msg) - } - } - } -} diff --git a/src/main/resources/views/platform/zhgh/welfare/mine/index.html b/src/main/resources/views/platform/zhgh/welfare/mine/index.html index ae1f591..d7a48b9 100644 --- a/src/main/resources/views/platform/zhgh/welfare/mine/index.html +++ b/src/main/resources/views/platform/zhgh/welfare/mine/index.html @@ -66,7 +66,6 @@ layout("/layouts/platform.html"){ @@ -74,115 +73,29 @@ layout("/layouts/platform.html"){ {{row.receiveAddress}} 暂无 - - - - - - - - - - - - - {{item.optionName}} - 未评价 - - - - - - -
- -
-
- - - -
- - 关 闭 - 提 交 - -
- - - -
-
-
- - - - - - - {{item.desc}} - - - - - - - + - diff --git a/src/main/resources/views/platform/zhgh/welfare/mine/selectView.js b/src/main/resources/views/platform/zhgh/welfare/mine/selectView.js new file mode 100644 index 0000000..fc3b5d1 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/welfare/mine/selectView.js @@ -0,0 +1,517 @@ +const selectView = { + template: /*language=HTML*/ ` + +
+ +
+
+ + 项目基本信息 +
+
+
+
项目名称
+
{{ projectInfo.name }}
+
+
+
选择时间
+
{{ projectInfo.choiceTimeStart }} 至 {{ projectInfo.choiceTimeEnd }}
+
+
+
发放时间
+
{{ projectInfo.provideTimeStart }} 至 {{ projectInfo.provideTimeEnd }}
+
+
+
发放地点
+
{{ projectInfo.provideAddress }}
+
+
+
+ + +
+
+ + 联系信息 +
+
+
+
联系电话
+
{{ mergedSelections[0]?.mobile || '暂无' }}
+
+
+
+ + +
+
+ + 我的选择 +
+ +
+
+
+ +
+ +
+
+
+
+
{{ item.optionName }}
+
+
+ 数量: + {{ item.selectNum }} +
+
+ 选择时间: + {{ item.selectTime }} +
+
+
+ + 查看详情 + +
+
+
+ 已选择 +
+
+
+ +
+ + 您还未选择任何福利项目 +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ `, + data() { + return { + projectId: null, + visible: false, + loading: false, + projectInfo: { + name: "", + choiceTimeStart: "", + choiceTimeEnd: "", + provideTimeStart: "", + provideTimeEnd: "", + provideAddress: "", + options: [] + }, + selectedOptions: [], + detailDialogVisible: false, + currentOption: null + } + }, + computed: { + mergedSelections() { + return this.selectedOptions.map((item) => { + const option = this.projectInfo.options?.find((opt) => opt.id === item.selectOptionId) || {} + return { + ...item, + optionName: option.optionName || "未知选项", + imgUrl: option.imgUrl, + description: option.description + } + }) + } + }, + methods: { + onOpen(id) { + this.projectId = id + this.visible = true + this.loadData() + }, + + async loadData() { + this.loading = true + await this.getProjectInfo() + await this.getUserSelections() + this.loading = false + }, + + async getProjectInfo() { + const { code, data, msg } = await this.$axios.post("/platform/welfare/common/projectInfo", { + id: this.projectId + }) + if (code === 0) { + this.projectInfo = data + } + }, + + async getUserSelections() { + const { code, data, msg } = await this.$axios.post("/platform/welfare/userSelect/getUserSelection", { projectId: this.projectId }) + if (code === 0) { + this.selectedOptions = data || [] + } + }, + + showOptionDetail(option) { + this.currentOption = option + this.detailDialogVisible = true + } + }, + style: /*language=CSS*/ ` + .welfare-select-view-dialog .el-dialog__body { + padding: 20px; + } + + /* 项目信息卡片 */ + .project-info-card { + background: #fff; + border-radius: 8px; + box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); + margin-bottom: 16px; + overflow: hidden; + } + + .project-info-header { + padding: 14px 16px; + border-bottom: 1px solid #EBEEF5; + font-size: 16px; + font-weight: 600; + color: #303133; + display: flex; + align-items: center; + background: linear-gradient(135deg, #f8f9fb 0%, #fff 100%); + } + + .project-info-header i { + margin-right: 8px; + color: var(--color-primary); + font-size: 18px; + } + + .project-info-content { + padding: 0; + } + + .info-item { + display: flex; + align-items: center; + padding: 12px 16px; + border-bottom: 1px solid #EBEEF5; + } + + .info-item:last-child { + border-bottom: none; + } + + .info-label { + width: 100px; + color: #606266; + font-weight: 500; + flex-shrink: 0; + } + + .info-value { + flex: 1; + color: #303133; + } + + /* 选择卡片 */ + .my-selections-card { + background: #fff; + border-radius: 8px; + box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); + overflow: hidden; + } + + .selections-header { + padding: 14px 16px; + border-bottom: 1px solid #EBEEF5; + font-size: 16px; + font-weight: 600; + color: #303133; + display: flex; + align-items: center; + background: linear-gradient(135deg, #f8f9fb 0%, #fff 100%); + } + + .selections-header i { + margin-right: 8px; + color: var(--color-primary); + font-size: 18px; + } + + .selections-content { + padding: 16px; + } + + .selection-item { + display: flex; + align-items: center; + padding: 12px; + border-radius: 6px; + margin-bottom: 12px; + background: #f8f9fb; + transition: all 0.3s; + } + + .selection-item:last-child { + margin-bottom: 0; + } + + .selection-item:hover { + transform: translateX(4px); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); + } + + .selection-item-image { + width: 80px; + height: 80px; + border-radius: 4px; + overflow: hidden; + flex-shrink: 0; + } + + .selection-item-image .el-image { + width: 100%; + height: 100%; + } + + .image-placeholder { + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + background: #f5f7fa; + color: #909399; + font-size: 24px; + } + + .selection-item-info { + flex: 1; + padding: 0 16px; + display: flex; + flex-direction: column; + } + + .selection-item-name { + font-size: 15px; + font-weight: 600; + color: #303133; + margin-bottom: 6px; + } + + .selection-item-meta { + margin-bottom: 8px; + } + + .selection-item-count, .selection-item-time { + font-size: 13px; + color: #606266; + margin-bottom: 4px; + } + + .selection-item-actions { + margin-top: 4px; + } + + .detail-btn { + padding: 4px 8px; + font-size: 12px; + color: var(--color-primary); + background: #ecf5ff; + border-radius: 4px; + } + + .detail-btn:hover { + background: #dbecff; + color: #3a8ee6; + } + + .detail-btn i { + margin-right: 4px; + } + + .count-value { + color: var(--color-primary); + font-weight: 600; + background: #ecf5ff; + padding: 2px 6px; + border-radius: 10px; + font-size: 12px; + } + + .selection-item-status { + flex-shrink: 0; + width: 70px; + text-align: right; + } + + .no-selections { + padding: 40px 0; + text-align: center; + color: #909399; + font-size: 14px; + display: flex; + flex-direction: column; + align-items: center; + } + + .no-selections i { + font-size: 40px; + margin-bottom: 10px; + color: #C0C4CC; + } + + /* 详情弹窗样式 */ + .welfare-detail-dialog .el-dialog__body { + padding: 0; + } + + .welfare-detail-content { + padding: 20px; + } + + .detail-header { + display: flex; + margin-bottom: 20px; + } + + .detail-image { + width: 120px; + height: 120px; + border-radius: 6px; + overflow: hidden; + flex-shrink: 0; + margin-right: 20px; + } + + .detail-image .el-image { + width: 100%; + height: 100%; + } + + .detail-title { + flex: 1; + } + + .detail-title h3 { + margin: 0 0 12px 0; + font-size: 18px; + color: #303133; + } + + .detail-meta { + display: flex; + flex-direction: column; + gap: 8px; + } + + .detail-count, .detail-time { + display: flex; + align-items: center; + font-size: 14px; + color: #606266; + } + + .detail-count i, .detail-time i { + margin-right: 6px; + color: #909399; + } + + .detail-divider { + height: 1px; + background: #EBEEF5; + margin: 20px 0; + } + + .detail-description { + color: #606266; + line-height: 1.6; + } + + /* 富文本内容样式 */ + .rich-text-content { + overflow-x: hidden; + word-break: break-word; + } + + .rich-text-content img { + max-width: 100%; + height: auto; + border-radius: 4px; + margin: 10px 0; + } + + .rich-text-content p { + margin: 8px 0; + line-height: 1.6; + } + + .rich-text-content a { + color: var(--color-primary); + text-decoration: none; + } + + .rich-text-content a:hover { + text-decoration: underline; + } + + .rich-text-content ul, .rich-text-content ol { + padding-left: 20px; + margin: 10px 0; + } + + .rich-text-content blockquote { + padding: 10px 15px; + border-left: 4px solid #EBEEF5; + background: #f8f9fb; + margin: 10px 0; + color: #606266; + } + ` +} diff --git a/src/main/resources/views/platform/zhgh/welfare/projectMange/filterUser.js b/src/main/resources/views/platform/zhgh/welfare/projectMange/filterUser.js new file mode 100644 index 0000000..240ef52 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/welfare/projectMange/filterUser.js @@ -0,0 +1,235 @@ +const filterUser = { + template: /*language=HTML*/ ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + `, + mixins: [initTableMixins], + data() { + return { + visible: false, + projectId: null, + pageForm: { + birthMonths: [], + userStates: [], + personTypes: [], + preparedBys: [], + unitIds: [] + }, + sexOptions: ["男", "女"], + unionOptions: [], + unitOptions: [], + tableColumns: [ + { prop: "loginname", label: "工号" }, + { prop: "username", label: "姓名" }, + { prop: "sex", label: "性别", sortable: true, checked: 0 }, + { prop: "birthday", label: "出生日期", sortable: true, checked: 0 }, + { prop: "personType", label: "人员类型", sortable: true }, + { prop: "preparedBy", label: "聘用方式", sortable: true }, + { prop: "userState", label: "在职状态", sortable: true }, + { prop: "unionName", label: "所属工会", sortable: true }, + { prop: "unitName", label: "所属单位", sortable: true } + ] + } + }, + methods: { + async onOpen(id) { + this.visible = true + this.resetPageForm() + this.pageForm.projectId = id + this.unionOptions = await this.$businessTool.listUnion() + this.unitOptions = await this.$businessTool.listUnit() + this.pageData() + }, + + resetPageForm() { + this.pageForm.userName = null + this.pageForm.loginName = null + this.pageForm.sex = null + this.pageForm.birthday = null + this.pageForm.birthMonths = [] + this.pageForm.unionId = null + this.pageForm.unitId = null + this.pageForm.personTypes = [] + this.pageForm.preparedBys = [] + this.pageForm.userStates = [] + this.pageForm.isMember = null + }, + + pageData() { + this.$axios + .post("/platform/welfare/project/mange/filterUserPageData", { + pageForm: JSON.stringify(this.pageForm) + }) + .then((res) => { + if (res.code === 0) { + this.tableData = res.data.list + this.pageForm.totalCount = res.data.totalCount + } else { + this.$message.error(res.msg) + } + }) + }, + onSubmit() { + this.$confirm("当前筛选出" + this.pageForm.totalCount + "条数据,您确认添加到福利名单吗?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }).then(async () => { + const { code, data, msg } = await this.$axios.post("/platform/welfare/project/mange/addWelfareUser", { + pageForm: JSON.stringify(this.pageForm), + projectId: this.projectId + }) + if (code === 0) { + this.$message.success(msg) + this.visible = false + this.$emit("refresh") + } else { + this.$message.error(msg) + } + }) + } + } +} diff --git a/src/main/resources/views/platform/zhgh/welfare/ProjectMange/index.html b/src/main/resources/views/platform/zhgh/welfare/projectMange/index.html similarity index 75% rename from src/main/resources/views/platform/zhgh/welfare/ProjectMange/index.html rename to src/main/resources/views/platform/zhgh/welfare/projectMange/index.html index 597efc2..55d6c7d 100644 --- a/src/main/resources/views/platform/zhgh/welfare/ProjectMange/index.html +++ b/src/main/resources/views/platform/zhgh/welfare/projectMange/index.html @@ -88,28 +88,14 @@ layout("/layouts/platform.html"){ {{row.isDisabled?'发布':'关闭'}} 通知未选择人员 - - - - 编辑 + + + + 生成福利名单 + 编辑 - - 删除 - + 删除 @@ -183,18 +169,17 @@ layout("/layouts/platform.html"){ - - - - - + + + + + - + + + + + + + @@ -258,15 +250,24 @@ layout("/layouts/platform.html"){ + + + + + diff --git a/src/main/resources/views/platform/zhgh/welfare/select/optionSelect.js b/src/main/resources/views/platform/zhgh/welfare/select/optionSelect.js new file mode 100644 index 0000000..e96e620 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/welfare/select/optionSelect.js @@ -0,0 +1,1057 @@ +const optionSelect = { + template: /*language=HTML*/ ` +
+ +
+ + 选择截止时间即将到期,请尽快选择! +
+ + +
+ + +
+ +
+ + +
+ + 项目信息 +
+
+ +
+
+
+
项目名称
+
{{ projectInfo.name }}
+
+
+
节日信息
+
{{ projectInfo.festival }} · {{ projectInfo.year }}年
+
+
+
选择时间
+
{{ formatTimeRange(projectInfo.choiceTimeStart, projectInfo.choiceTimeEnd) }}
+
+
+
发放时间
+
{{ formatTimeRange(projectInfo.provideTimeStart, projectInfo.provideTimeEnd) }}
+
+
+
发放地点
+
{{ projectInfo.provideAddress }}
+
+
+
+ + + +
+ + 福利选项 + 共 {{ projectInfo.options.length }} 项 +
+ +
+
+ + 已选择 + +
+ +
+ +
+
{{ option.optionName }}
+ + +
+ + 查看详情 +
+ + +
+ {{ null }} +
+ + +
+ + +
+
+
+
+
+
+ + + + + + +
+
{{ selectedOption.optionName }}
+
+
+
+ + + +
+ +
+
联系信息
+ + + + + + + +
+ +
已选择项目
+
+
+
+
+ +
+ +
+
+
+
+
{{ option.optionName }}
+
+ + 数量:{{ option.selectNum }} +
+
+
+
+ + × {{ option.selectNum }} + +
+
+
+ +
+ 总数量 + {{ totalSelectedCount }} 份 +
+ +
+ + {{ confirmMessage }} +
+ +
+ + {{ deadlineText }} +
+
+ + 取 消 + {{ hasSubmittedBefore ? '确认修改' : '确认提交' }} + +
+
+ `, + data() { + return { + projectId: null, + projectInfo: {}, + userSelection: [], + welfareProvideMode: [], + welfareSignMode: [], + selectedRadioId: "", // 单选模式下选中的选项ID + showConfirmDialog: false, + isSubmitting: false, + hasSubmittedBefore: false, // 是否之前提交过 + deadlineTime: null, // 选择截止时间 + showOptionDetailDialog: false, // 选项详情弹窗 + selectedOption: null, // 当前选中的选项 + contactForm: { + mobile: "" // 联系电话 + }, + contactRules: { + mobile: [ + { required: true, message: '请输入联系电话', trigger: 'blur' }, + { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur' } + ] + } + } + }, + computed: { + hasSelection() { + if (this.projectInfo.isCheckBox === "radio") { + return !!this.selectedRadioId + } else { + if (!this.projectInfo.options) return false + return this.projectInfo.options.some((option) => option.selectNum > 0) + } + }, + + selectedOptions() { + if (this.projectInfo.isCheckBox === "radio") { + if (!this.selectedRadioId || !this.projectInfo.options) return [] + return this.projectInfo.options.filter((option) => option.id === this.selectedRadioId) + } else { + if (!this.projectInfo.options) return [] + return this.projectInfo.options.filter((option) => option.selectNum > 0) + } + }, + + totalSelectedCount() { + if (!this.projectInfo.options) return 0 + return this.projectInfo.options.reduce((sum, option) => sum + (option.selectNum || 0), 0) + }, + + isDeadlineSoon() { + if (!this.projectInfo.choiceTimeEnd) return false + + const endTime = new Date(this.projectInfo.choiceTimeEnd) + const now = new Date() + const diffHours = (endTime - now) / (1000 * 60 * 60) + + return diffHours > 0 && diffHours < 24 + }, + + deadlineText() { + if (!this.deadlineTime) return "" + const now = new Date() + const deadline = new Date(this.deadlineTime) + const diffHours = Math.floor((deadline - now) / (1000 * 60 * 60)) + const diffMinutes = Math.floor((deadline - now) / (1000 * 60)) % 60 + + if (diffHours > 24) { + const diffDays = Math.floor(diffHours / 24) + return "还剩 " + diffDays + " 天可以修改" + } else if (diffHours > 0) { + return "还剩 " + diffHours + " 小时 " + diffMinutes + " 分钟可以修改" + } else if (diffMinutes > 0) { + return "还剩 " + diffMinutes + " 分钟可以修改" + } else { + return "选择时间已截止" + } + }, + + confirmMessage() { + if (this.hasSubmittedBefore) { + return "修改后的选择将覆盖之前的选择" + } + return "请仔细确认您的选择" + } + }, + methods: { + onOpen(projectId) { + this.projectId = projectId + this.getProjectInfo() + }, + + getProjectInfo() { + this.$axios.post("/platform/welfare/project/mange/findOne", { id: this.projectId }).then((res) => { + if (res.code === 0) { + this.projectInfo = res.data + this.deadlineTime = this.projectInfo.choiceTimeEnd + + // 初始化选项的selectNum为0 + if (this.projectInfo.options) { + this.projectInfo.options.forEach((option) => { + this.$set(option, "selectNum", 0) + }) + // 获取用户已有的选择 + this.getUserSelection() + } + } else { + this.$message.error(res.msg) + } + }) + }, + + // 获取用户选择的数据 + getUserSelection() { + this.$axios.post("/platform/welfare/userSelect/getUserSelection", { projectId: this.projectId }).then((resp) => { + if (resp.code === 0) { + this.userSelection = resp.data + this.hasSubmittedBefore = this.userSelection.length > 0 + + // 如果有用户选择数据,从中获取手机号 + if (this.userSelection && this.userSelection.length > 0 && this.userSelection[0].mobile) { + this.contactForm.mobile = this.userSelection[0].mobile + } else if (this.$store.user && this.$store.user.mobile) { + // 如果没有选择过,使用store中的默认手机号 + this.contactForm.mobile = this.$store.user.mobile + } + + // 设置已选择的选项 + if (this.projectInfo.options && this.userSelection.length > 0) { + // 单选模式 + if (this.projectInfo.isCheckBox === "radio" && this.userSelection[0]) { + this.selectedRadioId = this.userSelection[0].selectOptionId + const selectedOption = this.projectInfo.options.find((opt) => opt.id === this.selectedRadioId) + if (selectedOption) { + selectedOption.selectNum = 1 + } + } + // 多选模式 + else { + this.userSelection.forEach((selection) => { + const option = this.projectInfo.options.find((opt) => opt.id === selection.selectOptionId) + if (option) { + this.$set(option, "selectNum", selection.selectNum || 1) + } + }) + } + } + } else { + this.$message.error(resp.msg) + } + }) + }, + + // 执行提交 + doSubmit() { + // 验证手机号 + this.$refs.contactForm.validate(valid => { + if (!valid) { + return + } + + if (this.isSubmitting) return + this.isSubmitting = true + + let selections = [] + + // 单选模式 + if (this.projectInfo.isCheckBox === "radio") { + if (this.selectedRadioId) { + selections = [ + { + selectOptionId: this.selectedRadioId, + selectNum: 1, + mobile: this.contactForm.mobile + } + ] + } + } + // 多选模式 + else { + selections = this.selectedOptions.map((option) => ({ + selectOptionId: option.id, + selectNum: option.selectNum, + mobile: this.contactForm.mobile + })) + } + + this.$axios + .post("/platform/welfare/userSelect/confirmSelect", { + projectId: this.projectId, + selections: JSON.stringify(selections) + }) + .then((res) => { + this.isSubmitting = false + + if (res.code === 0) { + this.$message.success("选择成功") + this.$emit("refresh") + } else { + this.$message.error(res.msg) + } + }) + .catch(() => { + this.isSubmitting = false + this.$message.error("网络错误,请重试") + }) + }) + }, + + // 格式化时间范围 + formatTimeRange(start, end) { + if (!start || !end) return "未设置" + + const startDate = this.$moment(start).format("YYYY-MM-DD") + const endDate = this.$moment(end).format("YYYY-MM-DD") + + if (startDate === endDate) { + return startDate + " " + this.$moment(start).format("HH:mm") + "~" + this.$moment(end).format("HH:mm") + } else { + return startDate + " ~ " + endDate + } + }, + + // 提交选择 + submitSelection() { + if (!this.hasSelection) { + this.$message.error("请先选择福利") + return + } + + this.showConfirmDialog = true + }, + + // 单选选项选择 + selectRadioOption(optionId) { + this.selectedRadioId = optionId + + // 重置所有选项的selectNum + if (this.projectInfo.options) { + this.projectInfo.options.forEach((option) => { + if (option.id === optionId) { + option.selectNum = 1 + } else { + option.selectNum = 0 + } + }) + } + }, + + // 显示选项详情 + showOptionDetail(option) { + // 阻止事件冒泡,避免触发父元素的点击事件 + event.stopPropagation() + this.selectedOption = option + this.showOptionDetailDialog = true + } + }, + watch: { + "projectInfo.options": { + deep: true, + handler(options) { + if (!options) return + + const maxSelect = this.projectInfo.multiSelectNum || options.length + const totalCount = options.reduce((sum, option) => sum + (option.selectNum || 0), 0) + + if (totalCount > maxSelect) { + this.$message.warning("所有选项总份数不能超过" + maxSelect + "份") + // 找到最后修改的选项并调整其值 + const lastChanged = options.find((opt) => opt.selectNum > 0) + if (lastChanged) { + const otherCount = totalCount - lastChanged.selectNum + lastChanged.selectNum = Math.max(0, maxSelect - otherCount) + } + } + } + } + }, + style: /*language=CSS*/ ` + /* 全局变量 */ + :root { + --primary-color: #409EFF; + --primary-light: #ecf5ff; + --text-primary: #303133; + --text-secondary: #606266; + --text-light: #909399; + --border-color: #EBEEF5; + --success-color: #67c23a; + --warning-color: #e6a23c; + --danger-color: #f56c6c; + } + + /* 主容器样式 */ + .welfare-select-container { + background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%); + padding: 16px; + border-radius: 8px; + max-width: 1000px; + margin: 0 auto; + } + + /* 截止时间提醒 */ + .welfare-deadline { + background: linear-gradient(135deg, #fff7f7 0%, #fff 100%); + border-left: 3px solid var(--danger-color); + padding: 12px 16px; + margin-bottom: 16px; + border-radius: 6px; + display: flex; + align-items: center; + color: var(--danger-color); + box-shadow: 0 2px 8px rgba(245, 108, 108, 0.1); + animation: pulse 2s infinite; + } + + @keyframes pulse { + 0% { transform: scale(1); } + 50% { transform: scale(1.01); } + 100% { transform: scale(1); } + } + + .welfare-deadline i { + margin-right: 8px; + font-size: 16px; + } + + /* 选择提示 */ + .welfare-notice { + margin-bottom: 16px; + } + + .welfare-notice .el-alert { + border-radius: 6px; + padding: 12px 16px; + } + + /* 内容区域 */ + .welfare-content { + display: flex; + flex-direction: column; + gap: 16px; + margin-bottom: 16px; + } + + /* 项目信息卡片 */ + .welfare-info-card { + background: #fff; + border-radius: 8px; + box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); + width: 100%; + overflow: hidden; + transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); + } + + .project-cover { + height: 140px; + overflow: hidden; + position: relative; + margin: -10px -20px 16px; + } + + .project-cover::after { + content: ''; + position: absolute; + bottom: 0; + left: 0; + right: 0; + height: 40px; + background: linear-gradient(to top, rgba(255,255,255,1), rgba(255,255,255,0)); + } + + .project-cover .el-image { + width: 100%; + height: 100%; + object-fit: cover; + } + + .welfare-info-header { + padding: 14px 16px; + border-bottom: 1px solid var(--border-color); + font-size: 16px; + font-weight: 600; + color: var(--text-primary); + display: flex; + align-items: center; + background: linear-gradient(135deg, #f8f9fb 0%, #fff 100%); + } + + .welfare-info-header i { + margin-right: 8px; + color: var(--primary-color); + font-size: 18px; + } + + .info-item { + display: flex; + padding: 12px 16px; + border-bottom: 1px solid var(--border-color); + transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); + } + + .info-item:hover { + background: var(--primary-light); + } + + .info-item:last-child { + border-bottom: none; + } + + .info-label { + width: 100px; + color: var(--text-secondary); + font-weight: 500; + flex-shrink: 0; + } + + .info-value { + flex: 1; + color: var(--text-primary); + } + + /* 福利选项卡片 */ + .welfare-options-card { + background: #fff; + border-radius: 8px; + box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); + width: 100%; + overflow: hidden; + } + + .options-count { + font-size: 14px; + color: var(--text-light); + font-weight: normal; + margin-left: 8px; + opacity: 0.8; + } + + /* 选项网格 */ + .welfare-options-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); + gap: 16px; + padding: 16px; + } + + /* 选项卡片 */ + .welfare-option { + position: relative; + border-radius: 6px; + overflow: hidden; + background: #fff; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); + transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); + border: 2px solid transparent; + height: 100%; + display: flex; + flex-direction: column; + cursor: pointer; + animation: fadeIn 0.6s ease-out forwards; + } + + .welfare-option:hover { + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08); + transform: translateY(-2px); + } + + .welfare-option.selected { + border-color: var(--primary-color); + box-shadow: 0 4px 16px rgba(64, 158, 255, 0.15); + } + + .welfare-option.selected::before { + content: ''; + position: absolute; + top: 0; + left: 0; + right: 0; + height: 3px; + background: linear-gradient(90deg, var(--primary-color), #66b1ff); + z-index: 1; + } + + /* 选项标签 */ + .option-tag { + position: absolute; + top: 8px; + right: 8px; + z-index: 2; + padding: 4px 8px; + border-radius: 12px; + font-size: 12px; + font-weight: 500; + box-shadow: 0 2px 6px rgba(64, 158, 255, 0.2); + } + + /* 选项图片 */ + .option-image { + width: 100%; + height: 160px; + overflow: hidden; + position: relative; + } + + .option-image::after { + content: ''; + position: absolute; + bottom: 0; + left: 0; + right: 0; + height: 40px; + background: linear-gradient(to top, rgba(0,0,0,0.2), transparent); + } + + .option-image .el-image { + width: 100%; + height: 100%; + transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); + } + + .welfare-option:hover .option-image .el-image { + transform: scale(1.06); + } + + /* 选项内容 */ + .option-content { + padding: 12px 16px; + flex: 1; + display: flex; + flex-direction: column; + position: relative; + background: linear-gradient(135deg, #fff 0%, #f8f9fb 100%); + } + + .option-title { + font-size: 14px; + font-weight: 600; + color: var(--text-primary); + margin-bottom: 8px; + line-height: 1.4; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + padding-right: 24px; + } + + .option-detail-btn { + display: inline-flex; + align-items: center; + color: var(--primary-color); + font-size: 13px; + margin-top: 8px; + padding: 4px 8px; + border-radius: 4px; + background: var(--primary-light); + transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); + cursor: pointer; + } + + .option-detail-btn i { + margin-right: 4px; + font-size: 14px; + } + + .option-detail-btn:hover { + background: #dceeff; + transform: translateX(4px); + } + + /* 选择控件 */ + .option-radio { + position: absolute; + top: 12px; + right: 12px; + } + + .option-stepper { + position: absolute; + bottom: 12px; + right: 12px; + } + + .option-stepper .el-input-number { + width: 100px; + } + + /* 底部按钮 */ + .welfare-footer { + display: flex; + justify-content: center; + padding: 16px 0; + } + + .welfare-footer .el-button { + min-width: 140px; + height: 40px; + font-size: 15px; + font-weight: 500; + border-radius: 20px; + transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); + } + + .welfare-footer .el-button:hover { + transform: translateY(-2px); + box-shadow: 0 4px 12px rgba(64, 158, 255, 0.25); + } + + /* 确认弹窗样式 */ + .welfare-confirm-dialog { + border-radius: 8px; + } + + .confirm-content { + padding: 16px 0; + } + + .confirm-section-title { + font-size: 15px; + color: var(--text-primary); + margin-bottom: 12px; + font-weight: 500; + position: relative; + padding-left: 10px; + } + + .confirm-section-title::before { + content: ''; + position: absolute; + left: 0; + top: 50%; + transform: translateY(-50%); + width: 3px; + height: 14px; + background: var(--primary-color); + border-radius: 2px; + } + + .confirm-mobile-section { + margin-bottom: 20px; + } + + .selected-items { + background: #f8f9fb; + border-radius: 8px; + padding: 16px; + margin-bottom: 16px; + max-height: 300px; + overflow-y: auto; + } + + .selected-item { + display: flex; + justify-content: space-between; + align-items: center; + padding: 12px; + background: #fff; + border-radius: 8px; + margin-bottom: 10px; + transition: all 0.3s ease; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03); + } + + .selected-item:last-child { + margin-bottom: 0; + } + + .selected-item:hover { + transform: translateY(-2px); + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); + } + + .selected-item-left { + display: flex; + align-items: center; + flex: 1; + min-width: 0; + } + + .selected-item-image { + width: 60px; + height: 60px; + border-radius: 8px; + overflow: hidden; + margin-right: 12px; + flex-shrink: 0; + background: #f5f5f5; + border: 1px solid rgba(0, 0, 0, 0.06); + } + + .selected-item-image .el-image { + width: 100%; + height: 100%; + display: block; + } + + .image-slot { + display: flex; + justify-content: center; + align-items: center; + width: 100%; + height: 100%; + color: #909399; + font-size: 20px; + } + + .selected-item-info { + flex: 1; + min-width: 0; + padding: 4px 0; + } + + .selected-item-name { + color: var(--text-primary); + font-weight: 500; + font-size: 15px; + line-height: 1.4; + margin-bottom: 6px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .selected-item-quantity { + color: var(--text-secondary); + font-size: 13px; + display: flex; + align-items: center; + } + + .selected-item-quantity i { + margin-right: 4px; + font-size: 14px; + color: var(--primary-color); + } + + .selected-item-right { + flex-shrink: 0; + margin-left: 16px; + } + + .selected-item-right .el-tag { + font-size: 13px; + font-weight: 600; + padding: 0 10px; + height: 24px; + line-height: 22px; + border-radius: 12px; + } + + .confirm-total { + display: flex; + justify-content: space-between; + align-items: center; + padding: 12px; + background: #f8f9fb; + border-radius: 6px; + margin-top: 16px; + } + + .total-label { + color: var(--text-secondary); + font-weight: 500; + font-size: 14px; + } + + .total-value { + color: var(--primary-color); + font-weight: 600; + font-size: 15px; + } + + .confirm-warning { + margin-top: 16px; + padding: 10px 14px; + background: #fff7e6; + border-radius: 6px; + color: var(--warning-color); + display: flex; + align-items: center; + font-size: 13px; + } + + .confirm-warning.warning { + background: #fef0f0; + color: var(--danger-color); + } + + .confirm-warning i { + margin-right: 6px; + font-size: 16px; + } + + .deadline-info { + margin-top: 12px; + padding: 10px 14px; + background: var(--primary-light); + border-radius: 6px; + color: var(--primary-color); + display: flex; + align-items: center; + font-size: 13px; + } + + .deadline-info i { + margin-right: 6px; + font-size: 16px; + } + + /* 详情弹窗 */ + .welfare-detail-dialog { + border-radius: 8px; + } + + .welfare-detail-popup { + padding: 16px; + min-height: 200px; + } + + .welfare-detail-title { + font-size: 18px; + font-weight: 600; + color: var(--text-primary); + margin-bottom: 16px; + padding-bottom: 12px; + border-bottom: 1px solid var(--border-color); + text-align: center; + } + + .welfare-detail-content { + color: var(--text-secondary); + line-height: 1.6; + font-size: 14px; + } + + /* 加载状态 */ + .welfare-loading { + min-height: 300px; + display: flex; + align-items: center; + justify-content: center; + } + + /* 动画 */ + @keyframes fadeIn { + from { opacity: 0; transform: translateY(10px); } + to { opacity: 1; transform: translateY(0); } + } + + .welfare-select-container > * { + animation: fadeIn 0.5s ease-out forwards; + } + ` +} diff --git a/src/main/resources/views/platform/zhgh/welfare/statistics/index.html b/src/main/resources/views/platform/zhgh/welfare/statistics/index.html index 943e61e..940523c 100644 --- a/src/main/resources/views/platform/zhgh/welfare/statistics/index.html +++ b/src/main/resources/views/platform/zhgh/welfare/statistics/index.html @@ -33,41 +33,7 @@ layout("/layouts/platform.html"){ - - 导出各分工会福利签领表 - - - + 按福利选项导出