问题修改
This commit is contained in:
parent
fce6571a8b
commit
dc7b6c0ecf
|
|
@ -21,7 +21,7 @@ public interface ApprovalNodeMapper {
|
||||||
* @param processId 流程ID
|
* @param processId 流程ID
|
||||||
* @return 节点列表
|
* @return 节点列表
|
||||||
*/
|
*/
|
||||||
List<ApprovalNode> selectNodeListByProcessId(@Param("processId") Long processId);
|
List<ApprovalNode> selectNodeListByProcessId(@Param("processId") Long processId, @Param("deptId") Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ID查询节点
|
* 根据ID查询节点
|
||||||
|
|
|
||||||
|
|
@ -21,17 +21,17 @@ public interface ApprovalRecordMapper {
|
||||||
* @param instanceId 实例ID
|
* @param instanceId 实例ID
|
||||||
* @return 记录列表
|
* @return 记录列表
|
||||||
*/
|
*/
|
||||||
List<ApprovalRecord> selectRecordListByInstanceId(@Param("instanceId") Long instanceId);
|
List<ApprovalRecord> selectRecordListByInstanceId(@Param("instanceId") Long instanceId, @Param("deptId") Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据实例ID和节点ID查询审批记录列表
|
* 根据实例ID和节点ID查询审批记录列表
|
||||||
*
|
*
|
||||||
* @param instanceId 实例ID
|
* @param instanceId 实例ID
|
||||||
* @param nodeId 节点ID
|
* @param nodeId 节点ID
|
||||||
* @return 记录列表
|
* @return 记录列表
|
||||||
*/
|
*/
|
||||||
List<ApprovalRecord> selectRecordListByNode(@Param("instanceId") Long instanceId,
|
List<ApprovalRecord> selectRecordListByNode(@Param("instanceId") Long instanceId,
|
||||||
@Param("nodeId") Long nodeId);
|
@Param("nodeId") Long nodeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ID查询审批记录
|
* 根据ID查询审批记录
|
||||||
|
|
@ -45,7 +45,7 @@ public interface ApprovalRecordMapper {
|
||||||
* 查询节点已审批通过的数量(用于会签判断)
|
* 查询节点已审批通过的数量(用于会签判断)
|
||||||
*
|
*
|
||||||
* @param instanceId 实例ID
|
* @param instanceId 实例ID
|
||||||
* @param nodeId 节点ID
|
* @param nodeId 节点ID
|
||||||
* @return 通过数量
|
* @return 通过数量
|
||||||
*/
|
*/
|
||||||
int countPassedByNode(@Param("instanceId") Long instanceId, @Param("nodeId") Long nodeId);
|
int countPassedByNode(@Param("instanceId") Long instanceId, @Param("nodeId") Long nodeId);
|
||||||
|
|
@ -54,7 +54,7 @@ public interface ApprovalRecordMapper {
|
||||||
* 查询节点是否有驳回记录
|
* 查询节点是否有驳回记录
|
||||||
*
|
*
|
||||||
* @param instanceId 实例ID
|
* @param instanceId 实例ID
|
||||||
* @param nodeId 节点ID
|
* @param nodeId 节点ID
|
||||||
* @return 驳回数量
|
* @return 驳回数量
|
||||||
*/
|
*/
|
||||||
int countRejectedByNode(@Param("instanceId") Long instanceId, @Param("nodeId") Long nodeId);
|
int countRejectedByNode(@Param("instanceId") Long instanceId, @Param("nodeId") Long nodeId);
|
||||||
|
|
@ -63,13 +63,13 @@ public interface ApprovalRecordMapper {
|
||||||
* 查询用户在该节点是否已审批
|
* 查询用户在该节点是否已审批
|
||||||
*
|
*
|
||||||
* @param instanceId 实例ID
|
* @param instanceId 实例ID
|
||||||
* @param nodeId 节点ID
|
* @param nodeId 节点ID
|
||||||
* @param approverId 审批人ID
|
* @param approverId 审批人ID
|
||||||
* @return 记录信息
|
* @return 记录信息
|
||||||
*/
|
*/
|
||||||
ApprovalRecord selectRecordByApprover(@Param("instanceId") Long instanceId,
|
ApprovalRecord selectRecordByApprover(@Param("instanceId") Long instanceId,
|
||||||
@Param("nodeId") Long nodeId,
|
@Param("nodeId") Long nodeId,
|
||||||
@Param("approverId") Long approverId);
|
@Param("approverId") Long approverId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增审批记录
|
* 新增审批记录
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,8 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService {
|
||||||
ApprovalInstance instance = instanceMapper.selectInstanceById(instanceId);
|
ApprovalInstance instance = instanceMapper.selectInstanceById(instanceId);
|
||||||
if (instance != null) {
|
if (instance != null) {
|
||||||
// 查询审批记录
|
// 查询审批记录
|
||||||
List<ApprovalRecord> recordList = recordMapper.selectRecordListByInstanceId(instanceId);
|
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||||
|
List<ApprovalRecord> recordList = recordMapper.selectRecordListByInstanceId(instanceId, deptId);
|
||||||
instance.setRecordList(recordList);
|
instance.setRecordList(recordList);
|
||||||
}
|
}
|
||||||
return instance;
|
return instance;
|
||||||
|
|
@ -369,6 +370,6 @@ public class ApprovalEngineServiceImpl implements IApprovalEngineService {
|
||||||
* 生成审批实例编号
|
* 生成审批实例编号
|
||||||
*/
|
*/
|
||||||
private String generateInstanceCode() {
|
private String generateInstanceCode() {
|
||||||
return "AP" + System.currentTimeMillis() + (int)(Math.random() * 1000);
|
return "AP" + System.currentTimeMillis() + (int) (Math.random() * 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,8 @@ public class ApprovalInstanceServiceImpl implements IApprovalInstanceService {
|
||||||
ApprovalInstance instance = instanceMapper.selectInstanceById(id);
|
ApprovalInstance instance = instanceMapper.selectInstanceById(id);
|
||||||
if (instance != null) {
|
if (instance != null) {
|
||||||
// 查询审批记录
|
// 查询审批记录
|
||||||
List<ApprovalRecord> recordList = recordMapper.selectRecordListByInstanceId(id);
|
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||||
|
List<ApprovalRecord> recordList = recordMapper.selectRecordListByInstanceId(id, deptId);
|
||||||
instance.setRecordList(recordList);
|
instance.setRecordList(recordList);
|
||||||
}
|
}
|
||||||
return instance;
|
return instance;
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,8 @@ public class ApprovalProcessServiceImpl implements IApprovalProcessService {
|
||||||
ApprovalProcess process = processMapper.selectProcessById(id);
|
ApprovalProcess process = processMapper.selectProcessById(id);
|
||||||
if (process != null) {
|
if (process != null) {
|
||||||
// 查询节点列表
|
// 查询节点列表
|
||||||
List<ApprovalNode> nodeList = nodeMapper.selectNodeListByProcessId(id);
|
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||||
|
List<ApprovalNode> nodeList = nodeMapper.selectNodeListByProcessId(id,deptId);
|
||||||
process.setNodeList(nodeList);
|
process.setNodeList(nodeList);
|
||||||
}
|
}
|
||||||
return process;
|
return process;
|
||||||
|
|
@ -49,7 +50,8 @@ public class ApprovalProcessServiceImpl implements IApprovalProcessService {
|
||||||
ApprovalProcess process = processMapper.selectProcessByBusinessType(businessType);
|
ApprovalProcess process = processMapper.selectProcessByBusinessType(businessType);
|
||||||
if (process != null) {
|
if (process != null) {
|
||||||
// 查询节点列表
|
// 查询节点列表
|
||||||
List<ApprovalNode> nodeList = nodeMapper.selectNodeListByProcessId(process.getId());
|
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||||
|
List<ApprovalNode> nodeList = nodeMapper.selectNodeListByProcessId(process.getId(),deptId);
|
||||||
process.setNodeList(nodeList);
|
process.setNodeList(nodeList);
|
||||||
}
|
}
|
||||||
return process;
|
return process;
|
||||||
|
|
@ -63,7 +65,8 @@ public class ApprovalProcessServiceImpl implements IApprovalProcessService {
|
||||||
ApprovalProcess process = processMapper.selectProcessByBusinessTypeAndOrgId(businessType, orgId);
|
ApprovalProcess process = processMapper.selectProcessByBusinessTypeAndOrgId(businessType, orgId);
|
||||||
if (process != null) {
|
if (process != null) {
|
||||||
// 查询节点列表
|
// 查询节点列表
|
||||||
List<ApprovalNode> nodeList = nodeMapper.selectNodeListByProcessId(process.getId());
|
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||||
|
List<ApprovalNode> nodeList = nodeMapper.selectNodeListByProcessId(process.getId(),deptId);
|
||||||
process.setNodeList(nodeList);
|
process.setNodeList(nodeList);
|
||||||
}
|
}
|
||||||
return process;
|
return process;
|
||||||
|
|
|
||||||
|
|
@ -160,14 +160,14 @@ public class BackChangeServiceImpl implements BackChangeService {
|
||||||
// 编码重复
|
// 编码重复
|
||||||
String devCode = details.getDevCode();
|
String devCode = details.getDevCode();
|
||||||
if (!devCode.equals("/") && StringUtils.isNotBlank(devCode) && devCodeSet.contains(devCode)) {
|
if (!devCode.equals("/") && StringUtils.isNotBlank(devCode) && devCodeSet.contains(devCode)) {
|
||||||
return AjaxResult.error("添加的列表中设备编号存在重复:" + devCode);
|
return AjaxResult.error("添加的列表中设备编号存在重复:" + devCode, AjaxResult.class);
|
||||||
} else if (StringUtils.isNotBlank(devCode)) {
|
} else if (StringUtils.isNotBlank(devCode)) {
|
||||||
devCodeSet.add(devCode);
|
devCodeSet.add(devCode);
|
||||||
}
|
}
|
||||||
// typeId重复
|
// typeId重复
|
||||||
Long typeId = details.getTypeId();
|
Long typeId = details.getTypeId();
|
||||||
if (typeId != null && typeIdSet.contains(typeId)) {
|
if (typeId != null && typeIdSet.contains(typeId)) {
|
||||||
return AjaxResult.error("添加的列表中设备类型存在重复!");
|
return AjaxResult.error("添加的列表中设备类型存在重复!", AjaxResult.class);
|
||||||
} else if (typeId != null && "1".equals(details.getManageType())) {
|
} else if (typeId != null && "1".equals(details.getManageType())) {
|
||||||
typeIdSet.add(typeId);
|
typeIdSet.add(typeId);
|
||||||
}
|
}
|
||||||
|
|
@ -205,7 +205,7 @@ public class BackChangeServiceImpl implements BackChangeService {
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
throw new RuntimeException(e.getMessage());
|
throw new RuntimeException(e.getMessage());
|
||||||
}
|
}
|
||||||
return AjaxResult.success("退库申请提交成功,等待审批", csDeviceVo.getDevInfo().getId());
|
return AjaxResult.success("退库申请提交成功,等待审批", AjaxResult.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -431,9 +431,9 @@ public class BackChangeServiceImpl implements BackChangeService {
|
||||||
// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
|
// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
|
||||||
// dto.setCompanyId(deptId);
|
// dto.setCompanyId(deptId);
|
||||||
// }
|
// }
|
||||||
if(ADMIN_ID.equals(userId)){
|
if (ADMIN_ID.equals(userId)) {
|
||||||
dto.setCompanyId(1L);
|
dto.setCompanyId(1L);
|
||||||
}else{
|
} else {
|
||||||
dto.setCompanyId(deptId);
|
dto.setCompanyId(deptId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,6 @@ public class MaDevInfoXlsx {
|
||||||
@ApiModelProperty(value = "设备ID")
|
@ApiModelProperty(value = "设备ID")
|
||||||
private Integer maId;
|
private Integer maId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属省份
|
|
||||||
*/
|
|
||||||
@Excel(name = "所属省份")
|
|
||||||
@ApiModelProperty(value = "所属省份")
|
|
||||||
private String province;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -348,7 +348,9 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
||||||
String str = dept.getDeptName().replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
|
String str = dept.getDeptName().replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
|
||||||
dept.setDeptName(str);
|
dept.setDeptName(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
dept.setCompanyId(Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId()).orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId()));
|
dept.setCompanyId(Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId()).orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId()));
|
||||||
|
|
||||||
return mapper.selectDeptList(dept);
|
return mapper.selectDeptList(dept);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,11 +55,13 @@
|
||||||
WHEN ban.approver_type = '1' THEN
|
WHEN ban.approver_type = '1' THEN
|
||||||
(SELECT GROUP_CONCAT(su.nick_name)
|
(SELECT GROUP_CONCAT(su.nick_name)
|
||||||
FROM sys_user su
|
FROM sys_user su
|
||||||
WHERE FIND_IN_SET(su.user_id, ban.approver_ids))
|
WHERE FIND_IN_SET(su.user_id, ban.approver_ids)
|
||||||
|
AND su.dept_id = #{deptId})
|
||||||
WHEN ban.approver_type = '2' THEN
|
WHEN ban.approver_type = '2' THEN
|
||||||
(SELECT GROUP_CONCAT(sr.role_name)
|
(SELECT GROUP_CONCAT(sr.role_name)
|
||||||
FROM sys_role sr
|
FROM sys_role sr
|
||||||
WHERE FIND_IN_SET(sr.role_id, ban.approver_ids))
|
WHERE FIND_IN_SET(sr.role_id, ban.approver_ids)
|
||||||
|
AND sr.company_id = #{deptId})
|
||||||
END,
|
END,
|
||||||
'未配置'
|
'未配置'
|
||||||
) AS name
|
) AS name
|
||||||
|
|
|
||||||
|
|
@ -45,14 +45,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
WHEN ban.approver_type = '1' THEN
|
WHEN ban.approver_type = '1' THEN
|
||||||
(SELECT GROUP_CONCAT(su.nick_name)
|
(SELECT GROUP_CONCAT(su.nick_name)
|
||||||
FROM sys_user su
|
FROM sys_user su
|
||||||
WHERE FIND_IN_SET(su.user_id, ban.approver_ids))
|
WHERE FIND_IN_SET(su.user_id, ban.approver_ids)
|
||||||
|
AND su.dept_id = #{deptId})
|
||||||
WHEN ban.approver_type = '2' THEN
|
WHEN ban.approver_type = '2' THEN
|
||||||
(SELECT GROUP_CONCAT(sr.role_name)
|
(SELECT GROUP_CONCAT(sr.role_name)
|
||||||
FROM sys_role sr
|
FROM sys_role sr
|
||||||
WHERE FIND_IN_SET(sr.role_id, ban.approver_ids))
|
WHERE FIND_IN_SET(sr.role_id, ban.approver_ids)
|
||||||
|
AND sr.company_id = #{deptId})
|
||||||
END,
|
END,
|
||||||
'未配置'
|
'未配置'
|
||||||
) AS name
|
) AS name
|
||||||
FROM
|
FROM
|
||||||
bm_approval_record bar
|
bm_approval_record bar
|
||||||
left JOIN bm_approval_node ban on bar.node_id=ban.id
|
left JOIN bm_approval_node ban on bar.node_id=ban.id
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,7 @@
|
||||||
|
|
||||||
</where>
|
</where>
|
||||||
GROUP BY mdi.code
|
GROUP BY mdi.code
|
||||||
|
HAVING useNum > 0 and useNum is not null
|
||||||
UNION ALL
|
UNION ALL
|
||||||
|
|
||||||
SELECT CONCAT(tt4.type_name, '>', tt3.type_name, '>', tt2.type_name) as category,
|
SELECT CONCAT(tt4.type_name, '>', tt3.type_name, '>', tt2.type_name) as category,
|
||||||
|
|
@ -243,7 +243,7 @@
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
GROUP BY tl.tool_code
|
GROUP BY tl.tool_code
|
||||||
HAVING useNum > 0
|
HAVING useNum > 0 and useNum is not null
|
||||||
UNION ALL
|
UNION ALL
|
||||||
|
|
||||||
SELECT CONCAT(tt4.type_name, '>', tt3.type_name, '>', tt2.type_name) as category,
|
SELECT CONCAT(tt4.type_name, '>', tt3.type_name, '>', tt2.type_name) as category,
|
||||||
|
|
@ -291,7 +291,7 @@
|
||||||
</where>
|
</where>
|
||||||
|
|
||||||
GROUP BY tl.id
|
GROUP BY tl.id
|
||||||
HAVING useNum > 0
|
HAVING useNum > 0 and useNum is not null
|
||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT
|
SELECT
|
||||||
CASE
|
CASE
|
||||||
|
|
@ -347,7 +347,7 @@
|
||||||
|
|
||||||
</where>
|
</where>
|
||||||
GROUP BY mdi.code
|
GROUP BY mdi.code
|
||||||
|
HAVING useNum > 0 and useNum is not null
|
||||||
UNION ALL
|
UNION ALL
|
||||||
|
|
||||||
SELECT CONCAT(tt4.type_name, '>', tt3.type_name, '>', tt2.type_name) as category,
|
SELECT CONCAT(tt4.type_name, '>', tt3.type_name, '>', tt2.type_name) as category,
|
||||||
|
|
@ -393,7 +393,7 @@
|
||||||
AND cd.pro_code = #{proCode}
|
AND cd.pro_code = #{proCode}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
HAVING useNum > 0
|
HAVING useNum > 0 and useNum is not null
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getMonthMaxOrderByDate" resultType="java.lang.Integer">
|
<select id="getMonthMaxOrderByDate" resultType="java.lang.Integer">
|
||||||
|
|
|
||||||
|
|
@ -1747,7 +1747,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
SELECT sd.dept_name AS deptName,
|
SELECT sd.dept_name AS deptName,
|
||||||
sd.dept_abbreviation AS deptAbbreviation,
|
sd.dept_abbreviation AS deptAbbreviation,
|
||||||
ba.name AS cityName,
|
ba.name AS cityName,
|
||||||
IFNULL(sd.location, CONCAT(ba.latitude, ',', ba.longitude)) AS location,
|
IFNULL(sd.location, CONCAT(ba.lat, ',', ba.lng)) AS location,
|
||||||
-- 统计关联了mdi且mtv.maxTypeId=5080的总数量
|
-- 统计关联了mdi且mtv.maxTypeId=5080的总数量
|
||||||
IFNULL(sum(mdi.buy_price), 0) AS totalValue,
|
IFNULL(sum(mdi.buy_price), 0) AS totalValue,
|
||||||
SUM(CASE
|
SUM(CASE
|
||||||
|
|
|
||||||
|
|
@ -84,10 +84,10 @@
|
||||||
<if test="deptName != null and deptName != ''">
|
<if test="deptName != null and deptName != ''">
|
||||||
AND dept_name like concat('%', #{deptName}, '%')
|
AND dept_name like concat('%', #{deptName}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="companyId != null and companyId != 0">
|
<!--<if test="companyId != null and companyId != 0">
|
||||||
AND (d.dept_id = #{companyId} OR d.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{companyId},
|
AND (d.dept_id = #{companyId} OR d.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{companyId},
|
||||||
ancestors) ))
|
ancestors) ))
|
||||||
</if>
|
</if>-->
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectDeptVOList" resultMap="SysDeptVOResult">
|
<select id="selectDeptVOList" resultMap="SysDeptVOResult">
|
||||||
|
|
@ -151,10 +151,7 @@
|
||||||
LEFT JOIN tool_type tt3 ON tt2.parent_id = tt3.type_id
|
LEFT JOIN tool_type tt3 ON tt2.parent_id = tt3.type_id
|
||||||
WHERE
|
WHERE
|
||||||
tt.LEVEL = 4
|
tt.LEVEL = 4
|
||||||
<if test="deptId != null and deptId != 0">
|
|
||||||
AND (mdc.dept_id = #{deptId} OR mdc.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId},
|
|
||||||
ancestors) ))
|
|
||||||
</if>
|
|
||||||
GROUP BY
|
GROUP BY
|
||||||
tt.type_id
|
tt.type_id
|
||||||
) t
|
) t
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue