bug修复: 3880 用18187114427这个账户登录系统,分包合同管理工程名称字段新增不了数据

This commit is contained in:
gaowdong 2024-12-31 13:17:04 +08:00
parent 4d765aa1e8
commit c2a12d3463
2 changed files with 35 additions and 11 deletions

View File

@ -64,6 +64,9 @@ public class SelectController {
@CrossOrigin
@Log(title = "查询工程-orgId", businessType = BusinessType.SELECT)
public R getProByOrgId(SelectBean o){
// 前端穿的orgId实际是工程id用工程id去查org信息肯定对不上
o.setProId(o.getOrgId());
o.setOrgId(null);
SelfPermissionSettingUtils.getSelfPermissionByOrgId(o);
return service.getProByOrgId(o);
}
@ -161,6 +164,10 @@ public class SelectController {
@CrossOrigin
@Log(title = "查询公司和子公司", businessType = BusinessType.SELECT)
public R getCompanyAndSubCompany(SelectBean o){
//api 从名字上看是查公司和子公司但实际的sql却查的是工程信息
// 存在歧义下面这一行代码[o.setOrgId(null)]是根据sql语句来改的
// 前端穿的orgId实际是工程id用工程id去查org信息肯定对不上
o.setOrgId(null);
SelfPermissionSettingUtils.getSelfPermissionByOrgId(o);
return service.getCompanyAndSubCompany(o);
}

View File

@ -42,19 +42,33 @@
</select>
<select id="getCompanyAndSubCompany" resultType="com.bonus.system.api.domain.SelectBean">
<!-- SELECT-->
<!-- id,-->
<!-- `NAME`-->
<!-- FROM-->
<!-- bm_project_general bpg-->
<!-- left join bm_project bp on-->
<!-- WHERE is_active = '1'-->
<!-- <if test="orgId != null and orgId != '' and roleLevel &lt; 3 and roleLevel &gt; 1">-->
<!-- AND FIND_IN_SET(id,getParentList(#{orgId}))-->
<!-- </if>-->
<!-- <if test="orgId != null and orgId != '' and roleLevel &gt;= 3">-->
<!-- AND FIND_IN_SET(id,getParentList(#{orgId}))-->
<!-- limit 1,1-->
<!-- </if>-->
SELECT
id,
`NAME`
distinct
bpg.id,
bpg.NAME
FROM
bm_project_general
WHERE is_active = '1'
<if test="orgId != null and orgId != '' and roleLevel &lt; 3 and roleLevel &gt; 1">
AND FIND_IN_SET(id,getParentList(#{orgId}))
</if>
<if test="orgId != null and orgId != '' and roleLevel &gt;= 3">
AND FIND_IN_SET(id,getParentList(#{orgId}))
limit 1,1
bm_project_general bpg
left join bm_project bp on bpg.id = bp.project_general_id
WHERE bpg.is_active = '1'
and bp.is_active = '1'
<if test="orgId != null and orgId != ''">
and (bp.company_id = #{orgId} or bp.two_com_id = #{orgId})
</if>
</select>
<select id="getPrincipal" resultType="com.bonus.system.api.domain.SelectBean">
@ -81,7 +95,10 @@
SELECT bp.id,bp.name FROM bm_project bp
WHERE bp.is_active = '1'
<if test="orgId != null and orgId != ''">
AND bp.project_general_id = #{orgId}
AND (bp.company_id = #{orgId} or bp.two_com_id = #{orgId})
</if>
<if test="proId != null and proId != ''">
AND bp.project_general_id = #{proId}
</if>
<if test="type != null and type != '' and type == 1">
AND bp.pro_type in ('基建变电','基建线路','配网')