Commit 25ffb498 by 宋祥

1.厂区及生产组下拉框调整

parent 4ef2cb27
...@@ -112,14 +112,14 @@ public enum DdynamicEnum { ...@@ -112,14 +112,14 @@ public enum DdynamicEnum {
* 用途:厂区管理下拉框 * 用途:厂区管理下拉框
* 编写:songx * 编写:songx
*/ */
FACTORY_RECORD_BLOCK_ID("factory_record_block_id","factoryCode","factoryName","HPPZ011.queryComboBox"), FACTORY_RECORD_BLOCK_ID("factory_record_block_id","orgId","orgCname","HPXSOrg.queryFactoryComboBox"),
/** /**
* 模块:组管理 * 模块:组管理
* 用途:组管理下拉框 * 用途:组管理下拉框
* 编写:songx * 编写:songx
*/ */
GROUP_RECORD_BLOCK_ID("group_record_block_id","groupCode","groupName","HPPZ011.queryGroupComboBox"), GROUP_RECORD_BLOCK_ID("group_record_block_id","orgId","orgCname","HPXSOrg.queryGroupComboBox"),
/** /**
* 分厂与组一起查出,用于生产任务分派 * 分厂与组一起查出,用于生产任务分派
*/ */
...@@ -152,6 +152,7 @@ public enum DdynamicEnum { ...@@ -152,6 +152,7 @@ public enum DdynamicEnum {
* 用途:项目档案下拉框 * 用途:项目档案下拉框
* 编写:wwl * 编写:wwl
*/ */
@Deprecated
ORG_PROD_BLOCK_ID("org_prod_block_id","orgNo","orgName","HPSC005.queryOrgComboBox"), ORG_PROD_BLOCK_ID("org_prod_block_id","orgNo","orgName","HPSC005.queryOrgComboBox"),
......
package com.baosight.hpjx.hp.xs.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.ObjectUtils;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/1/15,15:08
*/
public class ServiceHPXSOrg extends ServiceBase {
/**
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "组织管理", operType = "查询", operDesc = "厂区下拉框")
public EiInfo queryFactoryComboBox(EiInfo inInfo) {
try {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.FACTORY_RECORD_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询厂区失败");
}
return inInfo;
}
/**
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "组织管理", operType = "查询", operDesc = "组下拉框")
public EiInfo queryGroupComboBox(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
if (ObjectUtils.isEmpty(queryRow.get("parentOrgId"))) {
queryRow.put("parentOrgId", CommonConstant.Field.ROOT);
}
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.GROUP_RECORD_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, queryRow, false);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询组失败");
}
return inInfo;
}
}
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<sqlMap namespace="HPXSOrg"> <sqlMap namespace="HPXSOrg">
<sql id="condition"> <sql id="condition">
AND IS_DELETED = '0'
<isNotEmpty prepend=" AND " property="orgEname"> <isNotEmpty prepend=" AND " property="orgEname">
ORG_ENAME = #orgEname# ORG_ENAME = #orgEname#
</isNotEmpty> </isNotEmpty>
...@@ -12,9 +13,6 @@ ...@@ -12,9 +13,6 @@
<isNotEmpty prepend=" AND " property="orgId"> <isNotEmpty prepend=" AND " property="orgId">
ORG_ID = #orgId# ORG_ID = #orgId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="orgIds">
ORG_ID IN <iterate close=")" open="(" conjunction="," property="orgIds">#orgIds[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgType"> <isNotEmpty prepend=" AND " property="orgType">
ORG_TYPE = #orgType# ORG_TYPE = #orgType#
</isNotEmpty> </isNotEmpty>
...@@ -26,6 +24,12 @@ ...@@ -26,6 +24,12 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="orgIds">
ORG_ID IN <iterate close=")" open="(" conjunction="," property="orgIds">#orgIds[]#</iterate>
</isNotEmpty>
</sql>
<sql id="order"> <sql id="order">
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="order"> <isNotEmpty property="order">
...@@ -48,6 +52,7 @@ ...@@ -48,6 +52,7 @@
FROM ${platSchema}.TXSOG01 FROM ${platSchema}.TXSOG01
WHERE 1=1 WHERE 1=1
<include refid="condition"/> <include refid="condition"/>
<include refid="customCondition"/>
<include refid="order"/> <include refid="order"/>
</select> </select>
...@@ -57,6 +62,7 @@ ...@@ -57,6 +62,7 @@
FROM ${platSchema}.TXSOG01 FROM ${platSchema}.TXSOG01
WHERE 1=1 WHERE 1=1
<include refid="condition"/> <include refid="condition"/>
<include refid="customCondition"/>
</select> </select>
<!-- 查询组织信息 --> <!-- 查询组织信息 -->
...@@ -66,9 +72,51 @@ ...@@ -66,9 +72,51 @@
ORG_CNAME as "orgCname" ORG_CNAME as "orgCname"
FROM ${platSchema}.TXSOG01 FROM ${platSchema}.TXSOG01
WHERE 1=1 WHERE 1=1
AND ORG_TYPE IN ('company', 'dept') AND ORG_TYPE != 'org'
<include refid="condition"/> <include refid="condition"/>
<include refid="customCondition"/>
<include refid="order"/> <include refid="order"/>
</select> </select>
<!-- 查询厂区信息 -->
<select id="queryFactoryComboBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
ORG_ID as "orgId",
ORG_CNAME as "orgCname"
FROM ${platSchema}.TXSOG01
WHERE 1=1
AND ORG_TYPE = 'factory'
<include refid="condition"/>
<include refid="order"/>
</select>
<!-- 查询组信息(递归) -->
<select id="queryGroupComboBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
T2.LEVEL AS "level", T3.ORG_ID AS "orgId", T3.ORG_CNAME AS "orgCname"
FROM (
SELECT
@CODES AS CODES,
(SELECT @CODES := GROUP_CONCAT(ORG_ID)
FROM ${platSchema}.TXSOG01
WHERE FIND_IN_SET(PARENT_ORG_ID, @CODES)
) AS T1,
@LEVEL:= @LEVEL+1 AS LEVEL
FROM ${platSchema}.TXSOG01,
(SELECT @CODES:=#parentOrgId#, @LEVEL:= 0) T4
WHERE @CODES IS NOT NULL
) T2,
${platSchema}.TXSOG01 T3
WHERE 1=1
AND FIND_IN_SET(T3.ORG_ID, T2.CODES)
AND ORG_TYPE IN ('prodGroup', 'cutGroup')
<isNotEmpty prepend=" AND " property="orgType">
ORG_TYPE = #orgType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
ORDER BY T2.LEVEL, T3.ORG_ID
</select>
</sqlMap> </sqlMap>
...@@ -24,10 +24,10 @@ $(function () { ...@@ -24,10 +24,10 @@ $(function () {
}, },
editor: function (container, options) { editor: function (container, options) {
let inInfo = new EiInfo(); let inInfo = new EiInfo();
inInfo.set("inqu_status-0-factoryCode", options.model["factoryCode"]); inInfo.set("inqu_status-0-parentOrgId", options.model["factoryCode"]);
// 1:生产组 // 1:生产组
inInfo.set("inqu_status-0-groupType", 1); inInfo.set("inqu_status-0-orgType", 'prodGroup');
inInfo.set("serviceName", "HPPZ011"); inInfo.set("serviceName", "HPXSOrg");
inInfo.set("methodName", "queryGroupComboBox"); inInfo.set("methodName", "queryGroupComboBox");
inInfo.set("blockId", "group_record_block_id"); inInfo.set("blockId", "group_record_block_id");
inInfo.set("field", options.field); inInfo.set("field", options.field);
...@@ -64,8 +64,8 @@ $(function () { ...@@ -64,8 +64,8 @@ $(function () {
$(window).load(function () { $(window).load(function () {
// 生产组名称 // 生产组名称
let inInfo = new EiInfo(); let inInfo = new EiInfo();
inInfo.set("inqu_status-0-groupType", 1); inInfo.set("inqu_status-0-orgType", 'prodGroup');
EiCommunicator.send("HPPZ011", "queryGroupComboBox", inInfo, { EiCommunicator.send("HPXSOrg", "queryGroupComboBox", inInfo, {
onSuccess: function (ei) { onSuccess: function (ei) {
factoryGroupGlobalData = ei.getBlock("group_record_block_id").getMappedRows(); factoryGroupGlobalData = ei.getBlock("group_record_block_id").getMappedRows();
}, },
......
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