Merge remote-tracking branch 'origin/ah-simple-test' into ah-simple-test

This commit is contained in:
jiang 2026-01-05 13:42:42 +08:00
commit 46b1e2a86d
24 changed files with 265 additions and 75 deletions

View File

@ -426,11 +426,17 @@ public class BackChangeServiceImpl implements BackChangeService {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据
if (userId != null && deptId != null
&& !userId.equals(ADMIN_ID)
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// if (userId != null && deptId != null
// && !userId.equals(ADMIN_ID)
// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// dto.setCompanyId(deptId);
// }
if(ADMIN_ID.equals(userId)){
dto.setCompanyId(1L);
}else{
dto.setCompanyId(deptId);
}
return mapper.getList(dto);
}

View File

@ -126,4 +126,6 @@ public class CsDeviceChangeVo {
private String endTime;
private String useTime;
private Long companyId;
}

View File

@ -502,9 +502,14 @@ public class DevChangeServiceImpl implements DevChangeService {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据
if (userId != null && deptId != null
&& !userId.equals(ADMIN_ID)
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// if (userId != null && deptId != null
// && !userId.equals(ADMIN_ID)
// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// dto.setCompanyId(deptId);
// }
if(ADMIN_ID.equals(userId)){
dto.setCompanyId(1L);
}else{
dto.setCompanyId(deptId);
}
return mapper.getList(dto);
@ -857,9 +862,14 @@ public class DevChangeServiceImpl implements DevChangeService {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据
if (userId != null && deptId != null
&& !userId.equals(ADMIN_ID)
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// if (userId != null && deptId != null
// && !userId.equals(ADMIN_ID)
// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// dto.setCompanyId(deptId);
// }
if(ADMIN_ID.equals(userId)){
dto.setCompanyId(1L);
}else{
dto.setCompanyId(deptId);
}
return mapper.getOutboundList(dto);
@ -1137,7 +1147,13 @@ public class DevChangeServiceImpl implements DevChangeService {
vo.setEndTime(endTimeAfterAddOneDay.format(dateFormatter));
}
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid();
if(ADMIN_ID.equals(userId)){
vo.setCompanyId(1L);
}else{
vo.setCompanyId(deptId);
}
return mapper.getDevChangeList(vo);
} catch (Exception e) {
log.error(e.getMessage());

View File

@ -33,9 +33,14 @@ public class MaDevInfoServiceImpl implements MaDevInfoService {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据
if (userId != null && deptId != null
&& !userId.equals(ADMIN_ID)
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// if (userId != null && deptId != null
// && !userId.equals(ADMIN_ID)
// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// o.setCompanyId(deptId);
// }
if(ADMIN_ID.equals(userId)){
o.setCompanyId(1L);
}else{
o.setCompanyId(deptId);
}
List<MaDevInfo> list = mapper.list(o);
@ -248,12 +253,15 @@ public class MaDevInfoServiceImpl implements MaDevInfoService {
Long companyId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据
if (userId != null && companyId != null
&& !userId.equals(ADMIN_ID)
&& !companyId.equals(PROVINCE_COMPANY_DEPT_ID)) {
companyId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
} else {
companyId = null;
// if (userId != null && companyId != null
// && !userId.equals(ADMIN_ID)
// && !companyId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// companyId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
// } else {
// companyId = null;
// }
if(ADMIN_ID.equals(userId)){
companyId = 1L;
}
Integer totalCount = mapper.selectTotalDeviceCount(companyId);

View File

@ -29,9 +29,14 @@ public class MaDevRetireWarningServiceImpl implements MaDevRetireWarningService{
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据
if (userId != null && deptId != null
&& !userId.equals(ADMIN_ID)
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// if (userId != null && deptId != null
// && !userId.equals(ADMIN_ID)
// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// o.setCompanyId(deptId);
// }
if(ADMIN_ID.equals(userId)){
o.setCompanyId(1L);
}else{
o.setCompanyId(deptId);
}
return mapper.list(o);

View File

@ -100,5 +100,7 @@ public class MaDevQc extends BaseEntity implements Serializable {
private String phonenumber;
private String alert;
private Long companyId;
}

View File

@ -22,6 +22,8 @@ import java.util.Date;
import java.util.List;
import java.util.Optional;
import static com.bonus.common.biz.constant.MaterialConstants.ADMIN_ID;
/**
* @Author ma_sh
* @create 2024/12/5 15:53
@ -47,6 +49,13 @@ public class MaDevQcServiceImpl implements MaDevQcService {
@Override
public List<MaDevQc> selectDevQcList(MaDevQc maDevQc) {
maDevQc.setQcCom(SecurityUtils.getLoginUser().getSysUser().getDeptId().toString());
Long userId = SecurityUtils.getLoginUser().getSysUser().getUserId();
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
if(ADMIN_ID.equals(userId)){
maDevQc.setCompanyId(1L);
}else{
maDevQc.setCompanyId(deptId);
}
return maDevQcMapper.selectDevQcList(maDevQc);
}

View File

@ -208,9 +208,14 @@ public class RepairServiceImpl implements RepairService {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据
if (userId != null && deptId != null
&& !userId.equals(ADMIN_ID)
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// if (userId != null && deptId != null
// && !userId.equals(ADMIN_ID)
// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// bean.setCompanyId(deptId);
// }
if(ADMIN_ID.equals(userId)){
bean.setCompanyId(1L);
}else{
bean.setCompanyId(deptId);
}
List<ToBeRepair> list = mapper.getRepairList(bean);

View File

@ -276,9 +276,14 @@ public class ToBeScrapServiceImpl implements ToBeScrapService {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据
if (userId != null && deptId != null
&& !userId.equals(ADMIN_ID)
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// if (userId != null && deptId != null
// && !userId.equals(ADMIN_ID)
// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// bean.setCompanyId(deptId);
// }
if(ADMIN_ID.equals(userId)){
bean.setCompanyId(1L);
}else{
bean.setCompanyId(deptId);
}
return scrapMapper.getScrapApplyList(bean);

View File

@ -41,9 +41,14 @@ public class ToolLedgerServiceImpl implements ToolLedgerService {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据
if (userId != null && deptId != null
&& !userId.equals(ADMIN_ID)
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// if (userId != null && deptId != null
// && !userId.equals(ADMIN_ID)
// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// entity.setCompanyId(deptId);
// }
if(ADMIN_ID.equals(userId)){
entity.setCompanyId(1L);
}else{
entity.setCompanyId(deptId);
}
return mapper.list(entity);
@ -60,9 +65,14 @@ public class ToolLedgerServiceImpl implements ToolLedgerService {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据
if (userId != null && deptId != null
&& !userId.equals(ADMIN_ID)
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// if (userId != null && deptId != null
// && !userId.equals(ADMIN_ID)
// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// entity.setCompanyId(deptId);
// }
if(ADMIN_ID.equals(userId)){
entity.setCompanyId(1L);
}else{
entity.setCompanyId(deptId);
}
List<ToolLedgerEntity> toolLedgerEntities = mapper.listCode(entity);

View File

@ -33,9 +33,9 @@ public class UpOrDownEquipmentServiceImpl implements UpOrDownEquipmentService {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据
if (userId != null && deptId != null
&& !userId.equals(ADMIN_ID)
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
if(ADMIN_ID.equals(userId)){
entity.setCompanyId(1L);
}else{
entity.setCompanyId(deptId);
}

View File

@ -38,9 +38,14 @@ public class UpOrDownToolServiceImpl implements UpOrDownToolService {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据
if (userId != null && deptId != null
&& !userId.equals(ADMIN_ID)
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// if (userId != null && deptId != null
// && !userId.equals(ADMIN_ID)
// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// entity.setCompanyId(deptId);
// }
if(ADMIN_ID.equals(userId)){
entity.setCompanyId(1L);
}else{
entity.setCompanyId(deptId);
}
return upOrDownToolMapper.list(entity);

View File

@ -114,9 +114,14 @@ public class WarehousingServiceImpl implements WarehousingService {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据
if (userId != null && deptId != null
&& !userId.equals(ADMIN_ID)
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// if (userId != null && deptId != null
// && !userId.equals(ADMIN_ID)
// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// warehousing.setCompanyId(deptId);
// }
if(ADMIN_ID.equals(userId)){
warehousing.setCompanyId(1L);
}else{
warehousing.setCompanyId(deptId);
}
List<WarehousingEntity> warehousingEntities = mapper.selectList(warehousing);

View File

@ -547,8 +547,15 @@
<if test="useUnit != null and useUnit != ''">
and cd.use_unit = #{useUnit}
</if>
<if test="companyId != null">
and cd.company_id = #{companyId}
<if test="companyId != null and companyId != 1 ">
and cd.company_id
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if>
GROUP BY
cd.id
@ -578,4 +585,4 @@
</select>
</mapper>
</mapper>

View File

@ -183,6 +183,16 @@
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!='' ">
and cds.create_time between #{startTime} and #{endTime}
</if>
<if test="companyId !=null and companyId !=1" >
and cds.company_id
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if>
GROUP BY
cds.id,
cds.change_status,
@ -567,8 +577,15 @@
<if test="proCode != null and proCode != ''">
and cd.pro_code = #{proCode}
</if>
<if test="companyId != null">
and cd.company_id = #{companyId}
<if test="companyId != null and companyId != 1 ">
and cd.company_id
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if>
GROUP BY
cd.id
@ -719,8 +736,18 @@
<if test="taskStatus != null and taskStatus != ''">
AND temp.taskStatus = #{taskStatus}
</if>
<if test="companyId != null and taskStatus != ''">
AND temp.companyId = #{companyId}
<!-- <if test="companyId != null and taskStatus != ''">-->
<!-- AND temp.companyId = #{companyId}-->
<!-- </if>-->
<if test="companyId != null and companyId != 1 ">
AND temp.companyId
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if>
</where>
@ -1281,4 +1308,4 @@
<delete id="deleteChangeInfo">
update cs_device_change set del_flag = '1' where id = #{id}
</delete>
</mapper>
</mapper>

View File

@ -360,8 +360,15 @@
LEFT JOIN sys_cnarea sc ON sc.area_code = mdi.province_id
<where>
mdi.is_active = '1' and mdi.entry_status = '1'
<if test="companyId != null">
AND mdi.on_company = #{companyId}
<if test="companyId !=null and companyId != 1">
AND mdi.on_company
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if>
<if test="typeId != null and typeId != 0 ">
and (
@ -527,8 +534,15 @@
LEFT JOIN sys_cnarea sc ON sc.area_code = mdi.province_id
<where>
mdi.is_active = '1' and mdi.entry_status = '1'
<if test="companyId != null">
AND mdi.on_company = #{companyId}
<if test="companyId != nul and companyId != 1">
AND mdi.on_company
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if>
</where>
</select>

View File

@ -63,8 +63,15 @@
<if test="manufacturerId != null and manufacturerId != ''">
AND mdi.supplier_id like concat('%',#{manufacturerId},'%')
</if>
<if test="companyId != null">
AND mdi.on_company = #{companyId}
<if test="companyId !=1 and companyId != null">
AND mdi.on_company
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if>
) a
<where>

View File

@ -109,8 +109,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createStartTime != null and createStartTime != '' and createEndTime != null and createEndTime != ''">
and DATE_FORMAT(m1.create_time,'%Y-%m-%d') between #{createStartTime} and #{createEndTime}
</if>
<if test="qcCom != null and qcCom != ''">
and m2.on_company = #{qcCom}
<if test="companyId != null and companyId != 1 ">
and m2.on_company
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if>
<if test="alert != null and alert != ''">
<choose>

View File

@ -287,8 +287,16 @@
<if test="status != null and status!=''">
AND cdc.review_status = #{status}
</if>
<if test="companyId != null">
and cdc.company_id = #{companyId}
<if test="companyId != null and changeId != 1">
and cdc.company_id
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if>
<if test="isAudit==1">
and cdc.review_status !='5'
@ -448,4 +456,4 @@
id = #{id}
LIMIT 1
</select>
</mapper>
</mapper>

View File

@ -144,8 +144,15 @@
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!='' ">
AND cdc.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
</if>
<if test="companyId != null">
and cdc.company_id = #{companyId}
<if test="companyId != null and changeId != 1">
and cdc.company_id
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if>
GROUP BY cdc.id
ORDER BY
@ -449,4 +456,4 @@
<delete id="deleteChangeInfo">
update cs_device_change set del_flag = '1' where id = #{id}
</delete>
</mapper>
</mapper>

View File

@ -104,8 +104,14 @@
AND tt.manage_type = #{manageMode}
</if>
<if test="companyId != null">
AND tl.company_id = #{companyId}
<if test="companyId != null and companyId != 1 ">
AND tl.company_id in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if>
<if test="typeName != null and typeName != ''">
AND tt.type_name LIKE CONCAT('%', #{typeName}, '%')
@ -228,8 +234,15 @@
<if test="toolCode != null and toolCode != ''">
AND tl.tool_code LIKE CONCAT('%', #{toolCode}, '%')
</if>
<if test="companyId != null">
AND (tl.company_id = #{companyId} OR tl.company_id IS NULL)
<if test="companyId != null and companyId != 1">
<!-- AND (tl.company_id = #{companyId} OR tl.company_id IS NULL)-->
and tl.company_id in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if>
ORDER BY
tl.create_time DESC

View File

@ -198,8 +198,16 @@
<if test="subProcess != null and subProcess != ''">
and mtv.childGx like concat('%', #{subProcess}, '%')
</if>
<if test="companyId != null and companyId != ''">
and mdi.on_company = #{companyId}
<if test="companyId != null and companyId != 1">
and mdi.on_company
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if>

View File

@ -89,7 +89,14 @@
AND tt.type_name LIKE CONCAT('%', #{typeName}, '%')
</if>
<if test="companyId != null and companyId != ''">
AND tl.company_id = #{companyId}
AND tl.company_id
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if>
GROUP BY tl.id

View File

@ -153,8 +153,15 @@
<if test="isStatus != null and isStatus != ''">
AND bw.status != #{isStatus}
</if>
<if test="companyId != null and companyId != ''">
AND su.dept_id = #{companyId}
<if test="companyId !=null and companyId != 1">
AND su.dept_id
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if>
<if test="startTime != null and endTime != null ">
and bw.create_time &gt;= #{startTime}
@ -221,4 +228,4 @@
</select>
</mapper>
</mapper>