Merge remote-tracking branch 'origin/lixuetao' into lixuetao

This commit is contained in:
xuetao.li
2023-05-16 17:41:48 +08:00
19 changed files with 58 additions and 32 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;
}
@@ -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);
}
}
//设置标签列表
@@ -38,6 +38,11 @@ public class ReportCommentVo {
*/
private String userName;
/**
* 用户名
*/
private String account;
/**
* 评论
*/
@@ -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">
@@ -9,6 +9,7 @@
ruc.id AS id,
ruc.user_id AS userId,
u.USNAME AS userName,
u.ACCOUNT AS account,
ruc.comment AS comment,
ruc.create_time AS createTime
FROM
@@ -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">
@@ -157,21 +157,12 @@ public class MenuEOController extends BaseController<MenuEO> {
if (roleId != null && !"".equals(roleId)) {
roleMenuEOPage.setRoleId(roleId);
RoleEO roleEO = roleEOService.selectByPrimaryKey(roleId);
if ("管理员".equals(roleEO.getName())) {
menuVOs.forEach(menuVO -> {
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()) && !"1".equals(menuVO.getIsButton())){
menuVO.setBelong(IsBelongEnum.BELONG.getValue());
break;
}
List<RoleMenuEO> roleMenuEOList =roleMenuEOService.queryByList(roleMenuEOPage);
for (MenuVO menuVO : menuVOs) {
for (RoleMenuEO roleMenuEO : roleMenuEOList){
if (StringUtils.equals(menuVO.getId(),roleMenuEO.getMenuId())){
menuVO.setBelong(IsBelongEnum.BELONG.getValue());
break;
}
}
}
@@ -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
@@ -73,6 +72,7 @@ public class OrgEOService extends ServiceImpl<OrgEODao, OrgEO> implements IOrgEo
orgEO.setId(orgEO.getDepartmentCode());
baseMapper.insert(orgEO);
}else{
orgEO.setId(orgEO.getOrgCode());
baseMapper.updateById(orgEO);
}
return Result.success();
@@ -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 -->
@@ -138,7 +138,7 @@ public class TaskController {
String endTime = en.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
map.put("endTime",endTime);
LocalDateTime startDateTime =
LocalDateTime.ofInstant(busProcessEntrust1.getCreateTime().toInstant(),
LocalDateTime.ofInstant(busProcessEntrust.getCreateTime().toInstant(),
ZoneId.systemDefault());
LocalDateTime endDateTime = LocalDateTime.ofInstant(busProcessEntrust1.getCreateTime().toInstant(), ZoneId.systemDefault());
long days = Duration.between(startDateTime.toLocalDate().atStartOfDay(), endDateTime.toLocalDate().atStartOfDay()).toDays() + 1;
@@ -155,12 +155,24 @@ public class TaskController {
String endTimestr = en.format(DateTimeFormatter.ofPattern("yyyy-MM-dd " +
"HH:mm:ss"));
map.put("endTime",endTimestr);
LocalDateTime startDateTime = LocalDateTime.ofInstant(createTime1.toInstant()
LocalDateTime startDateTime = LocalDateTime.ofInstant(busProcessEntrust.getCreateTime().toInstant()
, ZoneId.systemDefault());
LocalDateTime endDateTime = LocalDateTime.ofInstant(endTime.toInstant(), ZoneId.systemDefault());
long days = Duration.between(startDateTime.toLocalDate().atStartOfDay(), endDateTime.toLocalDate().atStartOfDay()).toDays() + 1;
map.put("approvalTime",days + "天");
}
}else {
Object endTime = historicTaskInstance.get("endTime");
map.put("endTime",historicTaskInstance.get("endTime"));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date endTimed = sdf.parse((String)endTime);
LocalDateTime en =
LocalDateTime.ofInstant(endTimed.toInstant(), ZoneId.systemDefault());
LocalDateTime startDateTime = LocalDateTime.ofInstant(busProcessEntrust.getCreateTime().toInstant()
, ZoneId.systemDefault());
LocalDateTime endDateTime = LocalDateTime.ofInstant(endTimed.toInstant(), ZoneId.systemDefault());
long days = Duration.between(startDateTime.toLocalDate().atStartOfDay(), endDateTime.toLocalDate().atStartOfDay()).toDays() + 1;
map.put("approvalTime",days + "天");
}
QueryWrapper<BusProcessApprove> datasQueryWrapper = new QueryWrapper<>();
datasQueryWrapper.lambda().eq(BusProcessApprove::getTaskId,historicTaskInstance.get("id"));