[新增] 上传报告流程开发
This commit is contained in:
@@ -44,5 +44,7 @@ public interface TtReportManageActDao extends BaseMapper<TtReportManageAct> {
|
||||
*/
|
||||
List<TtReportManageAct> queryList(@Param("pageVO") TtReportManageActPageVO ttReportManageActPageVO);
|
||||
|
||||
TtReportManageActPageVO selectByDataId(String dataId);
|
||||
TtReportManageAct selectByDataId(String dataId);
|
||||
|
||||
TtReportManageAct selectByPrcId(String prcId);
|
||||
}
|
||||
|
||||
@@ -95,6 +95,12 @@ public class ReportEntity {
|
||||
@TableField("del_flag")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 保密到期时间
|
||||
*/
|
||||
@TableField("secrecy_last")
|
||||
private Date secrecyLast;
|
||||
|
||||
/**
|
||||
* 用户id列表
|
||||
*/
|
||||
|
||||
@@ -113,11 +113,15 @@ public class TtReportManageAct {
|
||||
@TableField("del_flag")
|
||||
private Integer delFlag;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 权限设置
|
||||
* 保密到期时间
|
||||
*/
|
||||
@TableField("secrecy_last")
|
||||
private Date secrecyLast;
|
||||
|
||||
@TableField("file_name")
|
||||
private String fileName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<PowerApplyAct> powerList;
|
||||
private List<String> labelList;
|
||||
}
|
||||
|
||||
-4
@@ -4,7 +4,6 @@ package com.adc.da.report.service.impl;
|
||||
import com.adc.da.report.dao.mysql.PowerApplyDao;
|
||||
import com.adc.da.report.dao.mysql.ReportDao;
|
||||
import com.adc.da.report.dao.mysql.TtReportManageActDao;
|
||||
import com.adc.da.report.eo.PowerApplyAct;
|
||||
import com.adc.da.report.eo.TtReportManageAct;
|
||||
import com.adc.da.report.service.ITtReportManageActService;
|
||||
import com.adc.da.report.vo.DeleteParamRequestVO;
|
||||
@@ -123,8 +122,5 @@ public class ITtReportManageActServiceImpl extends ServiceImpl<TtReportManageAct
|
||||
public void saveReport(TtReportManageAct ttReportManageAct) {
|
||||
//保存报告
|
||||
reportDao.saveReportAct(ttReportManageAct);
|
||||
//保存报告权限数据
|
||||
List<PowerApplyAct> powerList = ttReportManageAct.getPowerList();
|
||||
powerApplyDao.saveBatch(powerList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,21 +4,26 @@
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="BaseColumnList">
|
||||
id,
|
||||
data_id, name, keycontent, maincontent, department, year, fileId, confidentialLevel, privacyLevel, createUserId, createDate, updateDate, del_flag
|
||||
id, name, keycontent, maincontent, department, year, fileId, confidentialLevel, privacyLevel,
|
||||
createUserId, createDate, updateDate, del_flag,secrecy_last
|
||||
</sql>
|
||||
|
||||
<sql id="BaseColumnValue">
|
||||
#{Vo.id},
|
||||
#{Vo.dataId},#{Vo.name},#{Vo.keycontent},#{Vo.maincontent},#{Vo.department},#{Vo.year},#{Vo.fileId},
|
||||
#{Vo.id},#{Vo.name},#{Vo.keycontent},#{Vo.maincontent},#{Vo.department},#{Vo.year},#{Vo.fileId},
|
||||
#{Vo.confidentialLevel},#{Vo.privacyLevel},
|
||||
#{Vo.createUserId},
|
||||
#{Vo.createDate},#{Vo.updateDate},#{Vo.del_flag}
|
||||
#{Vo.createDate},#{Vo.updateDate},#{Vo.del_flag},
|
||||
#{Vo.secrecyLast}
|
||||
</sql>
|
||||
|
||||
<insert id="saveReportAct">
|
||||
insert into TT_REPORT_MANAGE (<include refid="BaseColumnList"/>)
|
||||
value (<include refid="BaseColumnValue"/>)
|
||||
value (
|
||||
#{Vo.dataId},#{Vo.name},#{Vo.keycontent},#{Vo.maincontent},#{Vo.department},#{Vo.year},#{Vo.fileId},
|
||||
#{Vo.confidentialLevel},#{Vo.privacyLevel},
|
||||
#{Vo.createUserId},
|
||||
#{Vo.createDate},#{Vo.updateDate},#{Vo.del_flag},
|
||||
#{Vo.secrecyLast})
|
||||
</insert>
|
||||
|
||||
<select id="getReportDateList" parameterType="string" resultType="string">
|
||||
|
||||
@@ -20,6 +20,12 @@
|
||||
<result column="createDate" property="createDate" />
|
||||
<result column="updateDate" property="updateDate" />
|
||||
<result column="del_flag" property="delFlag" />
|
||||
<result column="secrecy_last" property="secrecyLast" />
|
||||
<result column="file_name" property="fileName" />
|
||||
<collection property="labelList" ofType="com.adc.da.report.eo.LabelEntity">
|
||||
<id column="lableId" property="id"/>
|
||||
<result column="lableName" property="name"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<!--表名信息-->
|
||||
@@ -31,6 +37,7 @@
|
||||
<sql id="BaseColumnList">
|
||||
id,
|
||||
task_id, prc_id, data_id, name, keycontent, maincontent, department, year, fileId, confidentialLevel, privacyLevel, createUserId, createDate, updateDate, del_flag
|
||||
,secrecy_last,file_name
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
@@ -117,12 +124,30 @@
|
||||
<include refid="BaseQuerySql"/>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
<select id="selectByDataId" resultType="com.adc.da.report.vo.TtReportManageActPageVO">
|
||||
<select id="selectByDataId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="BaseColumnList"/>
|
||||
FROM <include refid="TableName"/>
|
||||
a.id,
|
||||
task_id, prc_id, data_id, name, keycontent, maincontent, department, year, fileId, confidentialLevel, privacyLevel, createUserId, createDate, updateDate, del_flag
|
||||
,secrecy_last,file_name
|
||||
,label.label as lableName,label.id as labelId
|
||||
FROM <include refid="TableName"/> a
|
||||
LEFT JOIN ts_report_label rl on rl.report_id = a.data_id
|
||||
LEFT JOIN ts_tree_label label on rl.label_id = label.id
|
||||
<where>
|
||||
data_id = #{dataId}
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectByPrcId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
a.id,
|
||||
task_id, prc_id, data_id, name, keycontent, maincontent, department, year, fileId, confidentialLevel, privacyLevel, createUserId, createDate, updateDate, del_flag
|
||||
,secrecy_last,file_name
|
||||
,label.label as lableName,label.id as labelId
|
||||
FROM <include refid="TableName"/> a
|
||||
LEFT JOIN ts_report_label rl on rl.report_id = a.data_id
|
||||
LEFT JOIN ts_tree_label label on rl.label_id = label.id
|
||||
<where>
|
||||
prc_id = #{prcId}
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
@@ -4,21 +4,26 @@
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="BaseColumnList">
|
||||
id,
|
||||
data_id, name, keycontent, maincontent, department, year, fileId, confidentialLevel, privacyLevel, createUserId, createDate, updateDate, del_flag
|
||||
id, name, keycontent, maincontent, department, year, fileId, confidentialLevel, privacyLevel,
|
||||
createUserId, createDate, updateDate, del_flag,secrecy_last
|
||||
</sql>
|
||||
|
||||
<sql id="BaseColumnValue">
|
||||
#{Vo.id},
|
||||
#{Vo.dataId},#{Vo.name},#{Vo.keycontent},#{Vo.maincontent},#{Vo.department},#{Vo.year},#{Vo.fileId},
|
||||
#{Vo.id},#{Vo.name},#{Vo.keycontent},#{Vo.maincontent},#{Vo.department},#{Vo.year},#{Vo.fileId},
|
||||
#{Vo.confidentialLevel},#{Vo.privacyLevel},
|
||||
#{Vo.createUserId},
|
||||
#{Vo.createDate},#{Vo.updateDate},#{Vo.del_flag}
|
||||
#{Vo.createDate},#{Vo.updateDate},#{Vo.del_flag},
|
||||
#{Vo.secrecyLast}
|
||||
</sql>
|
||||
|
||||
<insert id="saveReportAct">
|
||||
insert into TT_REPORT_MANAGE (<include refid="BaseColumnList"/>)
|
||||
value (<include refid="BaseColumnValue"/>)
|
||||
value (
|
||||
#{Vo.dataId},#{Vo.name},#{Vo.keycontent},#{Vo.maincontent},#{Vo.department},#{Vo.year},#{Vo.fileId},
|
||||
#{Vo.confidentialLevel},#{Vo.privacyLevel},
|
||||
#{Vo.createUserId},
|
||||
#{Vo.createDate},#{Vo.updateDate},#{Vo.del_flag},
|
||||
#{Vo.secrecyLast})
|
||||
</insert>
|
||||
|
||||
<select id="getReportDateList" parameterType="string" resultType="string">
|
||||
|
||||
@@ -20,6 +20,12 @@
|
||||
<result column="createDate" property="createDate" />
|
||||
<result column="updateDate" property="updateDate" />
|
||||
<result column="del_flag" property="delFlag" />
|
||||
<result column="secrecy_last" property="secrecyLast" />
|
||||
<result column="file_name" property="fileName" />
|
||||
<collection property="labelList" ofType="com.adc.da.report.eo.LabelEntity">
|
||||
<id column="lableId" property="id"/>
|
||||
<result column="lableName" property="name"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<!--表名信息-->
|
||||
@@ -31,6 +37,7 @@
|
||||
<sql id="BaseColumnList">
|
||||
id,
|
||||
task_id, prc_id, data_id, name, keycontent, maincontent, department, year, fileId, confidentialLevel, privacyLevel, createUserId, createDate, updateDate, del_flag
|
||||
,secrecy_last,file_name
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
@@ -117,12 +124,30 @@
|
||||
<include refid="BaseQuerySql"/>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
<select id="selectByDataId" resultType="com.adc.da.report.vo.TtReportManageActPageVO">
|
||||
<select id="selectByDataId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="BaseColumnList"/>
|
||||
FROM <include refid="TableName"/>
|
||||
a.id,
|
||||
task_id, prc_id, data_id, name, keycontent, maincontent, department, year, fileId, confidentialLevel, privacyLevel, createUserId, createDate, updateDate, del_flag
|
||||
,secrecy_last,file_name
|
||||
,label.label as lableName,label.id as labelId
|
||||
FROM <include refid="TableName"/> a
|
||||
LEFT JOIN ts_report_label rl on rl.report_id = a.data_id
|
||||
LEFT JOIN ts_tree_label label on rl.label_id = label.id
|
||||
<where>
|
||||
data_id = #{dataId}
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectByPrcId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
a.id,
|
||||
task_id, prc_id, data_id, name, keycontent, maincontent, department, year, fileId, confidentialLevel, privacyLevel, createUserId, createDate, updateDate, del_flag
|
||||
,secrecy_last,file_name
|
||||
,label.label as lableName,label.id as labelId
|
||||
FROM <include refid="TableName"/> a
|
||||
LEFT JOIN ts_report_label rl on rl.report_id = a.data_id
|
||||
LEFT JOIN ts_tree_label label on rl.label_id = label.id
|
||||
<where>
|
||||
prc_id = #{prcId}
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -4,7 +4,9 @@ import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.excel.poi.excel.ExcelImportUtil;
|
||||
import com.adc.da.excel.poi.excel.entity.ImportParams;
|
||||
import com.adc.da.sys.constant.SysConstants;
|
||||
import com.adc.da.sys.dao.mysql.UserOrgEODao;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.sys.entity.UserOrgEO;
|
||||
import com.adc.da.sys.service.iservice.IUserEoService;
|
||||
import com.adc.da.sys.util.EncryptUtil;
|
||||
import com.adc.da.sys.util.RSAUtil;
|
||||
@@ -14,6 +16,7 @@ import com.adc.da.util.http.ResponseMessage;
|
||||
import com.adc.da.util.http.Result;
|
||||
import com.adc.da.util.utils.FileUtil;
|
||||
import com.adc.da.util.utils.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -35,6 +38,7 @@ import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -47,6 +51,8 @@ public class UserEOController extends BaseController<UserEO> {
|
||||
@Resource
|
||||
private IUserEoService userEOService;
|
||||
|
||||
private UserOrgEODao userOrgEODao;
|
||||
|
||||
@Value("${isPassEncrypted}")
|
||||
private boolean isPassEncrypted;
|
||||
|
||||
@@ -112,7 +118,20 @@ public class UserEOController extends BaseController<UserEO> {
|
||||
|
||||
|
||||
userEOService.save(eo);
|
||||
|
||||
//保存部门
|
||||
LambdaQueryWrapper<UserOrgEO> userOrgEOLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
userOrgEOLambdaQueryWrapper.eq(UserOrgEO::getUserId,eo.getUsid());
|
||||
userOrgEODao.delete(userOrgEOLambdaQueryWrapper);
|
||||
String orgId = eo.getOrgId();
|
||||
String[] split = orgId.split(",");
|
||||
List<UserOrgEO> userOrgEOS = new ArrayList<>();
|
||||
for (String s : split) {
|
||||
UserOrgEO userOrgEO = new UserOrgEO();
|
||||
userOrgEO.setUserId(eo.getUsid());
|
||||
userOrgEO.setOrgId(s);
|
||||
userOrgEOS.add(userOrgEO);
|
||||
}
|
||||
userOrgEODao.insertBatch(userOrgEOS);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@@ -97,6 +97,8 @@ public class UserEO extends BaseEntity implements Serializable {
|
||||
@TableField("USNAME")
|
||||
private String usname;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String orgId;
|
||||
|
||||
/**
|
||||
* 角色ID列表
|
||||
@@ -110,6 +112,12 @@ public class UserEO extends BaseEntity implements Serializable {
|
||||
@TableField(exist = false)
|
||||
private List<RoleEO> roleEOList = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 部门EO列表
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<RoleEO> orgList = new ArrayList<>();
|
||||
|
||||
@TableField(exist = false)
|
||||
private String roleId;
|
||||
|
||||
|
||||
@@ -57,6 +57,10 @@
|
||||
<result column="name" property="name"/>
|
||||
<result column="remarks" property="remarks"/>
|
||||
</collection>
|
||||
<collection property="orgList" ofType="com.adc.da.sys.entity.OrgEO">
|
||||
<id column="id" property="id"/>
|
||||
<result column="org_name" property="orgName"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<!-- 包含用户基本数据,角色数据,组织机构数据等-->
|
||||
@@ -93,10 +97,19 @@
|
||||
<!--获取用户角色信息-->
|
||||
<select id="getUserWithRoles" resultMap="UserRoleMap" parameterType="java.lang.String">
|
||||
select
|
||||
<include refid="User_Role_List"/>
|
||||
u.*, r.id as id,
|
||||
r.data_scope as dataScope,
|
||||
r.del_flag as r_delFlag,
|
||||
r.is_default as isDefault,
|
||||
r.name as name,
|
||||
r.remarks as remarks,
|
||||
org.id as orgId,
|
||||
org.org_name
|
||||
from TS_USER u
|
||||
left join TR_USER_ROLE ur on u.usid = ur.user_id
|
||||
left join TS_ROLE r on ur.role_id = r.id
|
||||
left join TR_USER_org uo on u.usid = uo.user_id
|
||||
left join TS_org org on uo.org_id = org.id and org.status = 1
|
||||
where u.usid = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -57,6 +57,10 @@
|
||||
<result column="name" property="name"/>
|
||||
<result column="remarks" property="remarks"/>
|
||||
</collection>
|
||||
<collection property="orgList" ofType="com.adc.da.sys.entity.OrgEO">
|
||||
<id column="id" property="id"/>
|
||||
<result column="org_name" property="orgName"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<!-- 包含用户基本数据,角色数据,组织机构数据等-->
|
||||
@@ -93,10 +97,19 @@
|
||||
<!--获取用户角色信息-->
|
||||
<select id="getUserWithRoles" resultMap="UserRoleMap" parameterType="java.lang.String">
|
||||
select
|
||||
<include refid="User_Role_List"/>
|
||||
u.*, r.id as id,
|
||||
r.data_scope as dataScope,
|
||||
r.del_flag as r_delFlag,
|
||||
r.is_default as isDefault,
|
||||
r.name as name,
|
||||
r.remarks as remarks,
|
||||
org.id as orgId,
|
||||
org.org_name
|
||||
from TS_USER u
|
||||
left join TR_USER_ROLE ur on u.usid = ur.user_id
|
||||
left join TS_ROLE r on ur.role_id = r.id
|
||||
left join TR_USER_org uo on u.usid = uo.user_id
|
||||
left join TS_org org on uo.org_id = org.id and org.status = 1
|
||||
where u.usid = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
+7
-8
@@ -13,9 +13,7 @@ import com.adc.da.wkflow.util.ImpulseSenderUtils;
|
||||
import com.adc.da.wkflow.util.activiti.ActivitiTools;
|
||||
import com.adc.da.wkflow.util.wrapper.WrapMapper;
|
||||
import com.adc.da.wkflow.util.wrapper.Wrapper;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -155,6 +153,7 @@ public class ActivitDefineController {
|
||||
String id = jsonObject.getString("id");
|
||||
String userId = jsonObject.getString("loginUserId");
|
||||
String bpnId = jsonObject.getString("bpnId");
|
||||
String reportId = jsonObject.getString("reportId");
|
||||
Object dataMsg = jsonObject.get("dataMsg");
|
||||
Object approveData =jsonObject.get("approveData");
|
||||
|
||||
@@ -187,9 +186,9 @@ public class ActivitDefineController {
|
||||
busProcessName.setCreatUserName(byId.getUsname());
|
||||
busProcessName.setPrcNum((String) prcNameAndPrcNum.get("prcNum"));
|
||||
busProcessName.setPrcType(prcType);
|
||||
String data = JSON.toJSONString(dataMsg, SerializerFeature.DisableCircularReferenceDetect);
|
||||
String dateId = activitDefineService.saveOrUpdateDate(prcType,data,task.getId(),pi.getId());
|
||||
busProcessName.setDataId(dateId);
|
||||
// String data = JSON.toJSONString(dataMsg, SerializerFeature.DisableCircularReferenceDetect);
|
||||
// String dateId = activitDefineService.saveOrUpdateDate(prcType,data,task.getId(),pi.getId(),reportId);
|
||||
// busProcessName.setDataId(dateId);
|
||||
// busProcessName.setPrcName((String) prcNameAndPrcNum.get("prcName"));
|
||||
busProcessName.setPrcName(jsonObject.getString("prcName"));
|
||||
busProcessName.setSubmitStatus(SubmitStatusEnum.SUBMIT.getValue());
|
||||
@@ -210,9 +209,9 @@ public class ActivitDefineController {
|
||||
one.setPrcId(pi.getId());
|
||||
one.setSubmitStatus(SubmitStatusEnum.SUBMIT.getValue());
|
||||
one.setCreatTime(sdf.format(new Date()));
|
||||
String data = JSON.toJSONString(dataMsg, SerializerFeature.DisableCircularReferenceDetect);
|
||||
String dateId = activitDefineService.saveOrUpdateDate(prcType,data,task.getId(),pi.getId());
|
||||
one.setDataId(dateId);
|
||||
// String data = JSON.toJSONString(dataMsg, SerializerFeature.DisableCircularReferenceDetect);
|
||||
// String dateId = activitDefineService.saveOrUpdateDate(prcType,data,task.getId(),pi.getId(),reportId);
|
||||
// one.setDataId(dateId);
|
||||
ibusprocessnameService.save(one);
|
||||
}
|
||||
|
||||
|
||||
+24
-25
@@ -1,10 +1,13 @@
|
||||
package com.adc.da.wkflow.business_activiti.service;
|
||||
|
||||
import com.adc.da.report.dao.mysql.PowerApplyActDao;
|
||||
import com.adc.da.report.dao.mysql.ReportLabelDao;
|
||||
import com.adc.da.report.dao.mysql.TtReportManageActDao;
|
||||
import com.adc.da.report.eo.PowerApplyAct;
|
||||
import com.adc.da.report.eo.ReportLabelEntity;
|
||||
import com.adc.da.report.eo.TtReportManageAct;
|
||||
import com.adc.da.report.service.IPowerApplyActService;
|
||||
import com.adc.da.report.service.IReportLabelService;
|
||||
import com.adc.da.report.service.ITtReportManageActService;
|
||||
import com.adc.da.util.utils.StringUtils;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -13,7 +16,6 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
@@ -35,47 +37,44 @@ public class ActivitDefineService {
|
||||
@Autowired
|
||||
ITtReportManageActService ttReportManageActService;
|
||||
|
||||
@Autowired
|
||||
private ReportLabelDao reportLabelDao;
|
||||
@Autowired
|
||||
private IReportLabelService iReportLabelService;
|
||||
|
||||
//保存data数据
|
||||
public String saveOrUpdateDate(String prcType, String dataJson,String taskId,String prcId) {
|
||||
String dataId = UUID.randomUUID().toString().replaceAll("-","");
|
||||
public String saveOrUpdateDate(String prcType, String dataJson,String taskId,String prcId,String reportId) {
|
||||
if (StringUtils.isBlank(reportId)){
|
||||
reportId = UUID.randomUUID().toString().replace("-","");
|
||||
}
|
||||
if ("1".equals(prcType)){
|
||||
List<PowerApplyAct> powerApplyActs = JSONObject.parseArray(dataJson, PowerApplyAct.class);
|
||||
for (PowerApplyAct powerApplyAct : powerApplyActs) {
|
||||
powerApplyAct.setId(UUID.randomUUID().toString().replaceAll("-",""));
|
||||
powerApplyAct.setDataId(dataId);
|
||||
powerApplyAct.setDataId(reportId);
|
||||
powerApplyAct.setTaskId(taskId);
|
||||
powerApplyAct.setPrcId(prcId);
|
||||
powerApplyAct.setDelFlag(0);
|
||||
powerApplyAct.setCreateDate(new Date());
|
||||
}
|
||||
powerApplyActDao.batchInsert(powerApplyActs);
|
||||
}else if ("2".equals(prcType)){
|
||||
}else if ("4".equals(prcType)){
|
||||
TtReportManageAct ttReportManageAct = JSONObject.parseObject(dataJson, TtReportManageAct.class);
|
||||
ttReportManageAct.setDataId(dataId);
|
||||
ttReportManageAct.setDataId(reportId);
|
||||
ttReportManageAct.setTaskId(taskId);
|
||||
ttReportManageAct.setPrcId(prcId);
|
||||
ttReportManageAct.setDelFlag(0);
|
||||
ttReportManageAct.setCreateDate(new Date());
|
||||
ttReportManageActService.saveOrUpdateSingle(ttReportManageAct);
|
||||
//权限
|
||||
List<PowerApplyAct> powerApplyActs = new ArrayList<>();
|
||||
List<PowerApplyAct> powerList = ttReportManageAct.getPowerList();
|
||||
for (PowerApplyAct powerApplyAct : powerList) {
|
||||
if (StringUtils.isEmpty(powerApplyAct.getId())){
|
||||
powerApplyAct.setId(UUID.randomUUID().toString().replaceAll("-",""));
|
||||
powerApplyAct.setReportId(ttReportManageAct.getId());
|
||||
powerApplyAct.setDataId(dataId);
|
||||
// powerApplyAct.setTaskId(taskId);
|
||||
powerApplyAct.setPrcId(prcId);
|
||||
powerApplyAct.setDelFlag(0);
|
||||
powerApplyAct.setCreateDate(new Date());
|
||||
powerApplyActs.add(powerApplyAct);
|
||||
}
|
||||
}
|
||||
if (powerApplyActs.size()>0){
|
||||
powerApplyActDao.batchInsert(powerApplyActs);
|
||||
}
|
||||
//插入报表标签关系表
|
||||
//修改报表标签关系表(先删后增)
|
||||
iReportLabelService.deleteReportLabelByReportId(new String[]{reportId});
|
||||
ttReportManageAct.getLabelList().forEach((label) -> {
|
||||
ReportLabelEntity reportLabelEntity = new ReportLabelEntity(com.adc.da.util.utils.UUID.randomUUID10()
|
||||
,ttReportManageAct.getDataId(), label);
|
||||
reportLabelDao.insert(reportLabelEntity);
|
||||
});
|
||||
}
|
||||
return dataId;
|
||||
return reportId;
|
||||
}
|
||||
}
|
||||
|
||||
+22
-17
@@ -4,8 +4,8 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.adc.da.login.util.UserUtils;
|
||||
import com.adc.da.report.dao.mysql.PowerApplyActDao;
|
||||
import com.adc.da.report.dao.mysql.TtReportManageActDao;
|
||||
import com.adc.da.report.eo.TtReportManageAct;
|
||||
import com.adc.da.report.vo.PowerApplyActPageVO;
|
||||
import com.adc.da.report.vo.TtReportManageActPageVO;
|
||||
import com.adc.da.sys.service.iservice.IUserEoService;
|
||||
import com.adc.da.sys.vo.UserVO;
|
||||
import com.adc.da.util.exception.AdcDaBaseException;
|
||||
@@ -282,6 +282,7 @@ public class TodoTaskController {
|
||||
public Wrapper<String> completeTaskByUserId(@RequestBody ApproveDataVO busMes) {
|
||||
log.info("!!!!!!!!!!!!!TaskId!!!!!!!!!!!!!!!"+busMes.getTaskId());
|
||||
String dataJson = busMes.getDataJson();
|
||||
String reportId = busMes.getReportId();
|
||||
if (busMes.getTaskId() != null && !busMes.getTaskId().equals("")) {
|
||||
Task task = taskService.createTaskQuery().taskId(busMes.getTaskId()).singleResult();
|
||||
if(task!=null){
|
||||
@@ -297,7 +298,8 @@ public class TodoTaskController {
|
||||
ibusProcessApproveService.save(busProcessApprove);
|
||||
if (StringUtils.isNotEmpty(dataJson)){
|
||||
//根据业务情况 对业务数据进行saveOrupdate
|
||||
activitDefineService.saveOrUpdateDate(busMes.getPrcType(),dataJson, task.getId(),task.getProcessInstanceId());
|
||||
activitDefineService.saveOrUpdateDate(busMes.getPrcType(),dataJson, task.getId(),
|
||||
task.getProcessInstanceId(),reportId);
|
||||
}
|
||||
taskService.complete(busMes.getTaskId());
|
||||
}
|
||||
@@ -444,11 +446,9 @@ public class TodoTaskController {
|
||||
String string = JSONArray.toJSONString(powerApplyActs);
|
||||
//去对应的 数据表查数据
|
||||
busProcessNewVO.setDataJson(string);
|
||||
}else if ("2".equals(prcType)){
|
||||
TtReportManageActPageVO ttReportManageActPageVO = ttReportManageActDao.selectByDataId(dataId);
|
||||
List<PowerApplyActPageVO> powerApplyActs = powerApplyActDao.selectListByPrcId(ttReportManageActPageVO.getPrcId());
|
||||
ttReportManageActPageVO.setPowerList(powerApplyActs);
|
||||
String string = JSONArray.toJSONString(ttReportManageActPageVO);
|
||||
}else if ("4".equals(prcType)){
|
||||
TtReportManageAct ttReportManageAct = ttReportManageActDao.selectByDataId(dataId);
|
||||
String string = JSONArray.toJSONString(ttReportManageAct);
|
||||
//去对应的 数据表查数据
|
||||
busProcessNewVO.setDataJson(string);
|
||||
}
|
||||
@@ -458,23 +458,27 @@ public class TodoTaskController {
|
||||
private BusProcessNewVO queryDetailDate(BusProcessNew busProcessNew, String prcType, Integer tag) {
|
||||
BusProcessNewVO busProcessNewVO = new BusProcessNewVO();
|
||||
BeanUtils.copyProperties(busProcessNew,busProcessNewVO);
|
||||
String pId = busProcessNew.getPId();
|
||||
String dataId = busProcessNew.getDataId();
|
||||
if ("1".equals(prcType)){
|
||||
List<PowerApplyActPageVO> powerApplyActs = new ArrayList<>();
|
||||
if (tag == 1){
|
||||
if (StringUtils.isBlank(pId)){
|
||||
//代办查看详情
|
||||
powerApplyActs = powerApplyActDao.selectListBydataIdNodel(dataId);
|
||||
}else {
|
||||
powerApplyActs = powerApplyActDao.selectListBydataId(dataId);
|
||||
}else {
|
||||
powerApplyActs = powerApplyActDao.selectListByPrcId(pId);
|
||||
}
|
||||
String string = JSONArray.toJSONString(powerApplyActs);
|
||||
//去对应的 数据表查数据
|
||||
busProcessNewVO.setDataJson(string);
|
||||
}else if("2".equals(prcType)){
|
||||
TtReportManageActPageVO ttReportManageActPageVO = ttReportManageActDao.selectByDataId(dataId);
|
||||
List<PowerApplyActPageVO> powerApplyActs = powerApplyActDao.selectListByPrcId(ttReportManageActPageVO.getPrcId());
|
||||
ttReportManageActPageVO.setPowerList(powerApplyActs);
|
||||
String string = JSONArray.toJSONString(ttReportManageActPageVO);
|
||||
}else if("4".equals(prcType)){
|
||||
TtReportManageAct ttReportManageAct = new TtReportManageAct();
|
||||
if (StringUtils.isBlank(pId)){
|
||||
ttReportManageAct = ttReportManageActDao.selectByDataId(dataId);
|
||||
}else {
|
||||
ttReportManageAct = ttReportManageActDao.selectByPrcId(pId);
|
||||
}
|
||||
String string = JSONArray.toJSONString(ttReportManageAct);
|
||||
//去对应的 数据表查数据
|
||||
busProcessNewVO.setDataJson(string);
|
||||
}
|
||||
@@ -491,6 +495,7 @@ public class TodoTaskController {
|
||||
public Wrapper<String> saveTaskFirst(@RequestBody ApproveDataVO approveDataVO) {
|
||||
String dataJson = approveDataVO.getDataJson();
|
||||
String submitJson = approveDataVO.getSubmitJson();
|
||||
String reportId = approveDataVO.getReportId();
|
||||
String saveId = null;
|
||||
String dataId = null;
|
||||
if (approveDataVO.getId() != null && !approveDataVO.getId().equals("")) {
|
||||
@@ -509,7 +514,7 @@ public class TodoTaskController {
|
||||
if (StringUtils.isNotEmpty(dataJson)){
|
||||
//根据业务情况 对业务数据进行saveOrupdate
|
||||
dataId = activitDefineService.saveOrUpdateDate(approveDataVO.getPrcType(), dataJson, null,
|
||||
null);
|
||||
null,reportId);
|
||||
busProcessName.setDataId(dataId);
|
||||
}
|
||||
iBusProcessNameService.saveOrUpdate(busProcessName);
|
||||
@@ -521,7 +526,7 @@ public class TodoTaskController {
|
||||
if (StringUtils.isNotEmpty(dataJson)) {
|
||||
//根据业务情况 对业务数据进行saveOrupdate
|
||||
dataId = activitDefineService.saveOrUpdateDate(approveDataVO.getPrcType(), dataJson,
|
||||
approveDataVO.getTaskId(),"");
|
||||
approveDataVO.getTaskId(),"",reportId);
|
||||
busProcessName.setDataId(dataId);
|
||||
}
|
||||
busProcessName.setPrcType(approveDataVO.getPrcType());
|
||||
|
||||
+3
-3
@@ -43,9 +43,9 @@ public class BusProcessNameServiceImpl extends ServiceImpl<BusProcessNameMapper,
|
||||
Map<String,Object> result = new HashMap<>();
|
||||
String prcName = "";
|
||||
String prcNum = "";
|
||||
if(StringUtils.equals(FlowTypeEnum.BGQXSQLC.getValue(), prcType)){
|
||||
prcName = FlowTypeEnum.BGQXSQLC.getPrcName();
|
||||
prcNum = FlowTypeEnum.BGQXSQLC.getPrcNum();
|
||||
if(StringUtils.equals(FlowTypeEnum.XZSQ.getValue(), prcType)){
|
||||
prcName = FlowTypeEnum.XZSQ.getPrcName();
|
||||
prcNum = FlowTypeEnum.XZSQ.getPrcNum();
|
||||
}else if (StringUtils.equals(FlowTypeEnum.SCBGLC.getValue(), prcType)){
|
||||
prcName = FlowTypeEnum.SCBGLC.getPrcName();
|
||||
prcNum = FlowTypeEnum.SCBGLC.getPrcNum();
|
||||
|
||||
@@ -34,4 +34,6 @@ public class ApproveDataVO {
|
||||
|
||||
private String prcName;
|
||||
|
||||
private String reportId;
|
||||
|
||||
}
|
||||
|
||||
@@ -5,8 +5,10 @@ package com.adc.da.wkflow.enums;
|
||||
*/
|
||||
public enum FlowTypeEnum {
|
||||
|
||||
BGQXSQLC("1","报告权限申请流程","QXSQ","报告权限申请流程",""),
|
||||
SCBGLC("2","上传报告流程","SCBG","上传报告流程",""),
|
||||
XZSQ("1","下载申请流程","QXSQ","下载申请流程",""),
|
||||
YLSQ("2","预览申请流程","QXSQ","预览申请流程",""),
|
||||
YLXZSQ("3","预览+下载申请流程","QXSQ","预览+下载申请流程",""),
|
||||
SCBGLC("4","上传审批流程","SCBG","上传审批流程",""),
|
||||
;
|
||||
|
||||
private String value;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.adc.da.wkflow.listener.SCBG;
|
||||
|
||||
import com.adc.da.login.util.UserUtils;
|
||||
import com.adc.da.report.dao.mysql.ReportDao;
|
||||
import com.adc.da.report.dao.mysql.TtReportManageActDao;
|
||||
import com.adc.da.report.eo.TtReportManageAct;
|
||||
import com.adc.da.wkflow.business_main.entity.BusProcessApprove;
|
||||
@@ -24,6 +25,7 @@ public class oneApplyAfter implements TaskListener {
|
||||
@Override
|
||||
public void notify(DelegateTask delegateTask) {
|
||||
TtReportManageActDao ttReportManageActDao = SpringContextUtil.getBean(TtReportManageActDao.class);
|
||||
ReportDao reportDao = SpringContextUtil.getBean(ReportDao.class);
|
||||
IBusProcessNewService busBean = SpringContextUtil.getBean(IBusProcessNewService.class);
|
||||
IBusProcessApproveService approveService = SpringContextUtil.getBean(IBusProcessApproveService.class);
|
||||
//查询task任务
|
||||
@@ -52,6 +54,10 @@ public class oneApplyAfter implements TaskListener {
|
||||
String s = object.getString("flag") == "" || object.getString("flag") == null ? FlagEnum.AGREE.getValue() : object.getString("flag");
|
||||
// 1: 同意 2:退回
|
||||
delegateTask.setVariable("flag",s);
|
||||
if ("1".equals(s)){
|
||||
// ttReportManageActService.saveReport(ttReportManageAct);
|
||||
reportDao.saveReportAct(ttReportManageAct);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,5 @@ public class reEditAfter implements TaskListener {
|
||||
JSONObject object = JSONObject.parseObject(fromValsJson);
|
||||
|
||||
delegateTask.setVariable("oneApprove",object.getString("oneApprove"));
|
||||
delegateTask.setVariable("twoApprove",object.getString("twoApprove"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,6 @@ public class startAfter implements TaskListener {
|
||||
JSONObject object = JSONObject.parseObject(fromValsJson);
|
||||
//审批人
|
||||
delegateTask.setVariable("oneApprove",object.getString("oneApprove"));
|
||||
delegateTask.setVariable("twoApprove",object.getString("twoApprove"));
|
||||
//发起人
|
||||
delegateTask.setVariable("userId",object.getString("userId"));
|
||||
}
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
package com.adc.da.wkflow.listener.SCBG;
|
||||
|
||||
import com.adc.da.login.util.UserUtils;
|
||||
import com.adc.da.report.dao.mysql.PowerApplyActDao;
|
||||
import com.adc.da.report.dao.mysql.TtReportManageActDao;
|
||||
import com.adc.da.report.eo.PowerApplyAct;
|
||||
import com.adc.da.report.eo.TtReportManageAct;
|
||||
import com.adc.da.report.service.ITtReportManageActService;
|
||||
import com.adc.da.wkflow.business_main.entity.BusProcessApprove;
|
||||
import com.adc.da.wkflow.business_main.entity.BusProcessNew;
|
||||
import com.adc.da.wkflow.business_main.service.IBusProcessApproveService;
|
||||
import com.adc.da.wkflow.business_main.service.IBusProcessNewService;
|
||||
import com.adc.da.wkflow.listener.FlagEnum;
|
||||
import com.adc.da.wkflow.util.SpringContextUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.activiti.engine.delegate.DelegateTask;
|
||||
import org.activiti.engine.delegate.TaskListener;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 上传报告 发起流程
|
||||
*/
|
||||
public class twoApplyAfter implements TaskListener {
|
||||
|
||||
@Override
|
||||
public void notify(DelegateTask delegateTask) {
|
||||
PowerApplyActDao powerApplyActDao = SpringContextUtil.getBean(PowerApplyActDao.class);
|
||||
TtReportManageActDao ttReportManageActDao = SpringContextUtil.getBean(TtReportManageActDao.class);
|
||||
ITtReportManageActService ttReportManageActService = SpringContextUtil.getBean(ITtReportManageActService.class);
|
||||
IBusProcessNewService busBean = SpringContextUtil.getBean(IBusProcessNewService.class);
|
||||
IBusProcessApproveService approveService = SpringContextUtil.getBean(IBusProcessApproveService.class);
|
||||
//查询task任务
|
||||
LambdaQueryWrapper<TtReportManageAct> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(TtReportManageAct::getTaskId, delegateTask.getId());
|
||||
List<TtReportManageAct> ttReportManageActs = ttReportManageActDao.selectList(queryWrapper);
|
||||
TtReportManageAct ttReportManageAct = new TtReportManageAct();
|
||||
if (ttReportManageActs.size()>0){
|
||||
ttReportManageAct = ttReportManageActs.get(0);
|
||||
List<PowerApplyAct> powerApplyActs = powerApplyActDao.selectActListBydataId(ttReportManageAct.getCreateUserId());
|
||||
for (PowerApplyAct powerApplyAct : powerApplyActs) {
|
||||
powerApplyAct.setReportId(ttReportManageAct.getId());
|
||||
}
|
||||
ttReportManageAct.setPowerList(powerApplyActs);
|
||||
}
|
||||
//构建工作流代办
|
||||
BusProcessNew busProcessNew = new BusProcessNew();
|
||||
busProcessNew.setUserId(UserUtils.getUserId());
|
||||
busProcessNew.setPId(delegateTask.getProcessInstanceId());
|
||||
busProcessNew.setTaskInfo(delegateTask.getEventName());
|
||||
busProcessNew.setTaskId(delegateTask.getId());
|
||||
busProcessNew.setDataId(ttReportManageAct.getDataId());
|
||||
busBean.save(busProcessNew);
|
||||
|
||||
//审批结果
|
||||
LambdaQueryWrapper<BusProcessApprove> approveWrapper = new LambdaQueryWrapper<>();
|
||||
approveWrapper.eq(BusProcessApprove::getTaskId, delegateTask.getId());
|
||||
List<BusProcessApprove> list = approveService.list(approveWrapper);
|
||||
String fromValsJson = list.get(0).getFromValsJson();
|
||||
JSONObject object = JSONObject.parseObject(fromValsJson);
|
||||
String s = object.getString("flag") == "" || object.getString("flag") == null ? FlagEnum.AGREE.getValue() : object.getString("flag");
|
||||
// 1: 同意 2:退回
|
||||
delegateTask.setVariable("flag",s);
|
||||
if ("1".equals(s)){
|
||||
ttReportManageActService.saveReport(ttReportManageAct);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,13 @@ public class ImpulseSenderUtils {
|
||||
String prcType = entry.getKey();
|
||||
FlowTypeEnum flowTypeEnumByValue = FlowTypeEnum.getFlowTypeEnumByValue(prcType);
|
||||
switch (flowTypeEnumByValue){
|
||||
case BGQXSQLC:
|
||||
case XZSQ:
|
||||
bgqxsqNumber = new AtomicInteger(count);
|
||||
case YLSQ:
|
||||
bgqxsqNumber = new AtomicInteger(count);
|
||||
case YLXZSQ:
|
||||
bgqxsqNumber = new AtomicInteger(count);
|
||||
case SCBGLC:
|
||||
bgqxsqNumber = new AtomicInteger(count);
|
||||
break;
|
||||
}
|
||||
@@ -88,13 +94,21 @@ public class ImpulseSenderUtils {
|
||||
throw new ActivitiException("非法的流程类型: " + flowType);
|
||||
}
|
||||
switch (flowTypeEnum){
|
||||
case BGQXSQLC:
|
||||
case XZSQ:
|
||||
number = bgqxsqNumber.incrementAndGet();
|
||||
checkNumberLegitimate(number,"报告权限申请流程");
|
||||
checkNumberLegitimate(number,"下载申请流程");
|
||||
break;
|
||||
case YLSQ:
|
||||
number = bgqxsqNumber.incrementAndGet();
|
||||
checkNumberLegitimate(number,"预览申请流程");
|
||||
break;
|
||||
case YLXZSQ:
|
||||
number = bgqxsqNumber.incrementAndGet();
|
||||
checkNumberLegitimate(number,"预览+下载申请流程");
|
||||
break;
|
||||
case SCBGLC:
|
||||
number = bgqxsqNumber.incrementAndGet();
|
||||
checkNumberLegitimate(number,"上传报告流程");
|
||||
checkNumberLegitimate(number,"上传审批流程");
|
||||
break;
|
||||
default:
|
||||
throw new ActivitiException("流程类型 " + flowType + " 非法!");
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user