From 4a80de3acc51cabdbf34fb7fa15fadcb90ce3d56 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: Wed, 18 Dec 2024 22:34:51 +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 --- pom.xml | 6 + .../yanzhu/system/api/RemoteFlowService.java | 32 +- .../factory/RemoteFlowFallbackFactory.java | 16 +- .../core/constant/ServiceNameConstants.java | 5 + .../yanzhu/common/core/utils/StringUtils.java | 72 +++- .../com/yanzhu/manage/domain/BasSignet.java | 41 +- .../com/yanzhu/manage/domain/BasTemplate.java | 25 +- .../domain/ProProjectInfoSubdeptsUsers.java | 14 + .../ProProjectInfoSubdeptsUsersMapper.java | 11 + .../com/yanzhu/security/utils/DictUtils.java | 23 ++ .../mapper/manage/BasSignetMapper.xml | 23 +- .../mapper/manage/BasTemplateMapper.xml | 19 +- .../ProProjectInfoSubdeptsUsersMapper.xml | 4 + .../file/controller/SysFileController.java | 31 ++ .../service/FastDfsSysFileServiceImpl.java | 12 + .../yanzhu/file/service/ISysFileService.java | 9 + .../file/service/LocalSysFileServiceImpl.java | 12 + .../file/service/MinioSysFileServiceImpl.java | 12 + .../controller/FlowDefinitionController.java | 10 + .../service/IFlowDefinitionService.java | 11 +- .../impl/FlowDefinitionServiceImpl.java | 41 ++ yanzhu-modules/yanzhu-manage/pom.xml | 5 + .../controller/BasSignetController.java | 98 +++++ .../controller/BasTemplateController.java | 186 +++++++++ .../yanzhu/manage/domain/SignetFileVo.java | 8 + .../com/yanzhu/manage/enums/BasTemTypes.java | 52 +++ ...raftPostEnums.java => CraftPostEnums.java} | 7 +- .../yanzhu/manage/enums/SignetKeyEnums.java | 32 ++ .../yanzhu/manage/enums/UserPostEnums.java | 16 +- .../manage/service/IBasSignetService.java | 61 +++ .../manage/service/IBasTemplateService.java | 61 +++ .../service/impl/BasSignetServiceImpl.java | 103 +++++ .../service/impl/BasTemplateServiceImpl.java | 104 +++++ .../service/impl/BusExamUserServiceImpl.java | 25 +- .../ProProjectInfoSubdeptsServiceImpl.java | 6 +- ...roProjectInfoSubdeptsUsersServiceImpl.java | 113 +++++- .../manage/utils/pdf/MyTableRenderPolicy.java | 3 +- .../manage/utils/pdf/WordToPdfUtil.java | 4 +- .../src/main/resources/template.json | 146 +++++++ yanzhu-ui-app/miniprogram/app.json | 1 + yanzhu-ui-app/miniprogram/app.wxss | 3 +- .../pages/components/jyq-result/index.js | 46 +++ .../pages/components/jyq-result/index.json | 4 + .../pages/components/jyq-result/index.wxml | 8 + .../pages/components/jyq-result/index.wxss | 42 ++ .../miniprogram/pages/project_qr/index.js | 145 +++++-- .../miniprogram/pages/project_qr/index.json | 2 +- .../miniprogram/pages/project_qr/index.wxml | 39 +- .../miniprogram/pages/project_qr/index.wxss | 40 +- yanzhu-ui-vue3/src/App.vue | 13 +- yanzhu-ui-vue3/src/api/manage/basSignet.js | 44 +++ yanzhu-ui-vue3/src/api/manage/basTemplate.js | 52 +++ .../src/components/ImagePreview/index.vue | 2 +- yanzhu-ui-vue3/src/plugins/download.js | 17 + .../src/views/manage/basSignet/index.vue | 322 ++++++++++++++++ .../src/views/manage/basTemplate/index.vue | 364 ++++++++++++++++++ 56 files changed, 2438 insertions(+), 165 deletions(-) create mode 100644 yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/BasSignetController.java create mode 100644 yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/BasTemplateController.java create mode 100644 yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/enums/BasTemTypes.java rename yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/enums/{craftPostEnums.java => CraftPostEnums.java} (68%) create mode 100644 yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/enums/SignetKeyEnums.java rename yanzhu-common/yanzhu-common-core/src/main/java/com/yanzhu/common/core/enums/CraftType.java => yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/enums/UserPostEnums.java (52%) create mode 100644 yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IBasSignetService.java create mode 100644 yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IBasTemplateService.java create mode 100644 yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/BasSignetServiceImpl.java create mode 100644 yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/BasTemplateServiceImpl.java create mode 100644 yanzhu-modules/yanzhu-manage/src/main/resources/template.json create mode 100644 yanzhu-ui-app/miniprogram/pages/components/jyq-result/index.js create mode 100644 yanzhu-ui-app/miniprogram/pages/components/jyq-result/index.json create mode 100644 yanzhu-ui-app/miniprogram/pages/components/jyq-result/index.wxml create mode 100644 yanzhu-ui-app/miniprogram/pages/components/jyq-result/index.wxss create mode 100644 yanzhu-ui-vue3/src/api/manage/basSignet.js create mode 100644 yanzhu-ui-vue3/src/api/manage/basTemplate.js create mode 100644 yanzhu-ui-vue3/src/views/manage/basSignet/index.vue create mode 100644 yanzhu-ui-vue3/src/views/manage/basTemplate/index.vue diff --git a/pom.xml b/pom.xml index 4b97c410..30bd2d21 100644 --- a/pom.xml +++ b/pom.xml @@ -231,6 +231,12 @@ + + org.apache.poi + poi + ${poi.version} + + com.lowagie itext diff --git a/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/RemoteFlowService.java b/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/RemoteFlowService.java index 255a555e..754d607a 100644 --- a/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/RemoteFlowService.java +++ b/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/RemoteFlowService.java @@ -3,8 +3,10 @@ package com.yanzhu.system.api; import com.yanzhu.common.core.constant.SecurityConstants; import com.yanzhu.common.core.constant.ServiceNameConstants; import com.yanzhu.common.core.domain.R; +import com.yanzhu.common.core.web.domain.AjaxResult; import com.yanzhu.system.api.factory.RemoteLogFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestHeader; @@ -16,36 +18,18 @@ import java.util.Map; * * @author JiangYuQi */ -@FeignClient(contextId = "remoteFlowService", value = ServiceNameConstants.MANAGE_SERVICE, fallbackFactory = RemoteLogFallbackFactory.class) +@FeignClient(contextId = "remoteFlowService", value = ServiceNameConstants.FLOWABLE_SERVICE, fallbackFactory = RemoteLogFallbackFactory.class) public interface RemoteFlowService { /** - * 保存分包单位信息 + * 发起流程 * - * @param data 表单信息 + * @param procDefId 流程Id + * @param variables 表单信息 * @param source 请求来源 * @return 结果 */ - @PostMapping("/proProjectInfoSubdepts/add") - public R addSubdeptsEntity(@RequestBody Map data, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); + @PostMapping("/definition/startByParams/{procDefId}") + public R startDefinitionByParams(@PathVariable("procDefId") String procDefId, @RequestBody Map variables, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); - /** - * 保存分包单位班组信息 - * - * @param data 表单信息 - * @param source 请求来源 - * @return 结果 - */ - @PostMapping("/proProjectInfoSubdeptsGroup/add") - public R addSubdeptsGroupEntity(@RequestBody Map data, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); - - /** - * 保存分包单位班组用户信息 - * - * @param data 表单信息 - * @param source 请求来源 - * @return 结果 - */ - @PostMapping("/proProjectInfoSubdeptsUsers/add") - public R addSubdeptsUsersEntity(@RequestBody Map data, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); } diff --git a/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/factory/RemoteFlowFallbackFactory.java b/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/factory/RemoteFlowFallbackFactory.java index bd6b4928..d13119e3 100644 --- a/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/factory/RemoteFlowFallbackFactory.java +++ b/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/factory/RemoteFlowFallbackFactory.java @@ -1,6 +1,7 @@ package com.yanzhu.system.api.factory; import com.yanzhu.common.core.domain.R; +import com.yanzhu.common.core.web.domain.AjaxResult; import com.yanzhu.system.api.RemoteFlowService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -10,7 +11,7 @@ import org.springframework.stereotype.Component; import java.util.Map; /** - * 管理服务降级处理 + * 工作流服务降级处理 * * @author JiangYuQi */ @@ -26,22 +27,11 @@ public class RemoteFlowFallbackFactory implements FallbackFactory addSubdeptsEntity(Map data, String source) + public R startDefinitionByParams(String procDefId, Map variables, String source) { return R.fail("保存分包单位信息失败:" + throwable.getMessage()); } - @Override - public R addSubdeptsGroupEntity(Map data, String source) - { - return R.fail("保存分包单位班组信息失败:" + throwable.getMessage()); - } - - @Override - public R addSubdeptsUsersEntity(Map data, String source) - { - return R.fail("保存分包单位班组用户信息失败:" + throwable.getMessage()); - } }; } } diff --git a/yanzhu-common/yanzhu-common-core/src/main/java/com/yanzhu/common/core/constant/ServiceNameConstants.java b/yanzhu-common/yanzhu-common-core/src/main/java/com/yanzhu/common/core/constant/ServiceNameConstants.java index 42d2d2ac..5b3b67af 100644 --- a/yanzhu-common/yanzhu-common-core/src/main/java/com/yanzhu/common/core/constant/ServiceNameConstants.java +++ b/yanzhu-common/yanzhu-common-core/src/main/java/com/yanzhu/common/core/constant/ServiceNameConstants.java @@ -22,6 +22,11 @@ public class ServiceNameConstants */ public static final String MANAGE_SERVICE = "yanzhu-manage"; + /** + * 工作流模块的serviceid + */ + public static final String FLOWABLE_SERVICE = "yanzhu-flowable"; + /** * 微信模块的serviceid */ diff --git a/yanzhu-common/yanzhu-common-core/src/main/java/com/yanzhu/common/core/utils/StringUtils.java b/yanzhu-common/yanzhu-common-core/src/main/java/com/yanzhu/common/core/utils/StringUtils.java index 5d57f227..0ec6ba16 100644 --- a/yanzhu-common/yanzhu-common-core/src/main/java/com/yanzhu/common/core/utils/StringUtils.java +++ b/yanzhu-common/yanzhu-common-core/src/main/java/com/yanzhu/common/core/utils/StringUtils.java @@ -2,10 +2,8 @@ package com.yanzhu.common.core.utils; import java.nio.ByteBuffer; import java.nio.charset.Charset; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.Map; +import java.text.SimpleDateFormat; +import java.util.*; import feign.form.util.CharsetUtil; import org.springframework.util.AntPathMatcher; @@ -666,7 +664,6 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils * @return */ public static String judgeGender(String idNumber) throws IllegalArgumentException{ - System.out.println(idNumber.length()); if(idNumber.length() != 18 && idNumber.length() != 15){ return "2"; } @@ -680,11 +677,74 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils char c = idNumber.charAt(idNumber.length() - 1); gender = Integer.parseInt(String.valueOf(c)); } - System.out.println("gender = " + gender); if(gender % 2 == 1){ return "0"; }else{ return "1"; } } + + /** + * 根据身份证号获取性别 + * @param idNumber + * @return + */ + public static String judgeGenderText(String idNumber) throws IllegalArgumentException{ + if(idNumber.length() != 18 && idNumber.length() != 15){ + return "未知"; + } + int gender = 0; + if(idNumber.length() == 18){ + //如果身份证号18位,取身份证号倒数第二位 + char c = idNumber.charAt(idNumber.length() - 2); + gender = Integer.parseInt(String.valueOf(c)); + }else{ + //如果身份证号15位,取身份证号最后一位 + char c = idNumber.charAt(idNumber.length() - 1); + gender = Integer.parseInt(String.valueOf(c)); + } + if(gender % 2 == 1){ + return "男"; + }else{ + return "女"; + } + } + + /** + * 根据身份证号获取年龄 + * @param idCard + * @return + */ + public static int getAgeFromIdCard(String idCard) { + if (idCard == null || idCard.length() != 18) { + throw new IllegalArgumentException("身份证号码无效!"); + } + // 提取出生日期(身份证号的第7到第14位) + String birthDateStr = idCard.substring(6, 14); + // 设置日期格式 + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); + try { + // 解析出生日期 + Date birthDate = sdf.parse(birthDateStr); + // 获取当前日期 + Calendar currentDate = Calendar.getInstance(); + // 获取出生日期的年份、月份、日期 + Calendar birthCalendar = Calendar.getInstance(); + birthCalendar.setTime(birthDate); + + // 计算年龄 + int age = currentDate.get(Calendar.YEAR) - birthCalendar.get(Calendar.YEAR); + + // 如果还没有过生日,年龄减1 + if (currentDate.get(Calendar.MONTH) < birthCalendar.get(Calendar.MONTH) || + (currentDate.get(Calendar.MONTH) == birthCalendar.get(Calendar.MONTH) && + currentDate.get(Calendar.DAY_OF_MONTH) < birthCalendar.get(Calendar.DAY_OF_MONTH))) { + age--; + } + return age; + } catch (Exception e) { + throw new IllegalArgumentException("身份证号码解析错误!", e); + } + } + } diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/BasSignet.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/BasSignet.java index 5ca234c0..693d2957 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/BasSignet.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/BasSignet.java @@ -18,18 +18,27 @@ public class BasSignet extends BaseEntity /** 主键 */ private Long id; - /** 公司主键 */ - @Excel(name = "公司主键") + /** 单位主键 */ private Long comId; + /** 单位名称 */ + @Excel(name = "单位名称") + private String comName; + /** 项目主键 */ - @Excel(name = "项目主键") private Long projectId; + /** 项目名称 */ + @Excel(name = "项目名称") + private String projectName; + /** 用户主键 */ - @Excel(name = "用户主键") private Long userId; + /** 用户名称 */ + @Excel(name = "用户名称") + private String userName; + /** 签名地址 */ @Excel(name = "签名地址") private String signetPath; @@ -106,6 +115,30 @@ public class BasSignet extends BaseEntity return isDel; } + public String getComName() { + return comName; + } + + public void setComName(String comName) { + this.comName = comName; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + @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/domain/BasTemplate.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/BasTemplate.java index e9439b72..91fb737f 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/BasTemplate.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/BasTemplate.java @@ -19,13 +19,20 @@ public class BasTemplate extends BaseEntity private Long id; /** 公司主键 */ - @Excel(name = "公司主键") private Long comId; + /** 单位名称 */ + @Excel(name = "单位名称") + private String comName; + /** 项目主键 */ @Excel(name = "项目主键") private Long projectId; + /** 项目名称 */ + @Excel(name = "项目名称") + private String projectName; + /** 模板名称 */ @Excel(name = "模板名称") private String temName; @@ -106,6 +113,22 @@ public class BasTemplate extends BaseEntity return isDel; } + public String getComName() { + return comName; + } + + public void setComName(String comName) { + this.comName = comName; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + @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/domain/ProProjectInfoSubdeptsUsers.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfoSubdeptsUsers.java index 3ea2d53f..a7bc687d 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfoSubdeptsUsers.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfoSubdeptsUsers.java @@ -136,6 +136,11 @@ public class ProProjectInfoSubdeptsUsers extends BaseEntity /** 劳务人员学历 */ private String degreeGrade; + /** + * 用户岗位 + */ + private String userPost; + public String getEnterState() { return enterState; } @@ -446,6 +451,14 @@ public class ProProjectInfoSubdeptsUsers extends BaseEntity this.subDeptPowerPath = subDeptPowerPath; } + public String getUserPost() { + return userPost; + } + + public void setUserPost(String userPost) { + this.userPost = userPost; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -458,6 +471,7 @@ public class ProProjectInfoSubdeptsUsers extends BaseEntity .append("userId", getUserId()) .append("subDeptGroup", getSubDeptGroup()) .append("subDeptGroupName", getSubDeptGroupName()) + .append("userPost", getUserPost()) .append("craftType", getCraftType()) .append("craftPost", getCraftPost()) .append("eduStatus", getEduStatus()) 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 8bfc56cc..ef429f3b 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 @@ -1,6 +1,8 @@ package com.yanzhu.manage.mapper; import java.util.List; +import java.util.Map; + import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers; import org.apache.ibatis.annotations.Param; @@ -84,4 +86,13 @@ public interface ProProjectInfoSubdeptsUsersMapper * 大屏-项目详情-今日出勤期统计 */ List groupByCraftTypeByAttendance(ProProjectInfoSubdeptsUsers where); + + /** + * 查询工作流配置 + * + * @param proId 流程项目 + * @param defType 流程类型 + * @return 结果 + */ + public List> findActReProcdefDept(@Param("proId")Long proId, @Param("defType")String defType); } diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/security/utils/DictUtils.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/security/utils/DictUtils.java index 8e1fc0bb..2f13dd19 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/security/utils/DictUtils.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/security/utils/DictUtils.java @@ -2,6 +2,8 @@ package com.yanzhu.common.security.utils; import java.util.Collection; import java.util.List; +import java.util.Objects; + import com.alibaba.fastjson2.JSONArray; import com.yanzhu.common.core.constant.CacheConstants; import com.yanzhu.common.core.utils.SpringUtils; @@ -43,6 +45,27 @@ public class DictUtils return null; } + /** + * 获取字典缓存 + * + * @param key 参数键 + * @return dictDatas 字典数据列表 + */ + public static String getDictLabel(String key, String value) + { + JSONArray arrayCache = SpringUtils.getBean(RedisService.class).getCacheObject(getCacheKey(key)); + if (StringUtils.isNotNull(arrayCache)) + { + List dictList = arrayCache.toList(SysDictData.class); + for(SysDictData dictData:dictList){ + if(Objects.equals(value,dictData.getDictValue())){ + return dictData.getDictLabel(); + } + } + } + return null; + } + /** * 删除指定字典缓存 * diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BasSignetMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BasSignetMapper.xml index b63eaab7..b62f9c94 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BasSignetMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BasSignetMapper.xml @@ -7,8 +7,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + @@ -20,22 +23,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, com_id, project_id, user_id, signet_path, signet_number, is_del, create_by, create_time, update_by, update_time, remark from bas_signet + select bs.id, bs.com_id, sd.dept_name as com_name, bs.project_id, pi.project_name, bs.user_id, su.nick_name as user_name, bs.signet_path, bs.signet_number, bs.is_del, bs.create_by, bs.create_time, bs.update_by, bs.update_time, bs.remark from bas_signet bs + left join pro_project_info pi on pi.id = bs.project_id + left join sys_dept sd on sd.dept_id = pi.com_id + left join sys_user su on su.user_id = bs.user_id diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BasTemplateMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BasTemplateMapper.xml index 0e01f3b2..978986e0 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BasTemplateMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BasTemplateMapper.xml @@ -7,7 +7,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -20,23 +22,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, com_id, project_id, tem_name, tem_type, tem_path, is_del, create_by, create_time, update_by, update_time, remark from bas_template + select bt.id, bt.com_id, sd.dept_name as com_name, bt.project_id, pi.project_name, bt.tem_name, bt.tem_type, bt.tem_path, bt.is_del, bt.create_by, bt.create_time, bt.update_by, bt.update_time, bt.remark from bas_template bt + left join pro_project_info pi on pi.id = bt.project_id + left join sys_dept sd on sd.dept_id = pi.com_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 943445a2..4a124289 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 @@ -290,4 +290,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + \ No newline at end of file diff --git a/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/controller/SysFileController.java b/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/controller/SysFileController.java index 33727d4a..c794b3c0 100644 --- a/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/controller/SysFileController.java +++ b/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/controller/SysFileController.java @@ -1,8 +1,11 @@ package com.yanzhu.file.controller; +import com.yanzhu.common.core.utils.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; @@ -11,6 +14,8 @@ import com.yanzhu.common.core.utils.file.FileUtils; import com.yanzhu.file.service.ISysFileService; import com.yanzhu.system.api.domain.SysFile; +import javax.servlet.http.HttpServletResponse; + /** * 文件请求处理 * @@ -89,4 +94,30 @@ public class SysFileController return R.fail(e.getMessage()); } } + + /** + * 文件通用下载... + * @param fileName + * @param response + */ + @GetMapping("/download") + public void downloadFile(String fileName, HttpServletResponse response) { + try + { + if (!FileUtils.checkAllowDownload(fileName)) + { + throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName)); + } + String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1); + String filePath = sysFileService.findFilePath(fileName); + + response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); + FileUtils.setAttachmentResponseHeader(response, realFileName); + FileUtils.writeBytes(filePath, response.getOutputStream()); + } + catch (Exception e) + { + log.error("下载文件失败", e); + } + } } \ No newline at end of file diff --git a/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/service/FastDfsSysFileServiceImpl.java b/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/service/FastDfsSysFileServiceImpl.java index 9dcdca9d..c1b2d034 100644 --- a/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/service/FastDfsSysFileServiceImpl.java +++ b/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/service/FastDfsSysFileServiceImpl.java @@ -39,4 +39,16 @@ public class FastDfsSysFileServiceImpl implements ISysFileService FileTypeUtils.getExtension(file), null); return domain + "/" + storePath.getFullPath(); } + + /** + * 获取文件地址... + * + * @param fileNames 上传的文件 + * @return 访问地址 + * @throws Exception + */ + public String findFilePath(String fileNames) throws Exception + { + return fileNames; + } } diff --git a/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/service/ISysFileService.java b/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/service/ISysFileService.java index b30dc4f1..3263a657 100644 --- a/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/service/ISysFileService.java +++ b/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/service/ISysFileService.java @@ -17,4 +17,13 @@ public interface ISysFileService * @throws Exception */ public String uploadFile(MultipartFile file) throws Exception; + + /** + * 获取文件地址... + * + * @param fileNames 上传的文件 + * @return 访问地址 + * @throws Exception + */ + public String findFilePath(String fileNames) throws Exception; } diff --git a/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/service/LocalSysFileServiceImpl.java b/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/service/LocalSysFileServiceImpl.java index f95875d7..e5c66a51 100644 --- a/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/service/LocalSysFileServiceImpl.java +++ b/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/service/LocalSysFileServiceImpl.java @@ -46,4 +46,16 @@ public class LocalSysFileServiceImpl implements ISysFileService String name = FileUploadUtils.upload(localFilePath, file); return localFilePrefix + name; } + + /** + * 获取文件地址... + * + * @param fileNames 上传的文件 + * @return 访问地址 + * @throws Exception + */ + public String findFilePath(String fileNames) throws Exception + { + return fileNames.replaceFirst(localFilePrefix,localFilePath); + } } diff --git a/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/service/MinioSysFileServiceImpl.java b/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/service/MinioSysFileServiceImpl.java index a2a2ff35..334b9746 100644 --- a/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/service/MinioSysFileServiceImpl.java +++ b/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/service/MinioSysFileServiceImpl.java @@ -42,4 +42,16 @@ public class MinioSysFileServiceImpl implements ISysFileService client.putObject(args); return minioConfig.getUrl() + "/" + minioConfig.getBucketName() + "/" + fileName; } + + /** + * 获取文件地址... + * + * @param fileNames 上传的文件 + * @return 访问地址 + * @throws Exception + */ + public String findFilePath(String fileNames) throws Exception + { + return fileNames; + } } diff --git a/yanzhu-modules/yanzhu-flowable/src/main/java/com/yanzhu/flowable/controller/FlowDefinitionController.java b/yanzhu-modules/yanzhu-flowable/src/main/java/com/yanzhu/flowable/controller/FlowDefinitionController.java index ac8b836e..1a4c9aa9 100644 --- a/yanzhu-modules/yanzhu-flowable/src/main/java/com/yanzhu/flowable/controller/FlowDefinitionController.java +++ b/yanzhu-modules/yanzhu-flowable/src/main/java/com/yanzhu/flowable/controller/FlowDefinitionController.java @@ -6,6 +6,7 @@ import com.yanzhu.common.core.web.domain.AjaxResult; import com.yanzhu.common.core.web.page.TableDataInfo; import com.yanzhu.common.log.annotation.Log; import com.yanzhu.common.log.enums.BusinessType; +import com.yanzhu.common.security.annotation.InnerAuth; import com.yanzhu.flowable.domain.SysExpression; import com.yanzhu.flowable.domain.dto.FlowProcDefDto; import com.yanzhu.flowable.domain.dto.FlowSaveXmlVo; @@ -167,6 +168,15 @@ public class FlowDefinitionController extends BaseController { return flowDefinitionService.startProcessInstanceById(procDefId, variables); } + @InnerAuth + @ApiOperation(value = "发起流程") + @Log(title = "发起流程", businessType = BusinessType.INSERT) + @PostMapping("/startByParams/{procDefId}") + public AjaxResult startByParams(@ApiParam(value = "流程定义id") @PathVariable(value = "procDefId") String procDefId, + @ApiParam(value = "变量集合,json对象") @RequestBody Map variables) { + return flowDefinitionService.startProcessInstanceByParams(procDefId, variables); + } + @ApiOperation(value = "激活或挂起流程定义") @Log(title = "激活/挂起流程", businessType = BusinessType.UPDATE) @PutMapping(value = "/updateState") diff --git a/yanzhu-modules/yanzhu-flowable/src/main/java/com/yanzhu/flowable/service/IFlowDefinitionService.java b/yanzhu-modules/yanzhu-flowable/src/main/java/com/yanzhu/flowable/service/IFlowDefinitionService.java index d93585c6..b5a0a0f1 100644 --- a/yanzhu-modules/yanzhu-flowable/src/main/java/com/yanzhu/flowable/service/IFlowDefinitionService.java +++ b/yanzhu-modules/yanzhu-flowable/src/main/java/com/yanzhu/flowable/service/IFlowDefinitionService.java @@ -16,7 +16,6 @@ public interface IFlowDefinitionService { boolean exist(String processDefinitionKey); - /** * 流程定义列表 * @@ -51,7 +50,13 @@ public interface IFlowDefinitionService { AjaxResult startProcessInstanceById(String procDefId, Map variables); - + /** + * 根据流程定义ID启动流程实例 + * @param procDefId + * @param variables + * @return + */ + AjaxResult startProcessInstanceByParams(String procDefId, Map variables); /** * 激活或挂起流程定义 * @@ -60,7 +65,6 @@ public interface IFlowDefinitionService { */ void updateState(Integer state, String deployId); - /** * 删除流程定义 * @@ -68,7 +72,6 @@ public interface IFlowDefinitionService { */ void delete(String deployId); - /** * 读取图片文件 * @param deployId diff --git a/yanzhu-modules/yanzhu-flowable/src/main/java/com/yanzhu/flowable/service/impl/FlowDefinitionServiceImpl.java b/yanzhu-modules/yanzhu-flowable/src/main/java/com/yanzhu/flowable/service/impl/FlowDefinitionServiceImpl.java index 505a5740..98432d6f 100644 --- a/yanzhu-modules/yanzhu-flowable/src/main/java/com/yanzhu/flowable/service/impl/FlowDefinitionServiceImpl.java +++ b/yanzhu-modules/yanzhu-flowable/src/main/java/com/yanzhu/flowable/service/impl/FlowDefinitionServiceImpl.java @@ -1,8 +1,10 @@ package com.yanzhu.flowable.service.impl; +import com.yanzhu.common.core.text.Convert; import com.yanzhu.common.core.web.domain.AjaxResult; import com.yanzhu.common.security.utils.SecurityUtils; import com.yanzhu.flowable.common.constant.ProcessConstants; +import com.yanzhu.flowable.common.enums.FlowComment; import com.yanzhu.flowable.domain.SysForm; import com.yanzhu.flowable.domain.dto.FlowProcDefDto; import com.yanzhu.flowable.factory.FlowServiceFactory; @@ -16,7 +18,9 @@ import org.flowable.bpmn.model.BpmnModel; import org.flowable.engine.repository.Deployment; import org.flowable.engine.repository.ProcessDefinition; import org.flowable.engine.repository.ProcessDefinitionQuery; +import org.flowable.engine.runtime.ProcessInstance; import org.flowable.image.impl.DefaultProcessDiagramGenerator; +import org.flowable.task.api.Task; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -196,6 +200,43 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl } } + /** + * 根据流程定义ID启动流程实例 + * + * @param procDefId 流程模板ID + * @param variables 流程变量 + * @return + */ + @Override + public AjaxResult startProcessInstanceByParams(String procDefId, Map variables) { + try { + ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId) + .latestVersion().singleResult(); + if (Objects.nonNull(processDefinition) && processDefinition.isSuspended()) { + return AjaxResult.error("流程已被挂起,请先激活流程"); + } + // 设置流程发起人Id到流程中 + String userId = Convert.toStr(variables.get(ProcessConstants.PROCESS_INITIATOR)); + String userName = Convert.toStr(variables.get("userName")); + String businessKey = Convert.toStr(variables.get("businessKey")); + identityService.setAuthenticatedUserId(userId); + ProcessInstance processInstance = runtimeService.startProcessInstanceById(procDefId, businessKey, variables); + + // 给第一步申请人节点设置任务执行人和意见 + Task task = taskService.createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).singleResult(); + if (Objects.nonNull(task)) { + taskService.addComment(task.getId(), processInstance.getProcessInstanceId(), FlowComment.NORMAL.getType(), userName + "发起流程申请"); + taskService.setAssignee(task.getId(), userId); + taskService.complete(task.getId(), variables); + } + return AjaxResult.success("流程启动成功"); + } catch (Exception e) { + e.printStackTrace(); + return AjaxResult.error("流程启动错误"); + } + } + + /** * 激活或挂起流程定义 diff --git a/yanzhu-modules/yanzhu-manage/pom.xml b/yanzhu-modules/yanzhu-manage/pom.xml index 77dfbf89..8c9e4fec 100644 --- a/yanzhu-modules/yanzhu-manage/pom.xml +++ b/yanzhu-modules/yanzhu-manage/pom.xml @@ -92,6 +92,11 @@ + + org.apache.poi + poi + + com.lowagie itext diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/BasSignetController.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/BasSignetController.java new file mode 100644 index 00000000..9e342e03 --- /dev/null +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/BasSignetController.java @@ -0,0 +1,98 @@ +package com.yanzhu.manage.controller; + +import com.yanzhu.common.core.utils.poi.ExcelUtil; +import com.yanzhu.common.core.web.controller.BaseController; +import com.yanzhu.common.core.web.domain.AjaxResult; +import com.yanzhu.common.core.web.page.TableDataInfo; +import com.yanzhu.common.log.annotation.Log; +import com.yanzhu.common.log.enums.BusinessType; +import com.yanzhu.common.security.annotation.RequiresPermissions; +import com.yanzhu.manage.domain.BasSignet; +import com.yanzhu.manage.service.IBasSignetService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 业务签名管理Controller + * + * @author JiangYuQi + * @date 2024-12-17 + */ +@RestController +@RequestMapping("/basSignet") +public class BasSignetController extends BaseController +{ + @Autowired + private IBasSignetService basSignetService; + + /** + * 查询业务签名管理列表 + */ + @RequiresPermissions("manage:basSignet:list") + @GetMapping("/list") + public TableDataInfo list(BasSignet basSignet) + { + startPage(); + List list = basSignetService.selectBasSignetList(basSignet); + return getDataTable(list); + } + + /** + * 导出业务签名管理列表 + */ + @RequiresPermissions("manage:basSignet:export") + @Log(title = "业务签名管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BasSignet basSignet) + { + List list = basSignetService.selectBasSignetList(basSignet); + ExcelUtil util = new ExcelUtil(BasSignet.class); + util.exportExcel(response, list, "业务签名管理数据"); + } + + /** + * 获取业务签名管理详细信息 + */ + @RequiresPermissions("manage:basSignet:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(basSignetService.selectBasSignetById(id)); + } + + /** + * 新增业务签名管理 + */ + @RequiresPermissions("manage:basSignet:add") + @Log(title = "业务签名管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BasSignet basSignet) + { + return toAjax(basSignetService.insertBasSignet(basSignet)); + } + + /** + * 修改业务签名管理 + */ + @RequiresPermissions("manage:basSignet:edit") + @Log(title = "业务签名管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BasSignet basSignet) + { + return toAjax(basSignetService.updateBasSignet(basSignet)); + } + + /** + * 删除业务签名管理 + */ + @RequiresPermissions("manage:basSignet:remove") + @Log(title = "业务签名管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(basSignetService.deleteBasSignetByIds(ids)); + } +} diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/BasTemplateController.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/BasTemplateController.java new file mode 100644 index 00000000..ddf03602 --- /dev/null +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/BasTemplateController.java @@ -0,0 +1,186 @@ +package com.yanzhu.manage.controller; + +import com.alibaba.fastjson2.JSON; +import com.yanzhu.common.core.utils.poi.ExcelUtil; +import com.yanzhu.common.core.web.controller.BaseController; +import com.yanzhu.common.core.web.domain.AjaxResult; +import com.yanzhu.common.core.web.page.TableDataInfo; +import com.yanzhu.common.log.annotation.Log; +import com.yanzhu.common.log.enums.BusinessType; +import com.yanzhu.common.security.annotation.RequiresPermissions; +import com.yanzhu.manage.config.ProfileConfig; +import com.yanzhu.manage.domain.BasTemplate; +import com.yanzhu.manage.enums.BasTemTypes; +import com.yanzhu.manage.service.IBasTemplateService; +import com.yanzhu.manage.utils.pdf.PoiUtil; +import org.apache.commons.io.FileUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.io.ClassPathResource; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; +import java.util.stream.Collectors; + +/** + * 业务模板管理Controller + * + * @author JiangYuQi + * @date 2024-12-17 + */ +@RestController +@RequestMapping("/basTemplate") +public class BasTemplateController extends BaseController +{ + @Autowired + private IBasTemplateService basTemplateService; + + /** + * 查询业务模板管理列表 + */ + @RequiresPermissions("manage:basTemplate:list") + @GetMapping("/list") + public TableDataInfo list(BasTemplate basTemplate) + { + startPage(); + List list = basTemplateService.selectBasTemplateList(basTemplate); + return getDataTable(list); + } + + /** + * 导出业务模板管理列表 + */ + @RequiresPermissions("manage:basTemplate:export") + @Log(title = "业务模板管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BasTemplate basTemplate) + { + List list = basTemplateService.selectBasTemplateList(basTemplate); + ExcelUtil util = new ExcelUtil(BasTemplate.class); + util.exportExcel(response, list, "业务模板管理数据"); + } + + /** + * 获取业务模板管理详细信息 + */ + @RequiresPermissions("manage:basTemplate:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(basTemplateService.selectBasTemplateById(id)); + } + + /** + * 新增业务模板管理 + */ + @RequiresPermissions("manage:basTemplate:add") + @Log(title = "业务模板管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BasTemplate basTemplate) + { + return toAjax(basTemplateService.insertBasTemplate(basTemplate)); + } + + /** + * 修改业务模板管理 + */ + @RequiresPermissions("manage:basTemplate:edit") + @Log(title = "业务模板管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BasTemplate basTemplate) + { + return toAjax(basTemplateService.updateBasTemplate(basTemplate)); + } + + /** + * 删除业务模板管理 + */ + @RequiresPermissions("manage:basTemplate:remove") + @Log(title = "业务模板管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(basTemplateService.deleteBasTemplateByIds(ids)); + } + + /** + * 预览业务模板管理 + */ + @RequiresPermissions("manage:basTemplate:query") + @GetMapping("/preview/{id}") + public AjaxResult previewBasTemplate(@PathVariable("id") Long id) + { + AjaxResult result = null; + try { + BasTemplate basTemplate = basTemplateService.selectBasTemplateById(id); + // 保存文件根目录 + String rootSavePath = ProfileConfig.profilePath; + if (Objects.nonNull(basTemplate)) { + String content = readFileContent("template.json"); + Map allCanShuMap = JSON.parseObject(content); + Map canShuMap = (Map) allCanShuMap.get(BasTemTypes.findTemplateDataKey(null)); + String temPath = basTemplate.getTemPath(); + String uploadPath = temPath.replaceAll(ProfileConfig.profile, ""); + if (temPath.indexOf(ProfileConfig.profile) > -1) { + temPath = temPath.replaceAll(ProfileConfig.profile, rootSavePath); + uploadPath = uploadPath.substring(0, uploadPath.lastIndexOf('/') + 1); + } + //文件名称 + String fileName = UUID.randomUUID() + ".pdf"; + //生成的测试合同地址 + String saveWordFilePath = rootSavePath + uploadPath + fileName; + String moBanTestFilePath = ProfileConfig.profile + uploadPath + fileName; + //生成文件夹 + File dirFile = FileUtils.getFile(rootSavePath + uploadPath); + if (!dirFile.exists()) { + dirFile.mkdirs(); + } + //word文件转PDF文件 + PoiUtil.createPdfByWordTemplate(temPath, saveWordFilePath, canShuMap); + result = AjaxResult.success(moBanTestFilePath); + } + } catch (Exception e) { + e.printStackTrace(); + result = AjaxResult.error(); + } + return result; + } + + /*** + * @param filePath + * @return java.lang.String + * @exception + * @Author JiangYuQi + * @Description 读取jar中的文件 + * @Date 2023/3/7 14:06 + **/ + private String readFileContent(String filePath){ + BufferedReader reader=null; + String content=""; + try { + ClassPathResource resource = new ClassPathResource(filePath); + reader=new BufferedReader(new InputStreamReader(resource.getInputStream())); + content = reader.lines().collect(Collectors.joining("\n")); + reader.close(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + try { + if(reader!=null){ + reader.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + return content; + } + +} diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/domain/SignetFileVo.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/domain/SignetFileVo.java index 1c41da1d..4be4a8b9 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/domain/SignetFileVo.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/domain/SignetFileVo.java @@ -25,6 +25,14 @@ public class SignetFileVo { @ApiModelProperty("图片") private String imgBase64; + @ApiModelProperty("身体健康情况") + @NotNull(message = "身体健康情况不能为空") + private Long illnessStatus; + + @ApiModelProperty("身体严重疾病情况") + @NotNull(message = "身体严重疾病情况不能为空") + private Long supIllnessStatus; + @ApiModelProperty("图片地址") @NotBlank(message = "图片地址不能为空") private String imgPath; diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/enums/BasTemTypes.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/enums/BasTemTypes.java new file mode 100644 index 00000000..3605756f --- /dev/null +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/enums/BasTemTypes.java @@ -0,0 +1,52 @@ +package com.yanzhu.manage.enums; + +import com.yanzhu.common.core.utils.StringUtils; + +import java.util.Objects; + +public enum BasTemTypes { + + DLR("1", "委托代理人"), + XMJL("2", "项目经理"), + BZZ("3", "班组长"), + LWGR("4", "劳务工人"); + + private final String code; + private final String info; + + BasTemTypes(String code, String info) + { + this.code = code; + this.info = info; + } + + public String getCode() + { + return code; + } + + public String getInfo() + { + return info; + } + + /** + * 获取模板数据 + * @param type + * @return + */ + public static String findTemplateDataKey(String type){ + if(StringUtils.isNotEmpty(type)){ + if(Objects.equals(DLR.getCode(),type)){ + return "wtdlr"; + }else if(Objects.equals(XMJL.getCode(),type)){ + return "xmjl"; + }else if(Objects.equals(BZZ.getCode(),type)){ + return "bzz"; + }else{ + return "default"; + } + } + return "default"; + } +} 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 similarity index 68% rename from yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/enums/craftPostEnums.java rename to yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/enums/CraftPostEnums.java index 08bc9542..66596af9 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 @@ -3,14 +3,15 @@ package com.yanzhu.manage.enums; /** * 工种岗位枚举 */ -public enum craftPostEnums { +public enum CraftPostEnums { - WTDLR("22", "委托代理人"); + WTDL("1022", "委托代理人"), + XMJL("1023", "委托代理人"); private final String code; private final String info; - craftPostEnums(String code, String info) + CraftPostEnums(String code, String info) { this.code = code; this.info = info; diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/enums/SignetKeyEnums.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/enums/SignetKeyEnums.java new file mode 100644 index 00000000..d7d131b0 --- /dev/null +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/enums/SignetKeyEnums.java @@ -0,0 +1,32 @@ +package com.yanzhu.manage.enums; + +/** + * 签名关键字枚举 + */ +public enum SignetKeyEnums { + + USER_SIGN("[USER-SIGN]", "用户签名关键字"), + GROUP_SIGN("[GROUP-SIGN]", "班组教育签名关键字"), + PROJECT_SIGN("[PROJECT-SIGN]", "项目部教育签名关键字"), + COMPANY_SIGN("[COMPANY-SIGN]", "公司级教育签名关键字"); + + private final String code; + private final String info; + + SignetKeyEnums(String code, String info) + { + this.code = code; + this.info = info; + } + + public String getCode() + { + return code; + } + + public String getInfo() + { + return info; + } + +} diff --git a/yanzhu-common/yanzhu-common-core/src/main/java/com/yanzhu/common/core/enums/CraftType.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/enums/UserPostEnums.java similarity index 52% rename from yanzhu-common/yanzhu-common-core/src/main/java/com/yanzhu/common/core/enums/CraftType.java rename to yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/enums/UserPostEnums.java index 3d9622ef..15e03d17 100644 --- a/yanzhu-common/yanzhu-common-core/src/main/java/com/yanzhu/common/core/enums/CraftType.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/enums/UserPostEnums.java @@ -1,18 +1,19 @@ -package com.yanzhu.common.core.enums; +package com.yanzhu.manage.enums; /** - * 工种类型 + * 用户岗位 */ -public enum CraftType { +public enum UserPostEnums { - PTGZ("1", "普通工种"), - TSGZ("2", "特殊工种"), - GLRY("3", "管理人员"); + WTDL("1", "委托代理"), + XMJL("2", "项目经理"), + BZZ("3", "班组长"), + LWGR("4", "劳务工人"); private final String code; private final String info; - CraftType(String code, String info) + UserPostEnums(String code, String info) { this.code = code; this.info = info; @@ -27,5 +28,4 @@ public enum CraftType { { return info; } - } diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IBasSignetService.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IBasSignetService.java new file mode 100644 index 00000000..482892e9 --- /dev/null +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IBasSignetService.java @@ -0,0 +1,61 @@ +package com.yanzhu.manage.service; + +import java.util.List; +import com.yanzhu.manage.domain.BasSignet; + +/** + * 业务签名管理Service接口 + * + * @author JiangYuQi + * @date 2024-12-17 + */ +public interface IBasSignetService +{ + /** + * 查询业务签名管理 + * + * @param id 业务签名管理主键 + * @return 业务签名管理 + */ + public BasSignet selectBasSignetById(Long id); + + /** + * 查询业务签名管理列表 + * + * @param basSignet 业务签名管理 + * @return 业务签名管理集合 + */ + public List selectBasSignetList(BasSignet basSignet); + + /** + * 新增业务签名管理 + * + * @param basSignet 业务签名管理 + * @return 结果 + */ + public int insertBasSignet(BasSignet basSignet); + + /** + * 修改业务签名管理 + * + * @param basSignet 业务签名管理 + * @return 结果 + */ + public int updateBasSignet(BasSignet basSignet); + + /** + * 批量删除业务签名管理 + * + * @param ids 需要删除的业务签名管理主键集合 + * @return 结果 + */ + public int deleteBasSignetByIds(Long[] ids); + + /** + * 删除业务签名管理信息 + * + * @param id 业务签名管理主键 + * @return 结果 + */ + public int deleteBasSignetById(Long id); +} diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IBasTemplateService.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IBasTemplateService.java new file mode 100644 index 00000000..e1e77ba8 --- /dev/null +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IBasTemplateService.java @@ -0,0 +1,61 @@ +package com.yanzhu.manage.service; + +import java.util.List; +import com.yanzhu.manage.domain.BasTemplate; + +/** + * 业务模板管理Service接口 + * + * @author JiangYuQi + * @date 2024-12-17 + */ +public interface IBasTemplateService +{ + /** + * 查询业务模板管理 + * + * @param id 业务模板管理主键 + * @return 业务模板管理 + */ + public BasTemplate selectBasTemplateById(Long id); + + /** + * 查询业务模板管理列表 + * + * @param basTemplate 业务模板管理 + * @return 业务模板管理集合 + */ + public List selectBasTemplateList(BasTemplate basTemplate); + + /** + * 新增业务模板管理 + * + * @param basTemplate 业务模板管理 + * @return 结果 + */ + public int insertBasTemplate(BasTemplate basTemplate); + + /** + * 修改业务模板管理 + * + * @param basTemplate 业务模板管理 + * @return 结果 + */ + public int updateBasTemplate(BasTemplate basTemplate); + + /** + * 批量删除业务模板管理 + * + * @param ids 需要删除的业务模板管理主键集合 + * @return 结果 + */ + public int deleteBasTemplateByIds(Long[] ids); + + /** + * 删除业务模板管理信息 + * + * @param id 业务模板管理主键 + * @return 结果 + */ + public int deleteBasTemplateById(Long id); +} diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/BasSignetServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/BasSignetServiceImpl.java new file mode 100644 index 00000000..2cef17fa --- /dev/null +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/BasSignetServiceImpl.java @@ -0,0 +1,103 @@ +package com.yanzhu.manage.service.impl; + +import com.yanzhu.common.core.context.SecurityContextHolder; +import com.yanzhu.common.core.utils.DateUtils; +import com.yanzhu.common.security.utils.SecurityUtils; +import com.yanzhu.manage.domain.BasSignet; +import com.yanzhu.manage.mapper.BasSignetMapper; +import com.yanzhu.manage.service.IBasSignetService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 业务签名管理Service业务层处理 + * + * @author JiangYuQi + * @date 2024-12-17 + */ +@Service +public class BasSignetServiceImpl implements IBasSignetService +{ + @Autowired + private BasSignetMapper basSignetMapper; + + /** + * 查询业务签名管理 + * + * @param id 业务签名管理主键 + * @return 业务签名管理 + */ + @Override + public BasSignet selectBasSignetById(Long id) + { + return basSignetMapper.selectBasSignetById(id); + } + + /** + * 查询业务签名管理列表 + * + * @param basSignet 业务签名管理 + * @return 业务签名管理 + */ + @Override + public List selectBasSignetList(BasSignet basSignet) + { + basSignet.setActiveComId(SecurityUtils.getLoginUser().getProjectDeptId()); + basSignet.setActiveProjectId(SecurityUtils.getLoginUser().getProjectId()); + return basSignetMapper.selectBasSignetList(basSignet); + } + + /** + * 新增业务签名管理 + * + * @param basSignet 业务签名管理 + * @return 结果 + */ + @Override + public int insertBasSignet(BasSignet basSignet) + { + basSignet.setCreateBy(SecurityContextHolder.getUserName()); + basSignet.setCreateTime(DateUtils.getNowDate()); + return basSignetMapper.insertBasSignet(basSignet); + } + + /** + * 修改业务签名管理 + * + * @param basSignet 业务签名管理 + * @return 结果 + */ + @Override + public int updateBasSignet(BasSignet basSignet) + { + basSignet.setUpdateBy(SecurityContextHolder.getUserName()); + basSignet.setUpdateTime(DateUtils.getNowDate()); + return basSignetMapper.updateBasSignet(basSignet); + } + + /** + * 批量删除业务签名管理 + * + * @param ids 需要删除的业务签名管理主键 + * @return 结果 + */ + @Override + public int deleteBasSignetByIds(Long[] ids) + { + return basSignetMapper.deleteBasSignetByIds(ids); + } + + /** + * 删除业务签名管理信息 + * + * @param id 业务签名管理主键 + * @return 结果 + */ + @Override + public int deleteBasSignetById(Long id) + { + return basSignetMapper.deleteBasSignetById(id); + } +} diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/BasTemplateServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/BasTemplateServiceImpl.java new file mode 100644 index 00000000..d64924f8 --- /dev/null +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/BasTemplateServiceImpl.java @@ -0,0 +1,104 @@ +package com.yanzhu.manage.service.impl; + +import java.util.List; +import com.yanzhu.common.core.context.SecurityContextHolder; +import com.yanzhu.common.core.utils.DateUtils; +import com.yanzhu.common.security.utils.SecurityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.yanzhu.manage.mapper.BasTemplateMapper; +import com.yanzhu.manage.domain.BasTemplate; +import com.yanzhu.manage.service.IBasTemplateService; + +/** + * 业务模板管理Service业务层处理 + * + * @author JiangYuQi + * @date 2024-12-17 + */ +@Service +public class BasTemplateServiceImpl implements IBasTemplateService +{ + @Autowired + private BasTemplateMapper basTemplateMapper; + + /** + * 查询业务模板管理 + * + * @param id 业务模板管理主键 + * @return 业务模板管理 + */ + @Override + public BasTemplate selectBasTemplateById(Long id) + { + return basTemplateMapper.selectBasTemplateById(id); + } + + /** + * 查询业务模板管理列表 + * + * @param basTemplate 业务模板管理 + * @return 业务模板管理 + */ + @Override + public List selectBasTemplateList(BasTemplate basTemplate) + { + basTemplate.setActiveComId(SecurityUtils.getLoginUser().getProjectDeptId()); + basTemplate.setActiveProjectId(SecurityUtils.getLoginUser().getProjectId()); + return basTemplateMapper.selectBasTemplateList(basTemplate); + } + + /** + * 新增业务模板管理 + * + * @param basTemplate 业务模板管理 + * @return 结果 + */ + @Override + public int insertBasTemplate(BasTemplate basTemplate) + { + basTemplate.setCreateBy(SecurityContextHolder.getUserName()); + basTemplate.setCreateTime(DateUtils.getNowDate()); + basTemplate.setUpdateBy(SecurityContextHolder.getUserName()); + basTemplate.setUpdateTime(DateUtils.getNowDate()); + return basTemplateMapper.insertBasTemplate(basTemplate); + } + + /** + * 修改业务模板管理 + * + * @param basTemplate 业务模板管理 + * @return 结果 + */ + @Override + public int updateBasTemplate(BasTemplate basTemplate) + { + basTemplate.setUpdateBy(SecurityContextHolder.getUserName()); + basTemplate.setUpdateTime(DateUtils.getNowDate()); + return basTemplateMapper.updateBasTemplate(basTemplate); + } + + /** + * 批量删除业务模板管理 + * + * @param ids 需要删除的业务模板管理主键 + * @return 结果 + */ + @Override + public int deleteBasTemplateByIds(Long[] ids) + { + return basTemplateMapper.deleteBasTemplateByIds(ids); + } + + /** + * 删除业务模板管理信息 + * + * @param id 业务模板管理主键 + * @return 结果 + */ + @Override + public int deleteBasTemplateById(Long id) + { + return basTemplateMapper.deleteBasTemplateById(id); + } +} 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 fdb6ac29..b3da962d 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 @@ -1,23 +1,30 @@ package com.yanzhu.manage.service.impl; -import java.util.*; -import java.util.stream.Collectors; - import com.alibaba.fastjson2.JSON; -import com.yanzhu.common.core.enums.*; +import com.yanzhu.common.core.enums.DataSourceEnuns; +import com.yanzhu.common.core.enums.IsDelEnums; +import com.yanzhu.common.core.enums.ShiFouEnums; +import com.yanzhu.common.core.enums.UseStateEnums; import com.yanzhu.common.core.exception.ServiceException; import com.yanzhu.common.core.text.Convert; 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.*; -import com.yanzhu.manage.mapper.*; +import com.yanzhu.manage.enums.CraftTypeEnums; +import com.yanzhu.manage.mapper.BusExamInfoMapper; +import com.yanzhu.manage.mapper.BusExamQuestionMapper; +import com.yanzhu.manage.mapper.BusExamUserMapper; +import com.yanzhu.manage.mapper.ProProjectInfoSubdeptsUsersMapper; +import com.yanzhu.manage.service.IBusExamUserService; import com.yanzhu.system.api.domain.SysUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import com.yanzhu.manage.service.IBusExamUserService; import org.springframework.transaction.annotation.Transactional; +import java.util.*; +import java.util.stream.Collectors; + /** * 用户试卷Service业务层处理 * @@ -96,7 +103,7 @@ public class BusExamUserServiceImpl implements IBusExamUserService query.setProjectId(cache.getActiveProjectId()); query.setCraftType(userEntity.getCraftType()); // 管理人员获取所有管理类试卷 - if(!Objects.equals(CraftType.GLRY.getCode(),query.getCraftType())){ + if(!Objects.equals(CraftTypeEnums.GLRY.getCode(),query.getCraftType())){ query.setCraftPost(userEntity.getCraftPost()); } query.setIsDel(IsDelEnums.NO.getCode()); @@ -190,7 +197,7 @@ public class BusExamUserServiceImpl implements IBusExamUserService examQuery.setProjectId(userEntity.getProjectId()); examQuery.setCraftType(userEntity.getCraftType()); // 管理人员获取所有管理类试卷 - if(!Objects.equals(CraftType.GLRY.getCode(),examQuery.getCraftType())){ + if(!Objects.equals(CraftTypeEnums.GLRY.getCode(),examQuery.getCraftType())){ examQuery.setCraftPost(userEntity.getCraftPost()); } examQuery.setIsDel(IsDelEnums.NO.getCode()); @@ -210,7 +217,7 @@ public class BusExamUserServiceImpl implements IBusExamUserService } // 获取试卷试题 - List questions = extractExamQuestion(findExamInfo,Objects.equals(CraftType.GLRY.getCode(),examQuery.getCraftType())?null:userEntity.getCraftPost()); + List questions = extractExamQuestion(findExamInfo,Objects.equals(CraftTypeEnums.GLRY.getCode(),examQuery.getCraftType())?null:userEntity.getCraftPost()); // 试题重新排序 Collections.shuffle(questions); 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 592551f7..89bbbadc 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 @@ -15,7 +15,7 @@ import com.yanzhu.manage.domain.ProProjectInfoSubdepts; import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers; import com.yanzhu.manage.enums.CraftTypeEnums; import com.yanzhu.manage.enums.SubDeptsEnums; -import com.yanzhu.manage.enums.craftPostEnums; +import com.yanzhu.manage.enums.CraftPostEnums; import com.yanzhu.manage.mapper.ProProjectInfoSubdeptsMapper; import com.yanzhu.manage.mapper.ProProjectInfoSubdeptsUsersMapper; import com.yanzhu.manage.service.IProProjectInfoSubdeptsService; @@ -152,7 +152,7 @@ public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdept subdeptsUser.setSubDeptPowerPath(proProjectInfoSubdepts.getSubDeptLeaderPowerPath()); subdeptsUser.setUserId(proProjectInfoSubdepts.getSubDeptLeaderId()); subdeptsUser.setCraftType(CraftTypeEnums.GLRY.getCode()); - subdeptsUser.setCraftPost(craftPostEnums.WTDLR.getCode()); + subdeptsUser.setCraftPost(CraftPostEnums.WTDL.getCode()); subdeptsUser.setDegreeGrade(""); subdeptsUser.setEduStatus(ShiFouEnums.FOU.getCodeStr()); subdeptsUser.setApproveStatus(ApproveStatus.await.getCode()); @@ -240,7 +240,7 @@ public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdept subdeptsUser.setSubDeptPowerPath(proProjectInfoSubdepts.getSubDeptLeaderPowerPath()); subdeptsUser.setUserId(proProjectInfoSubdepts.getSubDeptLeaderId()); subdeptsUser.setCraftType(CraftTypeEnums.GLRY.getCode()); - subdeptsUser.setCraftPost(craftPostEnums.WTDLR.getCode()); + subdeptsUser.setCraftPost(CraftPostEnums.WTDL.getCode()); subdeptsUser.setDegreeGrade(""); subdeptsUser.setEduStatus(ShiFouEnums.FOU.getCodeStr()); subdeptsUser.setApproveStatus(ApproveStatus.await.getCode()); 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 c45f96d6..29aa526f 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 @@ -1,22 +1,39 @@ package com.yanzhu.manage.service.impl; +import com.alibaba.fastjson.JSON; import com.yanzhu.common.core.constant.SecurityConstants; import com.yanzhu.common.core.context.SecurityContextHolder; +import com.yanzhu.common.core.domain.R; +import com.yanzhu.common.core.enums.ApproveStatus; +import com.yanzhu.common.core.enums.ShiFouEnums; import com.yanzhu.common.core.exception.ServiceException; +import com.yanzhu.common.core.text.Convert; import com.yanzhu.common.core.utils.DateUtils; import com.yanzhu.common.core.utils.StringUtils; +import com.yanzhu.common.core.web.domain.AjaxResult; +import com.yanzhu.common.security.utils.DictUtils; +import com.yanzhu.manage.config.ProfileConfig; +import com.yanzhu.manage.domain.BasTemplate; import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers; import com.yanzhu.manage.domain.SignetFileVo; +import com.yanzhu.manage.enums.BasTemTypes; +import com.yanzhu.manage.enums.CraftPostEnums; +import com.yanzhu.manage.enums.SignetKeyEnums; +import com.yanzhu.manage.mapper.BasTemplateMapper; import com.yanzhu.manage.mapper.ProProjectInfoSubdeptsUsersMapper; import com.yanzhu.manage.service.IProProjectInfoSubdeptsUsersService; import com.yanzhu.manage.service.IUniService; +import com.yanzhu.manage.utils.pdf.PoiUtil; +import com.yanzhu.system.api.RemoteFlowService; import com.yanzhu.system.api.RemoteUserService; import com.yanzhu.system.api.domain.SysUser; +import org.apache.commons.io.FileUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.List; +import java.io.File; +import java.util.*; /** * 分包单位工人Service业务层处理 @@ -27,14 +44,21 @@ import java.util.List; @Service public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSubdeptsUsersService { + @Autowired - private ProProjectInfoSubdeptsUsersMapper proProjectInfoSubdeptsUsersMapper; + private IUniService uniService; + + @Autowired + private BasTemplateMapper basTemplateMapper; @Autowired private RemoteUserService remoteUserService; @Autowired - private IUniService uniService; + private RemoteFlowService remoteFlowService; + + @Autowired + private ProProjectInfoSubdeptsUsersMapper proProjectInfoSubdeptsUsersMapper; /** * 查询分包单位工人 @@ -169,9 +193,92 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu if (StringUtils.isEmpty(dataList)) { throw new ServiceException("用户信息异常..."); } + ProProjectInfoSubdeptsUsers proSubdeptsUser = dataList.get(0); + proSubdeptsUser.setIllnessStatus(signetFileVo.getIllnessStatus()); + proSubdeptsUser.setSupIllnessStatus(signetFileVo.getSupIllnessStatus()); + + if(StringUtils.isEmpty(proSubdeptsUser.getUserPost())){ + throw new ServiceException("用户信息异常..."); + } + // 工作流配置查询 + List> procdefDatas = proProjectInfoSubdeptsUsersMapper.findActReProcdefDept(proSubdeptsUser.getProjectId(),proSubdeptsUser.getUserPost()); + if(StringUtils.isEmpty(procdefDatas)){ + throw new ServiceException("工作流配置异常...请联系管理员配置"); + } + String procDefId = Convert.toStr(procdefDatas.get(0).get("PROCDEF_ID_")); + + // 生成安全承诺教育书... + BasTemplate querys = new BasTemplate(); + querys.setComId(proSubdeptsUser.getComId()); + querys.setProjectId(proSubdeptsUser.getProjectId()); + querys.setTemType(proSubdeptsUser.getUserPost()); + querys.setIsDel(ShiFouEnums.FOU.getCode()); + List basTemplateList = basTemplateMapper.selectBasTemplateList(querys); + if (StringUtils.isEmpty(basTemplateList)) { + throw new ServiceException("业务模板信息异常...待管理员维护业务模板后再试"); + } + // 保存文件根目录 + String rootSavePath = ProfileConfig.profilePath; + String temPath = basTemplateList.get(0).getTemPath(); + if (temPath.indexOf(ProfileConfig.profile) > -1) { + temPath = temPath.replaceAll(ProfileConfig.profile, rootSavePath); + } + //文件名称 + String fileName = UUID.randomUUID() + ".pdf"; + String filePath = DateUtils.datePath(); + //生成的测试合同地址 + String saveWordFilePath = rootSavePath + filePath + fileName; + String saveEdusFilePath = ProfileConfig.profile + filePath + fileName; + //生成文件夹 + File dirFile = FileUtils.getFile(rootSavePath + filePath); + if (!dirFile.exists()) { + dirFile.mkdirs(); + } + //word文件转PDF文件 + Map dataMap = getUserDataMap(proSubdeptsUser); + try { + PoiUtil.createPdfByWordTemplate(temPath, saveWordFilePath, dataMap); + }catch (Exception e){ + throw new ServiceException("承诺书生成失败...服务器异常!!!"); + } proSubdeptsUser.setSubStep(100L); proSubdeptsUser.setEduSignPath(signetFileVo.getImgPath()); + proSubdeptsUser.setEduFilePath(saveEdusFilePath); + proSubdeptsUser.setApproveStatus(ApproveStatus.check.getCode()); + int res = proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proSubdeptsUser); + if(res>0){ + // 启动工作流审批节点... + Map variables = new HashMap<>(); + variables.put("INITIATOR",proSubdeptsUser.getUserId()); + variables.put("userName",proSubdeptsUser.getUser().getNickName()); + variables.put("businessKey",proSubdeptsUser.getId()); + R result = remoteFlowService.startDefinitionByParams(procDefId,variables,SecurityConstants.INNER); + System.out.println("flowable.RESULT==>"+JSON.toJSONString(result)); + if(Objects.isNull(result) || Objects.isNull(result.getData()) || result.getData().isError()){ + throw new ServiceException("工作流启动失败...服务器异常!!!"); + } + } + } + + /** + * 封装用户文件参数... + * @return + */ + private Map getUserDataMap(ProProjectInfoSubdeptsUsers proSubdeptsUser){ + Map dataMap = new HashMap<>(); + SysUser sysUser = proSubdeptsUser.getUser(); + dataMap.put("fName",sysUser.getNickName()); + dataMap.put("fSex",StringUtils.judgeGenderText(sysUser.getCardCode())); + dataMap.put("fAge",StringUtils.getAgeFromIdCard(sysUser.getCardCode())); + dataMap.put("fIllnessStatus",Objects.equals(ShiFouEnums.FOU.getCode(),proSubdeptsUser.getIllnessStatus())?"无":"有"); + dataMap.put("fSupIllnessStatus",Objects.equals(ShiFouEnums.FOU.getCode(),proSubdeptsUser.getSupIllnessStatus())?"无":"有"); + dataMap.put("fCraftPost", DictUtils.getDictLabel("pro_craft_post",proSubdeptsUser.getCraftPost())); + dataMap.put("fUserSign", SignetKeyEnums.USER_SIGN.getCode()); + dataMap.put("fGroupSign", SignetKeyEnums.GROUP_SIGN.getCode()); + dataMap.put("fProjectSign", SignetKeyEnums.PROJECT_SIGN.getCode()); + dataMap.put("fCompanySign", SignetKeyEnums.COMPANY_SIGN.getCode()); + return dataMap; } /** diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/pdf/MyTableRenderPolicy.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/pdf/MyTableRenderPolicy.java index df8c12ec..3a23074f 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/pdf/MyTableRenderPolicy.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/pdf/MyTableRenderPolicy.java @@ -45,7 +45,6 @@ import java.util.List; */ public class MyTableRenderPolicy extends AbstractRenderPolicy { - @Override public void doRender(RunTemplate runTemplate, Object data, XWPFTemplate template) throws Exception { NiceXWPFDocument doc = template.getXWPFDocument(); @@ -132,6 +131,7 @@ public class MyTableRenderPolicy extends AbstractRenderPolicy { } } } + /** * @description:填充单元格内容 * @author: wangjunsheng @@ -288,7 +288,6 @@ public class MyTableRenderPolicy extends AbstractRenderPolicy { XWPFRun targetrun = newParagraph.createRun(); CopyRun(targetrun, s); } - } /** diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/pdf/WordToPdfUtil.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/pdf/WordToPdfUtil.java index 973e896d..1046d0d6 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/pdf/WordToPdfUtil.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/pdf/WordToPdfUtil.java @@ -99,13 +99,13 @@ public class WordToPdfUtil { if (!getLicense()) { // 验证License 若不验证则转化出的pdf文档会有水印产生 return; } - long old = System.currentTimeMillis(); + //long old = System.currentTimeMillis(); File file = org.apache.commons.io.FileUtils.getFile(pdfFilePath); // 新建一个空白pdf文档 FileOutputStream os = org.apache.commons.io.FileUtils.openOutputStream(file); Document doc = new Document(wordFilePath); // Address是将要被转化的word文档 doc.save(os, SaveFormat.PDF);// 全面支持DOC, DOCX, OOXML, RTF HTML, OpenDocument, PDF, // EPUB, XPS, SWF 相互转换 - long now = System.currentTimeMillis(); + //long now = System.currentTimeMillis(); if(os!=null){ os.close(); } diff --git a/yanzhu-modules/yanzhu-manage/src/main/resources/template.json b/yanzhu-modules/yanzhu-manage/src/main/resources/template.json new file mode 100644 index 00000000..31f8382e --- /dev/null +++ b/yanzhu-modules/yanzhu-manage/src/main/resources/template.json @@ -0,0 +1,146 @@ +{ + "default": { + "heTongBianHao":"HT12345678910112", + "yiFangMingCheng":"张三丰", + "yiFangDaiMa": "61042719900625****", + "sflb":"身份证号", +"heTongShiChang":"12", +"ksn": "2023", +"ksy":"02", +"ksr": "13", +"jsn": "2024", +"jsy": "02", +"jsr": "14", +"youHuiBiLi":79, +"buChongTiaoKuan": "", +"jfgz":"[serviceKeyWord]", +"yfgz":"[userKeyWord]", +"jfqdsj": "[待甲方签订]", +"yfqdsj": "[待乙方签订]", +"lianXiDianHua": "181****8536", +"muQianJingYing":"", +"yinHangKaHao":"", +"kaiHuHang":"", +"kaiHuHangHangHao":"", +"daiXiaoFeiBiLi":"", +"sheBeiXingHao":"", +"sheBeiBianHao":"", +"sheBeiYaJin":"", +"yaJinPiaoHao":"", +"zhanDianXiangXiDiZhi":"", +"cnsKeyWord": "[cnsKeyWord]", +"cnsKeyDate": "[cnsKeyDate]", +"jfzg": "[JFZG]" + }, + "tzzht": { + "zhanDianBianHao": "6124211", + "yiFangMingCheng":"张三丰", + "yiFangXingBie":"男", + "yiFangDaiMa":"61042719900625****", + "chuShengRiQi":"1990-06-25", + "huKouSuoZaiDi": "陕西省彬县*********", + "zhuSuoDiZhi": "陕西省西安市三桥街道******", + "tongXunDiZhi": "陕西省西安市三桥街道******", + "yFLianXiDianHua": "18740352322", + "businessAddress": "陕西省西安市三桥街道******127号A座101", + "yFYouBian": "", + "shiMingCheng": "西安市", + "city":"西安", + "quXianMingCheng": "未央", + "xiangXiDiZhi": "陕西省西安市三桥街道******127号A座101", + "daiXiaoLeiXingMingCheng": "乐透数字型、即开型福利彩票", + "daiXiaoQiXian":1, + "ksn": "2023", + "ksy":"02", + "ksr": "13", + "jsn": "2024", + "jsy": "02", + "jsr": "14", + "sz":"[SZ]", + "jfgz":"[serviceKeyWord]", + "jfdbr":"[jfdbrKeyWord]", + "jfwtdlr":"[jfwtdlrKeyWord]", + "yfgz":"[userKeyWord]", + "yfyj": "[yfyjKeyWord]", + "jfqdsj": "[待甲方签订]", + "yfqdsj": "[待乙方签订]", + "cnsKeyWord": "[cnsKeyWord]", + "cnsKeyDate": "[cnsKeyDate]", + "LTSZDXF": "", + "JKYXDXF": "", + "JFWYJBFB": "", + "JFWYJZGBFB": "", + "JFZZWYJBFB": "", + "JFZZWYJZGBFB": "", + "YFWYJBFB": "", + "YFWYJZGBFB": "" + }, + "zsght": { + "heTongBianHao":"HT12345678910112", + "yiFangMingCheng":"张三丰", + "yiFangDaiMa": "61042719900625****", + "sflb":"身份证号", + "heTongShiChang":12, + "ksn": "2023", + "ksy":"02", + "ksr": "13", + "jsn": "2024", + "jsy": "02", + "jsr": "14", + "sheBeiYaJin":"1000", + "youHuiBiLi":91.5, + "jfgz":"[serviceKeyWord]", + "yfgz":"[userKeyWord]", + "jfqdsj": "[待甲方签订]", + "yfqdsj": "[待乙方签订]", + "lianXiDianHua":"181891385**", + "muQianJingYing":"", + "yinHangKaHao":"", + "kaiHuHang":"", + "zhanDianXiangXiDiZhi":"", + "kaiHuHangHangHao":"", + "daiXiaoFeiBiLi":"", + "cnsKeyWord": "[cnsKeyWord]", + "cnsKeyDate": "[cnsKeyDate]", + "sheBeiXingHao":"", + "sheBeiBianHao":"", + "yaJinPiaoHao":"", + "hangYeLeiXing":"", + "xiaoShouDiZhi":"" + }, + "bjzdht": { + "heTongBianHao":"HT12345678910112", + "yiFangMingCheng":"张三丰", + "yiFangDaiMa": "61042719900625****", + "sflb":"身份证号", + "heTongShiChang":12, + "ksn": "2023", + "ksy":"02", + "ksr": "13", + "jsn": "2024", + "jsy": "02", + "jsr": "14", + "sheBeiYaJin":"1000", + "youHuiBiLi":91.5, + "jfgz":"[serviceKeyWord]", + "yfgz":"[userKeyWord]", + "jfqdsj": "[待甲方签订]", + "yfqdsj": "[待乙方签订]", + "lianXiDianHua":"181891385**", + "muQianJingYing":"", + "yinHangKaHao":"", + "kaiHuHang":"", + "zhanDianXiangXiDiZhi":"", + "kaiHuHangHangHao":"", + "daiXiaoFeiBiLi":"", + "cnsKeyWord": "[cnsKeyWord]", + "cnsKeyDate": "[cnsKeyDate]", + "sheBeiXingHao":"", + "sheBeiBianHao":"", + "yaJinPiaoHao":"", + "hangYeLeiXing":"", + "xiaoShouDiZhi":"" + } +} + + diff --git a/yanzhu-ui-app/miniprogram/app.json b/yanzhu-ui-app/miniprogram/app.json index d9288eaa..8b7265eb 100644 --- a/yanzhu-ui-app/miniprogram/app.json +++ b/yanzhu-ui-app/miniprogram/app.json @@ -56,6 +56,7 @@ "safety-bar-chartss": "./components/safety-bar-chartss/index", "voucher-many-select": "pages/components/voucher-many-select/index", "sign": "pages/components/sign/sign", + "jyq-result": "pages/components/jyq-result/index", "safety-number": "./components/number/index", "select-person": "./components/select-person/index", "select-group-person": "./components/select-group-person/index", diff --git a/yanzhu-ui-app/miniprogram/app.wxss b/yanzhu-ui-app/miniprogram/app.wxss index 942e91d3..a44f3e4b 100644 --- a/yanzhu-ui-app/miniprogram/app.wxss +++ b/yanzhu-ui-app/miniprogram/app.wxss @@ -58,7 +58,7 @@ page { /* 中间内容用含有max_content 的 view 包起来 */ .max_content { - padding: 166rpx 0 90rpx; + padding: 166rpx 0 30rpx; } .max_content_scroll { @@ -1177,7 +1177,6 @@ swiper-item video { .study_examination_questions_con { display: inline-table; width: 100%; - } .study_examination_questions_topic { diff --git a/yanzhu-ui-app/miniprogram/pages/components/jyq-result/index.js b/yanzhu-ui-app/miniprogram/pages/components/jyq-result/index.js new file mode 100644 index 00000000..bcfb3afe --- /dev/null +++ b/yanzhu-ui-app/miniprogram/pages/components/jyq-result/index.js @@ -0,0 +1,46 @@ +// components/my-result/my-result.js +Component({ + /** + * 组件的属性列表 + */ + properties: { + iconPath: { + type: String, + value: '', // 默认图标路径,可以按需修改 + }, + title: { + type: String, + value: '默认标题', + }, + description: { + type: String, + }, + actionText: { + type: String, + }, + descActionText: { + type: String, + } + }, + + /** + * 组件的初始数据 + */ + data: { + + }, + + /** + * 组件的方法列表 + */ + methods: { + handleAction() { + // 这里可以触发对应的业务逻辑,比如跳转到某个页面等 + this.triggerEvent('action', {}); // 可以向外触发一个自定义事件,方便父组件监听 + }, + handleDescAction() { + // 这里可以触发对应的业务逻辑,比如跳转到某个页面等 + this.triggerEvent('descAction', {}); // 可以向外触发一个自定义事件,方便父组件监听 + } + } + }) \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/pages/components/jyq-result/index.json b/yanzhu-ui-app/miniprogram/pages/components/jyq-result/index.json new file mode 100644 index 00000000..e693f34b --- /dev/null +++ b/yanzhu-ui-app/miniprogram/pages/components/jyq-result/index.json @@ -0,0 +1,4 @@ +{ + "component": true + } + \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/pages/components/jyq-result/index.wxml b/yanzhu-ui-app/miniprogram/pages/components/jyq-result/index.wxml new file mode 100644 index 00000000..e72506d6 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/pages/components/jyq-result/index.wxml @@ -0,0 +1,8 @@ + + + + {{title}} + {{description}} + + + \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/pages/components/jyq-result/index.wxss b/yanzhu-ui-app/miniprogram/pages/components/jyq-result/index.wxss new file mode 100644 index 00000000..0ea37cda --- /dev/null +++ b/yanzhu-ui-app/miniprogram/pages/components/jyq-result/index.wxss @@ -0,0 +1,42 @@ +/* components/my-result/my-result.wxss */ +.my-result { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 20rpx; + } + + .icon { + width: 100rpx; + height: 100rpx; + margin-bottom: 20rpx; + } + + .title { + font-size: 32rpx; + font-weight: bold; + margin-bottom: 10rpx; + } + + .desc { + font-size: 28rpx; + color: #cccccc; + text-align: center; + margin-bottom: 20rpx; + } + + .action-btn { + background-color: #07c160; + color: white; + padding: 10rpx 20rpx; + border-radius: 8rpx; + } + + .desc-action-btn { + background-color: #999999; + color: white; + padding: 10rpx 20rpx; + border-radius: 8rpx; + margin-top: 20rpx; + } \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/pages/project_qr/index.js b/yanzhu-ui-app/miniprogram/pages/project_qr/index.js index 08eedceb..ce26ebea 100644 --- a/yanzhu-ui-app/miniprogram/pages/project_qr/index.js +++ b/yanzhu-ui-app/miniprogram/pages/project_qr/index.js @@ -98,7 +98,6 @@ Page({ eduVideoItem: [], busExamInfos: {}, busExamQuestions: [], - radio: '1', time: 3600, // 初始倒计时为 3600 秒 timer: null, timeStr: '', @@ -107,6 +106,15 @@ Page({ signTime: 5, signTimer: null, signPath: '', + youWuList: [{ + "id": "0", + "text": "无" + }, { + "id": "1", + "text": "有" + }], + illnessStatus: '', + supIllnessStatus: '', }, /** @@ -530,49 +538,110 @@ Page({ * 跳转签名页面 */ startSignFiles() { + let { + signTime, + illnessStatus, + supIllnessStatus + } = this.data; + if (signTime > 0) { + app.toast("请仔细阅读各项承诺书及三级安全教育!"); + return false; + } + if (illnessStatus == "") { + app.toast("请选择健康情况!"); + wx.pageScrollTo({ + scrollTop: 99999 + }); + return false; + } + if (supIllnessStatus == "") { + app.toast("请选择严重疾病情况!"); + wx.pageScrollTo({ + scrollTop: 99999 + }); + return false; + } let myCanvas = this.selectComponent(".myCanvas"); myCanvas.showSign(); }, /** - * 确认签名 - */ - sign(e){ - wx.pageScrollTo({ - scrollTop: 99999 - }); - let tempFilePath = e.detail - securityFileUpload(tempFilePath).then(res =>{ - if(res.code==200){ - this.setData({ - signPath:res.data.url - }); - } - }); -  }, + * 确认签名 + */ + sign(e) { + let tempFilePath = e.detail + securityFileUpload(tempFilePath).then(res => { + if (res.code == 200) { + this.setData({ + signPath: res.data.url + }); + } + }); + }, /** * 提交签名 */ submitSignFiles() { - let param = {}; - param.proId = this.data.proId; - param.userPhone = this.data.phoneNumber; - param.imgPath = this.data.signPath; - if(param.proId && param.userPhone && param.imgPath){ - submitUserSignets(param).then(res =>{ - if(res.code==200){ - this.setData({ - active:100 - }); + let { + proId, + signPath, + phoneNumber, + illnessStatus, + supIllnessStatus + } = this.data; + if (illnessStatus == "") { + app.toast("请选择身体健康情况!"); + return false; + } + if (supIllnessStatus == "") { + app.toast("请选择身体严重疾病情况!"); + return false; + } + if (proId && phoneNumber && imgPath) { + let that = this; + //弹出确认 + wx.showModal({ + title: '提示', + content: '是否确认提交文件签署信息?', + success: function (sm) { + if (sm.confirm) { + that.submitSignFilesValues(); + } } - }); - }else{ + }) + } else { app.toast("信息异常...请刷新页面后重新操作!"); return false; } }, + /** + * 提交文件签署表单 + */ + submitSignFilesValues() { + let { + proId, + signPath, + phoneNumber, + illnessStatus, + supIllnessStatus + } = this.data; + let param = {}; + param.proId = proId; + param.userPhone = phoneNumber; + param.imgPath = signPath; + param.illnessStatus = illnessStatus; + param.supIllnessStatus = supIllnessStatus; + submitUserSignets(param).then(res => { + if (res.code == 200) { + this.setData({ + active: 100 + }); + } + }); + }, + /** * 根据身份证号获取性别 * @param {*} idCard @@ -1120,6 +1189,26 @@ Page({ }) }, + /** + * 选中健康问题1 + * @param {*} e + */ + onChangeFileRadio1(e) { + this.setData({ + illnessStatus: e.detail.id + }) + }, + + /** + * 选中健康问题2 + * @param {*} e + */ + onChangeFileRadio2(e) { + this.setData({ + supIllnessStatus: e.detail.id + }) + }, + /** * 返回上一步 */ diff --git a/yanzhu-ui-app/miniprogram/pages/project_qr/index.json b/yanzhu-ui-app/miniprogram/pages/project_qr/index.json index bf55d1e9..e9fa9f25 100644 --- a/yanzhu-ui-app/miniprogram/pages/project_qr/index.json +++ b/yanzhu-ui-app/miniprogram/pages/project_qr/index.json @@ -7,5 +7,5 @@ "van-steps": "@vant/weapp/steps/index", "van-notice-bar": "@vant/weapp/notice-bar/index" }, - "navigationStyle":"custom" + "navigationStyle": "custom" } \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/pages/project_qr/index.wxml b/yanzhu-ui-app/miniprogram/pages/project_qr/index.wxml index dd1fe25c..37a8cd41 100644 --- a/yanzhu-ui-app/miniprogram/pages/project_qr/index.wxml +++ b/yanzhu-ui-app/miniprogram/pages/project_qr/index.wxml @@ -30,7 +30,7 @@ 单位类型 - + @@ -591,8 +591,10 @@ + - + + @@ -664,14 +666,16 @@ - + + + @@ -706,7 +710,7 @@ {{pancan.opt}} : {{pancan.result}} - 正确答案:{{item.answer}} 用户答案:{{item.userAnswer}}回答正确回答错误 + 正确答案:{{item.answer}} 您的答案:{{item.userAnswer}}正确错误 @@ -817,8 +821,27 @@ 人 员 签 字 :{{fileForm.fName}} 签 字 日 期 :{{fileForm.fDate}} - - + + + 1、高血压、心脏病等基础身体健康问题。 + + + + + + 2、严重呼吸系统疾病、严重心脑血管疾病、肝肾疾病、恶性肿瘤以及药物无法有效控制的高血压和糖尿病等基础性病症状征兆。 + + + + + + 3、受教育本人签名 + [点击签名进行修改] + + + + + diff --git a/yanzhu-ui-app/miniprogram/pages/project_qr/index.wxss b/yanzhu-ui-app/miniprogram/pages/project_qr/index.wxss index 305d3ba3..bdaa538f 100644 --- a/yanzhu-ui-app/miniprogram/pages/project_qr/index.wxss +++ b/yanzhu-ui-app/miniprogram/pages/project_qr/index.wxss @@ -157,7 +157,7 @@ overflow: hidden; } -.option{ +.option { padding-top: 8px; padding-bottom: 8px; display: flex; @@ -166,21 +166,23 @@ justify-content: flex-start; align-items: flex-start; } -.icon image{ + +.icon image { width: 22px; height: 22px; background-color: #eeeeee; } -.content{ +.content { padding-left: 5px; } -.bs{ + +.bs { font-weight: 800; color: #1890ff; } -.ac{ +.ac { font-weight: 400; color: #1890ff; } @@ -188,7 +190,6 @@ /* 考试面板 */ .kaoshimianban { width: 100%; - height: 220rpx; border: 1px solid #1e2336; background-color: #1e2336; padding-top: 20rpx; @@ -200,7 +201,6 @@ /* 考试面板 */ .kaoshimianban_1 { width: 100%; - height: 280rpx; border: 1px solid #1e2336; background-color: #1e2336; padding-top: 20rpx; @@ -209,7 +209,7 @@ border-radius: 15rpx; } -.doc{ +.doc { border: 1px solid #1e2336; background-color: #1e2336; font-size: 28rpx; @@ -219,44 +219,44 @@ margin-bottom: 15rpx; } -.doc .title{ +.doc .title { text-align: center; font-size: 20px; font-weight: 600; } -.doc .header{ +.doc .header { text-align: center; font-size: 15px; font-weight: 800; padding: 15rpx 0rpx; } -.doc .image{ +.doc .image { text-align: center; padding: 15rpx 0rpx; } -.doc .content{ +.doc .content { text-indent: 2ch; font-size: 15px; padding: 15rpx; line-height: 25px; } -.doc .content .underlines{ +.doc .content .underlines { padding-left: 10rpx; padding-right: 10rpx; text-decoration: underline; } -.doc .foot{ +.doc .foot { margin-left: 35%; font-size: 15px; padding: 15rpx; } -.time-unit{ +.time-unit { text-align: center; } @@ -267,14 +267,15 @@ color: #1890ff; } -.ksmv{ +.ksmv { padding: 10rpx 80rpx; } -.crd{ +.crd { text-align: right; } -.rdc{ + +.rdc { margin-left: 20rpx; } @@ -321,5 +322,4 @@ .problem_submit_to_save_s:active { background: #372a70; -} - +} \ No newline at end of file diff --git a/yanzhu-ui-vue3/src/App.vue b/yanzhu-ui-vue3/src/App.vue index ea3ca9b1..21feb340 100644 --- a/yanzhu-ui-vue3/src/App.vue +++ b/yanzhu-ui-vue3/src/App.vue @@ -13,16 +13,9 @@ onMounted(() => { }) \ No newline at end of file diff --git a/yanzhu-ui-vue3/src/api/manage/basSignet.js b/yanzhu-ui-vue3/src/api/manage/basSignet.js new file mode 100644 index 00000000..0cbfc8d9 --- /dev/null +++ b/yanzhu-ui-vue3/src/api/manage/basSignet.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询业务签名管理列表 +export function listBasSignet(query) { + return request({ + url: '/manage/basSignet/list', + method: 'get', + params: query + }) +} + +// 查询业务签名管理详细 +export function getBasSignet(id) { + return request({ + url: '/manage/basSignet/' + id, + method: 'get' + }) +} + +// 新增业务签名管理 +export function addBasSignet(data) { + return request({ + url: '/manage/basSignet', + method: 'post', + data: data + }) +} + +// 修改业务签名管理 +export function updateBasSignet(data) { + return request({ + url: '/manage/basSignet', + method: 'put', + data: data + }) +} + +// 删除业务签名管理 +export function delBasSignet(id) { + return request({ + url: '/manage/basSignet/' + id, + method: 'delete' + }) +} diff --git a/yanzhu-ui-vue3/src/api/manage/basTemplate.js b/yanzhu-ui-vue3/src/api/manage/basTemplate.js new file mode 100644 index 00000000..afcd4fb3 --- /dev/null +++ b/yanzhu-ui-vue3/src/api/manage/basTemplate.js @@ -0,0 +1,52 @@ +import request from '@/utils/request' + +// 查询业务模板管理列表 +export function listBasTemplate(query) { + return request({ + url: '/manage/basTemplate/list', + method: 'get', + params: query + }) +} + +// 查询业务模板管理详细 +export function getBasTemplate(id) { + return request({ + url: '/manage/basTemplate/' + id, + method: 'get' + }) +} + +// 新增业务模板管理 +export function addBasTemplate(data) { + return request({ + url: '/manage/basTemplate', + method: 'post', + data: data + }) +} + +// 修改业务模板管理 +export function updateBasTemplate(data) { + return request({ + url: '/manage/basTemplate', + method: 'put', + data: data + }) +} + +// 删除业务模板管理 +export function delBasTemplate(id) { + return request({ + url: '/manage/basTemplate/' + id, + method: 'delete' + }) +} + +// 预览业务模板管理 +export function previewBasTemplate(id) { + return request({ + url: '/manage/basTemplate/preview/' + id, + method: 'get' + }) +} diff --git a/yanzhu-ui-vue3/src/components/ImagePreview/index.vue b/yanzhu-ui-vue3/src/components/ImagePreview/index.vue index e2900df6..8ac2d0d5 100644 --- a/yanzhu-ui-vue3/src/components/ImagePreview/index.vue +++ b/yanzhu-ui-vue3/src/components/ImagePreview/index.vue @@ -4,7 +4,7 @@ fit="cover" :style="`width:${realWidth};height:${realHeight};`" :preview-src-list="realSrcList" - append-to-body="true" + preview-teleported >