宁夏流程及数据权限修改
This commit is contained in:
parent
2a284b8d52
commit
95b87226fa
|
|
@ -46,9 +46,10 @@ public class BackReceiveController extends BaseController {
|
|||
List<BackApplyInfo> list = backReceiveService.getbackReceiveList(record);
|
||||
return success(list);
|
||||
} else {
|
||||
startPage();
|
||||
List<BackApplyInfo> list = backReceiveService.getbackReceiveList(record);
|
||||
return success(getDataTable(list));
|
||||
Integer pageIndex = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1);
|
||||
Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex,pageSize, list));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ public class TmTask implements Serializable {
|
|||
private Long taskId;
|
||||
private Long parentId;
|
||||
private Integer outNum;
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 任务类型(定义数据字典)
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.bonus.sgzb.common.core.enums.TaskTypeEnum;
|
|||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.utils.GlobalConstants;
|
||||
import com.bonus.sgzb.common.core.utils.StringHelper;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -22,6 +23,7 @@ import java.text.SimpleDateFormat;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author hay
|
||||
|
|
@ -41,7 +43,23 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
|
||||
@Override
|
||||
public List<BackApplyInfo> getbackReceiveList(BackApplyInfo record) {
|
||||
return backReceiveMapper.getbackReceiveList(record);
|
||||
List<BackApplyInfo> backApplyInfoList = backReceiveMapper.getbackReceiveList(record);
|
||||
if (SecurityUtils.getLoginUser().getRoles().contains("admin")){
|
||||
return backApplyInfoList;
|
||||
}
|
||||
List<BackApplyInfo> backApplyInfos = new ArrayList<>();
|
||||
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||
if (backApplyInfoList.size() > 0) {
|
||||
for (BackApplyInfo backApplyInfo : backApplyInfoList) {
|
||||
if (Objects.equals(deptId, 101L) && backApplyInfo.getCompanyId().contains("101")) {
|
||||
backApplyInfos.add(backApplyInfo);
|
||||
}
|
||||
if (Objects.equals(deptId, 102L) && backApplyInfo.getCompanyId().contains("102")) {
|
||||
backApplyInfos.add(backApplyInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
return backApplyInfos;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -69,6 +69,10 @@ public class TmTaskServiceImpl implements TmTaskService {
|
|||
private BmFlowRecordService bmFlowRecordService;
|
||||
|
||||
private final static String STRING_ADMIN = "admin";
|
||||
private final static String STRING_SGB = "sgb";
|
||||
private final static String STRING_AJB = "sgb";
|
||||
private final static String STRING_JJFGS = "jjfgs";
|
||||
private final static String STRING_TSFGS = "tsfgs";
|
||||
|
||||
/**
|
||||
* 领料任务审核状态
|
||||
|
|
@ -88,7 +92,13 @@ public class TmTaskServiceImpl implements TmTaskService {
|
|||
// 再审核领料任务信息表
|
||||
List<LeaseApplyInfo> leaseApplyInfoList = record.getLeaseApplyInfoList();
|
||||
if (CollUtil.isNotEmpty(leaseApplyInfoList)) {
|
||||
List<LeaseApplyInfo> applyInfoList = leaseApplyInfoList.stream().filter(t -> t.getCompanyId().equals(companyId.intValue())).collect(Collectors.toList());
|
||||
Integer companyId1 = leaseApplyInfoList.get(0).getCompanyId();
|
||||
List<LeaseApplyInfo> applyInfoList = new ArrayList<>();
|
||||
if (companyId1 != null && companyId1 == 101) {
|
||||
applyInfoList = leaseApplyInfoList.stream().filter(t -> t.getCompanyId().equals(101)).collect(Collectors.toList());
|
||||
} else if (companyId1 != null && companyId1 == 102) {
|
||||
applyInfoList = leaseApplyInfoList.stream().filter(t -> t.getCompanyId().equals(102)).collect(Collectors.toList());
|
||||
}
|
||||
if (CollUtil.isNotEmpty(applyInfoList)) {
|
||||
for (LeaseApplyInfo leaseApplyInfo : applyInfoList) {
|
||||
taskId = leaseApplyInfo.getTaskId();
|
||||
|
|
@ -128,7 +138,13 @@ public class TmTaskServiceImpl implements TmTaskService {
|
|||
// 再审核领料任务信息表
|
||||
List<LeaseApplyInfo> leaseApplyInfoList = record.getLeaseApplyInfoList();
|
||||
if (CollUtil.isNotEmpty(leaseApplyInfoList)) {
|
||||
List<LeaseApplyInfo> applyInfoList = leaseApplyInfoList.stream().filter(t -> t.getCompanyId().equals(companyId.intValue())).collect(Collectors.toList());
|
||||
Integer companyId1 = leaseApplyInfoList.get(0).getCompanyId();
|
||||
List<LeaseApplyInfo> applyInfoList = new ArrayList<>();
|
||||
if (companyId1 != null && companyId1 == 101) {
|
||||
applyInfoList = leaseApplyInfoList.stream().filter(t -> t.getCompanyId().equals(101)).collect(Collectors.toList());
|
||||
} else if (companyId1 != null && companyId1 == 102) {
|
||||
applyInfoList = leaseApplyInfoList.stream().filter(t -> t.getCompanyId().equals(102)).collect(Collectors.toList());
|
||||
}
|
||||
if (CollUtil.isNotEmpty(applyInfoList)) {
|
||||
for (LeaseApplyInfo leaseApplyInfo : applyInfoList) {
|
||||
taskId = leaseApplyInfo.getTaskId();
|
||||
|
|
@ -141,7 +157,7 @@ public class TmTaskServiceImpl implements TmTaskService {
|
|||
List<LeaseApplyInfo> leaseApplyInfo = tmTaskMapper.getLeaseApplyInfo(taskId);
|
||||
for (LeaseApplyInfo applyInfo : leaseApplyInfo) {
|
||||
if (applyInfo.getStatus() != null) {
|
||||
if ("5".equals(applyInfo.getStatus()) || "7".equals(applyInfo.getStatus())) {
|
||||
if ("5".equals(applyInfo.getStatus()) || "7".equals(applyInfo.getStatus()) || "9".equals(applyInfo.getStatus())) {
|
||||
num++;
|
||||
}
|
||||
}
|
||||
|
|
@ -420,15 +436,23 @@ public class TmTaskServiceImpl implements TmTaskService {
|
|||
*/
|
||||
@Override
|
||||
public List<TmTask> getLeaseAuditList(TmTask record) {
|
||||
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
||||
List<TmTask> tmTaskList;
|
||||
if (roles.contains(STRING_ADMIN)) {
|
||||
tmTaskList = tmTaskMapper.getAuditListByLeaseTmTask(record);
|
||||
} else if (deptId == 101) {
|
||||
record.setCompanyId(101);
|
||||
tmTaskList = tmTaskMapper.getAuditListByLeaseTmTaskByPeople(record);
|
||||
} else if (deptId == 102) {
|
||||
record.setCompanyId(102);
|
||||
tmTaskList = tmTaskMapper.getAuditListByLeaseTmTaskByPeople(record);
|
||||
} else {
|
||||
String username = SecurityUtils.getLoginUser().getUsername();
|
||||
record.setCreateBy(username);
|
||||
tmTaskList = tmTaskMapper.getAuditListByLeaseTmTaskByPeople(record);
|
||||
}
|
||||
|
||||
for (TmTask tmTask : tmTaskList) {
|
||||
int count = 0;
|
||||
if (tmTask != null) {
|
||||
|
|
@ -591,9 +615,14 @@ public class TmTaskServiceImpl implements TmTaskService {
|
|||
*/
|
||||
@Override
|
||||
public List<TmTask> getLeaseAuditManageList(TmTask record) {
|
||||
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
||||
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||
if (roles.contains("fgs")) {
|
||||
record.setDeptId(deptId);
|
||||
}
|
||||
List<TmTask> tmTaskList = tmTaskMapper.getAuditManageListByLeaseTmTask(record);
|
||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
||||
|
||||
for (TmTask tmTask : tmTaskList) {
|
||||
int count = 0;
|
||||
if (tmTask != null) {
|
||||
|
|
@ -628,8 +657,8 @@ public class TmTaskServiceImpl implements TmTaskService {
|
|||
}
|
||||
}
|
||||
//施管部只能看到机具分公司(101)的数据
|
||||
if ((roles.contains("jjfgs") || roles.contains("sgb")) && companyId != null) {
|
||||
List<LeaseApplyInfo> auditListByLeaseInfo = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == companyId.intValue()).collect(Collectors.toList());
|
||||
if (roles.contains("jjfgs") || roles.contains("sgb") || deptId == 101) {
|
||||
List<LeaseApplyInfo> auditListByLeaseInfo = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == 101).collect(Collectors.toList());
|
||||
if (auditListByLeaseInfo != null && !auditListByLeaseInfo.isEmpty()) {
|
||||
// 对领料任务集合查询具体详情
|
||||
for (LeaseApplyInfo leaseApplyInfo : auditListByLeaseInfo) {
|
||||
|
|
@ -654,8 +683,8 @@ public class TmTaskServiceImpl implements TmTaskService {
|
|||
}
|
||||
}
|
||||
//安监部只能看到设备分公司(102)的数据
|
||||
if ((roles.contains("tsfgs") || roles.contains("ajb")) && companyId != null) {
|
||||
List<LeaseApplyInfo> auditListByLeaseInfo = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == companyId.intValue()).collect(Collectors.toList());
|
||||
if (roles.contains("tsfgs") || roles.contains("ajb") || deptId == 102) {
|
||||
List<LeaseApplyInfo> auditListByLeaseInfo = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == 102).collect(Collectors.toList());
|
||||
if (auditListByLeaseInfo != null && !auditListByLeaseInfo.isEmpty()) {
|
||||
// 对领料任务集合查询具体详情
|
||||
for (LeaseApplyInfo leaseApplyInfo : auditListByLeaseInfo) {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,13 @@
|
|||
package com.bonus.sgzb.base.controller;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.bonus.sgzb.base.domain.RepairTaskDetails;
|
||||
import com.bonus.sgzb.base.domain.*;
|
||||
import com.bonus.sgzb.base.domain.vo.DictVo;
|
||||
import com.bonus.sgzb.base.service.RepairService;
|
||||
import com.bonus.sgzb.common.core.utils.ListPagingUtil;
|
||||
import com.bonus.sgzb.common.core.utils.ServletUtils;
|
||||
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
|
|
@ -20,6 +23,9 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.bonus.sgzb.common.core.web.page.TableSupport.PAGE_NUM;
|
||||
import static com.bonus.sgzb.common.core.web.page.TableSupport.PAGE_SIZE;
|
||||
|
||||
/**
|
||||
* @author c liu
|
||||
* @date 2023/12/11
|
||||
|
|
@ -36,11 +42,11 @@ public class RepairController extends BaseController {
|
|||
@ApiOperation(value = "获取维修任务列表")
|
||||
@Log(title = "维修任务列表", businessType = BusinessType.QUERY)
|
||||
@GetMapping("/getRepairTaskList")
|
||||
public TableDataInfo getRepairTaskList(RepairTask bean)
|
||||
{
|
||||
startPage();
|
||||
public AjaxResult getRepairTaskList(RepairTask bean) {
|
||||
List<RepairTask> list = service.getRepairTaskList(bean);
|
||||
return getDataTable(list);
|
||||
Integer pageIndex = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1);
|
||||
Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -48,9 +54,8 @@ public class RepairController extends BaseController {
|
|||
*/
|
||||
@Log(title = "导出维修任务列表", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RepairTask bean)
|
||||
{
|
||||
List<RepairTask> list = service.exportRepairTaskList(bean);
|
||||
public void export(HttpServletResponse response, RepairTask bean) {
|
||||
List<RepairTask> list = service.getRepairTaskList(bean);
|
||||
ExcelUtil<RepairTask> util = new ExcelUtil<RepairTask>(RepairTask.class);
|
||||
util.exportExcel(response, list, "维修任务列表");
|
||||
}
|
||||
|
|
@ -61,8 +66,7 @@ public class RepairController extends BaseController {
|
|||
@ApiOperation(value = "获取维修任务列表")
|
||||
@Log(title = "维修任务列表", businessType = BusinessType.QUERY)
|
||||
@GetMapping("/getAppRepairTaskList")
|
||||
public AjaxResult getAppRepairTaskList(RepairTask bean)
|
||||
{
|
||||
public AjaxResult getAppRepairTaskList(RepairTask bean) {
|
||||
List<RepairTask> list = service.getRepairTaskList(bean);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
|
@ -73,8 +77,7 @@ public class RepairController extends BaseController {
|
|||
@ApiOperation(value = "获取维修任务机具列表")
|
||||
@Log(title = "维修任务机具列表", businessType = BusinessType.QUERY)
|
||||
@GetMapping("/getRepairMaTypeList")
|
||||
public TableDataInfo getRepairMaTypeList(RepairTaskDetails bean)
|
||||
{
|
||||
public TableDataInfo getRepairMaTypeList(RepairTaskDetails bean) {
|
||||
startPage();
|
||||
List<RepairTaskDetails> list = service.getRepairMaTypeList(bean);
|
||||
return getDataTable(list);
|
||||
|
|
@ -86,8 +89,7 @@ public class RepairController extends BaseController {
|
|||
@ApiOperation(value = "获取维修任务机具列表")
|
||||
@Log(title = "维修任务机具列表", businessType = BusinessType.QUERY)
|
||||
@GetMapping("/getAppRepairMaTypeList")
|
||||
public AjaxResult getAppRepairMaTypeList(RepairTaskDetails bean)
|
||||
{
|
||||
public AjaxResult getAppRepairMaTypeList(RepairTaskDetails bean) {
|
||||
List<RepairTaskDetails> list = service.getRepairMaTypeList(bean);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
|
@ -141,8 +143,7 @@ public class RepairController extends BaseController {
|
|||
* 获取维修员下拉选
|
||||
*/
|
||||
@GetMapping("/getUserSelect")
|
||||
public AjaxResult getUserSelect()
|
||||
{
|
||||
public AjaxResult getUserSelect() {
|
||||
List<SysUser> list = service.selectUserList();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
|
@ -151,8 +152,7 @@ public class RepairController extends BaseController {
|
|||
* 字典下拉选
|
||||
*/
|
||||
@GetMapping("/getDicSelect")
|
||||
public AjaxResult getDicSelect(@RequestParam String value)
|
||||
{
|
||||
public AjaxResult getDicSelect(@RequestParam String value) {
|
||||
List<DictVo> list = service.getDicSelect(value);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ public class RepairTask {
|
|||
*/
|
||||
private String endTime;
|
||||
private Long companyId;
|
||||
private String companyIds;
|
||||
private Long agreementId;
|
||||
private String repairStatusCode;
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
|||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.system.api.domain.SysUser;
|
||||
import com.bonus.sgzb.system.api.model.LoginUser;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -20,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author c liu
|
||||
|
|
@ -34,8 +36,21 @@ public class RepairServiceImpl implements RepairService {
|
|||
@Override
|
||||
public List<RepairTask> getRepairTaskList(RepairTask bean) {
|
||||
List<RepairTask> repairTaskList = mapper.getRepairTaskList(bean);
|
||||
if (SecurityUtils.getLoginUser().getRoles().contains("admin")){
|
||||
return repairTaskList;
|
||||
}
|
||||
List<RepairTask> repairTasks = new ArrayList<>();
|
||||
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||
for (RepairTask repairTask : repairTaskList) {
|
||||
if (Objects.equals(deptId, 101L) && repairTask.getCompanyIds().contains("101")){
|
||||
repairTasks.add(repairTask);
|
||||
}
|
||||
if (Objects.equals(deptId, 102L) && repairTask.getCompanyIds().contains("102")){
|
||||
repairTasks.add(repairTask);
|
||||
}
|
||||
}
|
||||
return repairTasks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RepairTask> exportRepairTaskList(RepairTask bean) {
|
||||
|
|
|
|||
|
|
@ -602,6 +602,7 @@
|
|||
sd.`name` AS taskName,
|
||||
tta.agreement_id AS agreementId,
|
||||
GROUP_CONCAT( DISTINCT mt2.type_id ) AS typeId,
|
||||
GROUP_CONCAT( bai.company_id ) AS companyId,
|
||||
GROUP_CONCAT(bad.id) as badId,
|
||||
GROUP_CONCAT( mt2.type_name, '' ) AS typeName
|
||||
FROM
|
||||
|
|
|
|||
|
|
@ -558,6 +558,9 @@
|
|||
LEFT JOIN sys_dic d ON d.id = tt.task_status
|
||||
WHERE
|
||||
tt.task_type = '29' and tt.status = '1'
|
||||
<if test="record.deptId != null and record.deptId != '' ">
|
||||
AND su.dept_id = #{record.deptId}
|
||||
</if>
|
||||
<if test="record.taskId != null and record.taskId != '' ">
|
||||
AND tt.task_id = #{record.taskId}
|
||||
</if>
|
||||
|
|
@ -932,7 +935,13 @@
|
|||
LEFT JOIN lease_apply_info lai ON lai.task_id = tt.task_id
|
||||
LEFT JOIN sys_dic d ON d.id = tt.task_status
|
||||
WHERE
|
||||
tt.task_type = '29' and tt.status = '1' and tt.create_by = #{record.createBy}
|
||||
tt.task_type = '29' and tt.status = '1'
|
||||
<if test="record.createBy != null and record.createBy != '' ">
|
||||
AND tt.create_by = #{record.createBy}
|
||||
</if>
|
||||
<if test="record.companyId != null and record.companyId != '' ">
|
||||
AND lai.company_id = #{record.companyId}
|
||||
</if>
|
||||
<if test="record.taskId != null and record.taskId != '' ">
|
||||
AND tt.task_id = #{record.taskId}
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@
|
|||
sd.name AS repairStatus,
|
||||
tt.task_status AS repairStatusCode,
|
||||
tt.company_id AS companyId,
|
||||
GROUP_CONCAT(DISTINCT rd.company_id) as companyIds,
|
||||
GROUP_CONCAT(DISTINCT mt2.type_name) as type
|
||||
FROM
|
||||
repair_apply_details rd
|
||||
|
|
|
|||
|
|
@ -40,10 +40,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="getMaUserList" resultType="com.bonus.sgzb.base.domain.WarehouseKeeper">
|
||||
SELECT su.user_id as userId, su.nick_name as userName FROM `sys_user` su
|
||||
SELECT
|
||||
su.user_id AS userId,
|
||||
su.nick_name AS userName
|
||||
FROM
|
||||
`sys_user` su
|
||||
LEFT JOIN sys_user_role sur ON su.user_id = sur.user_id
|
||||
LEFT JOIN sys_role sr ON sr.role_id = sur.role_id
|
||||
WHERE sr.role_id = '132' AND su.del_flag = '0'
|
||||
WHERE
|
||||
sr.role_id IN ( '132', '139' )
|
||||
AND su.del_flag = '0'
|
||||
<if test="userName != null and userName != ''">
|
||||
AND su.nick_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.bonus.sgzb.common.core.text.Convert;
|
||||
import com.bonus.sgzb.common.core.utils.ListPagingUtil;
|
||||
import com.bonus.sgzb.common.core.utils.ServletUtils;
|
||||
import com.bonus.sgzb.material.domain.RepairAuditDetails;
|
||||
import com.bonus.sgzb.material.domain.RepairPart;
|
||||
import com.bonus.sgzb.material.domain.RepairRecord;
|
||||
|
|
@ -25,6 +28,9 @@ import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
|||
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||
|
||||
import static com.bonus.sgzb.common.core.constant.Constants.PAGE_NUM;
|
||||
import static com.bonus.sgzb.common.core.constant.Constants.PAGE_SIZE;
|
||||
|
||||
/**
|
||||
* 修试审核详细
|
||||
*
|
||||
|
|
@ -42,8 +48,7 @@ public class RepairAuditDetailsController extends BaseController {
|
|||
*/
|
||||
@ApiOperation("查询修试审核任务列表")
|
||||
@GetMapping("/questList")
|
||||
public TableDataInfo questList(RepairAuditDetails repairAuditDetails) {
|
||||
startPage();
|
||||
public AjaxResult questList(RepairAuditDetails repairAuditDetails) {
|
||||
Map<String, Object> params = repairAuditDetails.getParams();
|
||||
if (params != null && !params.isEmpty()) {
|
||||
String beginTime = (String) params.get("beginTime");
|
||||
|
|
@ -53,7 +58,9 @@ public class RepairAuditDetailsController extends BaseController {
|
|||
repairAuditDetails.setParams(params);
|
||||
}
|
||||
List<ScrapApplyDetailsVO> list = repairAuditDetailsService.selectRepairQuestList(repairAuditDetails);
|
||||
return getDataTable(list);
|
||||
Integer pageIndex = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1);
|
||||
Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex,pageSize, list));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,20 +34,28 @@ public class BackApplyServiceImpl implements BackApplyService {
|
|||
@Override
|
||||
public List<BackApplyInfo> getBackApplyList(BackApplyInfo bean) {
|
||||
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
||||
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||
if (roles.contains("admin")) {
|
||||
//管理员可以看到所有退料申请
|
||||
return backApplyMapper.getBackApplyListByAdmin1(bean);
|
||||
}
|
||||
} else if (deptId == 101) {
|
||||
bean.setCompanyId("101");
|
||||
return backApplyMapper.getBackApplyList(bean);
|
||||
} else if (deptId == 102) {
|
||||
bean.setCompanyId("102");
|
||||
return backApplyMapper.getBackApplyList(bean);
|
||||
} else {
|
||||
//个人只能看到自己的申请的退料
|
||||
String username = SecurityUtils.getLoginUser().getUsername();
|
||||
bean.setCreateBy(username);
|
||||
return backApplyMapper.getBackApplyList(bean);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BackApplyInfo> getBackAuditList(BackApplyInfo bean) {
|
||||
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||
if (roles.contains("admin")) {
|
||||
//管理员可以看到所有退料申请
|
||||
return backApplyMapper.getBackApplyListByAdmin(bean);
|
||||
|
|
@ -56,9 +64,9 @@ public class BackApplyServiceImpl implements BackApplyService {
|
|||
List<BackApplyInfo> backApplyListByAdmin = backApplyMapper.getBackApplyListByAdmin(bean);
|
||||
//机具分公司只能看到机具公司的退料
|
||||
if (CollUtil.isNotEmpty(backApplyListByAdmin)) {
|
||||
if (roles.contains("jjfgs") || Objects.equals(companyId, 101L)) {
|
||||
if (roles.contains("jjfgs") || Objects.equals(deptId, 101L)) {
|
||||
for (BackApplyInfo backApplyInfo : backApplyListByAdmin) {
|
||||
if (StringUtils.hasText(backApplyInfo.getCompanyId()) && backApplyInfo.getCompanyId().contains(String.valueOf(companyId))) {
|
||||
if (StringUtils.hasText(backApplyInfo.getCompanyId()) && backApplyInfo.getCompanyId().contains(String.valueOf(deptId))) {
|
||||
backApplyInfos.add(backApplyInfo);
|
||||
}
|
||||
}
|
||||
|
|
@ -66,9 +74,9 @@ public class BackApplyServiceImpl implements BackApplyService {
|
|||
}
|
||||
//调试分公司只能看到调试公司的退料
|
||||
if (CollUtil.isNotEmpty(backApplyListByAdmin)) {
|
||||
if (roles.contains("tsfgs") || Objects.equals(companyId, 102L)) {
|
||||
if (roles.contains("tsfgs") || Objects.equals(deptId, 102L)) {
|
||||
for (BackApplyInfo backApplyInfo : backApplyListByAdmin) {
|
||||
if (StringUtils.hasText(backApplyInfo.getCompanyId()) && backApplyInfo.getCompanyId().contains(String.valueOf(companyId))) {
|
||||
if (StringUtils.hasText(backApplyInfo.getCompanyId()) && backApplyInfo.getCompanyId().contains(String.valueOf(deptId))) {
|
||||
backApplyInfos.add(backApplyInfo);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -126,13 +126,28 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
*/
|
||||
@Override
|
||||
public List<ScrapApplyDetailsVO> selectRepairQuestList(RepairAuditDetails repairAuditDetails) {
|
||||
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||
if (deptId == 101 || deptId == 102) {
|
||||
repairAuditDetails.setCompanyId(deptId.intValue());
|
||||
}
|
||||
List<ScrapApplyDetailsVO> repairQuestList = repairAuditDetailsMapper.selectRepairQuestList(repairAuditDetails);
|
||||
List<ScrapApplyDetailsVO> scrapApplyDetailsVOS = new ArrayList<>();
|
||||
for (ScrapApplyDetailsVO scrapApplyDetailsVO : repairQuestList) {
|
||||
Long taskId = scrapApplyDetailsVO.getTaskId();
|
||||
String typeName = repairAuditDetailsMapper.selectTypeNameByTaskId(taskId);
|
||||
scrapApplyDetailsVO.setItemType(typeName);
|
||||
if (deptId == 101 && "101".equals(scrapApplyDetailsVO.getCompanyId())) {
|
||||
scrapApplyDetailsVOS.add(scrapApplyDetailsVO);
|
||||
}
|
||||
if (deptId == 102 && "102".equals(scrapApplyDetailsVO.getCompanyId())) {
|
||||
scrapApplyDetailsVOS.add(scrapApplyDetailsVO);
|
||||
}
|
||||
}
|
||||
if (SecurityUtils.getLoginUser().getRoles().contains("admin")) {
|
||||
return repairQuestList;
|
||||
} else {
|
||||
return scrapApplyDetailsVOS;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -388,7 +403,9 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
}
|
||||
|
||||
|
||||
/**采购单号编码生成规则*/
|
||||
/**
|
||||
* 采购单号编码生成规则
|
||||
*/
|
||||
private String purchaseCodeRule(String code, Integer taskType) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
|
|
|
|||
|
|
@ -128,4 +128,5 @@ public class ScrapApplyDetailsVO {
|
|||
* 文件名称
|
||||
*/
|
||||
private String dispositionFileName;
|
||||
private String companyId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -433,7 +433,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN ma_type mt1 ON mt1.type_id=bad.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id=mt1.parent_id
|
||||
WHERE
|
||||
tt.create_by = #{createBy}
|
||||
1=1
|
||||
<if test="createBy != null and createBy != ''">
|
||||
and tt.create_by = #{createBy}
|
||||
</if>
|
||||
<if test="companyId != null and companyId != ''">
|
||||
and bai.company_id = #{companyId}
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (bai.`code` like concat('%', #{keyWord}, '%') or
|
||||
bai.back_person like concat('%', #{keyWord}, '%') or
|
||||
|
|
|
|||
|
|
@ -243,6 +243,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
dic.NAME taskStatusName,
|
||||
bui.unit_name unitName,
|
||||
bpl.lot_name projectName,
|
||||
rad.company_id companyId,
|
||||
su.nick_name createBy,
|
||||
tk.create_time createTime,
|
||||
tk.remark,
|
||||
|
|
@ -268,6 +269,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN sys_user su ON su.user_id = tk.create_by
|
||||
WHERE
|
||||
tk.task_type = 45
|
||||
<if test="companyId != null and companyId != ''">
|
||||
AND rad.company_id = #{companyId}
|
||||
</if>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (locate(#{keyword}, su.nick_name) > 0
|
||||
or locate(#{keyword}, tk.CODE) > 0
|
||||
|
|
|
|||
|
|
@ -173,8 +173,11 @@ public class SysUserController extends BaseController {
|
|||
*/
|
||||
@GetMapping("getInfo")
|
||||
public AjaxResult getInfo() {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
SysUser user = userService.selectUserById(SecurityUtils.getLoginUser().getUserid());
|
||||
if (SecurityUtils.getLoginUser() != null) {
|
||||
System.out.println(SecurityUtils.getLoginUser());
|
||||
System.out.println("====================================");
|
||||
System.out.println(SecurityUtils.getLoginUser().getSysUser().getUserId());
|
||||
SysUser user = userService.selectUserById(SecurityUtils.getLoginUser().getSysUser().getUserId());
|
||||
// 角色集合
|
||||
Set<String> roles = permissionService.getRolePermission(user);
|
||||
// 权限集合
|
||||
|
|
@ -184,6 +187,10 @@ public class SysUserController extends BaseController {
|
|||
ajax.put("roles", roles);
|
||||
ajax.put("permissions", permissions);
|
||||
return ajax;
|
||||
} else {
|
||||
return AjaxResult.error("获取用户信息失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -375,6 +382,7 @@ public class SysUserController extends BaseController {
|
|||
|
||||
/**
|
||||
* 通过任务状态获取下一级审批人的信息
|
||||
*
|
||||
* @param urgentProcessingUser
|
||||
* @return
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue