提交代码

dev_xd
姜玉琦 2024-12-18 22:34:51 +08:00
parent d563d23b07
commit 4a80de3acc
56 changed files with 2438 additions and 165 deletions

View File

@ -231,6 +231,12 @@
</dependency>
<!--根据word模板生成word文件 开始-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>

View File

@ -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<Long> addSubdeptsEntity(@RequestBody Map<String, Object> data, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
@PostMapping("/definition/startByParams/{procDefId}")
public R<AjaxResult> startDefinitionByParams(@PathVariable("procDefId") String procDefId, @RequestBody Map<String, Object> variables, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
*
*
* @param data
* @param source
* @return
*/
@PostMapping("/proProjectInfoSubdeptsGroup/add")
public R<Long> addSubdeptsGroupEntity(@RequestBody Map<String, Object> data, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
*
*
* @param data
* @param source
* @return
*/
@PostMapping("/proProjectInfoSubdeptsUsers/add")
public R<Long> addSubdeptsUsersEntity(@RequestBody Map<String, Object> data, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}

View File

@ -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<RemoteFlowServ
return new RemoteFlowService()
{
@Override
public R<Long> addSubdeptsEntity(Map<String, Object> data, String source)
public R<AjaxResult> startDefinitionByParams(String procDefId, Map<String, Object> variables, String source)
{
return R.fail("保存分包单位信息失败:" + throwable.getMessage());
}
@Override
public R<Long> addSubdeptsGroupEntity(Map<String, Object> data, String source)
{
return R.fail("保存分包单位班组信息失败:" + throwable.getMessage());
}
@Override
public R<Long> addSubdeptsUsersEntity(Map<String, Object> data, String source)
{
return R.fail("保存分包单位班组用户信息失败:" + throwable.getMessage());
}
};
}
}

View File

@ -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
*/

View File

@ -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);
}
}
}

View File

@ -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)

View File

@ -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)

View File

@ -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())

View File

@ -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<ProProjectInfoSubdeptsUsers> groupByCraftTypeByAttendance(ProProjectInfoSubdeptsUsers where);
/**
*
*
* @param proId
* @param defType
* @return
*/
public List<Map<String, Object>> findActReProcdefDept(@Param("proId")Long proId, @Param("defType")String defType);
}

View File

