feat(material): 高压MES物料查询库存和生产信息时增加组织ID过滤条件

This commit is contained in:
mzr 2025-10-17 11:03:36 +08:00
parent 138fdad30f
commit c6ccaf79e9
2 changed files with 6 additions and 5 deletions

View File

@ -42,6 +42,7 @@ public class MaterialToGyMesListener implements IBusinessListener {
private static final String updateUrl = "/bip/order/materialUpdate"; private static final String updateUrl = "/bip/order/materialUpdate";
private Map<String, String> configParams; private Map<String, String> configParams;
private BaseDAO baseDAO = new BaseDAO(); private BaseDAO baseDAO = new BaseDAO();
private String orgId = "";
public void doAction(IBusinessEvent event) throws BusinessException { public void doAction(IBusinessEvent event) throws BusinessException {
BDCommonEvent e = (BDCommonEvent) event; BDCommonEvent e = (BDCommonEvent) event;
@ -52,7 +53,7 @@ public class MaterialToGyMesListener implements IBusinessListener {
if (configParams.isEmpty()) { if (configParams.isEmpty()) {
throw new BusinessException("¸ßѹµÄgymes½Ó¿ÚȱÉÙÅäÖÃ"); throw new BusinessException("¸ßѹµÄgymes½Ó¿ÚȱÉÙÅäÖÃ");
} }
orgId = MyHelper.getStrValByCondition(OrgVO.getDefaultTableName(), OrgVO.PK_ORG, OrgVO.CODE + " = 'C046' and ISBUSINESSUNIT = 'Y'");
HYPubBO hyPub = new HYPubBO(); HYPubBO hyPub = new HYPubBO();
List<MaterialVO> voList = new ArrayList<>(); List<MaterialVO> voList = new ArrayList<>();
for (Object obj : objs) { for (Object obj : objs) {
@ -217,7 +218,7 @@ public class MaterialToGyMesListener implements IBusinessListener {
private Map getStockInfo(String pkMaterial) throws BusinessException { private Map getStockInfo(String pkMaterial) throws BusinessException {
String sql = " select martype, wholemanaflag, outpriority, remain,bd_stordoc.code as pk_stordoc" + String sql = " select martype, wholemanaflag, outpriority, remain,bd_stordoc.code as pk_stordoc" +
" from bd_materialstock left join bd_stordoc on bd_stordoc.pk_stordoc = bd_materialstock.pk_stordoc " + " from bd_materialstock left join bd_stordoc on bd_stordoc.pk_stordoc = bd_materialstock.pk_stordoc " +
" where pk_material = '" + pkMaterial + "' "; " where pk_material = '" + pkMaterial + "' " + " and bd_materialstock.pk_org = '" + orgId + "' ";
Map map = (Map) new BaseDAO().executeQuery(sql, new MapProcessor()); Map map = (Map) new BaseDAO().executeQuery(sql, new MapProcessor());
return map; return map;
} }
@ -228,7 +229,7 @@ public class MaterialToGyMesListener implements IBusinessListener {
"FROM " + "FROM " +
" bd_materialprod a" + " bd_materialprod a" +
" left join org_dept b on a.pk_prodeptdoc = b.pk_dept " + " left join org_dept b on a.pk_prodeptdoc = b.pk_dept " +
" where a.pk_material = '" + pkMaterial + "' "; " where a.pk_material = '" + pkMaterial + "' " + " and a.pk_org = '" + orgId + "' ";
Map map = (Map) new BaseDAO().executeQuery(sql, new MapProcessor()); Map map = (Map) new BaseDAO().executeQuery(sql, new MapProcessor());
return map; return map;
} }

View File

@ -300,7 +300,7 @@ public class MaterialToGyMesListener implements IBusinessListener {
private Map getStockInfo(String pkMaterial) throws BusinessException { private Map getStockInfo(String pkMaterial) throws BusinessException {
String sql = " select martype, wholemanaflag, outpriority, remain,bd_stordoc.code as pk_stordoc" + String sql = " select martype, wholemanaflag, outpriority, remain,bd_stordoc.code as pk_stordoc" +
" from bd_materialstock left join bd_stordoc on bd_stordoc.pk_stordoc = bd_materialstock.pk_stordoc " + " from bd_materialstock left join bd_stordoc on bd_stordoc.pk_stordoc = bd_materialstock.pk_stordoc " +
" where pk_material = '" + pkMaterial + "' "; " where pk_material = '" + pkMaterial + "' " + " and bd_materialstock.pk_org = '" + orgId + "' ";
Map map = (Map) new BaseDAO().executeQuery(sql, new MapProcessor()); Map map = (Map) new BaseDAO().executeQuery(sql, new MapProcessor());
return map; return map;
} }
@ -311,7 +311,7 @@ public class MaterialToGyMesListener implements IBusinessListener {
"FROM " + "FROM " +
" bd_materialprod a" + " bd_materialprod a" +
" left join org_dept b on a.pk_prodeptdoc = b.pk_dept " + " left join org_dept b on a.pk_prodeptdoc = b.pk_dept " +
" where a.pk_material = '" + pkMaterial + "' "; " where a.pk_material = '" + pkMaterial + "' " + " and a.pk_org = '" + orgId + "' ";
Map map = (Map) new BaseDAO().executeQuery(sql, new MapProcessor()); Map map = (Map) new BaseDAO().executeQuery(sql, new MapProcessor());
return map; return map;
} }