[新增] 权限申请流程 及 工作台的接口 开发完毕
This commit is contained in:
@@ -45,4 +45,5 @@ public interface PowerApplyActDao extends BaseMapper<PowerApplyAct> {
|
||||
|
||||
int batchInsert(@Param("list")List<PowerApplyAct> powerApplyActs);
|
||||
|
||||
List<PowerApplyActPageVO> selectListBydataId(@Param("dataId")String dataId);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.adc.da.report.dao.mysql;
|
||||
|
||||
import com.adc.da.report.eo.PowerApply;
|
||||
import com.adc.da.report.eo.PowerApplyAct;
|
||||
import com.adc.da.report.vo.PowerApplyPageVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -41,4 +42,6 @@ public interface PowerApplyDao extends BaseMapper<PowerApply> {
|
||||
* @description 列表查询
|
||||
*/
|
||||
List<PowerApply> queryList(@Param("pageVO") PowerApplyPageVO powerApplyPageVO);
|
||||
|
||||
int saveBatch(@Param("list") List<PowerApplyAct> powerApplies);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author bu
|
||||
* @version 1.0
|
||||
@@ -64,13 +66,13 @@ public class PowerApply {
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("create_date")
|
||||
private String createDate;
|
||||
private Date createDate;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField("update_date")
|
||||
private String updateDate;
|
||||
private Date updateDate = new Date();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,6 +6,9 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* @author bu
|
||||
* @version 1.0
|
||||
@@ -76,13 +79,13 @@ public class PowerApplyAct {
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("create_date")
|
||||
private String createDate;
|
||||
private Date createDate;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField("update_date")
|
||||
private String updateDate;
|
||||
private Date updateDate = new Date();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.adc.da.report.service.impl;
|
||||
|
||||
import com.adc.da.login.util.CommonUtils;
|
||||
import com.adc.da.login.util.UserUtils;
|
||||
import com.adc.da.report.constant.ReportConstants;
|
||||
import com.adc.da.report.dao.mysql.FileDao;
|
||||
import com.adc.da.report.dao.mysql.ReportDao;
|
||||
@@ -16,6 +17,8 @@ import com.adc.da.report.service.ITreeLabelService;
|
||||
import com.adc.da.report.util.*;
|
||||
import com.adc.da.report.vo.ReportQueryVo;
|
||||
import com.adc.da.report.vo.ReportVo;
|
||||
import com.adc.da.sys.dao.mysql.RoleEODao;
|
||||
import com.adc.da.sys.entity.RoleEO;
|
||||
import com.adc.da.util.utils.FileUtil;
|
||||
import com.adc.da.util.utils.StringUtils;
|
||||
import com.adc.da.util.utils.UUID;
|
||||
@@ -84,6 +87,9 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
||||
@Autowired
|
||||
private ObsBootUtil obsBootUtil;
|
||||
|
||||
@Autowired
|
||||
private RoleEODao roleEODao;
|
||||
|
||||
/**
|
||||
* 新增或编辑报告
|
||||
*
|
||||
@@ -347,16 +353,20 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
||||
IPage<ReportEntity> page = new Page<>();
|
||||
page.setCurrent(vo.getPageNo());
|
||||
page.setSize(vo.getPageSize());
|
||||
|
||||
//判断是不是管理员
|
||||
// boolean admin = CommonUtils.isAdmin();
|
||||
// if (admin) {
|
||||
// vo.setUsid(null);
|
||||
// } else {
|
||||
// vo.setUsid(CommonUtils.getUserId());
|
||||
// }
|
||||
|
||||
vo.setUsid(CommonUtils.getUserId());
|
||||
boolean admin = false;
|
||||
List<RoleEO> roleEOList = roleEODao.selectByuserId(UserUtils.getUserId());
|
||||
for (RoleEO roleEO : roleEOList) {
|
||||
if ("管理员".equals(roleEO.getName())){
|
||||
admin= !admin;
|
||||
}
|
||||
}
|
||||
if (admin) {
|
||||
vo.setUsid(null);
|
||||
} else {
|
||||
vo.setUsid(UserUtils.getUserId());
|
||||
}
|
||||
// vo.setUsid(CommonUtils.getUserId());
|
||||
IPage<ReportVo> list = reportDao.getAddReportPage(page, vo);
|
||||
|
||||
return list;
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.adc.da.report.vo;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author bu
|
||||
* @version 1.0
|
||||
@@ -24,6 +26,7 @@ public class PowerApplyActPageVO extends BasePageVO {
|
||||
*/
|
||||
private String taskId;
|
||||
|
||||
private String userId;
|
||||
/**
|
||||
* 数据id
|
||||
*/
|
||||
@@ -58,4 +61,80 @@ public class PowerApplyActPageVO extends BasePageVO {
|
||||
* 报告类别
|
||||
*/
|
||||
private String reportType;
|
||||
|
||||
private String reportId;
|
||||
/**
|
||||
* 原因
|
||||
*/
|
||||
private String applyReason;
|
||||
/**
|
||||
* 权限
|
||||
*/
|
||||
private String power;
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
private String keyContent;
|
||||
|
||||
/**
|
||||
* 主要内容
|
||||
*/
|
||||
private String mainContent;
|
||||
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
private String department;
|
||||
|
||||
/**
|
||||
* 年
|
||||
*/
|
||||
private String year;
|
||||
|
||||
/**
|
||||
* 文件id
|
||||
*/
|
||||
private String fileId;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 文件类型
|
||||
*/
|
||||
private String fileType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String createDate;
|
||||
|
||||
/**
|
||||
* 报告用户id
|
||||
*/
|
||||
private List<String> reportUserIdList;
|
||||
|
||||
/**
|
||||
* 报告涉密等级
|
||||
*/
|
||||
private String confidentialLevel;
|
||||
|
||||
/**
|
||||
* 隐私等级
|
||||
*/
|
||||
private String privacyLevel;
|
||||
|
||||
/**
|
||||
* 关联的标签id集合
|
||||
*/
|
||||
private List<String> labelList;
|
||||
|
||||
/**
|
||||
* 文件大小
|
||||
*/
|
||||
private String fileSize;
|
||||
|
||||
private String name;
|
||||
}
|
||||
|
||||
@@ -47,5 +47,7 @@ public class ReportQueryVo {
|
||||
private String usid;
|
||||
|
||||
private List<String> ids;
|
||||
//
|
||||
// private List<String> noIds;
|
||||
|
||||
}
|
||||
|
||||
@@ -92,4 +92,11 @@
|
||||
<include refid="BaseQuerySql"/>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
<select id="selectListBydataId" resultType="com.adc.da.report.vo.PowerApplyActPageVO">
|
||||
select a.*,
|
||||
rep.name,rep.keycontent,rep.maincontent,rep.DEPARTMENT,rep.year,rep.fileid,rep.confidentialLevel,rep.privacyLevel
|
||||
from <include refid="TableName"/> a
|
||||
left join TT_REPORT_MANAGE rep on a.report_id = rep.id
|
||||
where a.data_id = #{dataId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -44,6 +44,14 @@
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
<insert id="saveBatch">
|
||||
insert into power_apply (id,data_id, report_id, power, apply_reason, user_id, create_user_id, create_date, update_date, update_user_id, del_flag)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.id}, #{item.dataId}, #{item.reportId}, #{item.power}, #{item.applyReason}, #{item.userId}, #{item.createUserId}, #{item.createDate}, #{item.updateDate}, #{item.updateUserId}, #{item.delFlag})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
<!-- 根据查询VO进行分页查询 -->
|
||||
<select id="selectPage" resultMap="BaseResultMap">
|
||||
|
||||
@@ -170,12 +170,33 @@
|
||||
|
||||
|
||||
<select id="getAddReportPage" resultType="com.adc.da.report.vo.ReportVo">
|
||||
SELECT a.*
|
||||
from (
|
||||
select * from TT_REPORT_MANAGE eo
|
||||
LEFT JOIN tr_report_user ru on eo.id = ru.reportId
|
||||
WHERE eo.DEL_FLAG = 0 and ru.userId != #{pageVO.usid}
|
||||
|
||||
SELECT
|
||||
eo.id,
|
||||
eo.NAME,
|
||||
eo.keycontent,
|
||||
eo.maincontent,
|
||||
eo.DEPARTMENT,
|
||||
eo.YEAR,
|
||||
eo.fileid,
|
||||
eo.confidentialLevel,
|
||||
eo.privacyLevel,
|
||||
pa.report_id,
|
||||
pa.user_id
|
||||
FROM
|
||||
TT_REPORT_MANAGE eo
|
||||
LEFT JOIN tr_report_user ru ON eo.id = ru.reportId
|
||||
LEFT JOIN power_apply pa ON pa.report_id = eo.id
|
||||
WHERE
|
||||
eo.DEL_FLAG = 0
|
||||
<if test="pageVO.usid !='' and pageVO.usid != null">
|
||||
and ru.userId != #{pageVO.usid}
|
||||
</if>
|
||||
<if test="pageVO.usid !='' and pageVO.usid != null">
|
||||
and eo.id not in (
|
||||
SELECT tt.report_id from power_apply tt WHERE tt.user_id = #{pageVO.usid}
|
||||
)
|
||||
</if>
|
||||
<if test="pageVO.name !='' and pageVO.name != null">
|
||||
and name like CONCAT(CONCAT('%',#{pageVO.name}),'%')
|
||||
</if>
|
||||
@@ -186,11 +207,21 @@
|
||||
#{year}
|
||||
</foreach>
|
||||
</if>
|
||||
) a
|
||||
|
||||
LEFT JOIN power_apply pa on pa.report_id = a.id
|
||||
where
|
||||
pa.user_id is null or pa.user_id != #{pageVO.usid}
|
||||
<if test="pageVO.ids != null and pageVO.ids.size() > 0">
|
||||
and eo.id in
|
||||
<foreach collection="pageVO.ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY
|
||||
eo.id
|
||||
ORDER BY
|
||||
eo.updateDate DESC
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
Binary file not shown.
@@ -170,12 +170,33 @@
|
||||
|
||||
|
||||
<select id="getAddReportPage" resultType="com.adc.da.report.vo.ReportVo">
|
||||
SELECT a.*
|
||||
from (
|
||||
select * from TT_REPORT_MANAGE eo
|
||||
LEFT JOIN tr_report_user ru on eo.id = ru.reportId
|
||||
WHERE eo.DEL_FLAG = 0 and ru.userId != #{pageVO.usid}
|
||||
|
||||
SELECT
|
||||
eo.id,
|
||||
eo.NAME,
|
||||
eo.keycontent,
|
||||
eo.maincontent,
|
||||
eo.DEPARTMENT,
|
||||
eo.YEAR,
|
||||
eo.fileid,
|
||||
eo.confidentialLevel,
|
||||
eo.privacyLevel,
|
||||
pa.report_id,
|
||||
pa.user_id
|
||||
FROM
|
||||
TT_REPORT_MANAGE eo
|
||||
LEFT JOIN tr_report_user ru ON eo.id = ru.reportId
|
||||
LEFT JOIN power_apply pa ON pa.report_id = eo.id
|
||||
WHERE
|
||||
eo.DEL_FLAG = 0
|
||||
<if test="pageVO.usid !='' and pageVO.usid != null">
|
||||
and ru.userId != #{pageVO.usid}
|
||||
</if>
|
||||
<if test="pageVO.usid !='' and pageVO.usid != null">
|
||||
and eo.id not in (
|
||||
SELECT tt.report_id from power_apply tt WHERE tt.user_id = #{pageVO.usid}
|
||||
)
|
||||
</if>
|
||||
<if test="pageVO.name !='' and pageVO.name != null">
|
||||
and name like CONCAT(CONCAT('%',#{pageVO.name}),'%')
|
||||
</if>
|
||||
@@ -186,11 +207,21 @@
|
||||
#{year}
|
||||
</foreach>
|
||||
</if>
|
||||
) a
|
||||
|
||||
LEFT JOIN power_apply pa on pa.report_id = a.id
|
||||
where
|
||||
pa.user_id is null or pa.user_id != #{pageVO.usid}
|
||||
<if test="pageVO.ids != null and pageVO.ids.size() > 0">
|
||||
and eo.id in
|
||||
<foreach collection="pageVO.ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY
|
||||
eo.id
|
||||
ORDER BY
|
||||
eo.updateDate DESC
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
package com.adc.da.sys.dao.mysql;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.adc.da.sys.vo.UserRoleVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.adc.da.base.dao.BaseDao;
|
||||
import com.adc.da.sys.entity.RoleEO;
|
||||
import com.adc.da.sys.entity.UserRoleEO;
|
||||
import com.adc.da.sys.vo.UserRoleVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <br>
|
||||
@@ -116,4 +115,6 @@ public interface RoleEODao extends BaseDao<RoleEO> {
|
||||
IPage<UserRoleVO> getUserInfoPageByRoleId(IPage page,String roleId);
|
||||
|
||||
Long getUserCountByRoleId(@Param("roleId") String roleId);
|
||||
|
||||
List<RoleEO> selectByuserId(@Param("userId") String userId);
|
||||
}
|
||||
|
||||
@@ -316,6 +316,12 @@
|
||||
<select id="getpidByMenuId" parameterType="string" resultType="string">
|
||||
select parent_id from ts_menu where id=#{id}
|
||||
</select>
|
||||
<select id="selectByuserId" resultType="com.adc.da.sys.entity.RoleEO">
|
||||
SELECT * from ts_Role r
|
||||
LEFT JOIN tr_user_role ur on r.id = ur.role_id
|
||||
where r.del_flag = 0
|
||||
and ur.user_id =#{userId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
+1
-1
@@ -218,7 +218,7 @@ public class ActivitDefineController {
|
||||
}
|
||||
|
||||
BusProcessApprove busProcessApprove = new BusProcessApprove();
|
||||
busProcessApprove.setFromValsJson(approveData.toString());
|
||||
busProcessApprove.setFromValsJson(JSON.toJSONString(approveData));
|
||||
busProcessApprove.setTaskId(task.getId());
|
||||
busProcessApprove.setCreateDate(new Date());
|
||||
busProcessApprove.setPrcId(pi.getId());
|
||||
|
||||
+5
@@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -27,12 +28,16 @@ public class ActivitDefineService {
|
||||
String dataId = UUID.randomUUID().toString().replaceAll("-","");
|
||||
if ("1".equals(prcType)){
|
||||
List<PowerApplyAct> powerApplyActs = JSONObject.parseArray(dataJson, PowerApplyAct.class);
|
||||
// LambdaQueryWrapper<PowerApplyAct> powerWrapper = new LambdaQueryWrapper<>();
|
||||
// powerWrapper.eq(PowerApplyAct::getPrcId,prcId);
|
||||
// powerApplyActDao.delete(powerWrapper);
|
||||
for (PowerApplyAct powerApplyAct : powerApplyActs) {
|
||||
powerApplyAct.setId(UUID.randomUUID().toString().replaceAll("-",""));
|
||||
powerApplyAct.setDataId(dataId);
|
||||
powerApplyAct.setTaskId(taskId);
|
||||
powerApplyAct.setPrcId(prcId);
|
||||
powerApplyAct.setDelFlag(0);
|
||||
powerApplyAct.setCreateDate(new Date());
|
||||
}
|
||||
powerApplyActDao.batchInsert(powerApplyActs);
|
||||
}
|
||||
|
||||
+44
-25
@@ -3,7 +3,7 @@ package com.adc.da.wkflow.business_activiti.task;
|
||||
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.eo.PowerApplyAct;
|
||||
import com.adc.da.report.vo.PowerApplyActPageVO;
|
||||
import com.adc.da.sys.service.iservice.IUserEoService;
|
||||
import com.adc.da.sys.vo.UserVO;
|
||||
import com.adc.da.util.exception.AdcDaBaseException;
|
||||
@@ -30,10 +30,8 @@ import com.adc.da.wkflow.util.activiti.ActivitiTools;
|
||||
import com.adc.da.wkflow.util.date.DateTools;
|
||||
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.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -132,6 +130,10 @@ public class TodoTaskController {
|
||||
NativeTaskQuery nativeTaskQuery = taskTodoService.createSql(taskCommonQuery);
|
||||
List<Task> list = nativeTaskQuery.list();
|
||||
List<Task> listPage = this.startPage(list, taskCommonQuery.getCurrent(), taskCommonQuery.getSize());
|
||||
if (list.size() == 0){
|
||||
page.setCount(0L);
|
||||
return Result.success(page);
|
||||
}
|
||||
List<Map<String, Object>> listEnd = ActivitiTools.turnTasks(listPage);
|
||||
for (Map<String, Object> map : listEnd) {
|
||||
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(map.get("processDefinitionId") + "").singleResult();
|
||||
@@ -360,24 +362,26 @@ public class TodoTaskController {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param taskId
|
||||
* @param prcId
|
||||
* @param prcType
|
||||
*/
|
||||
@ApiOperation(value = "详情")
|
||||
@GetMapping("/queryDetail")
|
||||
public ResponseMessage queryDetail(@RequestParam("taskId") String taskId,@RequestParam("prcType")String prcType) {
|
||||
BusProcessNew busProcessNew = iBusProcessNewService.selectEOByTaskId(taskId);
|
||||
if (busProcessNew == null) {
|
||||
public ResponseMessage queryDetail(@RequestParam("prcId") String prcId,@RequestParam("prcType")String prcType) {
|
||||
List<BusProcessNew> busProcessNews = iBusProcessNewService.selectEOByTaskId(prcId);
|
||||
if (busProcessNews.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
BusProcessNew busProcessNew = busProcessNews.get(0);
|
||||
// 查找详细业务数据
|
||||
BusProcessNewVO busProcessNewVO = this.queryDetailDate(busProcessNew, prcType);
|
||||
//审批数据
|
||||
BusProcessApprove busProcessApprove = busProcessApproveMapper.selectEoByPrcIdAndTask(busProcessNewVO.getPId(),
|
||||
busProcessNewVO.getTaskId());
|
||||
String approveJson = JSON.toJSONString(busProcessApprove);
|
||||
busProcessNewVO.setApproveJson(approveJson);
|
||||
return Result.success(busProcessApprove);
|
||||
List<BusProcessApprove> busProcessApproves =
|
||||
busProcessApproveMapper.selectEoByPrcIdAndTask(busProcessNewVO.getPId());
|
||||
BusProcessApprove busProcessApprove = busProcessApproves.get(0);
|
||||
String approveJson = busProcessApprove.getFromValsJson();
|
||||
busProcessNewVO.setSubmitJson(approveJson);
|
||||
return Result.success(busProcessNewVO);
|
||||
}
|
||||
|
||||
private BusProcessNewVO queryDetailDate(BusProcessNew busProcessNew, String prcType) {
|
||||
@@ -385,16 +389,12 @@ public class TodoTaskController {
|
||||
BeanUtils.copyProperties(busProcessNew,busProcessNewVO);
|
||||
String dataId = busProcessNew.getDataId();
|
||||
if ("1".equals(prcType)){
|
||||
LambdaQueryWrapper<PowerApplyAct> powerWrapper = new LambdaQueryWrapper<>();
|
||||
powerWrapper.eq(PowerApplyAct::getDataId,dataId);
|
||||
List<PowerApplyAct> powerApplyActs = powerApplyActDao.selectList(powerWrapper);
|
||||
List<PowerApplyActPageVO> powerApplyActs = powerApplyActDao.selectListBydataId(dataId);
|
||||
String string = JSONArray.toJSONString(powerApplyActs);
|
||||
//去对应的 数据表查数据
|
||||
busProcessNewVO.setDateMesg(string);
|
||||
busProcessNewVO.setDataJson(string);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return busProcessNewVO;
|
||||
}
|
||||
|
||||
@@ -691,7 +691,17 @@ public class TodoTaskController {
|
||||
busProcessName.setTaskId(task.getTaskId());
|
||||
}
|
||||
});
|
||||
|
||||
//获取 审批结果
|
||||
// if (StringUtils.isNotEmpty(busProcessName.getTaskId())) {
|
||||
// List<BusProcessApprove> busProcessApproves = iBusProcessApproveService.selectEoByPrcIdAndTask(busProcessName.getPrcId());
|
||||
// if(busProcessApproves.size() != 0){
|
||||
// BusProcessApprove busProcessApprove = busProcessApproves.get(0);
|
||||
// JSONObject dataJson = JSONObject.parseObject(busProcessApprove.getFromValsJson());
|
||||
// if (StringUtils.isNotEmpty(dataJson.getString("flag"))) {
|
||||
// busProcessName.setStatus(dataJson.getString("flag"));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
Date createTime = null;
|
||||
Date endTime = null;
|
||||
try {
|
||||
@@ -850,15 +860,14 @@ public class TodoTaskController {
|
||||
userTask.forEach(task->{
|
||||
if (StringUtils.equals(task.getAssignee(),userId)) {
|
||||
busProcessName.setTaskId(task.getTaskId());
|
||||
busProcessName.setTaskDefinitionKey(task.getActivityId());
|
||||
}
|
||||
});
|
||||
|
||||
//获取 审批结果
|
||||
// if (StringUtils.isNotEmpty(busProcessName.getTaskId())) {
|
||||
// BusProcessApprove busProcessApprove =
|
||||
// iBusProcessApproveService.selectEoByPrcIdAndTask(busProcessName.getPrcId(),
|
||||
// busProcessName.getTaskId());
|
||||
// if(busProcessApprove != null){
|
||||
// List<BusProcessApprove> busProcessApproves = iBusProcessApproveService.selectEoByPrcIdAndTask(busProcessName.getPrcId());
|
||||
// if(busProcessApproves.size() != 0){
|
||||
// BusProcessApprove busProcessApprove = busProcessApproves.get(0);
|
||||
// JSONObject dataJson = JSONObject.parseObject(busProcessApprove.getFromValsJson());
|
||||
// if (StringUtils.isNotEmpty(dataJson.getString("flag"))) {
|
||||
// busProcessName.setStatus(dataJson.getString("flag"));
|
||||
@@ -1015,7 +1024,17 @@ public class TodoTaskController {
|
||||
} else {
|
||||
busProcessName.setTaskBackAssignee("");
|
||||
}
|
||||
|
||||
//获取 审批结果
|
||||
// if (StringUtils.isNotEmpty(busProcessName.getPrcId())) {
|
||||
// List<BusProcessApprove> busProcessApproves = iBusProcessApproveService.selectEoByPrcIdAndTask(busProcessName.getPrcId());
|
||||
// if(busProcessApproves.size() != 0){
|
||||
// BusProcessApprove busProcessApprove = busProcessApproves.get(0);
|
||||
// JSONObject dataJson = JSONObject.parseObject(busProcessApprove.getFromValsJson());
|
||||
// if (StringUtils.isNotEmpty(dataJson.getString("flag"))) {
|
||||
// busProcessName.setStatus(dataJson.getString("flag"));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
Date createTime = null;
|
||||
Date endTime = null;
|
||||
try {
|
||||
|
||||
+5
@@ -11,6 +11,7 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -53,4 +54,8 @@ public class BusProcessNew implements Serializable {
|
||||
@TableField("P_ID")
|
||||
private String pId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("CREATE_DATE")
|
||||
private Date createDate =new Date(System.currentTimeMillis());
|
||||
|
||||
}
|
||||
|
||||
+3
-1
@@ -4,6 +4,8 @@ import com.adc.da.wkflow.business_main.entity.BusProcessApprove;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
@@ -15,6 +17,6 @@ import org.apache.ibatis.annotations.Param;
|
||||
public interface BusProcessApproveMapper extends BaseMapper<BusProcessApprove> {
|
||||
|
||||
|
||||
BusProcessApprove selectEoByPrcIdAndTask(@Param("prcId") String prcId,@Param("taskId") String taskId);
|
||||
List<BusProcessApprove> selectEoByPrcIdAndTask(@Param("prcId") String prcId);
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ public interface BusProcessNewMapper extends BaseMapper<BusProcessNew> {
|
||||
|
||||
List<BusProcessNew> findNoExecuteBusProcessNewForEnd(@Param("taskIds")List<String> taskIds);
|
||||
|
||||
BusProcessNew selectEOByTaskId(@Param("taskId") String taskId);
|
||||
List<BusProcessNew> selectEOByTaskId(@Param("prcId") String prcId);
|
||||
// String queryTaskName(@Param("id")String id);
|
||||
|
||||
}
|
||||
|
||||
+2
-1
@@ -3,12 +3,13 @@ package com.adc.da.wkflow.business_main.service;
|
||||
import com.adc.da.wkflow.business_main.entity.BusProcessApprove;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* 审批历史业务类
|
||||
* 用于审批历史的查询的存取
|
||||
*/
|
||||
public interface IBusProcessApproveService extends IService<BusProcessApprove> {
|
||||
|
||||
BusProcessApprove selectEoByPrcIdAndTask(String prcId, String taskId);
|
||||
List<BusProcessApprove> selectEoByPrcIdAndTask(String prcId);
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,5 +29,5 @@ public interface IBusProcessNewService extends IService<BusProcessNew> {
|
||||
|
||||
List<BusProcessNew> findNoExecuteBusProcessNewForEnd(List<String> taskIdList);
|
||||
|
||||
BusProcessNew selectEOByTaskId(String taskId);
|
||||
List<BusProcessNew> selectEOByTaskId(String prcId);
|
||||
}
|
||||
|
||||
+4
-2
@@ -6,6 +6,8 @@ import com.adc.da.wkflow.business_main.service.IBusProcessApproveService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
@@ -20,8 +22,8 @@ public class BusProcessApproveServiceImpl extends ServiceImpl<BusProcessApproveM
|
||||
|
||||
|
||||
@Override
|
||||
public BusProcessApprove selectEoByPrcIdAndTask(String prcId, String taskId) {
|
||||
public List<BusProcessApprove> selectEoByPrcIdAndTask(String prcId) {
|
||||
|
||||
return baseMapper.selectEoByPrcIdAndTask(prcId,taskId);
|
||||
return baseMapper.selectEoByPrcIdAndTask(prcId);
|
||||
}
|
||||
}
|
||||
|
||||
+15
-2
@@ -5,6 +5,7 @@ import com.adc.da.wkflow.business_main.mapper.BusProcessNameMapper;
|
||||
import com.adc.da.wkflow.business_main.service.IBusProcessNameService;
|
||||
import com.adc.da.wkflow.enums.FlowTypeEnum;
|
||||
import com.adc.da.wkflow.util.ImpulseSenderUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.activiti.engine.ActivitiException;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -50,8 +51,20 @@ public class BusProcessNameServiceImpl extends ServiceImpl<BusProcessNameMapper,
|
||||
}
|
||||
result.put("id",prcNum);
|
||||
String numberByFlowType = ImpulseSenderUtils.getNumberByFlowType(prcType);
|
||||
prcNum = prcNum + currentDay + numberByFlowType;
|
||||
prcName = prcName + currentDay + numberByFlowType;
|
||||
//防止prcNum重复
|
||||
QueryWrapper<BusProcessName> queryByPrcNum = new QueryWrapper<>();
|
||||
queryByPrcNum.lambda().like(BusProcessName::getPrcNum,prcNum + currentDay);
|
||||
queryByPrcNum.orderByDesc("CREAT_TIME");
|
||||
List<BusProcessName> busNum = this.list(queryByPrcNum);
|
||||
if(busNum.size()>0){
|
||||
String currenBusNum = busNum.get(0).getPrcNum();
|
||||
String substring = currenBusNum.substring(currenBusNum.length()-4, currenBusNum.length());
|
||||
Long num = Long.parseLong(substring) + 1;
|
||||
prcNum = prcNum + currentDay + String.format("%04d", num);
|
||||
}else {
|
||||
prcNum = prcNum + currentDay + numberByFlowType;
|
||||
}
|
||||
|
||||
result.put("prcName",prcName);
|
||||
result.put("prcNum",prcNum);
|
||||
return result;
|
||||
|
||||
+2
-2
@@ -70,7 +70,7 @@ public class BusProcessNewServiceImpl extends ServiceImpl<BusProcessNewMapper, B
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusProcessNew selectEOByTaskId(String taskId) {
|
||||
return baseMapper.selectEOByTaskId(taskId);
|
||||
public List<BusProcessNew> selectEOByTaskId(String prcId) {
|
||||
return baseMapper.selectEOByTaskId(prcId);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -22,10 +22,10 @@ public class BusProcessNewVO {
|
||||
private String dataId;
|
||||
|
||||
@ApiModelProperty(value = "具体的业务数据")
|
||||
private String dateMesg;
|
||||
private String dataJson;
|
||||
|
||||
@ApiModelProperty(value = "具体的审批数据")
|
||||
private String approveJson;
|
||||
private String submitJson;
|
||||
|
||||
@ApiModelProperty(value = "节点信息")
|
||||
private String taskInfo;
|
||||
|
||||
@@ -50,7 +50,10 @@ public class aid1 implements TaskListener {
|
||||
List<BusProcessApprove> list = approveService.list(approveWrapper);
|
||||
String fromValsJson = list.get(0).getFromValsJson();
|
||||
JSONObject object = JSONObject.parseObject(fromValsJson);
|
||||
//审批人
|
||||
delegateTask.setVariable("oneApprove",object.getString("oneApprove"));
|
||||
delegateTask.setVariable("twoApprove",object.getString("twoApprove"));
|
||||
//发起人
|
||||
delegateTask.setVariable("userId",object.getString("userId"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,8 +48,8 @@ public class aid2 implements TaskListener {
|
||||
//审批结果
|
||||
LambdaQueryWrapper<BusProcessApprove> approveWrapper = new LambdaQueryWrapper<>();
|
||||
approveWrapper.eq(BusProcessApprove::getTaskId, delegateTask.getId());
|
||||
BusProcessApprove one = approveService.getOne(approveWrapper);
|
||||
String fromValsJson = one.getFromValsJson();
|
||||
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:退回
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.adc.da.wkflow.listener.powerApply;
|
||||
|
||||
import com.adc.da.login.util.UserUtils;
|
||||
import com.adc.da.report.dao.mysql.PowerApplyActDao;
|
||||
import com.adc.da.report.dao.mysql.PowerApplyDao;
|
||||
import com.adc.da.report.eo.PowerApplyAct;
|
||||
import com.adc.da.wkflow.business_main.entity.BusProcessApprove;
|
||||
import com.adc.da.wkflow.business_main.entity.BusProcessNew;
|
||||
@@ -24,6 +25,7 @@ public class aid3 implements TaskListener {
|
||||
@Override
|
||||
public void notify(DelegateTask delegateTask) {
|
||||
PowerApplyActDao powerApplyActDao = SpringContextUtil.getBean(PowerApplyActDao.class);
|
||||
PowerApplyDao powerApplyDao = SpringContextUtil.getBean(PowerApplyDao.class);
|
||||
IBusProcessNewService busBean = SpringContextUtil.getBean(IBusProcessNewService.class);
|
||||
IBusProcessApproveService approveService = SpringContextUtil.getBean(IBusProcessApproveService.class);
|
||||
//查询task任务
|
||||
@@ -48,11 +50,15 @@ public class aid3 implements TaskListener {
|
||||
//审批结果
|
||||
LambdaQueryWrapper<BusProcessApprove> approveWrapper = new LambdaQueryWrapper<>();
|
||||
approveWrapper.eq(BusProcessApprove::getTaskId, delegateTask.getId());
|
||||
BusProcessApprove one = approveService.getOne(approveWrapper);
|
||||
String fromValsJson = one.getFromValsJson();
|
||||
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)){
|
||||
powerApplyDao.saveBatch(powerApplyActs);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,8 +47,8 @@ public class aid4 implements TaskListener {
|
||||
//审批结果
|
||||
LambdaQueryWrapper<BusProcessApprove> approveWrapper = new LambdaQueryWrapper<>();
|
||||
approveWrapper.eq(BusProcessApprove::getTaskId, delegateTask.getId());
|
||||
BusProcessApprove one = approveService.getOne(approveWrapper);
|
||||
String fromValsJson = one.getFromValsJson();
|
||||
List<BusProcessApprove> list = approveService.list(approveWrapper);
|
||||
String fromValsJson = list.get(0).getFromValsJson();
|
||||
JSONObject object = JSONObject.parseObject(fromValsJson);
|
||||
|
||||
delegateTask.setVariable("oneApprove",object.getString("oneApprove"));
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<mapper namespace="com.adc.da.wkflow.business_main.mapper.BusProcessApproveMapper">
|
||||
|
||||
<select id="selectEoByPrcIdAndTask" resultType="com.adc.da.wkflow.business_main.entity.BusProcessApprove">
|
||||
select * from bus_process_approve where prc_id = #{prcId} and task_id = #{taskId}
|
||||
select * from bus_process_approve where prc_id = #{prcId}
|
||||
Order by CREATE_DATE desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
<select id="selectEOByTaskId" resultType="com.adc.da.wkflow.business_main.entity.BusProcessNew">
|
||||
select BUS_PROCESS_NEW.* from BUS_PROCESS_NEW
|
||||
INNER JOIN ACT_HI_TASKINST on BUS_PROCESS_NEW.TASK_ID = ACT_HI_TASKINST.ID_
|
||||
where BUS_PROCESS_NEW.TASK_ID = #{taskId}
|
||||
where BUS_PROCESS_NEW.P_ID = #{prcId}
|
||||
order by CREATE_DATE desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user