diff --git a/pom.xml b/pom.xml index f5143abf..0ea61c65 100644 --- a/pom.xml +++ b/pom.xml @@ -372,6 +372,14 @@ 本地服务器环境 62.234.3.186:8848 + + + + 测试服务器环境 + + 测试服务器环境 + 62.234.3.186:8848 + true @@ -384,14 +392,7 @@ 0.0.0.0:8848 - - 测试服务器环境 - - 测试服务器环境 - 62.234.3.186:8848 - - - + docker测试环境1 diff --git a/yanzhu-auth/pom.xml b/yanzhu-auth/pom.xml index 3bff77b8..be53cfe8 100644 --- a/yanzhu-auth/pom.xml +++ b/yanzhu-auth/pom.xml @@ -53,13 +53,16 @@ - + - ${project.artifactId} org.springframework.boot spring-boot-maven-plugin + 2.5.15 + + true + @@ -68,43 +71,17 @@ - - com.spotify - docker-maven-plugin - 1.2.0 + org.apache.maven.plugins + maven-war-plugin + 3.1.0 - - ${project.build.finalName} - latest - - openjdk:latest - - ["java", "-jar", "/${project.build.finalName}.jar"] - - true - ${configuration.docker-one-Host} - - - / - - ${project.build.directory} - - ${project.build.finalName}.jar - - + false + ${project.artifactId} - - - build-image - package - - build - - - + ${project.artifactId} @@ -113,5 +90,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/yanzhu-common/yanzhu-common-core/src/main/java/com/yanzhu/common/core/enums/UserTypeEnums.java b/yanzhu-common/yanzhu-common-core/src/main/java/com/yanzhu/common/core/enums/UserTypeEnums.java index ae2086cb..a5184898 100644 --- a/yanzhu-common/yanzhu-common-core/src/main/java/com/yanzhu/common/core/enums/UserTypeEnums.java +++ b/yanzhu-common/yanzhu-common-core/src/main/java/com/yanzhu/common/core/enums/UserTypeEnums.java @@ -7,8 +7,10 @@ public enum UserTypeEnums { ZSRY("00", "正式人员"), LSRY("08", "临时人员"), - FBDL("80", "分包代理"), - FBRY("81", "分包人员"); + FBWTDL("80", "分包代理人"), + FBXMJL("79", "分包项目经理"), + FBBZZZ("78", "分包班组组长"), + FBLWRY("77", "分包劳务人员"); private final String code; private final String info; diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfo.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfo.java index 2f6764f6..e0600b48 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfo.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfo.java @@ -49,6 +49,11 @@ public class ProProjectInfo extends BaseEntity @Excel(name = "项目类型") private String projectType; + /** + * 项目类型名称 + */ + private String projectTypeName; + /** 项目等级 */ @Excel(name = "项目等级") private String projectLevel; @@ -550,6 +555,14 @@ public class ProProjectInfo extends BaseEntity this.projectPackage = projectPackage; } + public String getProjectTypeName() { + return projectTypeName; + } + + public void setProjectTypeName(String projectTypeName) { + this.projectTypeName = projectTypeName; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/AttendanceUbiDataMapper.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/AttendanceUbiDataMapper.java index 340f4c9d..e53afad0 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/AttendanceUbiDataMapper.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/AttendanceUbiDataMapper.java @@ -1,6 +1,8 @@ package com.yanzhu.manage.mapper; import java.util.List; +import java.util.Map; + import com.yanzhu.manage.domain.AttendanceUbiData; /** @@ -63,4 +65,17 @@ public interface AttendanceUbiDataMapper List queryStatistics(AttendanceUbiData attendanceUbiData); List queryStatisticsByUserIds(AttendanceUbiData attendanceUbiData); + + /** + * 统计今日出勤信息 + * @param where 查询条件 + */ + List> statsAttendanceDays(AttendanceUbiData where); + + /** + * 统计人员出勤信息 + * @param where 查询条件 + */ + List> statsAttendanceView(AttendanceUbiData where); + } diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsUsersMapper.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsUsersMapper.java index ef429f3b..495a1810 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsUsersMapper.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsUsersMapper.java @@ -95,4 +95,9 @@ public interface ProProjectInfoSubdeptsUsersMapper * @return 结果 */ public List> findActReProcdefDept(@Param("proId")Long proId, @Param("defType")String defType); + + /** + * 统计分包单位在岗人员 + */ + public List> statsSubDeptsUsersByProId(ProProjectInfoSubdeptsUsers where); } diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/AttendanceUbiDataMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/AttendanceUbiDataMapper.xml index eca16430..8bc034bf 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/AttendanceUbiDataMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/AttendanceUbiDataMapper.xml @@ -40,11 +40,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" eventGuid,inPhoto,outPhoto,comName,projectName,sub_dept_id,sub_dept_name, inTime, outTime, deviceNo, is_del, state, remark, create_by, create_time, update_by, update_time from attendance_ubi_data + select id, comId, projectId, userId, userName, sub_dept_group, sub_dept_group_name, craft_type, craft_post,admitGuid, eventGuid,inPhoto,outPhoto,inData,outData,comName,projectName,sub_dept_id,sub_dept_name, inTime, outTime, deviceNo, is_del, state, remark, create_by, create_time, update_by, update_time from attendance_ubi_data - and comId = #{comId} @@ -63,7 +66,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and deviceNo = #{deviceNo} and is_del = #{isDel} and state = #{state} + and date(create_time) between #{params.beginTime} and #{params.endTime} + order by id desc + select u.craft_type as craftType, count(1) as total from attendance_ubi_data d + left join pro_project_info_subdepts_users u on u.user_id = d.userId + where u.id is not null and u.use_status = '1' + and d.comId = #{comId} + and d.projectId = #{projectId} + and d.sub_dept_id = #{subDeptId} + and d.sub_dept_group = #{subDeptGroup} + and date(d.create_time) = #{params.createTime} + group by u.craft_type + + + + \ No newline at end of file diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoMapper.xml index 75437765..7a0b2937 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoMapper.xml @@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -24,13 +25,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - @@ -89,22 +88,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select pi.id, pi.com_id, sd.dept_name as com_name, pi.dis_dept_id,sd2.dept_name dis_dept_name, pi.project_name, - pi.project_code, pi.simple_name, pi.project_type, pi.project_level, pi.project_regional, pi.project_package, pi.project_address, pi.project_nature, + pi.project_code, pi.simple_name, pi.project_type, sdd1.dict_label as project_type_name, pi.project_level, pi.project_regional, pi.project_package, pi.project_address, pi.project_nature, pi.tech_leader,pi.tech_leader_phone,pi.province,pi.city,pi.district, pi.licence_number, pi.project_person, pi.project_person_phone, pi.longitude, pi.latitude, pi.project_time_limit, pi.total_investment, pi.floor_area, pi.total_output_value, pi.planned_completion_time, pi.scheduled_start_time, pi.actual_operating_time, pi.actual_completion_time, @@ -131,6 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join sys_dept sd2 on sd2.dept_id = pi.dis_dept_id left join pro_project_info_depts pd on pi.id=pd.project_id left join pro_project_info_setting ps on pi.id=ps.project_id + left join sys_dict_data sdd1 on sdd1.dict_value = pi.project_type and sdd1.dict_type='pro_project_type' where pi.id = #{id} diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml index df9ffb35..39a6d94d 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml @@ -68,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + SELECT psu.id, psu.par_id, psu.com_id, psu.project_id, pi.project_name, psu.sub_dept_id, psu.sub_dept_type, dic3.dict_label as sub_dept_type_name, psu.sub_dept_name, psu.sub_dept_power_path, psu.user_id, psu.sub_dept_group, psu.sub_dept_group_name, psu.user_post, psu.craft_type, psu.craft_post, psu.edu_status, psu.edu_file_path, psu.edu_sign_path, psu.edu_date, psu.approve_status, @@ -314,4 +315,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where rp.SUSPENSION_STATE_ = 1 and PROJ_ID_ = #{proId} and TYPE_ = #{defType} order by SORT_ desc + + \ No newline at end of file diff --git a/yanzhu-common/yanzhu-common-security/src/main/java/com/yanzhu/common/security/service/TokenService.java b/yanzhu-common/yanzhu-common-security/src/main/java/com/yanzhu/common/security/service/TokenService.java index 914736a3..b7d163ce 100644 --- a/yanzhu-common/yanzhu-common-security/src/main/java/com/yanzhu/common/security/service/TokenService.java +++ b/yanzhu-common/yanzhu-common-security/src/main/java/com/yanzhu/common/security/service/TokenService.java @@ -49,8 +49,9 @@ public class TokenService public Map createToken(LoginUser loginUser) { String token = IdUtils.fastUUID(); - Long userId = loginUser.getSysUser().getUserId(); - String userName = loginUser.getSysUser().getUserName(); + SysUser user = loginUser.getSysUser(); + Long userId = user.getUserId(); + String userName = user.getUserName(); loginUser.setToken(token); loginUser.setUserid(userId); loginUser.setUsername(userName); @@ -65,6 +66,9 @@ public class TokenService // 接口返回信息 Map rspMap = new HashMap(); + rspMap.put("access_uid", userId); + rspMap.put("access_type", user.getUserType()); + rspMap.put("access_role", user.getRoles()); rspMap.put("access_token", JwtUtils.createToken(claimsMap)); rspMap.put("expires_in", expireTime); return rspMap; @@ -93,6 +97,7 @@ public class TokenService // 接口返回信息 Map rspMap = new HashMap(); + rspMap.put("access_uid", userId); rspMap.put("access_type", user.getUserType()); rspMap.put("access_role", user.getRoles()); rspMap.put("access_token", JwtUtils.createToken(claimsMap)); diff --git a/yanzhu-gateway/pom.xml b/yanzhu-gateway/pom.xml index d1703871..c9e9bbf2 100644 --- a/yanzhu-gateway/pom.xml +++ b/yanzhu-gateway/pom.xml @@ -91,11 +91,14 @@ - ${project.artifactId} org.springframework.boot spring-boot-maven-plugin + 2.5.15 + + true + @@ -104,44 +107,18 @@ - - com.spotify - docker-maven-plugin - 1.2.0 + org.apache.maven.plugins + maven-war-plugin + 3.1.0 - - ${project.build.finalName} - latest - - openjdk:latest - - ["java", "-jar", "/${project.build.finalName}.jar"] - - true - ${configuration.docker-two-Host} - - - / - - ${project.build.directory} - - ${project.build.finalName}.jar - - + false + ${project.artifactId} - - - build-image - package - - build - - - - + ${project.artifactId} + src/main/resources @@ -150,4 +127,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/yanzhu-modules/yanzhu-file/pom.xml b/yanzhu-modules/yanzhu-file/pom.xml index ff17d34f..5296cfce 100644 --- a/yanzhu-modules/yanzhu-file/pom.xml +++ b/yanzhu-modules/yanzhu-file/pom.xml @@ -69,11 +69,14 @@ - ${project.artifactId} org.springframework.boot spring-boot-maven-plugin + 2.5.15 + + true + @@ -82,43 +85,17 @@ - - com.spotify - docker-maven-plugin - 1.2.0 + org.apache.maven.plugins + maven-war-plugin + 3.1.0 - - ${project.build.finalName} - latest - - openjdk:latest - - ["java", "-jar", "/${project.build.finalName}.jar"] - - true - ${configuration.docker-one-Host} - - - / - - ${project.build.directory} - - ${project.build.finalName}.jar - - + false + ${project.artifactId} - - - build-image - package - - build - - - + ${project.artifactId} @@ -127,5 +104,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/yanzhu-modules/yanzhu-flowable/pom.xml b/yanzhu-modules/yanzhu-flowable/pom.xml index 959fceb7..7339194c 100644 --- a/yanzhu-modules/yanzhu-flowable/pom.xml +++ b/yanzhu-modules/yanzhu-flowable/pom.xml @@ -114,11 +114,14 @@ - ${project.artifactId} org.springframework.boot spring-boot-maven-plugin + 2.5.15 + + true + @@ -127,44 +130,18 @@ - - com.spotify - docker-maven-plugin - 1.2.0 + org.apache.maven.plugins + maven-war-plugin + 3.1.0 - - ${project.build.finalName} - latest - - openjdk:latest - - ["java", "-jar", "/${project.build.finalName}.jar"] - - true - ${configuration.docker-two-Host} - - - / - - ${project.build.directory} - - ${project.build.finalName}.jar - - + false + ${project.artifactId} - - - build-image - package - - build - - - - + ${project.artifactId} + src/main/resources @@ -173,4 +150,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/yanzhu-modules/yanzhu-flowable/src/main/java/com/yanzhu/flowable/controller/FlowBusinessKeyController.java b/yanzhu-modules/yanzhu-flowable/src/main/java/com/yanzhu/flowable/controller/FlowBusinessKeyController.java index ad388567..ba7d8aa3 100644 --- a/yanzhu-modules/yanzhu-flowable/src/main/java/com/yanzhu/flowable/controller/FlowBusinessKeyController.java +++ b/yanzhu-modules/yanzhu-flowable/src/main/java/com/yanzhu/flowable/controller/FlowBusinessKeyController.java @@ -188,7 +188,7 @@ public class FlowBusinessKeyController extends BaseController { if(CollectionUtils.isNotEmpty(list)){ data.put("todo",list.size()); }else{ - data.put("todo",5); + data.put("todo",0); } return success(data); } diff --git a/yanzhu-modules/yanzhu-manage/pom.xml b/yanzhu-modules/yanzhu-manage/pom.xml index 0f8f1138..304df2a0 100644 --- a/yanzhu-modules/yanzhu-manage/pom.xml +++ b/yanzhu-modules/yanzhu-manage/pom.xml @@ -172,13 +172,13 @@ - ${project.artifactId} org.springframework.boot spring-boot-maven-plugin + 2.5.15 - true + true @@ -188,44 +188,18 @@ - - com.spotify - docker-maven-plugin - 1.2.0 + org.apache.maven.plugins + maven-war-plugin + 3.1.0 - - ${project.build.finalName} - latest - - openjdk:latest - - ["java", "-jar", "/${project.build.finalName}.jar"] - - true - ${configuration.docker-two-Host} - - - / - - ${project.build.directory} - - ${project.build.finalName}.jar - - + false + ${project.artifactId} - - - build-image - package - - build - - - - + ${project.artifactId} + src/main/resources @@ -234,4 +208,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProProjectInfoDeptsController.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProProjectInfoDeptsController.java index 688bdbbf..d6d51ced 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProProjectInfoDeptsController.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProProjectInfoDeptsController.java @@ -95,4 +95,16 @@ public class ProProjectInfoDeptsController extends BaseController { return toAjax(proProjectInfoDeptsService.deleteProProjectInfoDeptsByIds(ids)); } + + /** + * 查询参建单位 + */ + @GetMapping("/findAllDepts/{proId}") + public AjaxResult remove(@PathVariable("proId") Long proId) + { + ProProjectInfoDepts query = new ProProjectInfoDepts(); + query.setProjectId(proId); + List list = proProjectInfoDeptsService.selectProProjectInfoDeptsList(query); + return success(list); + } } diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProProjectInfoSubdeptsUsersController.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProProjectInfoSubdeptsUsersController.java index 59847f5c..13425e07 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProProjectInfoSubdeptsUsersController.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProProjectInfoSubdeptsUsersController.java @@ -9,6 +9,7 @@ import com.yanzhu.common.log.annotation.Log; import com.yanzhu.common.log.enums.BusinessType; import com.yanzhu.common.security.annotation.InnerAuth; import com.yanzhu.common.security.annotation.RequiresPermissions; +import com.yanzhu.common.security.utils.SecurityUtils; import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers; import com.yanzhu.manage.service.IProProjectInfoSubdeptsUsersService; import com.yanzhu.manage.service.IUniService; @@ -35,6 +36,7 @@ public class ProProjectInfoSubdeptsUsersController extends BaseController @Autowired private IUniService uniService; + /** * 查询分包单位工人列表 */ @@ -174,4 +176,18 @@ public class ProProjectInfoSubdeptsUsersController extends BaseController return AjaxResult.error(ex.getMessage()); } } + + /** + * 查询分包单位人员 + * @param proId 项目主键 + */ + @GetMapping("/findProSubDeptsUser/{proId}") + public AjaxResult findProSubDeptsUser(@PathVariable("proId")Long proId) + { + ProProjectInfoSubdeptsUsers query = new ProProjectInfoSubdeptsUsers(); + query.setProjectId(proId); + query.setUserId(SecurityUtils.getUserId()); + List list = proProjectInfoSubdeptsUsersService.selectProProjectInfoSubdeptsUsersList(query); + return success(list); + } } diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/wechat/WXAttendanceController.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/wechat/WXAttendanceController.java new file mode 100644 index 00000000..9b26696e --- /dev/null +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/wechat/WXAttendanceController.java @@ -0,0 +1,85 @@ +package com.yanzhu.manage.controller.wechat; + +import com.yanzhu.common.core.web.controller.BaseController; +import com.yanzhu.common.core.web.domain.AjaxResult; +import com.yanzhu.common.redis.service.RedisService; +import com.yanzhu.manage.domain.AttendanceUbiData; +import com.yanzhu.manage.service.IAttendanceUbiDataService; +import com.yanzhu.manage.service.IProProjectInfoSubdeptsUsersService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @version : V1.0 + * @ClassName: WXAttendanceController + * @Description: 人员考勤 + * @Auther: JiangYuQi + * @Date: 2024/12/7 18:03 + */ +@RestController +@RequestMapping("/attendance") +public class WXAttendanceController extends BaseController { + + @Autowired + private RedisService redisService; + + @Autowired + private IAttendanceUbiDataService attendanceUbiDataService; + + @Autowired + private IProProjectInfoSubdeptsUsersService proProjectInfoSubdeptsUsersService; + + /** + * 统计劳务人员信息 + * @param proId 项目主键 + * @return + */ + @GetMapping("/v1/findSubDeptsUsers/{proId}") + public AjaxResult findSubDeptsUsers(@PathVariable("proId") Long proId){ + List> list = proProjectInfoSubdeptsUsersService.statsSubDeptsUsersByProId(proId); + return AjaxResult.success(list); + } + + /** + * 统计今日出勤信息 + * @param proId 项目主键 + * @return + */ + @GetMapping("/v1/findDaysAttendanceView/{proId}") + public AjaxResult findDaysAttendanceView(@PathVariable("proId") Long proId){ + List> list = attendanceUbiDataService.statsAttendanceDaysByProId(proId); + return AjaxResult.success(list); + } + + /** + * 统计人员出勤信息 + * @param proId 项目主键 + * @return + */ + @GetMapping("/v1/findSubDeptsAttendanceView/{proId}") + public AjaxResult findSubDeptsAttendanceView(@PathVariable("proId") Long proId){ + List> list = attendanceUbiDataService.statsAttendanceViewByProId(proId); + Map data = new HashMap<>(); + data.put("list",list); + data.put("user",list.stream().mapToInt((u) -> Integer.valueOf(String.valueOf(u.get("total")))).sum()); + return AjaxResult.success(data); + } + + /** + * 统计人员出勤明细 + * @param proId 项目主键 + * @return + */ + @GetMapping("/v1/findUsersAttendanceView/{proId}") + public AjaxResult findUsersAttendanceView(@PathVariable("proId") Long proId){ + List list = attendanceUbiDataService.findUsersAttendanceView(proId); + return AjaxResult.success(list); + } +} diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IAttendanceUbiDataService.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IAttendanceUbiDataService.java index 82d76015..71a79b1d 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IAttendanceUbiDataService.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IAttendanceUbiDataService.java @@ -2,6 +2,8 @@ package com.yanzhu.manage.service; import java.util.Date; import java.util.List; +import java.util.Map; + import com.yanzhu.manage.domain.AttendanceUbiData; /** @@ -76,4 +78,23 @@ public interface IAttendanceUbiDataService List queryStatisticsByUserIds(AttendanceUbiData attendanceUbiData); List procStatistics(Date inTime, List datas, List userDatas,boolean updateCraft); + + /** + * 统计今日出勤信息 + * @param proId + */ + List> statsAttendanceDaysByProId(Long proId); + + /** + * 统计人员出勤信息 + * @param proId + */ + List> statsAttendanceViewByProId(Long proId); + + /** + * 查询人员出勤明细 + * @param proId + */ + List findUsersAttendanceView(Long proId); + } 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 c11154f8..8bccd2e9 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 @@ -4,6 +4,7 @@ import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers; import com.yanzhu.manage.domain.SignetFileVo; import java.util.List; +import java.util.Map; /** * 分包单位工人Service接口 @@ -117,4 +118,10 @@ public interface IProProjectInfoSubdeptsUsersService * @return */ List groupByCraftTypeByAttendance(ProProjectInfoSubdeptsUsers where); + + /** + * 统计分包单位在岗人员 + * @param proId + */ + List> statsSubDeptsUsersByProId(Long proId); } diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/AttendanceUbiDataServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/AttendanceUbiDataServiceImpl.java index c7fd1e20..7b63d260 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/AttendanceUbiDataServiceImpl.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/AttendanceUbiDataServiceImpl.java @@ -2,14 +2,21 @@ package com.yanzhu.manage.service.impl; import java.util.*; -import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A; +import cn.hutool.core.date.DateUtil; import com.yanzhu.common.core.context.SecurityContextHolder; +import com.yanzhu.common.core.enums.ShiFouEnums; +import com.yanzhu.common.core.enums.UserTypeEnums; import com.yanzhu.common.core.utils.DateUtils; import com.yanzhu.common.core.utils.StringUtils; +import com.yanzhu.common.security.utils.SecurityUtils; import com.yanzhu.manage.domain.AttendanceUbiData; +import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers; +import com.yanzhu.manage.enums.UserPostEnums; import com.yanzhu.manage.mapper.AttendanceUbiDataMapper; +import com.yanzhu.manage.mapper.ProProjectInfoSubdeptsUsersMapper; import com.yanzhu.manage.service.IAttendanceUbiDataService; import com.yanzhu.system.api.domain.SysDictData; +import com.yanzhu.system.api.domain.SysUser; import com.yanzhu.system.mapper.SysDictDataMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -23,12 +30,16 @@ import org.springframework.stereotype.Service; @Service public class AttendanceUbiDataServiceImpl implements IAttendanceUbiDataService { - @Autowired - private AttendanceUbiDataMapper attendanceUbiDataMapper; - @Autowired private SysDictDataMapper dictDataMapper; + + @Autowired + private AttendanceUbiDataMapper attendanceUbiDataMapper; + + @Autowired + private ProProjectInfoSubdeptsUsersMapper proProjectInfoSubdeptsUsersMapper; + /** * 查询考勤管理 * @@ -195,4 +206,79 @@ public class AttendanceUbiDataServiceImpl implements IAttendanceUbiDataService } return days; } + + /** + * 统计今日出勤信息 + * @param proId + */ + @Override + public List> statsAttendanceDaysByProId(Long proId){ + AttendanceUbiData attendanceQuery = new AttendanceUbiData(); + attendanceQuery.setProjectId(proId); + SysUser sysUser = SecurityUtils.getLoginUser().getSysUser(); + if(!Objects.equals(sysUser.getUserType(), UserTypeEnums.ZSRY.getCode()) && !Objects.equals(sysUser.getUserType(),UserTypeEnums.LSRY.getCode())){ + ProProjectInfoSubdeptsUsers query = new ProProjectInfoSubdeptsUsers(); + query.setProjectId(proId); + query.setUserId(sysUser.getUserId()); + List users = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersList(query); + if(StringUtils.isNotEmpty(users)){ + attendanceQuery.setSubDeptId(users.get(0).getSubDeptId()); + if(Objects.equals(users.get(0).getUserPost(), UserPostEnums.BZZ.getCode())){ + attendanceQuery.setSubDeptGroup(users.get(0).getSubDeptGroup()); + } + } + } + return attendanceUbiDataMapper.statsAttendanceDays(attendanceQuery); + } + + /** + * 统计人员出勤信息 + * @param proId + */ + @Override + public List> statsAttendanceViewByProId(Long proId){ + AttendanceUbiData attendanceQuery = new AttendanceUbiData(); + attendanceQuery.setProjectId(proId); + SysUser sysUser = SecurityUtils.getLoginUser().getSysUser(); + if(!Objects.equals(sysUser.getUserType(), UserTypeEnums.ZSRY.getCode()) && !Objects.equals(sysUser.getUserType(),UserTypeEnums.LSRY.getCode())){ + ProProjectInfoSubdeptsUsers query = new ProProjectInfoSubdeptsUsers(); + query.setProjectId(proId); + query.setUserId(sysUser.getUserId()); + List users = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersList(query); + if(StringUtils.isNotEmpty(users)){ + attendanceQuery.setSubDeptId(users.get(0).getSubDeptId()); + if(Objects.equals(users.get(0).getUserPost(), UserPostEnums.BZZ.getCode())){ + attendanceQuery.setSubDeptGroup(users.get(0).getSubDeptGroup()); + } + } + } + Map params = new HashMap<>(); + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.DAY_OF_MONTH, -1); + params.put("beginTime",DateUtil.format(calendar.getTime(),DateUtils.YYYY_MM_DD)); + calendar.add(Calendar.DAY_OF_MONTH, -6); + params.put("endTime",DateUtil.format(calendar.getTime(),DateUtils.YYYY_MM_DD)); + attendanceQuery.setParams(params); + return attendanceUbiDataMapper.statsAttendanceView(attendanceQuery); + } + + /** + * 查询人员出勤明细 + * @param proId + */ + @Override + public List findUsersAttendanceView(Long proId){ + AttendanceUbiData attendanceQuery = new AttendanceUbiData(); + attendanceQuery.setProjectId(proId); + attendanceQuery.setUserId(SecurityUtils.getUserId()); + Map params = new HashMap<>(); + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.DAY_OF_MONTH, -1); + params.put("beginTime",DateUtil.format(calendar.getTime(),DateUtils.YYYY_MM_DD)); + calendar.add(Calendar.DAY_OF_MONTH, -6); + params.put("endTime",DateUtil.format(calendar.getTime(),DateUtils.YYYY_MM_DD)); + attendanceQuery.setParams(params); + attendanceQuery.setIsDel(ShiFouEnums.FOU.getCode()); + return attendanceUbiDataMapper.selectAttendanceUbiDataList(attendanceQuery); + } } diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsGroupServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsGroupServiceImpl.java index 8ee60a33..e96f37a0 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsGroupServiceImpl.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsGroupServiceImpl.java @@ -88,7 +88,7 @@ public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSu SysUser sysUser = new SysUser(); sysUser.setUserName(proProjectInfoSubdeptsGroup.getGroupLeaderPhone()); sysUser.setNickName(proProjectInfoSubdeptsGroup.getGroupLeaderName()); - sysUser.setUserType(UserTypeEnums.FBRY.getCode()); + sysUser.setUserType(UserTypeEnums.FBBZZZ.getCode()); sysUser.setCardType(CardTypeEnums.SFZ.getCode()); sysUser.setCardCode(proProjectInfoSubdeptsGroup.getGroupLeaderCode()); sysUser.setUserPicture(proProjectInfoSubdeptsGroup.getGroupLeaderUserPicture()); @@ -126,7 +126,7 @@ public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSu SysUser sysUser = new SysUser(); sysUser.setUserName(proProjectInfoSubdeptsGroup.getGroupLeaderPhone()); sysUser.setNickName(proProjectInfoSubdeptsGroup.getGroupLeaderName()); - sysUser.setUserType(UserTypeEnums.FBRY.getCode()); + sysUser.setUserType(UserTypeEnums.FBBZZZ.getCode()); sysUser.setCardType(CardTypeEnums.SFZ.getCode()); sysUser.setCardCode(proProjectInfoSubdeptsGroup.getGroupLeaderCode()); sysUser.setUserPicture(proProjectInfoSubdeptsGroup.getGroupLeaderUserPicture()); diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsServiceImpl.java index 30bc69fc..c4c9091e 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsServiceImpl.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsServiceImpl.java @@ -110,7 +110,7 @@ public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdept SysUser sysUser = new SysUser(); sysUser.setUserName(proProjectInfoSubdepts.getSubDeptLeaderPhone()); sysUser.setNickName(proProjectInfoSubdepts.getSubDeptLeaderName()); - sysUser.setUserType(UserTypeEnums.FBDL.getCode()); + sysUser.setUserType(UserTypeEnums.FBWTDL.getCode()); sysUser.setPhonenumber(proProjectInfoSubdepts.getSubDeptLeaderPhone()); sysUser.setCardType(CardTypeEnums.SFZ.getCode()); sysUser.setCardCode(proProjectInfoSubdepts.getSubDeptLeaderCode()); @@ -200,7 +200,7 @@ public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdept SysUser sysUser = new SysUser(); sysUser.setUserName(proProjectInfoSubdepts.getSubDeptLeaderPhone()); sysUser.setNickName(proProjectInfoSubdepts.getSubDeptLeaderName()); - sysUser.setUserType(UserTypeEnums.FBDL.getCode()); + sysUser.setUserType(UserTypeEnums.FBWTDL.getCode()); sysUser.setPhonenumber(proProjectInfoSubdepts.getSubDeptLeaderPhone()); sysUser.setCardType(CardTypeEnums.SFZ.getCode()); sysUser.setCardCode(proProjectInfoSubdepts.getSubDeptLeaderCode()); @@ -272,7 +272,7 @@ public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdept sysUser.setUserName(proProjectInfoSubdepts.getSubDeptLeaderPhone()); sysUser.setNickName(proProjectInfoSubdepts.getSubDeptLeaderName()); sysUser.setPhonenumber(proProjectInfoSubdepts.getSubDeptLeaderPhone()); - sysUser.setUserType(UserTypeEnums.FBDL.getCode()); + sysUser.setUserType(UserTypeEnums.FBWTDL.getCode()); sysUser.setCardType(CardTypeEnums.SFZ.getCode()); sysUser.setCardCode(proProjectInfoSubdepts.getSubDeptLeaderCode()); sysUser.setUserPicture(proProjectInfoSubdepts.getLeaderUserPicture()); @@ -348,7 +348,7 @@ public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdept sysUser.setUserName(proProjectInfoSubdepts.getSubDeptLeaderPhone()); sysUser.setNickName(proProjectInfoSubdepts.getSubDeptLeaderName()); sysUser.setPhonenumber(proProjectInfoSubdepts.getSubDeptLeaderPhone()); - sysUser.setUserType(UserTypeEnums.FBDL.getCode()); + sysUser.setUserType(UserTypeEnums.FBWTDL.getCode()); sysUser.setCardType(CardTypeEnums.SFZ.getCode()); sysUser.setCardCode(proProjectInfoSubdepts.getSubDeptLeaderCode()); sysUser.setUserPicture(proProjectInfoSubdepts.getLeaderUserPicture()); 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 740ae03f..076ccd13 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 @@ -110,6 +110,15 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu proProjectInfoSubdeptsUsers.setSubStep(1L); proProjectInfoSubdeptsUsers.setApproveStatus(ApproveStatus.passed.getCode()); SysUser user = proProjectInfoSubdeptsUsers.getUser(); + if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.WTDL)){ + user.setUserType(UserTypeEnums.FBWTDL.getCode()); + }else if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.XMJL)){ + user.setUserType(UserTypeEnums.FBXMJL.getCode()); + }else if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.BZZ)){ + user.setUserType(UserTypeEnums.FBBZZZ.getCode()); + }else if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.LWGR)){ + user.setUserType(UserTypeEnums.FBLWRY.getCode()); + } Long userId= remoteUserService.registerUserInfo(user, SecurityConstants.INNER).getData(); proProjectInfoSubdeptsUsers.setUserId(userId); uniService.syncUniUser(userId,proProjectInfoSubdeptsUsers.getProjectId()); @@ -202,7 +211,15 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu // 完善人员信息... user.setUserName(proProjectInfoSubdeptsUsers.getPhoneNumber()); user.setPhonenumber(proProjectInfoSubdeptsUsers.getPhoneNumber()); - user.setUserType(UserTypeEnums.FBRY.getCode()); + if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.WTDL)){ + user.setUserType(UserTypeEnums.FBWTDL.getCode()); + }else if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.XMJL)){ + user.setUserType(UserTypeEnums.FBXMJL.getCode()); + }else if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.BZZ)){ + user.setUserType(UserTypeEnums.FBBZZZ.getCode()); + }else if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.LWGR)){ + user.setUserType(UserTypeEnums.FBLWRY.getCode()); + } user.setCardType(CardTypeEnums.SFZ.getCode()); user.setSex(StringUtils.judgeGender(user.getCardCode())); user.setCreateBy(DataSourceEnuns.APP.getInfo()); @@ -226,6 +243,18 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu proProjectInfoSubdeptsUsers.setUpdateBy(SecurityUtils.getUsername()); proProjectInfoSubdeptsUsers.setUpdateTime(DateUtils.getNowDate()); SysUser user = proProjectInfoSubdeptsUsers.getUser(); + // 完善人员信息... + if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.WTDL)){ + user.setUserType(UserTypeEnums.FBWTDL.getCode()); + }else if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.XMJL)){ + user.setUserType(UserTypeEnums.FBXMJL.getCode()); + }else if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.BZZ)){ + user.setUserType(UserTypeEnums.FBBZZZ.getCode()); + }else if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.LWGR)){ + user.setUserType(UserTypeEnums.FBLWRY.getCode()); + } + user.setUpdateBy(SecurityUtils.getUsername()); + user.setUpdateTime(DateUtils.getNowDate()); Long userId = remoteUserService.registerUserInfo(user, SecurityConstants.INNER).getData(); proProjectInfoSubdeptsUsers.setUserId(userId); uniService.syncUniUser(userId,proProjectInfoSubdeptsUsers.getProjectId()); @@ -343,7 +372,15 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu // 完善人员信息 user.setUserName(user.getPhonenumber()); - user.setUserType(UserTypeEnums.FBRY.getCode()); + if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.WTDL)){ + user.setUserType(UserTypeEnums.FBWTDL.getCode()); + }else if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.XMJL)){ + user.setUserType(UserTypeEnums.FBXMJL.getCode()); + }else if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.BZZ)){ + user.setUserType(UserTypeEnums.FBBZZZ.getCode()); + }else if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.LWGR)){ + user.setUserType(UserTypeEnums.FBLWRY.getCode()); + } user.setCardType(CardTypeEnums.SFZ.getCode()); user.setSex(StringUtils.judgeGender(user.getCardCode())); user.setUpdateBy(DataSourceEnuns.APP.getInfo()); @@ -614,4 +651,27 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu return proProjectInfoSubdeptsUsersMapper.groupByCraftTypeByAttendance(where); } + /** + * 统计分包单位在岗人员 + * @param proId + */ + @Override + public List> statsSubDeptsUsersByProId(Long proId){ + ProProjectInfoSubdeptsUsers query = new ProProjectInfoSubdeptsUsers(); + query.setProjectId(proId); + SysUser sysUser = SecurityUtils.getLoginUser().getSysUser(); + if(!Objects.equals(sysUser.getUserType(),UserTypeEnums.ZSRY.getCode()) && !Objects.equals(sysUser.getUserType(),UserTypeEnums.LSRY.getCode())){ + query.setUserId(sysUser.getUserId()); + List users = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersList(query); + query.setUserId(null); + if(StringUtils.isNotEmpty(users)){ + query.setSubDeptId(users.get(0).getSubDeptId()); + if(Objects.equals(users.get(0).getUserPost(),UserPostEnums.BZZ.getCode())){ + query.setSubDeptGroup(users.get(0).getSubDeptGroup()); + } + } + } + return proProjectInfoSubdeptsUsersMapper.statsSubDeptsUsersByProId(query); + } + } diff --git a/yanzhu-modules/yanzhu-system/pom.xml b/yanzhu-modules/yanzhu-system/pom.xml index 6e843396..ad21b65d 100644 --- a/yanzhu-modules/yanzhu-system/pom.xml +++ b/yanzhu-modules/yanzhu-system/pom.xml @@ -94,11 +94,14 @@ - ${project.artifactId} org.springframework.boot spring-boot-maven-plugin + 2.5.15 + + true + @@ -107,44 +110,18 @@ - - com.spotify - docker-maven-plugin - 1.2.0 + org.apache.maven.plugins + maven-war-plugin + 3.1.0 - - ${project.build.finalName} - latest - - openjdk:latest - - ["java", "-jar", "/${project.build.finalName}.jar"] - - true - ${configuration.docker-two-Host} - - - / - - ${project.build.directory} - - ${project.build.finalName}.jar - - + false + ${project.artifactId} - - - build-image - package - - build - - - - + ${project.artifactId} + src/main/resources @@ -152,5 +129,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/api/attendance.js b/yanzhu-ui-app/miniprogram/api/attendance.js new file mode 100644 index 00000000..53244cbd --- /dev/null +++ b/yanzhu-ui-app/miniprogram/api/attendance.js @@ -0,0 +1,35 @@ +import { + request +} from '../utils/request' + +// 统计劳务人员信息 +export function findSubDeptsUsers(proId) { + return request({ + url: '/manage/attendance/v1/findSubDeptsUsers/'+proId, + method: 'get' + }) +} + +// 统计今日出勤信息 +export function findDaysAttendanceView(proId) { + return request({ + url: '/manage/attendance/v1/findDaysAttendanceView/'+proId, + method: 'get' + }) +} + +// 统计人员出勤信息 +export function findSubDeptsAttendanceView(proId) { + return request({ + url: '/manage/attendance/v1/findSubDeptsAttendanceView/'+proId, + method: 'get' + }) +} + +// 查询人员出勤信息 +export function findUsersAttendanceView(proId) { + return request({ + url: '/manage/attendance/v1/findUsersAttendanceView/'+proId, + method: 'get' + }) +} diff --git a/yanzhu-ui-app/miniprogram/api/login.js b/yanzhu-ui-app/miniprogram/api/login.js index 3aaea177..dc07d9f7 100644 --- a/yanzhu-ui-app/miniprogram/api/login.js +++ b/yanzhu-ui-app/miniprogram/api/login.js @@ -69,3 +69,11 @@ export function getMaPhoneNumber(data) { }) } +//从缓存获取用户信息 +export function findUserInfoByCache(){ + return request({ + 'url': '/system/user/getInfo', + 'method': 'get' + }) +} + diff --git a/yanzhu-ui-app/miniprogram/api/project.js b/yanzhu-ui-app/miniprogram/api/project.js index 6a6cf0b1..79f9f35e 100644 --- a/yanzhu-ui-app/miniprogram/api/project.js +++ b/yanzhu-ui-app/miniprogram/api/project.js @@ -43,6 +43,14 @@ export function findProSubDeptsUserById(id) { }) } +// 查询项目参建单位人员 +export function findProSubDeptsUserByParams(proId) { + return request({ + url: '/manage/proProjectInfoSubdeptsUsers/findProSubDeptsUser/' + proId, + method: 'get' + }) +} + // 新增项目参建单位人员 export function registerSubDeptsUsers(data) { return request({ @@ -50,4 +58,20 @@ export function registerSubDeptsUsers(data) { method: 'post', data: data }) +} + +// 查询我的项目信息 +export function findMyProjectList() { + return request({ + url: '/manage/proProjectInfo/findMyProjectList', + method: 'get' + }) +} + +// 查询项目参建单位 +export function findProjectDepts(proId) { + return request({ + url: '/manage/proProjectInfoDepts/findAllDepts/' + proId, + method: 'get' + }) } \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/app.js b/yanzhu-ui-app/miniprogram/app.js index 2b94bd3b..8a6ea032 100644 --- a/yanzhu-ui-app/miniprogram/app.js +++ b/yanzhu-ui-app/miniprogram/app.js @@ -26,15 +26,9 @@ import { App({ globalData: { userData: null, - paramDeptId: '', useProjectId: '', useProjectName: '', - searchProject: { - id: "", - text: "全部临时项目", - projectId: "", - projectName: "全部临时项目" - }, + searchProject: {}, projectInfoList: [], }, diff --git a/yanzhu-ui-app/miniprogram/app.json b/yanzhu-ui-app/miniprogram/app.json index 8b7265eb..f3c29501 100644 --- a/yanzhu-ui-app/miniprogram/app.json +++ b/yanzhu-ui-app/miniprogram/app.json @@ -10,9 +10,8 @@ "pages/project_flowable/detailTask/index", "pages/project_flowable/editTask/index", "pages/project_flowable/myProcessIns/index", - "pages/project_info/list/index", - "pages/project_info/add/index", - "pages/project_info/edit/index", + "pages/project_info/index", + "pages/project_list/index", "pages/project_check/list/index", "pages/project_check/edit/index", "pages/project_check/info/index", @@ -63,7 +62,8 @@ "select-group-position": "./components/select-group-position/index", "van-dropdown-menu": "@vant/weapp/dropdown-menu/index", "van-dropdown-item": "@vant/weapp/dropdown-item/index", - "curve-echarts": "pages/components/curve-echarts/index" + "curve-echarts": "pages/components/curve-echarts/index", + "user-infos": "pages/components/user-infos/index" }, "window": { "backgroundTextStyle": "light", diff --git a/yanzhu-ui-app/miniprogram/components/safety-bar-chart/index.js b/yanzhu-ui-app/miniprogram/components/safety-bar-chart/index.js index b651c2fd..47f24675 100644 --- a/yanzhu-ui-app/miniprogram/components/safety-bar-chart/index.js +++ b/yanzhu-ui-app/miniprogram/components/safety-bar-chart/index.js @@ -95,7 +95,7 @@ Component({ var option = { grid: { //图表的位置 - top: "8%", + top: "0%", left: "3%", right: "5%", bottom: "-12%", @@ -189,7 +189,7 @@ Component({ name: { width: 120, color: '#c6d9fa', - padding:[0,0,0,10], + padding:[0,0,0,5], fontSize:'14', }, color:{ @@ -226,8 +226,7 @@ Component({ }, { type: 'bar', - name:legend[0], - + //name:legend[0], stack: '1', legendHoverLink: false, barWidth: 6, @@ -242,7 +241,7 @@ Component({ data: yesProp }, { type: 'bar', - name:legend[1], + //name:legend[1], stack: '1', legendHoverLink: false, barWidth: 6, diff --git a/yanzhu-ui-app/miniprogram/config.js b/yanzhu-ui-app/miniprogram/config.js index aa17fc72..09d706dd 100644 --- a/yanzhu-ui-app/miniprogram/config.js +++ b/yanzhu-ui-app/miniprogram/config.js @@ -1,8 +1,10 @@ // 应用全局配置 module.exports = { timeout: 60000, - appId: "wx2350a5efb3f28e66", + appId: "wx46466c7828eede2b", + //baseUrl: 'https:xiangguan.sxyanzhu.com', baseUrl: 'http://127.0.0.1:8080', + //baseImgUrl: 'https:xiangguan.sxyanzhu.com/file', baseImgUrl: 'http://127.0.0.1:9300', noSecuritys:['/code','/auth/wxLogin','/auth/getMaOpenId','/auth/getMaPhoneNumber','/auth/maLogin'] }; \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/pages/components/project-select/index.js b/yanzhu-ui-app/miniprogram/pages/components/project-select/index.js index 97f67807..6ea54b3e 100644 --- a/yanzhu-ui-app/miniprogram/pages/components/project-select/index.js +++ b/yanzhu-ui-app/miniprogram/pages/components/project-select/index.js @@ -1,3 +1,4 @@ +// pages/components/project-select/index.js const app = getApp() Component({ /** @@ -14,7 +15,6 @@ Component({ type: String } }, - /**数据监听 */ observers: { init: function (val) { @@ -25,7 +25,6 @@ Component({ } }, }, - /** * 组件的初始数据 */ @@ -34,21 +33,17 @@ Component({ index: 0, item: '', columns: [], + defaultColumns: [], projectList: [], + findProjectValue:"", }, created() { - if (this.data.init && this.data.init.id == "") { - this.setData({ - projectList: this.data.init.concat(app.globalData.projectInfoList) - }) - } else { - this.setData({ - projectList: app.globalData.projectInfoList - }) - } + this.setData({ + projectList: app.globalData.projectInfoList, + findProjectValue:"", + }) }, - /** * 组件的方法列表 */ @@ -61,7 +56,7 @@ Component({ data.forEach((item, i) => { selectColumns.push({ id: item.id, - text: item.text + text: item.projectName }); if (initData.id == item.id) { this.setData({ @@ -69,20 +64,40 @@ Component({ }) } }); - console.log("default-index=" + this.data.index); this.setData({ + findProjectValue:"", columns: selectColumns, + defaultColumns:selectColumns, show: true }); } }, + //获取搜索的项目名称 + findProject: function (even) { + if(even.detail.value){ + let list = []; + this.data.columns.forEach(item=>{ + if(item.text.indexOf(even.detail.value)>-1){ + list.push(item); + } + }); + this.setData({ + columns: list + }) + }else{ + this.setData({ + columns: this.data.defaultColumns + }) + } + }, + onClose() { this.setData({ show: false }); }, - + onSelectChange(e) { this.setData({ item: e.detail.value @@ -99,5 +114,13 @@ Component({ }); }, + /** + * 重新加载项目列表 + */ + load:function(){ + this.setData({ + projectList: app.globalData.projectInfoList, + }) + } } }) \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/pages/components/project-select/index.wxml b/yanzhu-ui-app/miniprogram/pages/components/project-select/index.wxml index 47dd6447..139ca908 100644 --- a/yanzhu-ui-app/miniprogram/pages/components/project-select/index.wxml +++ b/yanzhu-ui-app/miniprogram/pages/components/project-select/index.wxml @@ -1,18 +1,17 @@ - - - {{item.text}} - + + + {{item.text}} + - - 取消 - {{placeholder}} - 确认 - - - + + 取消 + + 确认 + + + \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/pages/components/project-select/index.wxss b/yanzhu-ui-app/miniprogram/pages/components/project-select/index.wxss index 76d5ce23..54fb5799 100644 --- a/yanzhu-ui-app/miniprogram/pages/components/project-select/index.wxss +++ b/yanzhu-ui-app/miniprogram/pages/components/project-select/index.wxss @@ -1,49 +1,54 @@ /* pages/components/project-select/index.wxss */ -.video_add{ - padding: 20rpx 30rpx; - } - .video_address{ - background:#30343f; - padding:0 20rpx; - border-radius:50rpx; - font-size: 28rpx; - } - .video_address_min{ - background:url("http://fileimg.makalu.cc/CORE_B1C818B4CF2C44FE9D96624589329EBC.png") no-repeat left/40rpx; - height: 80rpx; - line-height: 80rpx; - padding-left: 50rpx; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - word-break: break-all; - } - - - .option_list_title{ - display: flex; - justify-content: space-between; - align-items: center; - padding: 20rpx; - color: #06d4f8; - } - .option_list_title_btn{ - color: #1989fa; - font-size: 30rpx; - } - - .popup_style{ - background: #232a44 !important; - } -.time_select_style{ - background: none !important; +.video_add { + padding: 20rpx 30rpx; } -.time_active_style{ - color: #ffffff !important; +.video_address { + background: #30343f; + padding: 0 20rpx; + border-radius: 50rpx; + font-size: 28rpx; } -.time_list_style{ - background: none !important; - color: #546696 !important; + +.video_address_min { + background: url("https://szgcwx.jhncidg.com/staticFiles/img/menu/CORE_B1C818B4CF2C44FE9D96624589329EBC.png") no-repeat left/40rpx; + height: 80rpx; + line-height: 80rpx; + padding-left: 50rpx; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + word-break: break-all; +} + + +.option_list_title { + display: flex; + justify-content: space-between; + align-items: center; + padding: 20rpx; + color: #06d4f8; +} + +.option_list_title_btn { + color: #1989fa; + font-size: 30rpx; +} + +.popup_style { + background: #232a44 !important; +} + +.time_select_style { + background: none !important; +} + +.time_active_style { + color: #ffffff !important; +} + +.time_list_style { + background: none !important; + color: #546696 !important; } \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.js b/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.js new file mode 100644 index 00000000..3c3a204f --- /dev/null +++ b/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.js @@ -0,0 +1,216 @@ +import { + removeToken + } from '../../../utils/auth' + import { + loginOut, + updatePwd, + findOpenUserMsgId + } 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: "", + }, + + created() { + let that = this; + //获取缓存数据 + wx.getStorage({ + key: 'userinfo', + success: function (res) { + that.setData({ + userData: res.data, + loginName: res.data.loginName, + msgOpenId: res.data.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.setStorageSync('isReload', "1") + wx.redirectTo({ + url: '../login/index', + }) + }, + + 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 (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 (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); + removeToken(); + wx.clearStorageSync(); + wx.setStorageSync('isReload', "1"); + setTimeout(()=>{ + wx.redirectTo({ + url: '../login/index', + }); + },500) + } + }); + }, + } + }) \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.json b/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.json new file mode 100644 index 00000000..8e61fa4e --- /dev/null +++ b/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.json @@ -0,0 +1,11 @@ +{ + "usingComponents": { + "van-row": "@vant/weapp/row", + "van-col": "@vant/weapp/col", + "van-popup": "@vant/weapp/popup", + "van-notice-bar": "@vant/weapp/notice-bar/index", + "van-grid": "@vant/weapp/grid/index", + "van-grid-item": "@vant/weapp/grid-item/index" + }, + "navigationStyle":"custom" + } \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.wxml b/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.wxml new file mode 100644 index 00000000..6a40e776 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.wxml @@ -0,0 +1,88 @@ + + + + + + + + + {{userData.deptName}} + + + + + + + + + {{userData.nickName}} + {{userData.loginName}} + 消息未授权 + 消息已授权 + + + + + 关注公众号才能成功开启消息通知 + + + + + + 授权消息通知 + + + + + + + 修改密码 + + + + + + + 退出登录 + + + + + + + + + + + + + + 旧密码 + + + + + + + + 新密码 + + + + + + + + 确认密码 + + + + + + + + 取消 + 修改密码 + + + \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.wxss b/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.wxss new file mode 100644 index 00000000..fc5f554a --- /dev/null +++ b/yanzhu-ui-app/miniprogram/pages/components/user-infos/index.wxss @@ -0,0 +1,207 @@ +.header_img { + padding-left: 30rpx; + padding-top: 10rpx; +} + +.header_img image { + width: 33rpx; + height: 33rpx; +} + +/* 左侧菜单 */ +.left_max { + padding-top: 180rpx; +} + +.left_head { + width: 140rpx; + height: 140rpx; + margin: auto; + background: #2b345b; + border-radius: 50%; +} + +.left_head image { + width: 140rpx; + height: 140rpx; + border-radius: 50%; +} + +.left_info { + font-size: 28rpx; + padding-top: 10rpx; +} + +.left_info_name { + padding: 10rpx; +} + +.left_info_dept { + text-align: center; + margin-bottom: 40rpx; +} + +.left_manage_max { + padding: 50rpx 0; +} + +.left_manage_min { + padding: 0 5%; + margin-top: 40rpx; +} +.message-title{ + color: #FFFFFF; + font-weight: 600; + text-align: center; +} + +.color_blue { + color: #45affb; +} + +.left_manage { + padding: 20rpx 20rpx 15rpx; + background: #2b345b; + border-radius: 100rpx; + font-size: 28rpx; + text-align: center; +} + +.left_manage:active { + background: #232a4a; +} + +.left_pro { + position: relative; + top: -10rpx; + padding-left: 20rpx; +} + +.left_icon { + width: 40rpx; + height: 40rpx; + float: left; +} + +.left_flaot { + width: 40rpx; + height: 40rpx; + float: right; +} + +.left_password { + text-align: center; + padding-bottom: 5rpx; +} + +.left_binding { + text-align: center; + padding-bottom: 5rpx; + color: #45affb; +} + +.left_sign { + text-align: center; + padding-bottom: 5rpx; + color: #F56C6C; +} + +.left_begin { + text-align: center; + padding-bottom: 5rpx; + color: #faf8ff; +} + +.left_manage2 { + float: left; + width: 50%; + margin-bottom: 35rpx; + color: #ffffff; +} + +.password-icon { + width: 40rpx; + height: 40rpx; + position: absolute; + right: 60rpx; + margin-top: -60rpx; + z-index: 999; +} + +.bg_bg { + text-align: center; + margin-top: 80rpx; + } + + .bg_bg image { + width: 320rpx; + height: 320rpx; + } + +.inspect_input_fill_in { + height: 90rpx; + background: #212737; + border-radius: 10rpx; + padding: 0 30rpx; +} + +.problem_submit_to { + padding: 40rpx; + display: flex; + align-items: center; + justify-content: space-around; +} + +.problem_submit_to_btn { + padding: 20rpx 0; + width: 220rpx; + text-align: center; + border-radius: 10rpx; + background: #3e4148; +} + +.problem_submit_to_btn:active { + background: #292d35; +} + +.problem_submit_to_save { + background: #513ea7; +} + +.problem_submit_to_save:active { + background: #372a70; +} + +.inspect_info { + padding: 30rpx; + margin-bottom: 30rpx; +} + +.inspect_info_list { + padding: 10rpx 0; +} + +.inspect_info_title { + padding: 10rpx 0; + color: #83a5ef +} + +.inspect_info_type { + padding: 20rpx 0; + display: flex; + justify-content: space-around; +} + +.inspect_info_type view { + width: 30%; + padding: 18rpx 0; + background: #262c3c; + text-align: center; + border-radius: 10rpx; + color: #6a77a3; +} + +.inspect_info_type .active { + color: #ffffff; + background: #576691; +} \ 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 af58fe2b..f609224c 100644 --- a/yanzhu-ui-app/miniprogram/pages/login/login.js +++ b/yanzhu-ui-app/miniprogram/pages/login/login.js @@ -3,6 +3,7 @@ import { setToken, getOpenId, setOpenId, + setUserInfo, getSessionKey, setSessionKey, } from '../../utils/auth' @@ -12,8 +13,11 @@ import { getCodeImg, getMaOpenId, refreshMobileToken, + findUserInfoByCache, } from '../../api/login' - +import { + findMyProjectList, +} from '../../api/project' const app = getApp(); Page({ @@ -55,11 +59,9 @@ Page({ //刷新权限信息 refreshMobileToken().then(res => { if (res.code == '200') { - wx.redirectTo({ - url: '../index/index', - }) + this.getUserInfoByCache(); } else { - that.loadCodeImage(); + this.loadCodeImage(); } }); } else { @@ -121,11 +123,9 @@ Page({ "uuid": that.data.uuid, }).then(res => { if (res.code == '200') { - setToken(res.access_token) + setToken(res.data.access_token) //跳转页面 - wx.redirectTo({ - url: '../index/index', - }) + this.getUserInfoByCache(); } else { that.loadCodeImage(); } @@ -153,4 +153,49 @@ Page({ } }, + /** + * 查询 + * 用户详细信息 + * @param {*} e + */ + getUserInfoByCache: function () { + findUserInfoByCache().then(res=>{ + if(res.code==200){ + setUserInfo(res.user); + app.globalData.userData = res.user; + this.getMyProjectList(); + } + }); + }, + + /** + * 查询 + * 用户项目信息 + * 根据项目配置进入不同页面... + */ + getMyProjectList: function () { + findMyProjectList().then(res=>{ + if(res.code==200){ + app.globalData.projectInfoList = res.rows; + if(res.rows.length>0){ + 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', + }) + }else{ + //多项目进入项目切换页面 + wx.redirectTo({ + url: '../project_list/index', + }) + } + }else{ + app.toast("未查询到当前用户项目,信息审核中或人员已离场"); + return false; + } + } + }); + }, }) \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/pages/project_info/add/index.js b/yanzhu-ui-app/miniprogram/pages/project_info/add/index.js deleted file mode 100644 index b166313f..00000000 --- a/yanzhu-ui-app/miniprogram/pages/project_info/add/index.js +++ /dev/null @@ -1,188 +0,0 @@ -import { - getProjectNo, - addProjectInfo, -} from '../../../api/project' -const app = getApp() -Page({ - - /** - * 页面的初始数据 - */ - data: { - parDeptId: null, - projectName: null, - proNo: "", - proName: "", - proInfo: "", - proAddress: "", - proPerson: "", - proPersonPhone: "", - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad(options) { - this.initProNo(); - this.setData({ - parDeptId: app.globalData.userData?.parDeptId, - parDeptName: app.globalData.userData?.parDeptName - }); - }, - - /** - * 初始化临建项目编号 - * @param {*} e - */ - initProNo: function (e) { - getProjectNo().then(res => { - if (res.code == 200) { - this.setData({ - proNo: res.data - }); - } - }) - }, - - /** - * 项目名称 - * @param {*} e - */ - inputProName: function (e) { - this.setData({ - proName: e.detail.value - }); - }, - - /** - * 项目负责人 - * @param {*} e - */ - inputProPerson: function (e) { - this.setData({ - proPerson: e.detail.value - }); - }, - - /** - * 项目负责人电话 - * @param {*} e - */ - inputProPersonPhone: function (e) { - this.setData({ - proPersonPhone: e.detail.value - }); - }, - - /** - * 临建项目地址 - * @param {*} e - */ - onInputProAddress: function (e) { - this.setData({ - proAddress: e.detail.value - }); - }, - - /** - * 临建项目详情 - * @param {*} e - */ - onInputProInfo: function (e) { - this.setData({ - proInfo: e.detail.value - }); - }, - - returnToPage: function () { - /*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/ - wx.redirectTo({ - url: '../list/index', - }) - }, - - /** - * 提交保存数据 - */ - onSaveSubmit: function () { - let { - proNo, - proName, - proInfo, - proAddress, - proPerson, - proPersonPhone, - } = this.data; - //数据效验 - if (proNo == "") { - app.toast("数据异常,请刷新页面重试!") - return; - } - if (proName == "") { - app.toast("请填写临建项目名称!") - return; - } - addProjectInfo({ - no: proNo, - name: proName - }).then(res => { - if (res.code == 200) { - app.toast("新增成功!") - setTimeout(() => { - wx.redirectTo({ - url: '../list/index', - }) - }, 200) - } - }); - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady() { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow() { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide() { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload() { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh() { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom() { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage() { - - } -}) \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/pages/project_info/add/index.json b/yanzhu-ui-app/miniprogram/pages/project_info/add/index.json deleted file mode 100644 index ba2821f5..00000000 --- a/yanzhu-ui-app/miniprogram/pages/project_info/add/index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "usingComponents": {}, - "navigationStyle":"custom" -} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/pages/project_info/add/index.wxml b/yanzhu-ui-app/miniprogram/pages/project_info/add/index.wxml deleted file mode 100644 index 6aad83f4..00000000 --- a/yanzhu-ui-app/miniprogram/pages/project_info/add/index.wxml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - 新增临建项目 - - - - - - - - {{parDeptName}} - - - 临建项目编号 - - - - - - 临建项目名称 - - - - - - 临建项目地址 - -