Commit b3636202 by liuyang

2024-05-27 修复工序设置、工艺流程、工序单价用户所属公司属于工厂导致无法查询问题

parent e7fbac6b
......@@ -174,6 +174,16 @@ public enum DdynamicEnum {
COMPANY_RECORD_BLOCK_ID("company_record_block_id","companyCode","companyName","HPXSUser.queryCompanyComboBox"),
/**
* 模块:用户公司
* 用途:公司下拉框
* 编写:ly
*/
COMPANY_RECORD_BOX_BLOCK_ID("company_record_box_block_id","orgId","orgCname","HGXSOrg.queryParent",new HashMap(){{
put("orgType", OrgTypeEnum.COMPANY.getCode());
put("isParentOrgId","true");
}}),
/**
* 模块:用户
* 用途:用户下拉框
* 编写:yk
......
......@@ -11,6 +11,7 @@ import com.baosight.hggp.hg.sb.domain.HGSB002;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
......@@ -38,11 +39,11 @@ public class ServiceHGSB001 extends ServiceEPBase {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
outInfo = super.query(inInfo, HGSB001.QUERY, new HGSB001());
Map qarma = new HashMap();
if (!HGSBTools.getRoleDataAuth()){
String userId = "admin".equals(UserSessionUtils.getUserId())?"":UserSessionUtils.getUserId();
qarma.put(User.FIELD_USER_ID,userId);
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),qarma);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_RECORD_BOX_BLOCK_ID),qarma);
qarma.clear();
Map userCompany = HGSBTools.getUserCompany();
......
......@@ -34,12 +34,13 @@ public class ServiceHGSJ001 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ001.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
EiInfo outInfo = super.initLoad(inInfo,new HGSJ002());
outInfo = super.query(inInfo, HGSJ001.QUERY, new HGSJ001());
EiInfo outInfo = super.query(inInfo, HGSJ001.QUERY, new HGSJ001());
Map qarma = new HashMap();
String userId = "admin".equals(UserSessionUtils.getUserId())?"":UserSessionUtils.getUserId();
qarma.put(User.FIELD_USER_ID,userId);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),qarma);
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_RECORD_BOX_BLOCK_ID),qarma);
qarma.clear();
List orgIds = getOrgId();
qarma.put(Org.FIELD_ORG_ID,orgIds);
......
......@@ -8,7 +8,9 @@ import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sj.domain.HGSJ002;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils;
......@@ -35,12 +37,13 @@ public class ServiceHGSJ002 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
EiInfo outInfo = super.initLoad(inInfo,new HGSJ002());
outInfo = super.query(inInfo, HGSJ002.QUERY, new HGSJ002());
EiInfo outInfo = super.query(inInfo, HGSJ002.QUERY, new HGSJ002());
Map qarma = new HashMap();
String userId = "admin".equals(UserSessionUtils.getUserId())?"":UserSessionUtils.getUserId();
qarma.put(User.FIELD_USER_ID,userId);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),qarma);
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_RECORD_BOX_BLOCK_ID),qarma);
return outInfo;
}
......
......@@ -35,8 +35,7 @@ public class ServiceHGSJ002A extends ServiceEPBase {
//inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HGPZ002A.FIELD_PARENT_ID,inInfo.get("inqu_status-0-parendId"));
//inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HGPZ002A.FIELD_FLOW_CODE,inInfo.get("inqu_status-0-flowCode"));
String factoryCode = inInfo.getCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HGSJ002A.FIELD_FACTORY_CODE).toString();
EiInfo outInfo = super.initLoad(inInfo,new HGSJ002());
outInfo = super.query(inInfo, HGSJ002A.QUERY, new HGSJ002A());
EiInfo outInfo = super.query(inInfo, HGSJ002A.QUERY, new HGSJ002A());
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROCESS_CODE_BLOCK_ID),
new HashMap<String,Object>(){{
put(HGSJ002A.FIELD_FACTORY_CODE,factoryCode);
......
......@@ -38,26 +38,29 @@ public class ServiceHGSJ003 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ003.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
EiInfo outInfo = super.initLoad(inInfo,new HGSJ002());
outInfo = super.query(inInfo, HGSJ003.QUERY, new HGSJ003());
List asList = new ArrayList<>();
EiInfo outInfo = super.query(inInfo, HGSJ003.QUERY, new HGSJ003());
Map qarma = new HashMap();
String userId = "admin".equals(UserSessionUtils.getUserId())?"":UserSessionUtils.getUserId();
qarma.put(User.FIELD_USER_ID,userId);
asList.add(DdynamicEnum.COMPANY_BOX_BLOCK_ID);
asList.add(DdynamicEnum.PROCESS_CODE_BLOCK_ID);
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_RECORD_BOX_BLOCK_ID),qarma);
qarma.clear();
if (CollectionUtils.isNotEmpty(orgList)){
Org org = orgList.get(0);
if (!org.getOrgType().equals("company")) {
//如果不是公司公司,则找到上一级
Org org1 = HGXSTools.XsOrg.queryCompany(org.getOrgId());
qarma.put(HGSJ002A.FIELD_FACTORY_CODE,org1.getOrgId());
List<Org> orgList1 = HGXSTools.XsOrg.queryParent(org.getOrgId());
for (Org org1:orgList1) {
if ("company".equals(org1.getOrgType()) && !"root".equals(org1.getParentOrgId())) {
qarma.put(HGSJ002A.FIELD_FACTORY_CODE,org1.getOrgId());
}
}
}else {
qarma.put(HGSJ002A.FIELD_FACTORY_CODE,org.getOrgId());
}
}
CommonMethod.initBlock(outInfo, asList, qarma);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.PROCESS_CODE_BLOCK_ID), qarma);
return outInfo;
}
......@@ -221,9 +224,23 @@ public class ServiceHGSJ003 extends ServiceEPBase {
@OperationLogAnnotation(operModul = "工艺单价",operType = "下载模板",operDesc = "下载模板")
public EiInfo downloadTemplate(EiInfo inInfo){
Map<String, Object> param = new HashMap<>(4);
Map map = HGSJTools.Hgsj003.getCompany(UserSession.getLoginName(),OrgTypeEnum.COMPANY.getCode());
param.put(HGSJ003.FIELD_FACTORY_CODE, map.get("orgEname"));
param.put(HGSJ003.FIELD_FACTORY_NAME, map.get("orgCname"));
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isNotEmpty(orgList)){
Org org = orgList.get(0);
if (!"company".equals(org.getOrgType())) {
//如果不是公司公司,则找到上一级
List<Org> orgList1 = HGXSTools.XsOrg.queryParent(org.getOrgId());
for (Org org1:orgList1) {
if ("company".equals(org1.getOrgType()) && !"root".equals(org1.getParentOrgId())) {
param.put(HGSJ003.FIELD_FACTORY_CODE,org1.getOrgId());
param.put(HGSJ003.FIELD_FACTORY_NAME,org1.getOrgCname());
}
}
}else {
param.put(HGSJ003.FIELD_FACTORY_CODE,org.getOrgId());
param.put(HGSJ003.FIELD_FACTORY_NAME,org.getOrgCname());
}
}
param.put(HGSJ003.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
param.put(HGSJ003.FIELD_STATUS, CommonConstant.YesNo.YES_1);
//param.put("orgType", OrgTypeEnum.COMPANY.getCode());
......
......@@ -130,6 +130,9 @@
<isNotEmpty prepend=" AND " property="orgType">
ORG_TYPE = #orgType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="isParentOrgId">
PARENT_ORG_ID != 'root'
</isNotEmpty>
AND ACCOUNT_CODE = #accountCode#
ORDER BY T2.LEVEL, T3.ORG_ID
</select>
......
......@@ -21,7 +21,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="groupName" cname="设备区域" placeholder="模糊查询" colWidth="3"/>
<%--<EF:EFSelect blockId="inqu_status" row="0" ename="groupCode" cname="设备区域" colWidth="3" filter="contains">
......@@ -48,7 +48,7 @@
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="120" required="false"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="设备区域"
columnTemplate="#=textField#" itemTemplate="#=textField#"
......
$(function (){
var factoryCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var factoryCodes = __eiInfo.getBlock("company_record_box_block_id").getMappedRows();
var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
......
......@@ -22,7 +22,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="processName" cname="工序名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="princName" cname="负责人" placeholder="模糊查询" colWidth="3"/>
......@@ -43,7 +43,7 @@
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="factoryName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="processCode" cname="工序编码" enable="false" width="100" align="center"/>
......
$(function (){
var factoryCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var factoryCodes = __eiInfo.getBlock("company_record_box_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
......
......@@ -17,7 +17,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="flowName" cname="流程名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="状态" colWidth="3" filter="contains">
......@@ -37,7 +37,7 @@
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="flowCode" cname="流程编码" enable="false" width="100" align="center"/>
<EF:EFColumn ename="flowName" cname="流程名称" width="120" enable="true" readonly="false" align="center" required="true"/>
......
$(function (){
var factoryCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var factoryCodes = __eiInfo.getBlock("company_record_box_block_id").getMappedRows();
var processCodes = __eiInfo.getBlock("processCode_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
......
......@@ -17,7 +17,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<%--<EF:EFSelect blockId="inqu_status" row="0" ename="processCode" cname="工序名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
......@@ -41,7 +41,7 @@
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="processCode" cname="工序名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment