Merge branch 'lixuetao'

This commit is contained in:
bupengxiang
2023-05-16 16:20:23 +08:00
39 changed files with 153 additions and 35 deletions
@@ -51,4 +51,9 @@ public class PowerApplyConstants {
* 有预览和下载全部报告权限的levelId
*/
public static final Double SPECIAL_LEVEL_FOUL = 4.0;
/**
* 有预览和下载全部报告权限的Employee_TYPE_ID
*/
public static final Double EMPLOYEE_TYPE_ID_ONE = 1.0;
}
@@ -54,4 +54,6 @@ public interface PowerApplyActDao extends BaseMapper<PowerApplyAct> {
List<PowerApplyAct> selectActListBydataId(@Param("dataId")String dataId);
int batchDel(@Param("ids") List<String> ids);
boolean deleteByDataId(String dataId);
}
@@ -47,4 +47,7 @@ public interface TtReportManageActDao extends BaseMapper<TtReportManageAct> {
List<TtReportManageAct> selectByDataId(String dataId);
TtReportManageAct selectByPrcId(String prcId);
boolean deleteByDataId(String dataId);
}
@@ -458,11 +458,14 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
//设置权限
UserEO userEo = userEODao.selectById(UserUtils.getUserId());
String levelId = userEo.getLevelId() == null ? "0.8" : userEo.getLevelId();
String employeeTypeId = userEo.getEmployeeTypeId() == null ? "0.8" : userEo.getEmployeeTypeId();
//用户级别
double level = Double.parseDouble(levelId);
double employeeType = Double.parseDouble(employeeTypeId);
//总监拥有全部报告的预览和下载权力
if (level == SPECIAL_LEVEL_ONE || level == SPECIAL_LEVEL_TWO ||
level == SPECIAL_LEVEL_THREE || level == SPECIAL_LEVEL_FOUL) {
level == SPECIAL_LEVEL_THREE || level == SPECIAL_LEVEL_FOUL ||
employeeType == EMPLOYEE_TYPE_ID_ONE) {
list.getRecords().forEach(reportVo -> {
reportVo.setPower(PREVIEW_DOWNLOAD);
});
@@ -632,9 +635,15 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
//校验权限
//总监(levelId)
UserEO userEo = userEODao.selectById(userId);
Double levelId = Double.parseDouble(userEo.getLevelId() == null ? "1.0" : userEo.getLevelId());
if (levelId.equals(SPECIAL_LEVEL_ONE) || levelId.equals(SPECIAL_LEVEL_TWO) ||
levelId.equals(SPECIAL_LEVEL_THREE) || levelId.equals(SPECIAL_LEVEL_FOUL)) {
String levelId = userEo.getLevelId() == null ? "0.8" : userEo.getLevelId();
String employeeTypeId = userEo.getEmployeeTypeId() == null ? "0.8" : userEo.getEmployeeTypeId();
//用户级别
double level = Double.parseDouble(levelId);
double employeeType = Double.parseDouble(employeeTypeId);
//总监拥有全部报告的预览和下载权力
if (level == SPECIAL_LEVEL_ONE || level == SPECIAL_LEVEL_TWO ||
level == SPECIAL_LEVEL_THREE || level == SPECIAL_LEVEL_FOUL ||
employeeType == EMPLOYEE_TYPE_ID_ONE) {
return true;
}
//本人
@@ -680,11 +689,13 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
ReportDetailVo reportDetailVo = reportDao.reportDetail(reportId);
//设置部门名称
String department = reportDetailVo.getDepartment();
String[] idArray = department.split(",");
List<OrgEO> orgEOList = orgEOService.query().in("ID", idArray).list();
if (CollectionUtils.isNotEmpty(orgEOList)) {
String departmentName = orgEOList.stream().map(OrgEO::getOrgName).collect(Collectors.joining(","));
reportDetailVo.setDepartmentName(departmentName);
if (StrUtil.isNotBlank(department)) {
String[] idArray = department.split(",");
List<OrgEO> orgEOList = orgEOService.query().in("ID", idArray).list();
if (CollectionUtils.isNotEmpty(orgEOList)) {
String departmentName = orgEOList.stream().map(OrgEO::getOrgName).collect(Collectors.joining(","));
reportDetailVo.setDepartmentName(departmentName);
}
}
//设置标签列表
@@ -67,6 +67,10 @@
#{id}
</foreach>
</update>
<update id="deleteByDataId">
UPDATE power_apply_act set del_flag = 1
where data_id = #{dataId}
</update>
<!-- 根据查询VO进行分页查询 -->
@@ -228,7 +228,7 @@
ORDER BY updateDate desc
</select>
<select id="isAct" resultType="java.lang.String">
SELECT rep.name FROM
SELECT pro.prc_name FROM
bus_process_name pro
WHERE pro.CREAT_USER = #{Vo.usid}
and pro.SUBMIT_STATUS = 1
@@ -236,7 +236,7 @@
<foreach collection="Vo.ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
GROUP BY rep.id;
GROUP BY pro.id;
</select>
<select id="selectByidAndName" resultType="java.lang.Long">
@@ -90,6 +90,10 @@
</if>
</where>
</sql>
<update id="deleteByDataId">
UPDATE <include refid="TableName"/> set del_flag = 1
where data_id = #{dataId}
</update>
<!-- 根据查询VO进行分页查询 -->
<select id="selectPage" resultMap="BaseResultMap">
@@ -67,6 +67,10 @@
#{id}
</foreach>
</update>
<update id="deleteByDataId">
UPDATE power_apply_act set del_flag = 1
where data_id = #{dataId}
</update>
<!-- 根据查询VO进行分页查询 -->
@@ -228,7 +228,7 @@
ORDER BY updateDate desc
</select>
<select id="isAct" resultType="java.lang.String">
SELECT rep.name FROM
SELECT pro.prc_name FROM
bus_process_name pro
WHERE pro.CREAT_USER = #{Vo.usid}
and pro.SUBMIT_STATUS = 1
@@ -236,7 +236,7 @@
<foreach collection="Vo.ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
GROUP BY rep.id;
GROUP BY pro.id;
</select>
<select id="selectByidAndName" resultType="java.lang.Long">
@@ -286,7 +286,8 @@
rm.fileId AS fileId,
f.file_name as fileName,
rm.confidentialLevel AS confidentialLevel,
rm.privacyLevel AS privacyLevel
rm.privacyLevel AS privacyLevel,
rm.secrecy_last AS secrecyLast
FROM `tt_report_manage` AS rm
LEFT JOIN ts_user AS u ON u.USID = rm.createUserId
LEFT JOIN ts_org as org on org.id = rm.department
@@ -90,6 +90,10 @@
</if>
</where>
</sql>
<update id="deleteByDataId">
UPDATE <include refid="TableName"/> set del_flag = 1
where data_id = #{dataId}
</update>
<!-- 根据查询VO进行分页查询 -->
<select id="selectPage" resultMap="BaseResultMap">
@@ -160,20 +160,21 @@ public class MenuEOController extends BaseController<MenuEO> {
RoleEO roleEO = roleEOService.selectByPrimaryKey(roleId);
if ("管理员".equals(roleEO.getName())) {
menuVOs.forEach(menuVO -> {
menuVO.setBelong(IsBelongEnum.BELONG.getValue());
if (!"1".equals(menuVO.getIsButton())) {
menuVO.setBelong(IsBelongEnum.BELONG.getValue());
}
});
}else{
List<RoleMenuEO> roleMenuEOList =roleMenuEOService.queryByList(roleMenuEOPage);
for (MenuVO menuVO : menuVOs) {
for (RoleMenuEO roleMenuEO : roleMenuEOList){
if (StringUtils.equals(menuVO.getId(),roleMenuEO.getMenuId())){
if (StringUtils.equals(menuVO.getId(),roleMenuEO.getMenuId()) && !"1".equals(menuVO.getIsButton())){
menuVO.setBelong(IsBelongEnum.BELONG.getValue());
break;
}
}
}
}
}
//List<MenuVO> levelMenus = menuEOService.changeMenu(menuVOs);
@@ -112,10 +112,7 @@ public class UserEOController extends BaseController<UserEO> {
if (userEOService.getUserByLoginName(eo.getAccount(), eo.getUsid()) != null) {
return Result.error("用户名已存在!");
}
userEOService.save(eo);
return Result.success();
}
@@ -79,6 +79,19 @@ public class MenuEO extends TreeEntity implements Serializable {
*/
private String isUrl;
/**
* 1代表是按钮
*/
private String isButton;
public String getIsButton() {
return isButton;
}
public void setIsButton(String isButton) {
this.isButton = isButton;
}
public String getIsUrl() {
return isUrl;
}
@@ -17,7 +17,6 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.UUID;
@Service("orgEOService")
@Transactional
@@ -71,6 +70,7 @@ public class OrgEOService extends ServiceImpl<OrgEODao, OrgEO> implements IOrgEo
orgEO.setId(orgEO.getOrgCode());
baseMapper.insert(orgEO);
}else{
orgEO.setId(orgEO.getOrgCode());
baseMapper.updateById(orgEO);
}
return Result.success();
@@ -76,7 +76,6 @@ public class UserEOServiceImpl implements IUserEoService {
@Override
@Transactional(rollbackFor = Exception.class)
public void save(UserEO eo) {
// TODO 组织机构和角色
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (StringUtils.isEmpty(eo.getUsid())) {
eo.setDelFlag(0);
@@ -116,14 +115,14 @@ public class UserEOServiceImpl implements IUserEoService {
userRoleEODao.insert(userRoleEO);
});
// // 插入组织关联表 暂时用不上,页面不维护组织机构
// eo.getOrgList().forEach(c -> {
// UserOrgEO userOrgEO = new UserOrgEO();
// userOrgEO.setUserId(eo.getUsid());
// userOrgEO.setOrgId(c.getOrgCode());
// userOrgEODao.insert(userOrgEO);
// });
String[] split = eo.getOrgId().split(",");
// 插入组织关联表 暂时用不上,页面不维护组织机构
for (String s : split) {
UserOrgEO userOrgEO = new UserOrgEO();
userOrgEO.setUserId(eo.getUsid());
userOrgEO.setOrgId(s);
userOrgEODao.insert(userOrgEO);
}
}
/**
@@ -65,6 +65,20 @@ public class MenuVO extends TreeVO<MenuVO> {
*/
private String isUrl;
/**
*
* @return
*/
private String isButton;
public String getIsButton() {
return isButton;
}
public void setIsButton(String isButton) {
this.isButton = isButton;
}
public String getIsUrl() {
return isUrl;
}
@@ -18,11 +18,12 @@
<result column="remarks" property="remarks"/>
<result column="sort" property="sort"/>
<result column="ext_info" property="extInfo" />
<result column="is_button" property="isButton" />
</resultMap>
<!-- TS_MENU table all fields -->
<sql id="Base_Column_List">
id, del_flag, name, parent_id, parent_ids, href, icon,iconHref,iconClick,iconClickHref, is_show, permission, remarks, sort, ext_info,is_url
id, del_flag, name, parent_id, parent_ids, href, icon,iconHref,iconClick,iconClickHref, is_show, permission, remarks, sort, ext_info,is_url,is_button
</sql>
<!-- 用于按名称查询记录时的sql,添加前缀TS_MENU -->
@@ -18,11 +18,12 @@
<result column="remarks" property="remarks"/>
<result column="sort" property="sort"/>
<result column="ext_info" property="extInfo" />
<result column="is_button" property="isButton" />
</resultMap>
<!-- TS_MENU table all fields -->
<sql id="Base_Column_List">
id, del_flag, name, parent_id, parent_ids, href, icon,iconHref,iconClick,iconClickHref, is_show, permission, remarks, sort, ext_info,is_url
id, del_flag, name, parent_id, parent_ids, href, icon,iconHref,iconClick,iconClickHref, is_show, permission, remarks, sort, ext_info,is_url,is_button
</sql>
<!-- 用于按名称查询记录时的sql,添加前缀TS_MENU -->
@@ -120,6 +120,7 @@ public class TaskController {
if(userById.getOrgEOList().size()>0){
map.put("orgName",userById.getOrgEOList().get(0).getOrgName());
}
map.put("name",historicTaskInstance.get("name"));
map.put("assignee", enUserName+"(" + consigner + " 委托)");
map.put("assigneeId", busProcessEntrust.getEnUserId());
map.put("prcType",one.getPrcType());
@@ -894,16 +894,20 @@ public class TodoTaskController {
@ApiOperation(value = "删除草稿", notes = "删除草稿")
@GetMapping("/deleteDraft")
public Wrapper<String> deleteDraft(String id) {
public Wrapper<String> deleteDraft(String id,String prcType,String dataId) {
//iBusProcessNameService.removeById(id);
//2022-10-11修改为逻辑删除 如果物理删除,会影响发号器计算的编号数量。导致编号重复。
BusProcessName busProcessName = new BusProcessName();
busProcessName.setId(id);
busProcessName.setSubmitStatus(SubmitStatusEnum.DELETE.getValue());
this.iBusProcessNameService.updateById(busProcessName);
//删除业务数据
iBusProcessNewService.deleteData(prcType,dataId);
return WrapMapper.ok("删除成功");
}
@ApiOperation(value = "已发流程", notes = "已发流程")
@PostMapping("/issuedProcess")
public Page IssuedProcess(@RequestBody TaskCommonQuery taskCommonQuery) {
@@ -31,4 +31,10 @@ public interface IBusProcessNewService extends IService<BusProcessNew> {
List<BusProcessNew> selectEOByTaskId(String prcId);
BusProcessNew selectEOByDataId(String prcId);
/**
* 删除业务数据
* @param prcType
* @param dataId
*/
void deleteData(String prcType, String dataId);
}
@@ -1,13 +1,18 @@
package com.adc.da.wkflow.business_main.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.adc.da.report.dao.mysql.PowerApplyActDao;
import com.adc.da.report.dao.mysql.TtReportManageActDao;
import com.adc.da.util.exception.AdcDaBaseException;
import com.adc.da.wkflow.business_main.entity.BusProcessNew;
import com.adc.da.wkflow.business_main.mapper.BusProcessNewMapper;
import com.adc.da.wkflow.business_main.service.IBusProcessNewService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.activiti.engine.TaskService;
import org.activiti.engine.task.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Comparator;
@@ -26,8 +31,14 @@ import java.util.stream.Collectors;
@Service
public class BusProcessNewServiceImpl extends ServiceImpl<BusProcessNewMapper, BusProcessNew> implements IBusProcessNewService {
@Autowired
private TaskService taskService;
@Autowired
private PowerApplyActDao powerApplyActDao;
@Autowired
private TtReportManageActDao ttReportManageActDao;
/*
* @Author yuzhong
* @Description
@@ -78,4 +89,36 @@ public class BusProcessNewServiceImpl extends ServiceImpl<BusProcessNewMapper, B
public BusProcessNew selectEOByDataId(String dataId) {
return baseMapper.selectEOByDataId(dataId);
}
/**
* 删除业务数据
* @param prcType
* @param dataId
*/
@Override
@Transactional
public void deleteData(String prcType, String dataId) {
if ("".equals(prcType)){
//预览
powerApplyActDao.deleteByDataId(dataId);
}else if ("1".equals(prcType)){
//预览
powerApplyActDao.deleteByDataId(dataId);
} else if ("2".equals(prcType)){
//预览 + 下载
powerApplyActDao.deleteByDataId(dataId);
}else if ("3".equals(prcType)){
//下载
powerApplyActDao.deleteByDataId(dataId);
} else if("4".equals(prcType)){
//上传
ttReportManageActDao.deleteByDataId(dataId);
}else if("5".equals(prcType)){
//编辑
ttReportManageActDao.deleteByDataId(dataId);
}else {
throw new AdcDaBaseException("没有流程类型"+prcType);
}
}
}