@ -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<SysDictData> dictList = arrayCache.toList(SysDictData.class);
for(SysDictData dictData:dictList){
if(Objects.equals(value,dictData.getDictValue())){
return dictData.getDictLabel();
}
}
}
return null;
}
/**
*
*

View File

@ -7,8 +7,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="BasSignet" id="BasSignetResult">
<result property="id" column="id" />
<result property="comId" column="com_id" />
<result property="comName" column="com_name" />
<result property="projectId" column="project_id" />
<result property="projectName" column="project_name" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<result property="signetPath" column="signet_path" />
<result property="signetNumber" column="signet_number" />
<result property="isDel" column="is_del" />
@ -20,22 +23,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectBasSignetVo">
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
</sql>
<select id="selectBasSignetList" parameterType="BasSignet" resultMap="BasSignetResult">
<include refid="selectBasSignetVo"/>
<where>
<if test="comId != null "> and com_id = #{comId}</if>
<if test="projectId != null "> and project_id = #{projectId}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="isDel != null "> and is_del = #{isDel}</if>
<if test="comId != null "> and bs.com_id = #{comId}</if>
<if test="projectId != null "> and bs.project_id = #{projectId}</if>
<if test="activeComId != null "> and bs.com_id = #{activeComId}</if>
<if test="activeProjectId != null "> and bs.project_id = #{activeProjectId}</if>
<if test="projectName != null and projectName != ''"> and pi.project_name like concat('%', #{projectName}, '%')</if>
<if test="userName != null and userName != ''"> and su.nick_name like concat('%', #{userName}, '%')</if>
<if test="userId != null "> and bs.user_id = #{userId}</if>
<if test="isDel != null "> and bs.is_del = #{isDel}</if>
</where>
order by bs.id desc
</select>
<select id="selectBasSignetById" parameterType="Long" resultMap="BasSignetResult">
<include refid="selectBasSignetVo"/>
where id = #{id}
where bs.id = #{id}
</select>
<insert id="insertBasSignet" parameterType="BasSignet" useGeneratedKeys="true" keyProperty="id">

View File

@ -7,7 +7,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="BasTemplate" id="BasTemplateResult">
<result property="id" column="id" />
<result property="comId" column="com_id" />
<result property="comName" column="com_name" />
<result property="projectId" column="project_id" />
<result property="projectName" column="project_name" />
<result property="temName" column="tem_name" />
<result property="temType" column="tem_type" />
<result property="temPath" column="tem_path" />
@ -20,23 +22,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectBasTemplateVo">
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
</sql>
<select id="selectBasTemplateList" parameterType="BasTemplate" resultMap="BasTemplateResult">
<include refid="selectBasTemplateVo"/>
<where>
<if test="comId != null "> and com_id = #{comId}</if>
<if test="projectId != null "> and project_id = #{projectId}</if>
<if test="temName != null and temName != ''"> and tem_name like concat('%', #{temName}, '%')</if>
<if test="temType != null and temType != ''"> and tem_type = #{temType}</if>
<if test="isDel != null "> and is_del = #{isDel}</if>
<if test="comId != null "> and bt.com_id = #{comId}</if>
<if test="projectId != null "> and bt.project_id = #{projectId}</if>
<if test="temName != null and temName != ''"> and bt.tem_name like concat('%', #{temName}, '%')</if>
<if test="temType != null and temType != ''"> and bt.tem_type = #{temType}</if>
<if test="isDel != null "> and bt.is_del = #{isDel}</if>
</where>
order by bt.id desc
</select>
<select id="selectBasTemplateById" parameterType="Long" resultMap="BasTemplateResult">
<include refid="selectBasTemplateVo"/>
where id = #{id}
where bt.id = #{id}
</select>
<insert id="insertBasTemplate" parameterType="BasTemplate" useGeneratedKeys="true" keyProperty="id">

View File

@ -290,4 +290,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="findActReProcdefDept" resultType="Map">
select * from act_re_procdef_dept where PROJ_ID_ = #{proId} and TYPE_ = #{defType} order by SORT_
</select>
</mapper>

View File

@ -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);
}
}
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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);
}
}

View File

@ -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;
}
}

View File

@ -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<String, Object> variables) {
return flowDefinitionService.startProcessInstanceByParams(procDefId, variables);
}
@ApiOperation(value = "激活或挂起流程定义")
@Log(title = "激活/挂起流程", businessType = BusinessType.UPDATE)
@PutMapping(value = "/updateState")

View File

@ -16,7 +16,6 @@ public interface IFlowDefinitionService {
boolean exist(String processDefinitionKey);
/**
*
*
@ -51,7 +50,13 @@ public interface IFlowDefinitionService {
AjaxResult startProcessInstanceById(String procDefId, Map<String, Object> variables);
/**
* ID
* @param procDefId
* @param variables
* @return
*/
AjaxResult startProcessInstanceByParams(String procDefId, Map<String, Object> 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

View File

@ -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<String, Object> 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("流程启动错误");
}
}
/**
*

View File

@ -92,6 +92,11 @@
</dependency>
<!--根据word模板生成word文件 开始-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
</dependency>
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>

View File

@ -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<BasSignet> 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<BasSignet> list = basSignetService.selectBasSignetList(basSignet);
ExcelUtil<BasSignet> util = new ExcelUtil<BasSignet>(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));
}
}

View File

@ -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<BasTemplate> 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<BasTemplate> list = basTemplateService.selectBasTemplateList(basTemplate);
ExcelUtil<BasTemplate> util = new ExcelUtil<BasTemplate>(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<String, Object> allCanShuMap = JSON.parseObject(content);
Map<String, Object> canShuMap = (Map<String, Object>) 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;
}
}

View File

@ -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;

View File

@ -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";
}
}

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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<BasSignet> 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);
}

View File

@ -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<BasTemplate> 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);
}

View File

@ -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<BasSignet> 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);
}
}

View File

@ -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<BasTemplate> 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);
}
}

View File

@ -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<BusExamQuestion> questions = extractExamQuestion(findExamInfo,Objects.equals(CraftType.GLRY.getCode(),examQuery.getCraftType())?null:userEntity.getCraftPost());
List<BusExamQuestion> questions = extractExamQuestion(findExamInfo,Objects.equals(CraftTypeEnums.GLRY.getCode(),examQuery.getCraftType())?null:userEntity.getCraftPost());
// 试题重新排序
Collections.shuffle(questions);

View File

@ -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());

View File

@ -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<Map<String, Object>> 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<BasTemplate> 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<String, Object> 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<String, Object> variables = new HashMap<>();
variables.put("INITIATOR",proSubdeptsUser.getUserId());
variables.put("userName",proSubdeptsUser.getUser().getNickName());
variables.put("businessKey",proSubdeptsUser.getId());
R<AjaxResult> 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<String, Object> getUserDataMap(ProProjectInfoSubdeptsUsers proSubdeptsUser){
Map<String, Object> 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;
}
/**

View File

@ -45,7 +45,6 @@ import java.util.List;
*/
public class MyTableRenderPolicy extends AbstractRenderPolicy<Object> {
@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<Object> {
}
}
}
/**
* @description:
* @author: wangjunsheng
@ -288,7 +288,6 @@ public class MyTableRenderPolicy extends AbstractRenderPolicy<Object> {
XWPFRun targetrun = newParagraph.createRun();
CopyRun(targetrun, s);
}
}
/**

View File

@ -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();
}

View File

@ -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":""
}
}

View File

@ -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",

View File

@ -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 {

View File

@ -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', {}); // 可以向外触发一个自定义事件,方便父组件监听
}
}
})

View File

@ -0,0 +1,4 @@
{
"component": true
}

View File

@ -0,0 +1,8 @@
<!-- components/my-result/my-result.wxml -->
<view class="my-result">
<image class="icon" src="{{iconPath}}" mode="aspectFit"></image>
<text class="title">{{title}}</text>
<text class="desc">{{description}}</text>
<button wx:if="{{actionText}}" class="action-btn" bindtap="handleAction"> {{actionText}} </button>
<button wx:if="{{descActionText}}" class="desc-action-btn" bindtap="handleDescAction"> {{descActionText}} </button>
</view>

View File

@ -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;
}

View File

@ -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
})
},
/**
* 返回上一步
*/

