From c9104c62e30f87ef05e4bb2040550a2d7c69e1f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E7=8E=89=E7=90=A6?= <7507756+jiang_yuqi@user.noreply.gitee.com> Date: Sun, 16 Feb 2025 17:19:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/BusTrainingVideoUserMapper.xml | 5 +- .../common/security/utils/SecurityUtils.java | 3 +- .../controller/BusExamUserController.java | 7 +- .../BusTrainingVideoUserController.java | 7 +- .../controller/ProProjectInfoController.java | 5 +- .../controller/wechat/WxController.java | 38 +- .../yanzhu/manage/enums/CraftPostEnums.java | 8 +- .../manage/service/IBusExamUserService.java | 8 + .../service/IBusTrainingVideoUserService.java | 7 + .../IProProjectInfoSubdeptsUsersService.java | 8 + .../service/impl/BusExamUserServiceImpl.java | 12 + .../impl/BusTrainingVideoUserServiceImpl.java | 12 + ...roProjectInfoSubdeptsUsersServiceImpl.java | 21 +- .../system/controller/SysRoleController.java | 4 +- yanzhu-ui-app/miniprogram/api/project.js | 8 + yanzhu-ui-app/miniprogram/app.json | 8 +- .../pages/components/user-infos/index.js | 369 ++++++------ .../miniprogram/pages/login/login.js | 17 +- .../project_flowable/approveTask/index.wxml | 8 +- .../project_flowable/detailTask/index.wxml | 8 +- .../project_flowable/subDeptsUsers/index.js | 5 +- .../miniprogram/pages/project_info/index.js | 55 +- .../miniprogram/pages/project_list/index.js | 19 +- .../miniprogram/pages/project_more/index.js | 18 +- .../pages/project_problemmodify/add/index.js | 543 ++++++++++++++++++ .../project_problemmodify/add/index.json | 7 + .../project_problemmodify/add/index.wxml | 141 +++++ .../project_problemmodify/add/index.wxss | 6 + .../project_problemmodify/check/index.js | 304 ++++++++++ .../project_problemmodify/check/index.json | 10 + .../project_problemmodify/check/index.wxml | 211 +++++++ .../project_problemmodify/check/index.wxss | 22 + .../project_problemmodify/draft/index.js | 368 ++++++++++++ .../project_problemmodify/draft/index.json | 7 + .../project_problemmodify/draft/index.wxml | 113 ++++ .../project_problemmodify/draft/index.wxss | 6 + .../pages/project_problemmodify/info/index.js | 252 ++++++++ .../project_problemmodify/info/index.json | 8 + .../project_problemmodify/info/index.wxml | 169 ++++++ .../project_problemmodify/info/index.wxss | 22 + .../pages/project_problemmodify/list/index.js | 293 ++++++++++ .../project_problemmodify/list/index.json | 7 + .../project_problemmodify/list/index.wxml | 77 +++ .../project_problemmodify/list/index.wxss | 1 + .../project_problemmodify/modify/index.js | 299 ++++++++++ .../project_problemmodify/modify/index.json | 10 + .../project_problemmodify/modify/index.wxml | 154 +++++ .../project_problemmodify/modify/index.wxss | 22 + .../miniprogram/pages/project_qr/index.js | 19 +- yanzhu-ui-vue3/src/api/manage/busExamUser.js | 4 +- .../src/api/manage/busTrainingVideoUser.js | 4 +- .../task/myProcess/detail/indexDrawer.vue | 13 +- .../flowable/task/todo/detail/indexDrawer.vue | 13 +- 53 files changed, 3478 insertions(+), 287 deletions(-) create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/add/index.js create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/add/index.json create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/add/index.wxml create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/add/index.wxss create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/check/index.js create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/check/index.json create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/check/index.wxml create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/check/index.wxss create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/draft/index.js create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/draft/index.json create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/draft/index.wxml create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/draft/index.wxss create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/info/index.js create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/info/index.json create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/info/index.wxml create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/info/index.wxss create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/list/index.js create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/list/index.json create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/list/index.wxml create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/list/index.wxss create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/modify/index.js create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/modify/index.json create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/modify/index.wxml create mode 100644 yanzhu-ui-app/miniprogram/pages/project_problemmodify/modify/index.wxss diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BusTrainingVideoUserMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BusTrainingVideoUserMapper.xml index 8e01cbfe..c21215a3 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BusTrainingVideoUserMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BusTrainingVideoUserMapper.xml @@ -34,12 +34,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select btvu.id, btvu.com_id, sd.dept_name as com_name, btvu.project_id, pi.project_name, btvu.user_id, su.nick_name as user_nick, su.user_name, btvu.video_id, btv.train_title, + select btvu.id, btvu.com_id, btvu.project_id, pi.project_name, btvu.user_id, su.nick_name as user_nick, su.user_name, btvu.video_id, btv.train_title, btv.train_type, dic1.dict_label as train_type_name, btv.train_level, dic2.dict_label as train_level_name, btv.train_file_path, btv.train_file_image, btvu.play_times, btvu.play_dates, btvu.play_status, btvu.sort_by, btvu.is_del, btvu.create_by, btvu.create_time, btvu.update_by, btvu.update_time, btvu.remark from bus_training_video_user btvu left join bus_training_video btv on btv.id = btvu.video_id left join pro_project_info pi on pi.id = btvu.project_id - left join sys_dept sd on sd.com_id = btvu.com_id left join sys_user su on su.user_id = btvu.user_id left join sys_dict_data dic1 ON btv.train_type = dic1.`dict_value` AND dic1.`dict_type`='edu_train_type' left join sys_dict_data dic2 ON btv.train_level = dic2.`dict_value` AND dic2.`dict_type`='edu_train_level' @@ -48,7 +47,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/yanzhu-common/yanzhu-common-security/src/main/java/com/yanzhu/common/security/utils/SecurityUtils.java b/yanzhu-common/yanzhu-common-security/src/main/java/com/yanzhu/common/security/utils/SecurityUtils.java index dd02c673..42fd8181 100644 --- a/yanzhu-common/yanzhu-common-security/src/main/java/com/yanzhu/common/security/utils/SecurityUtils.java +++ b/yanzhu-common/yanzhu-common-security/src/main/java/com/yanzhu/common/security/utils/SecurityUtils.java @@ -10,6 +10,7 @@ import com.yanzhu.common.core.utils.ServletUtils; import com.yanzhu.common.core.utils.StringUtils; import com.yanzhu.system.api.model.LoginUser; +import java.util.Objects; import java.util.Set; /** @@ -100,7 +101,7 @@ public class SecurityUtils */ public static boolean isGSAdmin() { - return getLoginUser().getRoles().contains("gsAdmin"); + return Objects.nonNull(getLoginUser().getRoles()) && getLoginUser().getRoles().contains("gsAdmin"); } /** diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/BusExamUserController.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/BusExamUserController.java index 7bb69475..ac0f2bdf 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/BusExamUserController.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/BusExamUserController.java @@ -68,12 +68,13 @@ public class BusExamUserController extends BaseController * 获取用户试卷详细信息 * @RequiresPermissions("manage:busExamUser:query") */ - @GetMapping(value = "/last/{userId}") - public AjaxResult findBusExamUserList(@PathVariable("userId") Long userId) + @GetMapping(value = "/last/{proId}") + public AjaxResult findBusExamUserList(@PathVariable("userId") Long proId,Long userId) { BusExamUser query = new BusExamUser(); query.setUserId(userId); - List list = busExamUserService.selectBusExamUserList(query); + query.setProjectId(proId); + List list = busExamUserService.selectAllList(query); if(StringUtils.isNotEmpty(list)){ return success(busExamUserService.selectBusExamUserById(list.get(0).getId())); } diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/BusTrainingVideoUserController.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/BusTrainingVideoUserController.java index 37d670ea..ab09ca51 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/BusTrainingVideoUserController.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/BusTrainingVideoUserController.java @@ -67,12 +67,13 @@ public class BusTrainingVideoUserController extends BaseController * 获取用户培训视频详细信息 * @RequiresPermissions("manage:busTrainingVideoUser:query") */ - @GetMapping(value = "/last/{userId}") - public AjaxResult findBusTrainingVideoUserLast(@PathVariable("userId") Long userId) + @GetMapping(value = "/last/{proId}") + public AjaxResult findBusTrainingVideoUserLast(@PathVariable("proId") Long proId,Long userId) { BusTrainingVideoUser query = new BusTrainingVideoUser(); query.setUserId(userId); - return success(busTrainingVideoUserService.selectBusTrainingVideoUserList(query)); + query.setProjectId(proId); + return success(busTrainingVideoUserService.selectAllList(query)); } /** diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProProjectInfoController.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProProjectInfoController.java index 9d2a330e..6be1b47d 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProProjectInfoController.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProProjectInfoController.java @@ -1,9 +1,6 @@ package com.yanzhu.manage.controller; -import com.yanzhu.common.core.constant.Constants; import com.yanzhu.common.core.domain.R; -import com.yanzhu.common.core.utils.PageUtils; -import com.yanzhu.common.core.utils.StringUtils; import com.yanzhu.common.core.utils.bean.BeanUtils; import com.yanzhu.common.core.utils.poi.ExcelUtil; import com.yanzhu.common.core.web.controller.BaseController; @@ -24,7 +21,6 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.List; import java.util.Map; -import java.util.concurrent.TimeUnit; /** * 项目信息Controller @@ -148,6 +144,7 @@ public class ProProjectInfoController extends BaseController LoginUser loginUser = SecurityUtils.getLoginUser(); proProjectInfo.setComId(loginUser.getSysUser().getComId()); if(!SecurityUtils.isAdmin(loginUser.getUserid())){ + System.out.println("SecurityUtils.getRoles==>"+SecurityUtils.getLoginUser().getRoles()); if(SecurityUtils.isGSAdmin()){ proProjectInfo.setActiveComId(SecurityUtils.getLoginUser().getProjectDeptId()); }else{ diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/wechat/WxController.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/wechat/WxController.java index 93066b24..9b23ece9 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/wechat/WxController.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/wechat/WxController.java @@ -3,12 +3,13 @@ package com.yanzhu.manage.controller.wechat; import com.yanzhu.common.core.utils.OcrService; import com.yanzhu.common.core.web.controller.BaseController; import com.yanzhu.common.core.web.domain.AjaxResult; -import com.yanzhu.manage.domain.BusExamUser; -import com.yanzhu.manage.domain.ProProjectInfoSubdepts; -import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers; -import com.yanzhu.manage.domain.SignetFileVo; +import com.yanzhu.common.security.utils.SecurityUtils; +import com.yanzhu.manage.domain.*; +import com.yanzhu.manage.enums.SubDeptsEnums; +import com.yanzhu.manage.enums.UserPostEnums; import com.yanzhu.manage.service.*; import com.yanzhu.security.utils.DictUtils; +import com.yanzhu.system.api.model.LoginUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -97,12 +98,39 @@ public class WxController extends BaseController { return success(proProjectInfoSubdeptsService.findProSubDeptsInfo(proId,phoneNumber)); } + /** + * 查询分包单位信息 + * @param proId 项目主键 + */ + @GetMapping("/findProSubDeptsUserInfo/{proId}") + public AjaxResult findProSubDeptsUserInfo(@PathVariable("proId") Long proId) + { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if(SecurityUtils.isGSAdmin()){ + ProProjectInfo projectInfo = proProjectInfoService.selectProProjectInfoById(proId); + ProProjectInfoSubdeptsUsers adminUser = new ProProjectInfoSubdeptsUsers(); + adminUser.setId(0L); + adminUser.setComId(projectInfo.getComId()); + adminUser.setComName(projectInfo.getComName()); + adminUser.setProjectId(projectInfo.getId()); + adminUser.setProjectName(projectInfo.getProjectName()); + adminUser.setSubDeptId(0L); + adminUser.setSubDeptType(SubDeptsEnums.JSDW.getCode()); + adminUser.setUserId(loginUser.getUserid()); + adminUser.setUserPost(UserPostEnums.JSDWGL.getCode()); + adminUser.setUserName(loginUser.getSysUser().getNickName()); + return success(adminUser); + }else{ + return success(proProjectInfoSubdeptsUsersService.findProSubDeptsUserInfo(proId, SecurityUtils.getUserId())); + } + } + /** * 查询分包单位人员 * @param id 人员主键 */ @GetMapping("/findProSubDeptsUser/{id}") - public AjaxResult findProSubDeptsUserById(@PathVariable("id")Long id) + public AjaxResult findProSubDeptsUserById(@PathVariable("id") Long id) { return success(proProjectInfoSubdeptsUsersService.selectProProjectInfoSubdeptsUsersById(id)); } diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/enums/CraftPostEnums.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/enums/CraftPostEnums.java index 6dde05aa..17683de9 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/enums/CraftPostEnums.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/enums/CraftPostEnums.java @@ -5,10 +5,10 @@ package com.yanzhu.manage.enums; */ public enum CraftPostEnums { - WTDL("1022", "委托代理人"), - XMJL("1023", "项目经理"), - AQZY("1024", "安全专员"), - CLZY("1025", "材料专员"); + WTDL("3022", "委托代理人"), + XMJL("3023", "项目经理"), + AQZY("3024", "安全专员"), + CLZY("3025", "材料专员"); private final String code; private final String info; diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IBusExamUserService.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IBusExamUserService.java index eccf855b..9e7257c2 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IBusExamUserService.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IBusExamUserService.java @@ -20,6 +20,14 @@ public interface IBusExamUserService */ public BusExamUser selectBusExamUserById(Long id); + /** + * 查询用户试卷列表 + * + * @param busExamUser 用户试卷 + * @return 用户试卷集合 + */ + public List selectAllList(BusExamUser busExamUser); + /** * 查询用户试卷列表 * diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IBusTrainingVideoUserService.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IBusTrainingVideoUserService.java index 761c80f7..551d2cb3 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IBusTrainingVideoUserService.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IBusTrainingVideoUserService.java @@ -20,6 +20,13 @@ public interface IBusTrainingVideoUserService */ public BusTrainingVideoUser selectBusTrainingVideoUserById(Long id); + /** + * 查询用户培训视频列表 + * @param busTrainingVideoUser + * @return + */ + public List selectAllList(BusTrainingVideoUser busTrainingVideoUser); + /** * 查询用户培训视频列表 * diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IProProjectInfoSubdeptsUsersService.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IProProjectInfoSubdeptsUsersService.java index d6d57fff..2a5baeed 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IProProjectInfoSubdeptsUsersService.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IProProjectInfoSubdeptsUsersService.java @@ -95,6 +95,14 @@ public interface IProProjectInfoSubdeptsUsersService */ public ProProjectInfoSubdeptsUsers findProSubDeptsUser(Long proId, String phoneNumber); + /** + * 查询用户在项目中的信息 + * @param proId 项目主键 + * @param userId 用户主键 + * @return + */ + public ProProjectInfoSubdeptsUsers findProSubDeptsUserInfo(Long proId, Long userId); + /** * 提交文件签署 * @param signetFileVo diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/BusExamUserServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/BusExamUserServiceImpl.java index 4f4fca02..1078ad67 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/BusExamUserServiceImpl.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/BusExamUserServiceImpl.java @@ -58,6 +58,18 @@ public class BusExamUserServiceImpl implements IBusExamUserService return busExamUserMapper.selectBusExamUserById(id); } + /** + * 查询用户试卷列表 + * + * @param busExamUser 用户试卷 + * @return 用户试卷 + */ + @Override + public List selectAllList(BusExamUser busExamUser) + { + return busExamUserMapper.selectBusExamUserList(busExamUser); + } + /** * 查询用户试卷列表 * diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/BusTrainingVideoUserServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/BusTrainingVideoUserServiceImpl.java index 58575b6a..a8a4992f 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/BusTrainingVideoUserServiceImpl.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/BusTrainingVideoUserServiceImpl.java @@ -47,6 +47,18 @@ public class BusTrainingVideoUserServiceImpl implements IBusTrainingVideoUserSer return busTrainingVideoUserMapper.selectBusTrainingVideoUserById(id); } + /** + * 查询用户培训视频列表 + * + * @param busTrainingVideoUser 用户培训视频 + * @return 用户培训视频 + */ + @Override + public List selectAllList(BusTrainingVideoUser busTrainingVideoUser) + { + return busTrainingVideoUserMapper.selectBusTrainingVideoUserList(busTrainingVideoUser); + } + /** * 查询用户培训视频列表 * diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsUsersServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsUsersServiceImpl.java index fc5836ef..bc7ff2f4 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsUsersServiceImpl.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsUsersServiceImpl.java @@ -757,6 +757,17 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu return null; } + /** + * 查询用户在项目中的信息 + * @param proId 项目主键 + * @param userId 用户主键 + * @return + */ + @Override + public ProProjectInfoSubdeptsUsers findProSubDeptsUserInfo(Long proId, Long userId){ + return proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersByParamId(proId,userId); + } + /** * 提交文件签署 * @param signetFileVo @@ -890,7 +901,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.WTDL.getCode())){ ProProjectInfoSubdepts proProjectInfoSubdepts = proProjectInfoSubdeptsMapper.selectProProjectInfoSubdeptsById(proProjectInfoSubdeptsUsers.getSubDeptId()); proProjectInfoSubdepts.setApproveStatus(ApproveStatus.exempt.getCode()); - if(Objects.isNull(proProjectInfoSubdepts.getUseStatus()) && Objects.equals(proProjectInfoSubdepts.getUseStatus(),UseStateEnums.AW.getCode())){ + if(Objects.nonNull(proProjectInfoSubdepts.getUseStatus()) && Objects.equals(proProjectInfoSubdepts.getUseStatus(),UseStateEnums.AW.getCode())){ proProjectInfoSubdepts.setUseStatus(UseStateEnums.IN.getCode()); } // 生成二维码 @@ -920,7 +931,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu if(Objects.nonNull(groups) && groups.size()>0){ ProProjectInfoSubdeptsGroup specialGroup = groups.get(0); specialGroup.setApproveStatus(ApproveStatus.exempt.getCode()); - if(Objects.isNull(specialGroup.getUseStatus()) && Objects.equals(specialGroup.getUseStatus(),UseStateEnums.AW.getCode())){ + if(Objects.nonNull(specialGroup.getUseStatus()) && Objects.equals(specialGroup.getUseStatus(),UseStateEnums.AW.getCode())){ specialGroup.setUseStatus(UseStateEnums.IN.getCode()); } proProjectInfoSubdeptsGroupMapper.updateProProjectInfoSubdeptsGroup(specialGroup); @@ -941,7 +952,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu }else if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.BZZ.getCode())){ ProProjectInfoSubdeptsGroup proProjectInfoSubdeptsGroup = proProjectInfoSubdeptsGroupMapper.selectProProjectInfoSubdeptsGroupById(proProjectInfoSubdeptsUsers.getSubDeptGroup()); proProjectInfoSubdeptsGroup.setApproveStatus(ApproveStatus.exempt.getCode()); - if(Objects.isNull(proProjectInfoSubdeptsGroup.getUseStatus()) && Objects.equals(proProjectInfoSubdeptsGroup.getUseStatus(),UseStateEnums.AW.getCode())){ + if(Objects.nonNull(proProjectInfoSubdeptsGroup.getUseStatus()) && Objects.equals(proProjectInfoSubdeptsGroup.getUseStatus(),UseStateEnums.AW.getCode())){ proProjectInfoSubdeptsGroup.setUseStatus(UseStateEnums.IN.getCode()); } proProjectInfoSubdeptsGroupMapper.updateProProjectInfoSubdeptsGroup(proProjectInfoSubdeptsGroup); @@ -1069,11 +1080,11 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersById(id); ProProjectInfoSubdeptsUsers userQuery = new ProProjectInfoSubdeptsUsers(); userQuery.setWorkType(101L); - userQuery.setProjectId(proProjectInfoSubdeptsUsers.getProjectId()); + userQuery.setComId(proProjectInfoSubdeptsUsers.getComId()); List users = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersList(userQuery); if(StringUtils.isNotEmpty(users)){ BasSignet query = new BasSignet(); - query.setProjectId(users.get(0).getProjectId()); + query.setComId(users.get(0).getComId()); query.setUserId(users.get(0).getUserId()); List signets = basSignetMapper.selectBasSignetList(query); if(StringUtils.isNotEmpty(signets)){ diff --git a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysRoleController.java b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysRoleController.java index 1ffb54a0..ee9cf1b0 100644 --- a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysRoleController.java +++ b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysRoleController.java @@ -103,10 +103,10 @@ public class SysRoleController extends BaseController { return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在"); } - else if (!roleService.checkRoleKeyUnique(role)) + /**else if (!roleService.checkRoleKeyUnique(role)) { return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在"); - } + }*/ role.setCreateBy(SecurityUtils.getUsername()); return toAjax(roleService.insertRole(role)); diff --git a/yanzhu-ui-app/miniprogram/api/project.js b/yanzhu-ui-app/miniprogram/api/project.js index 79b1bbaf..39ef7545 100644 --- a/yanzhu-ui-app/miniprogram/api/project.js +++ b/yanzhu-ui-app/miniprogram/api/project.js @@ -43,6 +43,14 @@ export function findProSubDeptsUser(proId, phoneNumber) { }) } +// 查询项目参建单位人员 +export function findProSubDeptsUserInfo(proId) { + return request({ + url: '/manage/wxApi/findProSubDeptsUserInfo/' + proId, + method: 'get' + }) +} + // 查询项目参建单位人员 export function findProSubDeptsUserById(id) { return request({ diff --git a/yanzhu-ui-app/miniprogram/app.json b/yanzhu-ui-app/miniprogram/app.json index 62b3875c..5aab3cac 100644 --- a/yanzhu-ui-app/miniprogram/app.json +++ b/yanzhu-ui-app/miniprogram/app.json @@ -15,7 +15,13 @@ "pages/project_list/index", "pages/project_more/index", "pages/project_qr/index", - "pages/sign_mags/index" + "pages/sign_mags/index", + "pages/project_problemmodify/list/index", + "pages/project_problemmodify/info/index", + "pages/project_problemmodify/modify/index", + "pages/project_problemmodify/check/index", + "pages/project_problemmodify/add/index", + "pages/project_problemmodify/draft/index" ], "usingComponents": { "van-row": "@vant/weapp/row", diff --git a/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.js b/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.js index f1897435..d6fa1dec 100644 --- a/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.js +++ b/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.js @@ -1,209 +1,210 @@ import { removeToken - } from '../../../utils/auth' - import { +} from '../../../utils/auth' +import { loginOut, updatePwd, findOpenUserMsgId - } from '../../../api/login' - - const app = getApp() - Component({ +} from '../../../api/login' + +const app = getApp() +Component({ /**数据监听 */ observers: {}, /** * 组件的初始数据 */ data: { - show: false, - userData: {}, - resPas: false, - oldPsw: '', - newPsw: '', - password: '', - showOldPass: true, - showNewPass: true, - showPassWord: true, - binding: false, - msgOpenId: "", + show: false, + userData: {}, + resPas: false, + oldPsw: '', + newPsw: '', + password: '', + showOldPass: true, + showNewPass: true, + showPassWord: true, + binding: false, + msgOpenId: "", }, - + created() { this.setData({ - userData: app.globalData.userData, - loginName: app.globalData.userData.userName, - msgOpenId: "", + userData: app.globalData.userData, + loginName: app.globalData.userData.userName, + msgOpenId: "", }) }, + /** * 组件的方法列表 */ methods: { - loadUserInfo() { - let that = this; - //获取缓存数据 - wx.getStorage({ - key: 'userinfo', - success: function (res) { - findOpenUserMsgId(res.data.openId).then(vo =>{ - if(vo.code==200 && vo.data){ - res.data.msgOpenId=vo.data.msgOpenId; - wx.setStorage({ - key: 'userinfo', - data: res.data - }); - that.setData({ - show:true, - userData: res.data, - loginName: res.data.loginName, - msgOpenId: res.data.msgOpenId || "", - }) - } - }); - } - }) - }, - - showPopup() { - this.setData({ - show: true - }); - }, - - /** - * 关闭用户详情 - */ - closePopup() { - this.setData({ - show: false - }); - }, - - //修改密码 - resPassword: function () { - this.setData({ - resPas: true - }); - }, - - //绑定公众号 - binding: function () { - app.initWxAuth(); - }, - - /** - * 修改密码返回 - */ - closeResPas: function () { - this.setData({ - resPas: false - }); - }, - - /** - * 修改密码返回 - */ - closeBinding: function () { - this.setData({ - binding: false - }); - }, - - bindingBuild: function () { - wx.previewImage({ - urls: "https://szgcwx.jhncidg.com/staticFiles/qrv1.jpg".split(","), - current: 0 - }) - }, - - //退出登录 - loginOut: function () { - loginOut().then(res => { - removeToken(); - wx.clearStorageSync(); - wx.redirectTo({ - url: '../login/login' + loadUserInfo() { + let that = this; + //获取缓存数据 + wx.getStorage({ + key: 'userinfo', + success: function (res) { + findOpenUserMsgId(res.data.openId).then(vo => { + if (vo.code == 200 && vo.data) { + res.data.msgOpenId = vo.data.msgOpenId; + wx.setStorage({ + key: 'userinfo', + data: res.data + }); + that.setData({ + show: true, + userData: res.data, + loginName: res.data.loginName, + msgOpenId: res.data.msgOpenId || "", + }) + } + }); + } }) - }); - }, - - seeTap1() { - let that = this; - that.setData({ - // 切换图标 - showOldPass: !that.data.showOldPass - }) - }, - - seeTap2() { - let that = this; - that.setData({ - // 切换图标 - showNewPass: !that.data.showNewPass - }) - }, - - seeTap3() { - let that = this; - that.setData({ - // 切换图标 - showPassWord: !that.data.showPassWord - }) - if (that.data.newPsw != '' && that.data.newPsw != that.data.password) { - app.toast("两次密码输入不一致!"); - } - }, - - /** - * 添加预警信息 - */ - submit: function () { - var that = this; - if (false && that.data.oldPsw == '') { - app.toast("请输入旧密码!"); - return; - } - if (that.data.password == '') { - app.toast("请确认新密码!"); - return; - } - if (that.data.newPsw != '' && that.data.newPsw != that.data.password) { - app.toast("两次密码输入不一致!"); - return; - } - if (false && that.data.oldPsw.length < 6) { - app.toast("请输入旧密码长度 [6-20]位字符!"); - return; - } - if (that.data.newPsw.length < 6) { - app.toast("请输入新密码长度 [6-20]位字符!"); - return; - } - if (that.data.password.length < 6) { - app.toast("请输入确认密码长度 [6-20]位字符!"); - return; - } - let data = { - loginName: that.data.loginName, - oldPass: that.data.oldPsw, - password: that.data.newPsw, - confPass: that.data.password, - source:"u" - } - updatePwd(data).then(res =>{ - if(res.code==200){ - app.toast("密码修改成功,请重新登录!",800); - loginOut().then(res =>{ + }, + + showPopup() { + this.setData({ + show: true + }); + }, + + /** + * 关闭用户详情 + */ + closePopup() { + this.setData({ + show: false + }); + }, + + //修改密码 + resPassword: function () { + this.setData({ + resPas: true + }); + }, + + //绑定公众号 + binding: function () { + app.initWxAuth(); + }, + + /** + * 修改密码返回 + */ + closeResPas: function () { + this.setData({ + resPas: false + }); + }, + + /** + * 修改密码返回 + */ + closeBinding: function () { + this.setData({ + binding: false + }); + }, + + bindingBuild: function () { + wx.previewImage({ + urls: "https://szgcwx.jhncidg.com/staticFiles/qrv1.jpg".split(","), + current: 0 + }) + }, + + //退出登录 + loginOut: function () { + loginOut().then(res => { removeToken(); wx.clearStorageSync(); - setTimeout(()=>{ - wx.redirectTo({ - url: '../login/login' - }); - },500) + wx.redirectTo({ + url: '../login/login' + }) }); - } - }); - }, + }, + + seeTap1() { + let that = this; + that.setData({ + // 切换图标 + showOldPass: !that.data.showOldPass + }) + }, + + seeTap2() { + let that = this; + that.setData({ + // 切换图标 + showNewPass: !that.data.showNewPass + }) + }, + + seeTap3() { + let that = this; + that.setData({ + // 切换图标 + showPassWord: !that.data.showPassWord + }) + if (that.data.newPsw != '' && that.data.newPsw != that.data.password) { + app.toast("两次密码输入不一致!"); + } + }, + + /** + * 添加预警信息 + */ + submit: function () { + var that = this; + if (false && that.data.oldPsw == '') { + app.toast("请输入旧密码!"); + return; + } + if (that.data.password == '') { + app.toast("请确认新密码!"); + return; + } + if (that.data.newPsw != '' && that.data.newPsw != that.data.password) { + app.toast("两次密码输入不一致!"); + return; + } + if (false && that.data.oldPsw.length < 6) { + app.toast("请输入旧密码长度 [6-20]位字符!"); + return; + } + if (that.data.newPsw.length < 6) { + app.toast("请输入新密码长度 [6-20]位字符!"); + return; + } + if (that.data.password.length < 6) { + app.toast("请输入确认密码长度 [6-20]位字符!"); + return; + } + let data = { + loginName: that.data.loginName, + oldPass: that.data.oldPsw, + password: that.data.newPsw, + confPass: that.data.password, + source: "u" + } + updatePwd(data).then(res => { + if (res.code == 200) { + app.toast("密码修改成功,请重新登录!", 800); + loginOut().then(res => { + removeToken(); + wx.clearStorageSync(); + setTimeout(() => { + wx.redirectTo({ + url: '../login/login' + }); + }, 500) + }); + } + }); + }, } - }) \ No newline at end of file +}) \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/pages/login/login.js b/yanzhu-ui-app/miniprogram/pages/login/login.js index f346abb4..c3cf8cfc 100644 --- a/yanzhu-ui-app/miniprogram/pages/login/login.js +++ b/yanzhu-ui-app/miniprogram/pages/login/login.js @@ -4,6 +4,7 @@ import { getOpenId, setOpenId, setUserInfo, + getUserInfo, getSessionKey, setSessionKey, } from '../../utils/auth' @@ -17,6 +18,7 @@ import { } from '../../api/login' import { findMyProjectList, + findProSubDeptsUserInfo, } from '../../api/project' const app = getApp(); Page({ @@ -178,10 +180,17 @@ Page({ if(res.rows.length==1){ app.globalData.useProjectId = res.rows[0].id; app.globalData.useProjectName = res.rows[0].projectName; - //单项目直接进入项目页面 - wx.redirectTo({ - url: '../project_info/index', - }) + findProSubDeptsUserInfo(app.globalData.useProjectId).then(detail=>{ + if(detail.code==200){ + let userInfo = getUserInfo(); + userInfo.projectUserInfo = detail.data; + setUserInfo(userInfo); + //单项目直接进入项目页面 + wx.redirectTo({ + url: '../project_info/index', + }) + } + }); }else{ //多项目进入项目切换页面 wx.redirectTo({ diff --git a/yanzhu-ui-app/miniprogram/pages/project_flowable/approveTask/index.wxml b/yanzhu-ui-app/miniprogram/pages/project_flowable/approveTask/index.wxml index 01746523..7ba1d4e7 100644 --- a/yanzhu-ui-app/miniprogram/pages/project_flowable/approveTask/index.wxml +++ b/yanzhu-ui-app/miniprogram/pages/project_flowable/approveTask/index.wxml @@ -192,7 +192,13 @@ - 所属民族 + 民族 + {{subDeptUserData.userInfos.nation}} + + + + + 籍贯 {{subDeptUserData.userInfos.nativePlace}} diff --git a/yanzhu-ui-app/miniprogram/pages/project_flowable/detailTask/index.wxml b/yanzhu-ui-app/miniprogram/pages/project_flowable/detailTask/index.wxml index 10c447b8..eb80ea1f 100644 --- a/yanzhu-ui-app/miniprogram/pages/project_flowable/detailTask/index.wxml +++ b/yanzhu-ui-app/miniprogram/pages/project_flowable/detailTask/index.wxml @@ -192,7 +192,13 @@ - 所属民族 + 民族 + {{subDeptUserData.userInfos.nation}} + + + + + 籍贯 {{subDeptUserData.userInfos.nativePlace}} diff --git a/yanzhu-ui-app/miniprogram/pages/project_flowable/subDeptsUsers/index.js b/yanzhu-ui-app/miniprogram/pages/project_flowable/subDeptsUsers/index.js index 0367e18c..1354f88d 100644 --- a/yanzhu-ui-app/miniprogram/pages/project_flowable/subDeptsUsers/index.js +++ b/yanzhu-ui-app/miniprogram/pages/project_flowable/subDeptsUsers/index.js @@ -162,11 +162,10 @@ Page({ procInsId, deployId, category, - businessKey, - finishTime + businessKey } = e.currentTarget.dataset.set wx.setStorageSync('nav-types', "users"); - if (finishTime) { + if (this.data.activeState=="ysh") { //详情页面 wx.redirectTo({ url: `../detailTask/index?taskId=${taskId}&taskName=${taskName}&procInsId=${procInsId}&deployId=${deployId}&category=${category}&businessKey=${businessKey}` diff --git a/yanzhu-ui-app/miniprogram/pages/project_info/index.js b/yanzhu-ui-app/miniprogram/pages/project_info/index.js index 724e0c0c..7ddd692f 100644 --- a/yanzhu-ui-app/miniprogram/pages/project_info/index.js +++ b/yanzhu-ui-app/miniprogram/pages/project_info/index.js @@ -1,11 +1,11 @@ import config from '../../config' import { - getToken + getToken, + getUserInfo } from '../../utils/auth' import { findProjectInfo, - findProjectDepts, - findProSubDeptsUserByParams + findProjectDepts } from '../../api/project' import { findSubDeptsUsers, @@ -145,8 +145,8 @@ Page({ //项目基本信息 this.getProjectInfo(app.globalData.useProjectId); //用户项目信息 - this.getProSubDeptsUserInfo(app.globalData.useProjectId); - //项目单位信息 + this.getProSubDeptsUserInfo(); + //项目建设单位 this.getProjectDepts(app.globalData.useProjectId); } else { console.log("未查询到Token...{}...准备重新登录") @@ -349,29 +349,28 @@ Page({ * 查询单位人员信息 * @param {*} proId */ - getProSubDeptsUserInfo(proId) { - findProSubDeptsUserByParams(proId).then(res => { - app.globalData.subDeptUserData = res.data[0]; - this.setData({ - subDeptUserInfo: res.data[0] - }); - //劳务人员信息 - if ((app.globalData.subDeptUserData.subDeptType=='1' || app.globalData.subDeptUserData.subDeptType=='4' || app.globalData.subDeptUserData.subDeptType=='5') && app.globalData.subDeptUserData.userPost != '4' && app.globalData.subDeptUserData.userPost != '5' && app.globalData.subDeptUserData.userPost != '6' && app.globalData.subDeptUserData.userPost != '8') { - //统计劳务人员信息 - this.getSubDeptsUsers(app.globalData.useProjectId); - this.initSubDeptDaysCharts(app.globalData.useProjectId); - } - this.awaitTask(); - //今日出勤信息 - if (app.globalData.subDeptUserData.subDeptType=='1') { - this.getSubDeptsAttendanceView(app.globalData.useProjectId); - } - //人员出勤信息 - if (app.globalData.subDeptUserData.userPost == '4' || app.globalData.subDeptUserData.userPost == '5' || app.globalData.subDeptUserData.userPost == '6' || app.globalData.subDeptUserData.userPost == '8') { - //统计劳务人员信息 - this.getUsersAttendanceView(app.globalData.useProjectId); - } + getProSubDeptsUserInfo() { + const proUserInfo = getUserInfo(); + app.globalData.subDeptUserData = proUserInfo.projectUserInfo; + this.setData({ + subDeptUserInfo: proUserInfo.projectUserInfo }); + //劳务人员信息 + if ((app.globalData.subDeptUserData.subDeptType=='1' || app.globalData.subDeptUserData.subDeptType=='4' || app.globalData.subDeptUserData.subDeptType=='5') && app.globalData.subDeptUserData.userPost != '4' && app.globalData.subDeptUserData.userPost != '5' && app.globalData.subDeptUserData.userPost != '6' && app.globalData.subDeptUserData.userPost != '8') { + //统计劳务人员信息 + this.getSubDeptsUsers(app.globalData.useProjectId); + this.initSubDeptDaysCharts(app.globalData.useProjectId); + } + this.awaitTask(); + //今日出勤信息 + if (app.globalData.subDeptUserData.subDeptType=='1') { + this.getSubDeptsAttendanceView(app.globalData.useProjectId); + } + //人员出勤信息 + if (app.globalData.subDeptUserData.userPost == '4' || app.globalData.subDeptUserData.userPost == '5' || app.globalData.subDeptUserData.userPost == '6' || app.globalData.subDeptUserData.userPost == '8') { + //统计劳务人员信息 + this.getUsersAttendanceView(app.globalData.useProjectId); + } }, /** @@ -467,7 +466,7 @@ Page({ /** * 查询 - * 项目参建单位 + * 项目建设单位 * @param {*} proId */ getProjectDepts: function (proId) { diff --git a/yanzhu-ui-app/miniprogram/pages/project_list/index.js b/yanzhu-ui-app/miniprogram/pages/project_list/index.js index 26fdd608..f305bb76 100644 --- a/yanzhu-ui-app/miniprogram/pages/project_list/index.js +++ b/yanzhu-ui-app/miniprogram/pages/project_list/index.js @@ -1,8 +1,11 @@ import { - getToken + getToken, + setUserInfo, + getUserInfo } from '../../utils/auth' import { findMyProjectList, + findProSubDeptsUserInfo, } from '../../api/project' const app = getApp() Page({ @@ -56,8 +59,16 @@ import { //赋值到公共参数 app.globalData.useProjectId = even.currentTarget.dataset['id']; app.globalData.useProjectName = even.currentTarget.dataset['name']; - wx.redirectTo({ - url: '../project_info/index', - }) + findProSubDeptsUserInfo(app.globalData.useProjectId).then(detail=>{ + if(detail.code==200){ + let userInfo = getUserInfo(); + userInfo.projectUserInfo = detail.data; + setUserInfo(userInfo); + //单项目直接进入项目页面 + wx.redirectTo({ + url: '../project_info/index', + }) + } + }); } }) \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/pages/project_more/index.js b/yanzhu-ui-app/miniprogram/pages/project_more/index.js index a59693e4..8f779456 100644 --- a/yanzhu-ui-app/miniprogram/pages/project_more/index.js +++ b/yanzhu-ui-app/miniprogram/pages/project_more/index.js @@ -4,9 +4,6 @@ import { import { findUserMenuList } from '../../api/publics' -import { - findProSubDeptsUserByParams -} from '../../api/project' import { findMyTask } from '../../api/flowable' @@ -60,7 +57,7 @@ Page({ //用户权限菜单 this.getUserMenuList(app.globalData.useProjectId); //用户项目信息 - this.getProSubDeptsUserInfo(app.globalData.useProjectId); + this.getProSubDeptsUserInfo(); this.awaitTask(); } else { console.log("未查询到Token...{}...准备重新登录") @@ -86,15 +83,12 @@ Page({ /** * 查询单位人员信息 - * @param {*} proId */ - getProSubDeptsUserInfo(proId) { - findProSubDeptsUserByParams(proId).then(res => { - app.globalData.subDeptUserData = res.data; - this.setData({ - subDeptUserInfo: res.data[0] - }); - }); + getProSubDeptsUserInfo() { + const proUserInfo = getUserInfo(); + this.setData({ + subDeptUserInfo: proUserInfo.projectUserInfo + }); }, goMenu: function (event) { diff --git a/yanzhu-ui-app/miniprogram/pages/project_problemmodify/add/index.js b/yanzhu-ui-app/miniprogram/pages/project_problemmodify/add/index.js new file mode 100644 index 00000000..9cb7d862 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/pages/project_problemmodify/add/index.js @@ -0,0 +1,543 @@ +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + maxDate: new Date(2088, 1, 1).getTime(), + minDate: new Date().getTime() + (3600 * 48 * 1000), + projectId: "", + projectName: "", + loginName: "", + userName: "", + rectifierData: [], + rectifierData2: [], + rectifierData3: [], + imageInfoData: [], + //验收时间 + nickedTime: '', + loadShow: false, + lordSent: "", + lordSentUser: "", + copySend: "", + copySendUser: "", + recheckSend: "", + recheckSendUser: "", + workParts: "", + changeInfo: "", + dangerType: "1", + dangerTypeList: [], + selectValue: "", + selectIndex: "", + problemType: "1", + showHis: false, + problemTypeList: [{ + id: "1", + text: "常规检查" + }, { + id: "2", + text: "专项检查" + }], + flowNodes:[{text:'开始'},{text:'提交隐患'},{text:'隐患整改'},{text:'隐患复检'},{text:'结束'}], + active: 0 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + let { + ts + } = options + this.setData({ + projectId: app.globalData.projectId, + projectName: app.globalData.projectName, + loginName: res.data.loginName, + userName: res.data.nickName, + recheckSend: res.data.nickName, + recheckSendUser: res.data.loginName + }); + //获取缓存数据 + wx.getStorage({ + key: 'YanZhu-XD-App-UserInfoKey', + success: res => { + this.setData({ + projectId: app.globalData.projectId, + projectName: app.globalData.projectName, + loginName: res.data.loginName, + userName: res.data.nickName, + recheckSend: res.data.nickName, + recheckSendUser: res.data.loginName + }); + this.getAllProjectUserData(); + this.getDangerTypeList(); + this.getHisInfo(); + } + }) + }, + + //查询项目人员数据 + getAllProjectUserData() { + let that = this + wx.request({ + url: app.globalData.reqUrl + '/wechat/projectuserinfo/queryAllProjectUserByParams', + method: "get", + data: { + projectId: that.data.projectId, + loginName: that.data.loginName + }, + header: { + 'content-type': 'application/x-www-form-urlencoded' + }, + success(res) { + res = res.data + if (res.code == 200) { + that.setData({ + rectifierData: res.data, + rectifierData3: res.data, + }) + } + } + }) + + wx.request({ + url: app.globalData.reqUrl + '/wechat/projectuserinfo/queryAllProjectUserByParams', + method: "get", + data: { + projectId: that.data.projectId, + loginName: that.data.loginName, + selectMy: 'Y' + }, + header: { + 'content-type': 'application/x-www-form-urlencoded' + }, + success(res) { + res = res.data; + if (res.code == 200) { + let findMy = false; + res.data.forEach(it => { + if (it.userinfoList.length > 0) { + it.userinfoList.forEach(u => { + if (that.data.loginName == u.phonenumber) { + findMy = true; + } + }); + } + }); + if(!findMy){ + res.data[0].userinfoList.push({state:false,nickName:that.data.userName,jobTypeName:'集团公司',phonenumber:that.data.loginName}); + } + that.setData({ + rectifierData2: res.data, + }) + } + } + }) + }, + + getHisInfo() { + //这里查询当前登录人上次提交隐患,自动填充整改人,复检人,抄送人 + let that = this + wx.request({ + url: app.globalData.reqUrl + '/wechat/projectProblemmodify/findLastDataByParams', + method: "get", + data: { + projectId: that.data.projectId, + createUser: that.data.loginName, + infoType: 1 + }, + header: { + 'content-type': 'application/x-www-form-urlencoded' + }, + success(res) { + res = res.data + if (res.code == 200 && res.data) { + that.setData({ + showHis: true, + lordSent: res.data.lordSent, + lordSentUser: res.data.lordSentUser, + recheckSend: res.data.recheckSend, + recheckSendUser: res.data.recheckSendUser, + copySend: res.data.copySend, + copySendUser: res.data.copySendUser + }) + } + } + }) + }, + + getDangerTypeList() { + let that = this + wx.request({ + url: app.globalData.reqUrl + '/wechat/projectProblemmodify/queryDangerType', + method: "get", + data: { + type: 'ssp_zlyhlx' + }, + header: { + 'content-type': 'application/x-www-form-urlencoded' + }, + success(res) { + res = res.data + if (res.code == 200) { + let list = []; + res.data.forEach(it => { + list.push({ + "id": it.dictValue, + "text": it.dictLabel + }); + }) + that.setData({ + dangerTypeList: list + }) + } + } + }) + }, + + //隐患描述 + onInputWorkParts(e) { + let workParts = e.detail.value + this.setData({ + workParts + }) + }, + + //整改要求 + onInputChangeInfoValue(e) { + let changeInfo = e.detail.value + this.setData({ + changeInfo + }) + }, + + //验收时间 + onInputTime(e) { + let nickedTime = e.detail + this.setData({ + nickedTime + }) + }, + + // list 上传图片 + onImagesArr(e) { + var data = this.data.imageInfoData + data = e.detail + this.setData({ + imageInfoData: data + }) + }, + + //添加整改人 + onAddLordSent(e) { + if (e.detail.length > 0) { + this.setData({ + lordSent: e.detail[0].userName, + lordSentUser: e.detail[0].phoneNumber + }) + } + }, + + //添加抄送人 + onAddCopySend(e) { + if (e.detail.length > 0) { + let phoneNumbers = ""; + let userNames = ""; + e.detail.forEach(it => { + phoneNumbers += "," + it.phoneNumber; + userNames += "," + it.userName; + }); + this.setData({ + copySend: userNames.substring(1), + copySendUser: phoneNumbers.substring(1) + }) + } else { + this.setData({ + copySend: "", + copySendUser: "" + }) + } + }, + + //添加复检人 + onAddRecheckSend(e) { + if (e.detail.length > 0) { + this.setData({ + recheckSend: e.detail[0].userName, + recheckSendUser: e.detail[0].phoneNumber + }) + } + }, + + //取消页面 + cancelSaveView() { + this.returnToPage() + }, + + //保存 + onProblemSubmitSave() { + this.setData({ + loadShow: true + }) + let that = this + let { + projectId, + projectName, + dangerType, + lordSent, + lordSentUser, + copySend, + copySendUser, + workParts, + changeInfo, + nickedTime, + recheckSend, + recheckSendUser, + imageInfoData, + loginName, + problemType, + userName + } = that.data; + //数据效验 + if (projectId == "" || loginName == "") { + app.toast("数据异常,请刷新页面重试!") + that.setData({ + loadShow: false + }) + return; + } + if (imageInfoData.length == 0) { + app.toast("请上传隐患现场图片!") + that.setData({ + loadShow: false + }) + return; + } + if (problemType == "") { + app.toast("请选择检查类型!") + that.setData({ + loadShow: false + }) + return; + } + if (dangerType == "") { + app.toast("请选择隐患类型!") + that.setData({ + loadShow: false + }) + return; + } + if (workParts == "") { + app.toast("请填写隐患描述!") + that.setData({ + loadShow: false + }) + return; + } + if (changeInfo == "") { + app.toast("请填写隐患整改要求!") + that.setData({ + loadShow: false + }) + return; + } + if (nickedTime == "") { + app.toast("请选择整改截至时间!") + that.setData({ + loadShow: false + }) + return; + } + if (lordSent == "" || lordSentUser == "") { + app.toast("请选择整改人!") + that.setData({ + loadShow: false + }) + return; + } + if (recheckSend == "" || recheckSendUser == "") { + app.toast("请选择复检人!") + that.setData({ + loadShow: false + }) + return; + } + if (copySend == "" || copySendUser == "") { + app.toast("请选择抄送人!") + that.setData({ + loadShow: false + }) + return; + } + let pos = copySend.split(","); + pos.forEach(it => { + if (it == lordSent) { + app.toast("抄送人中不能包含整改人!") + that.setData({ + loadShow: false + }) + return; + } + }); + let fileUrls = []; + imageInfoData.forEach(async (item) => { + let uploadUrl = app.globalData.uploadUrl + '/common/upload' + let name = "file" + //这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片 + let obj = await that.syncUploadImage(uploadUrl, item, name); + fileUrls.push(obj.data.fileName); + //验证图片上传完毕 + if (fileUrls.length == imageInfoData.length) { + let params = { + projectId, + infoType: "1", + problemArea: projectName, + problemType, + workParts, + changeInfo, + lordSent, + lordSentUser, + copySend, + copySendUser, + checkState: 0, + nickedTime: nickedTime + " 23:59:59", + smarkUrl: fileUrls.toString(), + createUser: loginName, + dangerType, + recheckSend, + recheckSendUser + } + wx.request({ + url: app.globalData.reqUrl + '/wechat/projectProblemmodify/addQuality', + method: "POST", + data: params, + header: { + "Username": loginName, + "Content-Type": "application/json" + }, + success(res) { + that.setData({ + loadShow: false + }) + res = res.data + if (res.code == 200) { + app.toast("添加成功!") + setTimeout(() => { + wx.redirectTo({ + url: '../list/index', + }) + }, 200) + } + } + }) + } + }) + }, + + /** + * 这里考虑上传图片异步问题,封装为同步 + */ + syncUploadImage(url, uploadFile, name) { + return new Promise((resolve, reject) => { + wx.uploadFile({ + url, // 上传的服务器接口地址 + filePath: uploadFile, + header: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8" + }, + name, //上传的所需字段,后端提供 + formData: { + user: 'test' + }, + success: (res) => { + // 上传完成操作 + const data = JSON.parse(res.data) + resolve({ + data: data + }) + }, + fail: (err) => { + //上传失败:修改pedding为reject + console.log("访问接口失败", err); + wx.showToast({ + title: "网络出错,上传失败", + icon: 'none', + duration: 1000 + }); + reject(err) + } + }); + }) + }, + + //选择检查类型 + onSelectProblemType(e) { + this.setData({ + problemType: e.detail.id + }) + }, + + //选择隐患类型 + onSelectDangerType(e) { + this.setData({ + dangerType: e.detail.id + }) + }, + + returnToPage: function () { + /*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/ + wx.redirectTo({ + url: '../list/index', + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/pages/project_problemmodify/add/index.json b/yanzhu-ui-app/miniprogram/pages/project_problemmodify/add/index.json new file mode 100644 index 00000000..8ee905ec --- /dev/null +++ b/yanzhu-ui-app/miniprogram/pages/project_problemmodify/add/index.json @@ -0,0 +1,7 @@ +{ + "usingComponents": { + "van-steps": "@vant/weapp/steps/index", + "van-overlay": "@vant/weapp/overlay/index" + }, + "navigationStyle":"custom" + } \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/pages/project_problemmodify/add/index.wxml b/yanzhu-ui-app/miniprogram/pages/project_problemmodify/add/index.wxml new file mode 100644 index 00000000..4e0fbe4f --- /dev/null +++ b/yanzhu-ui-app/miniprogram/pages/project_problemmodify/add/index.wxml @@ -0,0 +1,141 @@ + + + + + + + + 新增质量隐患 + + + + + + + + + {{projectName}} + + + 隐患图片 + + + + + + 检查类型 + + + + + + 隐患类型 + + + + + + 隐患描述 + +