View File

@ -7,5 +7,5 @@
"van-steps": "@vant/weapp/steps/index",
"van-notice-bar": "@vant/weapp/notice-bar/index"
},
"navigationStyle":"custom"
"navigationStyle": "custom"
}

View File

@ -30,7 +30,7 @@
<view class="inspect_info_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">单位类型</view>
<view class="inspect_info_content">
<voucher-select columns="{{deptTypeList}}" placeholder="请单位企业类型" bindchange="onSubDeptType" selectValue="{{form.subDeptType}}"></voucher-select>
<voucher-select columns="{{deptTypeList}}" placeholder="请选择单位企业类型" bindchange="onSubDeptType" selectValue="{{form.subDeptType}}"></voucher-select>
</view>
</view>
<view class="inspect_info_list">
@ -591,8 +591,10 @@
<view class="max_content">
<project-select init="{{initProject}}"></project-select>
<van-steps steps="{{ flowNodes }}" active="{{ active }}" />
<view class="kaoshimianban_1">
<view class="time-unit">
<jyq-result iconPath="https://guangzhou.sxyanzhu.com/YZLJXM/profile/icon/dd.png" title="考试剩余时间{{timeStr}}" description="试卷满分{{busExamInfos.fullMark}},及格分数{{busExamInfos.passMark}},请加油努力。" />
<!-- <view class="time-unit">
<text class="time-unit-number">离考试结束:{{ timeStr }}</text>
</view>
<view class="ksmv">
@ -608,7 +610,7 @@
</van-col>
</van-row>
</view>
</view>
</view> -->
</view>
<view class="inspect_for_scroll" wx:for="{{busExamQuestions}}" wx:key="index">
<view class="inspect_for_bgd">
@ -664,14 +666,16 @@
<project-select init="{{initProject}}"></project-select>
<van-steps steps="{{ flowNodes }}" active="{{ active }}" />
<view class="kaoshimianban">
<view class="time-unit">
<jyq-result wx:if="{{busExamInfos.passMark<=busExamInfos.userMark}}" iconPath="https://guangzhou.sxyanzhu.com/YZLJXM/profile/icon/cg.png" title="恭喜!考试通过" description="本次考试已顺利完成,您可以去签署安全承诺文件了。" actionText="立 即 签 署" bind:action="startSignFile" />
<jyq-result wx:if="{{busExamInfos.passMark>busExamInfos.userMark}}" iconPath="https://guangzhou.sxyanzhu.com/YZLJXM/profile/icon/sb.png" title="很遗憾!考试未通过" description="本次考试未通过,重新考试通过后您才可以签署安全承诺文件,请返回学习或继续考试。" actionText="继 续 考 试" bind:action="anewBusEduQuestion" descActionText="返 回 学 习" bind:descAction="onClickPreviousNode" />
<!-- <view class="time-unit">
<text class="timeline_for_state_2 timeline_for_state_6" wx:if="{{busExamInfos.passMark>busExamInfos.userMark}}">很 遗 憾 考 试 不 通 过</text><text class="timeline_for_state_1 timeline_for_state_6" wx:if="{{busExamInfos.passMark<=busExamInfos.userMark}}">恭 喜 考 试 通 过</text>
</view>
<view class="problem_submit_to" wx:if="{{isPapers}}">
<view wx:if="{{busExamInfos.passMark>busExamInfos.userMark}}" class="problem_submit_to_btn2 problem_submit_to_back" bindtap="onClickPreviousNode">返 回 学 习</view>
<view class="problem_submit_to_btn2 problem_submit_to_save" wx:if="{{busExamInfos.passMark>busExamInfos.userMark}}" bindtap="anewBusEduQuestion">重 新 考 试</view>
<view class="problem_submit_to_btn2 problem_submit_to_save" wx:if="{{busExamInfos.passMark<=busExamInfos.userMark}}" bindtap="startBusEduExamNode">立 即 签 署 安 全 承 诺 书</view>
</view>
</view> -->
</view>
<view class="inspect_for_scroll" wx:for="{{busExamQuestions}}" wx:key="index">
<view class="inspect_for_bgd">
@ -706,7 +710,7 @@
<view class="content {{pancan.selected?'ac':''}}">{{pancan.opt}} : {{pancan.result}}</view>
</view>
</view>
<view class="inspect_list_info_position crd" wx:if="{{isPapers}}">正确答案:<text class="color_purple">{{item.answer}}</text> 用户答案:<text class="color_purple">{{item.userAnswer}}</text><text class="timeline_for_state_1 rdc" wx:if="{{item.answer==item.userAnswer}}">回答正确</text><text class="timeline_for_state_2 rdc" wx:if="{{item.answer!=item.userAnswer}}">回答错误</text></view>
<view class="inspect_list_info_position crd" wx:if="{{isPapers}}">正确答案:<text class="color_purple">{{item.answer}}</text> 您的答案:<text class="color_purple">{{item.userAnswer}}</text><text class="timeline_for_state_1 rdc" wx:if="{{item.answer==item.userAnswer}}">正确</text><text class="timeline_for_state_2 rdc" wx:if="{{item.answer!=item.userAnswer}}">错误</text></view>
</view>
</view>
</view>
@ -817,8 +821,27 @@
<view class="foot">人 员 签 字 {{fileForm.fName}}</view>
<view class="foot">签 字 日 期 {{fileForm.fDate}}</view>
</view>
<view class="doc">
<sign bind:returnData="sign" canvasId="canvas" class="myCanvas"></sign>
<view class="inspect_info">
<view class="inspect_info_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">1、高血压、心脏病等基础身体健康问题。</view>
<view class="inspect_info_content">
<voucher-select columns="{{youWuList}}" placeholder="请选择" bindchange="onChangeFileRadio1" selectValue="{{illnessStatus}}"></voucher-select>
</view>
</view>
<view class="inspect_info_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">2、严重呼吸系统疾病、严重心脑血管疾病、肝肾疾病、恶性肿瘤以及药物无法有效控制的高血压和糖尿病等基础性病症状征兆。</view>
<view class="inspect_info_content">
<voucher-select columns="{{youWuList}}" placeholder="请选择" bindchange="onChangeFileRadio2" selectValue="{{supIllnessStatus}}"></voucher-select>
</view>
</view>
<view class="inspect_info_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">3、受教育本人签名
<text style="font-size: small; color: antiquewhite;">[点击签名进行修改]</text>
</view>
<view class="inspect_info_content">
<sign bind:returnData="sign" canvasId="canvas" class="myCanvas"></sign>
</view>
</view>
</view>
</view>
<view class="class_btnall">

View File

@ -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;
}
}

View File

@ -13,16 +13,9 @@ onMounted(() => {
})
</script>
<style lang="scss">
.no-form-label {
.el-form-item {
.el-form-item__label {
display: none !important;
}
}
}
.fitem-no-width{
.el-form-item__label{
width:unset !important;
.el-form-item__content {
.el-select--default {
width: 192px;
}
}
</style>

View File

@ -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'
})
}

View File

@ -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'
})
}

View File

@ -4,7 +4,7 @@
fit="cover"
:style="`width:${realWidth};height:${realHeight};`"
:preview-src-list="realSrcList"
append-to-body="true"
preview-teleported
>
<template #error>
<div class="image-slot">

View File

@ -8,6 +8,23 @@ import { blobValidate } from '@/utils/ruoyi'
const baseURL = import.meta.env.VITE_APP_BASE_API
export default {
resource(resource) {
var url = baseURL + "/file/download?fileName=" + encodeURIComponent(resource);
axios({
method: 'get',
url: url,
responseType: 'blob',
headers: { 'Authorization': 'Bearer ' + getToken() }
}).then((res) => {
const isBlob = blobValidate(res.data);
if (isBlob) {
const blob = new Blob([res.data])
this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
} else {
this.printErrMsg(res.data);
}
})
},
zip(url, name) {
var url = baseURL + url
axios({

View File

@ -0,0 +1,322 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="项目名称" prop="projectName" v-if="!userStore.currentProId">
<el-input
v-model="queryParams.projectName"
placeholder="请输入项目名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="用户名称" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入用户名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8" v-if="false">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
@click="handleAdd"
v-hasPermi="['manage:basSignet:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['manage:basSignet:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['manage:basSignet:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="Download"
@click="handleExport"
v-hasPermi="['manage:basSignet:export']"
>导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="basSignetList">
<el-table-column label="所属公司" align="center" prop="comName" />
<el-table-column label="项目名称" align="center" prop="projectName" />
<el-table-column label="用户名称" align="center" prop="userName" />
<el-table-column label="签名照片" align="center" prop="signetPath" width="220">
<template #default="scope">
<ImagePreview :src="scope.row.signetPath" :width="200" :height="100"/>
</template>
</el-table-column>
<el-table-column label="使用次数" align="center" prop="signetNumber" />
<el-table-column label="创建时间" align="center" prop="createTime" width="160">
<template #default="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column label="最后使用时间" align="center" prop="updateTime" width="160">
<template #default="scope">
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column label="启用状态" align="center" prop="isDel">
<template #default="scope">
<!-- <el-tooltip :content="scope.row.isDel == 0 ? '启用' : '停用'" placement="top">
<el-switch
:active-value="parseInt(0)"
:inactive-value="parseInt(1)"
v-model="scope.row.isDel"
@change="setStatus($event, scope.row)"
/>
</el-tooltip> -->
<dict-tag :options="sys_is_del" :value="scope.row.isDel"/>
</template>
</el-table-column>
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:basSignet:edit']"></el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:basSignet:remove']"></el-button>
</template>
</el-table-column> -->
</el-table>
<pagination
v-show="total>0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改业务签名管理对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="basSignetRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="公司主键" prop="comId">
<el-input v-model="form.comId" placeholder="请输入公司主键" />
</el-form-item>
<el-form-item label="项目主键" prop="projectId">
<el-input v-model="form.projectId" placeholder="请输入项目主键" />
</el-form-item>
<el-form-item label="用户主键" prop="userId">
<el-input v-model="form.userId" placeholder="请输入用户主键" />
</el-form-item>
<el-form-item label="签名地址" prop="signetPath">
<el-input v-model="form.signetPath" placeholder="请输入签名地址" />
</el-form-item>
<el-form-item label="签名使用次数" prop="signetNumber">
<el-input v-model="form.signetNumber" placeholder="请输入签名使用次数" />
</el-form-item>
<el-form-item label="删除标识" prop="isDel">
<el-input v-model="form.isDel" placeholder="请输入删除标识" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="BasSignet">
import { listBasSignet, getBasSignet, delBasSignet, addBasSignet, updateBasSignet } from "@/api/manage/basSignet";
import useUserStore from '@/store/modules/user'
const { proxy } = getCurrentInstance();
const { sys_is_del} = proxy.useDict('sys_is_del');
const userStore = useUserStore()
const basSignetList = ref([]);
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const data = reactive({
form: {},
queryParams: {
pageNum: 1,
pageSize: 10,
comId: null,
projectId: null,
projectName: null,
userId: null,
userName: null,
isDel: null,
},
rules: {
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询业务签名管理列表 */
function getList() {
loading.value = true;
listBasSignet(queryParams.value).then(response => {
basSignetList.value = response.rows;
total.value = response.total;
loading.value = false;
});
}
//
function cancel() {
open.value = false;
reset();
}
//
function reset() {
form.value = {
id: null,
comId: null,
projectId: null,
userId: null,
signetPath: null,
signetNumber: null,
isDel: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
};
proxy.resetForm("basSignetRef");
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
//
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
function handleAdd() {
reset();
open.value = true;
title.value = "添加业务签名管理";
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
const _id = row.id || ids.value
getBasSignet(_id).then(response => {
form.value = response.data;
open.value = true;
title.value = "修改业务签名管理";
});
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["basSignetRef"].validate(valid => {
if (valid) {
if (form.value.id != null) {
updateBasSignet(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
} else {
addBasSignet(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
});
}
}
});
}
/** 启用状态滑块控制 */
function setStatus(val, row) {
proxy.$modal
.confirm(`是否确认${val == 0 ? "启用" : "停用"}当前数据项?`)
.then(function () {
let param = {'id': row.id, 'isDel': val};
return updateBasSignet(param);
})
.then(() => {
getList();
proxy.$modal.msgSuccess("修改成功");
})
.catch(() => {
//
if (val == 0) {
row.isDel = 1;
} else {
row.isDel = 0;
}
});
}
/** 删除按钮操作 */
function handleDelete(row) {
const _ids = row.id || ids.value;
proxy.$modal.confirm('是否确认删除业务签名管理编号为"' + _ids + '"的数据项?').then(function() {
return delBasSignet(_ids);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
/** 导出按钮操作 */
function handleExport() {
proxy.download('manage/basSignet/export', {
...queryParams.value
}, `basSignet_${new Date().getTime()}.xlsx`)
}
getList();
</script>

View File

@ -0,0 +1,364 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="项目名称" prop="projectName" v-if="!userStore.currentProId">
<el-input
v-model="queryParams.projectName"
placeholder="请输入项目名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="模板名称" prop="temName">
<el-input
v-model="queryParams.temName"
placeholder="请输入模板名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="模板类型" prop="temType">
<el-select v-model="queryParams.temType" placeholder="请选择模板类型" clearable>
<el-option
v-for="dict in bas_tem_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-alert
title="温馨提示"
type="success"
description="上传多个相同类型的模板,在生成承诺书文件时,会读取最新且有效的文件,请至少保证一个生效中的模板文件"
show-icon
style="margin-bottom: 20px;"
/>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
@click="handleAdd"
v-hasPermi="['manage:basTemplate:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['manage:basTemplate:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['manage:basTemplate:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="Download"
@click="handleExport"
v-hasPermi="['manage:basTemplate:export']"
>导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="basTemplateList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="所属公司" align="center" prop="comName" />
<el-table-column label="项目名称" align="center" prop="projectName" />
<el-table-column label="模板名称" align="center" prop="temName" />
<el-table-column label="模板类型" align="center" prop="temType" width="120">
<template #default="scope">
<dict-tag :options="sys_is_del" :value="scope.row.isDel"/>
</template>
</el-table-column>
<el-table-column label="启用状态" align="center" prop="isDel" width="100">
<template #default="scope">
<el-tooltip :content="scope.row.isDel == 0 ? '启用' : '停用'" placement="top">
<el-switch
:active-value="parseInt(0)"
:inactive-value="parseInt(1)"
v-model="scope.row.isDel"
@change="setStatus($event, scope.row)"
/>
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column label="修改时间" align="center" prop="updateTime" width="160">
<template #default="scope">
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column label="预览模板" align="center" prop="temPath" width="120">
<template #default="scope">
<el-button link type="primary" icon="Position" @click="handlePreview(scope.row)" v-hasPermi="['manage:basTemplate:query']"></el-button>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="120" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:basTemplate:edit']"></el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改业务模板管理对话框 -->
<el-dialog :title="title" v-model="open" width="880px" append-to-body>
<el-form ref="basTemplateRef" :model="form" :rules="rules" label-width="88px">
<el-alert
title="温馨提示"
type="warning"
description="业务模板是劳务人员签署进场文件时的模板,文件中有 [关键字] 埋点,修改时请联系运维人员。"
show-icon
style="margin-bottom: 20px;"
/>
<el-form-item label="项目名称" v-if="form.projectId">
<el-tag effect="plain">{{ form.projectName }}</el-tag>
</el-form-item>
<el-form-item label="模板名称" prop="temName">
<el-input v-model="form.temName" placeholder="请输入模板名称" />
</el-form-item>
<el-form-item label="模板类型" prop="temType">
<el-select v-model="form.temType" placeholder="请选择模板类型" style="width:100%">
<el-option
v-for="dict in bas_tem_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="模板文件" prop="temPath">
<file-upload v-model="form.temPath" :limit="1" :fileType="['doc']" :fileSize="50" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="BasTemplate">
import { listBasTemplate, getBasTemplate, delBasTemplate, addBasTemplate, updateBasTemplate, previewBasTemplate } from "@/api/manage/basTemplate";
import useUserStore from '@/store/modules/user'
const { proxy } = getCurrentInstance();
const { sys_is_del, bas_tem_type} = proxy.useDict('sys_is_del', 'bas_tem_type');
const userStore = useUserStore()
const basTemplateList = ref([]);
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const data = reactive({
form: {},
queryParams: {
pageNum: 1,
pageSize: 10,
comId: null,
projectId: null,
projectName: null,
temName: null,
temType: null,
isDel: null,
},
rules: {
temName: [{ required: true, message: "模板名称不能为空", trigger: "blur" }],
temType: [{ required: true, message: "模板类型不能为空", trigger: "blur" }],
temPath: [{ required: true, message: "模板文件不能为空", trigger: "change" }],
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询业务模板管理列表 */
function getList() {
loading.value = true;
listBasTemplate(queryParams.value).then(response => {
basTemplateList.value = response.rows;
total.value = response.total;
loading.value = false;
});
}
//
function cancel() {
open.value = false;
reset();
}
//
function reset() {
form.value = {
id: null,
comId: null,
projectId: null,
temName: null,
temType: null,
temPath: null,
isDel: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
};
proxy.resetForm("basTemplateRef");
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
//
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
function handleAdd() {
if(!userStore.currentProId){
proxy.$modal.msgWarning("请切换到项目数据!!!");
return false;
}
reset();
form.value.comId = userStore.currentComId;
form.value.comName = userStore.currentComName;
form.value.projectId = userStore.currentProId;
form.value.projectName = userStore.currentProName;
open.value = true;
title.value = "添加业务模板";
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
const _id = row.id || ids.value
getBasTemplate(_id).then(response => {
form.value = response.data;
open.value = true;
title.value = "修改业务模板";
});
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["basTemplateRef"].validate(valid => {
if (valid) {
if (form.value.id != null) {
updateBasTemplate(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
} else {
addBasTemplate(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
});
}
}
});
}
/** 启用状态滑块控制 */
function setStatus(val, row) {
proxy.$modal
.confirm(`是否确认${val == 0 ? "启用" : "停用"}当前数据项?`)
.then(function () {
let param = {'id': row.id, 'isDel': val};
return updateBasTemplate(param);
})
.then(() => {
getList();
proxy.$modal.msgSuccess("修改成功");
})
.catch(() => {
//
if (val == 0) {
row.isDel = 1;
} else {
row.isDel = 0;
}
});
}
/** 删除按钮操作 */
function handleDelete(row) {
const _ids = row.id || ids.value;
proxy.$modal.confirm('是否确认删除业务模板管理编号为"' + _ids + '"的数据项?').then(function() {
return delBasTemplate(_ids);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
/** 导出按钮操作 */
function handleExport() {
proxy.download('manage/basTemplate/export', {
...queryParams.value
}, `basTemplate_${new Date().getTime()}.xlsx`)
}
/** 模板预览 */
function handlePreview(row){
previewBasTemplate(row.id).then(res=>{
if(res.code==200){
proxy.$download.resource(res.msg);
}
});
}
getList();
</script>