Commit 352b58e0 by 宋祥

1.质量巡检单功能

parent 832fb1fb
...@@ -101,8 +101,8 @@ public enum DdynamicEnum { ...@@ -101,8 +101,8 @@ public enum DdynamicEnum {
MAT_CODE_BLOCK_ID("mat_code_block_id","matCode","matCode","HPPZ007.queryMatCodeComboBox"), MAT_CODE_BLOCK_ID("mat_code_block_id","matCode","matCode","HPPZ007.queryMatCodeComboBox"),
/** /**
* 模块:存货编码 * 模块:用户
* 用途:存货编码下拉框 * 用途:用户下拉框
* 编写:yk * 编写:yk
*/ */
USER_BLOCK_ID("user_block_id","loginName","userName","HPXSUser.queryComboBox"), USER_BLOCK_ID("user_block_id","loginName","userName","HPXSUser.queryComboBox"),
...@@ -133,6 +133,36 @@ public enum DdynamicEnum { ...@@ -133,6 +133,36 @@ public enum DdynamicEnum {
*/ */
PROJ_RECORD_BLOCK_ID("proj_record_block_id","projCode","projName","HPSC001.queryComboBox"), PROJ_RECORD_BLOCK_ID("proj_record_block_id","projCode","projName","HPSC001.queryComboBox"),
/**
* 模块:部件档案
* 用途:项目档案下拉框
* 编写:wwl
*/
INVENT_RECORD_BLOCK_ID("invent_record_block_id","prdtCode","prdtName","HPSC003.queryInventComboBox"),
/**
* 模块:零部件档案
* 用途:项目档案下拉框
* 编写:wwl
*/
SUB_INVENT_RECORD_BLOCK_ID("sub_invent_record_block_id","prdtCode","prdtName","HPSC004.queryInventComboBox"),
/**
* 模块:生产组
* 用途:项目档案下拉框
* 编写:wwl
*/
ORG_PROD_BLOCK_ID("org_prod_block_id","orgNo","orgName","HPSC005.queryOrgComboBox"),
/**
* 模块:项目档案(生产中)
* 用途:项目档案下拉框
* 编写:wwl
*/
PROJ_PROD_BLOCK_ID("proj_prod_block_id","projCode","projName","HPSC005.queryProjComboBox"),
//------------------------------------用户管理----------------------------------- //------------------------------------用户管理-----------------------------------
/** /**
......
package com.baosight.hpjx.core.dao; package com.baosight.hpjx.core.dao;
import com.baosight.hpjx.core.security.UserSessionUtils; import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.xs.tools.HPXSUserTools; import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.AssertUtils; import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.DateUtils; import com.baosight.hpjx.util.DateUtils;
import com.baosight.iplat4j.core.data.DaoEPBase; import com.baosight.iplat4j.core.data.DaoEPBase;
...@@ -119,7 +119,7 @@ public class DaoUtils { ...@@ -119,7 +119,7 @@ public class DaoUtils {
} }
// 创建人部门编码 // 创建人部门编码
try { try {
BeanUtils.setProperty(bean, "depCode", HPXSUserTools.getOrgId()); BeanUtils.setProperty(bean, "depCode", HPXSTools.getOrgId());
} catch (Exception e) { } catch (Exception e) {
log.warn("写入创建人企业编码失败", e); log.warn("写入创建人企业编码失败", e);
} }
...@@ -175,7 +175,7 @@ public class DaoUtils { ...@@ -175,7 +175,7 @@ public class DaoUtils {
} }
// 创建人部门编码 // 创建人部门编码
try { try {
map.put("depCode", HPXSUserTools.getOrgId()); map.put("depCode", HPXSTools.getOrgId());
} catch (Exception e) { } catch (Exception e) {
log.warn("写入创建人企业编码失败", e); log.warn("写入创建人企业编码失败", e);
} }
......
package com.baosight.hpjx.core.security; package com.baosight.hpjx.core.security;
import com.baosight.hpjx.hp.xs.domain.User; import com.baosight.hpjx.hp.xs.domain.User;
import com.baosight.hpjx.hp.xs.tools.HPXSUserTools; import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.soa.XLocalManager; import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession; import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentMap;
...@@ -80,7 +79,7 @@ public class UserSessionUtils extends UserSession { ...@@ -80,7 +79,7 @@ public class UserSessionUtils extends UserSession {
} }
String depCode = MapUtils.getString(depMap, loginName); String depCode = MapUtils.getString(depMap, loginName);
if (depCode == null) { if (depCode == null) {
depCode = HPXSUserTools.getOrgId(); depCode = HPXSTools.getOrgId();
depCode = depCode == null ? "" : depCode.trim(); depCode = depCode == null ? "" : depCode.trim();
depMap.put(loginName, depCode); depMap.put(loginName, depCode);
} }
......
...@@ -209,4 +209,16 @@ public class HPSqlConstant { ...@@ -209,4 +209,16 @@ public class HPSqlConstant {
public static final String UPDATE_ASSIGN_NUM = "HPSC005.updateAssignNum"; public static final String UPDATE_ASSIGN_NUM = "HPSC005.updateAssignNum";
} }
/**
* 质量巡检单
*
* @author:songx
* @date:2024/2/2,14:23
*/
public class HPZL001 {
// 已处理
public static final String DO_PROCESS = "HPZL001.doProcess";
}
} }
package com.baosight.hpjx.hp.pz.service; package com.baosight.hpjx.hp.pz.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant; import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant; import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ009; import com.baosight.hpjx.hp.pz.domain.HPPZ009;
import com.baosight.hpjx.hp.xs.tools.HPXSUserTools; import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.AssertUtils; import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils; import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils; import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.RsaUtils; import com.baosight.hpjx.util.RsaUtils;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
...@@ -21,7 +18,6 @@ import com.baosight.iplat4j.core.web.threadlocal.UserSession; ...@@ -21,7 +18,6 @@ import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import com.baosight.xservices.xs.constants.LoginConstants; import com.baosight.xservices.xs.constants.LoginConstants;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -257,7 +253,7 @@ public class ServiceHPPZ009 extends ServiceBase { ...@@ -257,7 +253,7 @@ public class ServiceHPPZ009 extends ServiceBase {
HPPZ009 fPz009 = new HPPZ009(); HPPZ009 fPz009 = new HPPZ009();
fPz009.fromMap(resultRows.get(i)); fPz009.fromMap(resultRows.get(i));
// 校验企业下是否存在用户 // 校验企业下是否存在用户
int count = HPXSUserTools.countByCompany(fPz009.getCompanyCode()); int count = HPXSTools.countByCompany(fPz009.getCompanyCode());
if (count > 0) { if (count > 0) {
throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户",
fPz009.getCompanyName())); fPz009.getCompanyName()));
......
...@@ -5,7 +5,7 @@ import com.baosight.hpjx.core.dao.DaoUtils; ...@@ -5,7 +5,7 @@ import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPSqlConstant; import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ009; import com.baosight.hpjx.hp.pz.domain.HPPZ009;
import com.baosight.hpjx.hp.pz.domain.HPPZ010; import com.baosight.hpjx.hp.pz.domain.HPPZ010;
import com.baosight.hpjx.hp.xs.tools.HPXSUserTools; import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.AssertUtils; import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.LogUtils; import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.RsaUtils; import com.baosight.hpjx.util.RsaUtils;
...@@ -248,7 +248,7 @@ public class ServiceHPPZ010 extends ServiceBase { ...@@ -248,7 +248,7 @@ public class ServiceHPPZ010 extends ServiceBase {
HPPZ009 fPz009 = new HPPZ009(); HPPZ009 fPz009 = new HPPZ009();
fPz009.fromMap(resultRows.get(i)); fPz009.fromMap(resultRows.get(i));
// 校验企业下是否存在用户 // 校验企业下是否存在用户
int count = HPXSUserTools.countByCompany(fPz009.getCompanyCode()); int count = HPXSTools.countByCompany(fPz009.getCompanyCode());
if (count > 0) { if (count > 0) {
throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户",
fPz009.getCompanyName())); fPz009.getCompanyName()));
......
...@@ -5,6 +5,7 @@ import com.baosight.hpjx.core.dao.DaoUtils; ...@@ -5,6 +5,7 @@ import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils; import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant; import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils; import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
...@@ -195,5 +196,17 @@ public class ServiceHPSC001 extends ServiceBase { ...@@ -195,5 +196,17 @@ public class ServiceHPSC001 extends ServiceBase {
throw new PlatException(outInfo.getMsg()); throw new PlatException(outInfo.getMsg());
} }
} }
/**
* 项目下拉框
*
* @param inInfo
* @return
*/
public EiInfo queryComboBox(EiInfo inInfo) {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.PROJ_RECORD_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo));
return inInfo;
}
} }
...@@ -8,6 +8,7 @@ import com.baosight.hpjx.hp.sc.domain.HPSC003; ...@@ -8,6 +8,7 @@ import com.baosight.hpjx.hp.sc.domain.HPSC003;
import com.baosight.hpjx.hp.sc.domain.HPSC004; import com.baosight.hpjx.hp.sc.domain.HPSC004;
import com.baosight.hpjx.hp.sc.domain.HPSC005; import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
...@@ -18,6 +19,7 @@ import com.baosight.iplat4j.core.web.threadlocal.UserSession; ...@@ -18,6 +19,7 @@ import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
...@@ -247,5 +249,18 @@ public class ServiceHPSC003 extends ServiceBase { ...@@ -247,5 +249,18 @@ public class ServiceHPSC003 extends ServiceBase {
eiInfo.setMsg("提交成功!"); eiInfo.setMsg("提交成功!");
return eiInfo; return eiInfo;
} }
/**
* 部件下拉框
*
* @param inInfo
* @return
*/
public EiInfo queryInventComboBox(EiInfo inInfo) {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.INVENT_RECORD_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo));
return inInfo;
}
} }
package com.baosight.hpjx.hp.sc.service; package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.sc.domain.HPSC004; import com.baosight.hpjx.hp.sc.domain.HPSC004;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
...@@ -144,4 +147,17 @@ public class ServiceHPSC004 extends ServiceBase { ...@@ -144,4 +147,17 @@ public class ServiceHPSC004 extends ServiceBase {
eiInfo.set("list",list); eiInfo.set("list",list);
return eiInfo; return eiInfo;
} }
/**
* 部件下拉框
*
* @param inInfo
* @return
*/
public EiInfo queryInventComboBox(EiInfo inInfo) {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.SUB_INVENT_RECORD_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo));
return inInfo;
}
} }
package com.baosight.hpjx.hp.sc.service; package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.pz.domain.HPPZ011; import com.baosight.hpjx.hp.pz.domain.HPPZ011;
import com.baosight.hpjx.hp.sc.domain.HPSC004; import com.baosight.hpjx.hp.sc.domain.HPSC004;
import com.baosight.hpjx.hp.sc.domain.HPSC005; import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
...@@ -157,5 +160,30 @@ public class ServiceHPSC005 extends ServiceBase { ...@@ -157,5 +160,30 @@ public class ServiceHPSC005 extends ServiceBase {
} }
return query(eiInfo); return query(eiInfo);
} }
/**
* 项目下拉框
*
* @param inInfo
* @return
*/
public EiInfo queryProjComboBox(EiInfo inInfo) {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.PROJ_PROD_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo));
return inInfo;
}
/**
* 生产组下拉框
*
* @param inInfo
* @return
*/
public EiInfo queryOrgComboBox(EiInfo inInfo) {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.ORG_PROD_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo));
return inInfo;
}
} }
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
Generate time : 2024-01-17 10:33:49
Version : 1.0
schema : hpjx
tableName : T_HPSC003
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
PROJ_TYPE TINYINT,
PROJ_CODE VARCHAR,
PROJ_NAME VARCHAR,
PLAN_INFO_NO VARCHAR,
PRDT_CODE VARCHAR,
PRDT_NAME VARCHAR,
PLAN_COMPLETION_DATE VARCHAR,
STATUS TINYINT,
CREATED_BY VARCHAR,
CREATED_TIME DATETIME,
UPDATED_BY VARCHAR,
UPDATED_TIME DATETIME,
DEP_CODE VARCHAR,
REMARK VARCHAR
-->
<sqlMap namespace="HPSC003"> <sqlMap namespace="HPSC003">
<sql id="condition"> <sql id="condition">
...@@ -80,7 +59,7 @@ ...@@ -80,7 +59,7 @@
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC003"> resultClass="com.baosight.hpjx.hp.sc.domain.HPSC003">
SELECT SELECT
ID as "id", ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 --> COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
PROJ_TYPE as "projType", <!-- 项目类型 --> PROJ_TYPE as "projType", <!-- 项目类型 -->
PROJ_CODE as "projCode", <!-- 项目编码 --> PROJ_CODE as "projCode", <!-- 项目编码 -->
...@@ -237,4 +216,20 @@ ...@@ -237,4 +216,20 @@
ID = #id# ID = #id#
</update> </update>
<!-- 部件下拉框 -->
<select id="queryInventComboBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
PRDT_CODE as "prdtCode",
PRDT_NAME as "prdtName"
FROM ${hpjxSchema}.T_HPSC003
WHERE 1=1
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
ORDER BY PROJ_CODE
</select>
</sqlMap> </sqlMap>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
Generate time : 2024-01-17 10:33:53
Version : 1.0
schema : hpjx
tableName : T_HPSC004
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
DEPT_CODE VARCHAR NOT NULL,
PROJ_CODE VARCHAR,
PROJ_NAME VARCHAR,
PARENT_ID VARCHAR,
PARENT_PRDT_NAME VARCHAR,
TYPE VARCHAR NOT NULL,
LEAF VARCHAR NOT NULL,
SORT VARCHAR NOT NULL,
ICON VARCHAR NOT NULL,
PRDT_CODE VARCHAR,
PRDT_NAME VARCHAR,
NUM INTEGER NOT NULL,
UNIT_WT DECIMAL NOT NULL,
TOTAL_WT DECIMAL NOT NULL,
FILE_PATH1 VARCHAR,
FILE_PATH2 VARCHAR,
FILE_PATH3 VARCHAR,
FILE_PATH4 VARCHAR,
FILE_PATH5 VARCHAR,
PLAN_COMMENT_DATE VARCHAR,
PLAN_COMPLETION_DATE VARCHAR,
ACTUAL_COMPLETION_DATE VARCHAR,
ACTUAL_COMPLETION_NUM INTEGER,
ACTUAL_COMPLETION_UNIT_WT DECIMAL,
STATUS TINYINT,
DEL_STATUS TINYINT,
CREATED_BY VARCHAR,
CREATED_TIME DATETIME,
UPDATED_BY VARCHAR,
UPDATED_TIME DATETIME,
REMARK VARCHAR
-->
<sqlMap namespace="HPSC004"> <sqlMap namespace="HPSC004">
<sql id="condition"> <sql id="condition">
...@@ -484,4 +446,21 @@ ...@@ -484,4 +446,21 @@
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
<!-- 零部件下拉框 -->
<select id="queryInventComboBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
A.PRDT_CODE as "prdtCode",
B.PRDT_NAME as "prdtName"
FROM ${hpjxSchema}.T_HPSC004 A, ${hpjxSchema}.T_HPSC003 B
WHERE 1=1
AND A.PARENT_ID = B.PLAN_INFO_NO
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentPrdtCode">
B.PRDT_CODE = #parentPrdtCode#
</isNotEmpty>
ORDER BY A.PROJ_CODE
</select>
</sqlMap> </sqlMap>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPSC005"> <sqlMap namespace="HPSC005">
<sql id="column"> <sql id="column">
ID as "id", ID as "id",
...@@ -334,4 +334,41 @@ ...@@ -334,4 +334,41 @@
PRODUCTION_ORDER_NO like CONCAT('%', #productionOrderNo#, '%') PRODUCTION_ORDER_NO like CONCAT('%', #productionOrderNo#, '%')
</isNotEmpty> </isNotEmpty>
</select> </select>
<!-- 项目下拉框 -->
<select id="queryProjComboBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
PROJ_CODE as "projCode",
PROJ_NAME as "projName"
FROM ${hpjxSchema}.T_HPSC005
WHERE 1=1
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="statuses">
STATUS IN <iterate close=")" open="(" conjunction="," property="statuses">#statuses[]#</iterate>
</isNotEmpty>
ORDER BY PROJ_CODE
</select>
<!-- 生产组下拉框 -->
<select id="queryOrgComboBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
(CASE WHEN A.DOCUMENT_TYPE = 1 THEN B.ORG_NO ELSE A.ORG_NO END) AS "orgNo",
(CASE WHEN A.DOCUMENT_TYPE = 1 THEN B.ORG_NAME ELSE A.ORG_NAME END) AS "orgName"
FROM HPJX.T_HPSC005 A
LEFT JOIN HPJX.T_HPSC005A B ON A.PRODUCTION_ORDER_NO = B.PRODUCTION_ORDER_NO
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partCode">
A.PART_CODE = #partCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="statuses">
STATUS IN <iterate close=")" open="(" conjunction="," property="statuses">#statuses[]#</iterate>
</isNotEmpty>
</select>
</sqlMap> </sqlMap>
...@@ -3,8 +3,12 @@ package com.baosight.hpjx.hp.sc.tools; ...@@ -3,8 +3,12 @@ package com.baosight.hpjx.hp.sc.tools;
import com.baosight.hpjx.core.dao.DaoBase; import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.hp.constant.HPSqlConstant; import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC010; import com.baosight.hpjx.hp.kc.domain.HPKC010;
import com.baosight.hpjx.hp.pz.domain.HPPZ004;
import com.baosight.hpjx.hp.sc.domain.HPSC001;
import com.baosight.hpjx.hp.sc.domain.HPSC002;
import com.baosight.hpjx.hp.sc.domain.HPSC005; import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.hp.sc.domain.HPSC005A; import com.baosight.hpjx.hp.sc.domain.HPSC005A;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
...@@ -44,13 +48,61 @@ public class HPSCTools { ...@@ -44,13 +48,61 @@ public class HPSCTools {
map.put("unassignedNum", new BigDecimal(0.000)); map.put("unassignedNum", new BigDecimal(0.000));
map.put("status","2"); map.put("status","2");
} else { } else {
//子单的数量小于母单 //子单的数量小于母单
map.put("assignedNum",num); map.put("assignedNum", num);
map.put("unassignedNum", jhNum.subtract(num)); map.put("unassignedNum", jhNum.subtract(num));
map.put("status","1"); map.put("status", "1");
} }
DaoBase.getInstance().update(HPSqlConstant.HPSC005.UPDATE_ASSIGN_NUM, map); DaoBase.getInstance().update(HPSqlConstant.HPSC005.UPDATE_ASSIGN_NUM, map);
} }
} }
/**
* HPSC001公共DAO定义
*
* @author:songx
* @date:2024/2/4,10:17
*/
public static class HpSc001 {
/**
* 查询
*
* @param projCode
* @return
*/
public static HPSC001 get(String projCode) {
AssertUtils.isEmpty(projCode, "项目编码不能为空");
Map queryMap = new HashMap();
queryMap.put("projCode", projCode);
List<HPSC001> results = DaoBase.getInstance().query("HPSC001.query", queryMap);
AssertUtils.isNull(results, String.format("项目编码[%s]信息不存在", projCode));
return results.get(0);
}
}
/**
* HPSC002公共DAO定义
*
* @author:songx
* @date:2024/2/4,10:17
*/
public static class HpSc002 {
/**
* 查询
*
* @param prdtCode
* @return
*/
public static HPSC002 get(String prdtCode) {
AssertUtils.isEmpty(prdtCode, "部件编码不能为空");
Map queryMap = new HashMap();
queryMap.put("prdtCode", prdtCode);
List<HPSC002> results = DaoBase.getInstance().query("HPSC002.query", queryMap);
AssertUtils.isNull(results, String.format("部件编码[%s]信息不存在", prdtCode));
return results.get(0);
}
}
} }
package com.baosight.hpjx.hp.xs.service; package com.baosight.hpjx.hp.xs.service;
import com.baosight.hpjx.common.DdynamicEnum; import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.xs.domain.User; import com.baosight.hpjx.hp.xs.domain.User;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils; import com.baosight.hpjx.util.EiInfoUtils;
...@@ -56,7 +57,26 @@ public class ServiceHPXSUser extends ServiceBase { ...@@ -56,7 +57,26 @@ public class ServiceHPXSUser extends ServiceBase {
} }
/** /**
* 查询用户的一页下拉框 * 查询用户下拉框
*
* @param inInfo
* @return
*/
public EiInfo queryComboBox(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put("companyCode", UserSessionUtils.getCompanyCode());
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.USER_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, queryMap);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询企业失败");
}
return inInfo;
}
/**
* 查询用户的企业下拉框
* *
* @param inInfo * @param inInfo
* @return * @return
......
package com.baosight.hpjx.hp.xs.tools; package com.baosight.hpjx.hp.xs.tools;
import com.baosight.hpjx.core.dao.DaoBase; import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.hp.xs.domain.Org;
import com.baosight.hpjx.hp.xs.domain.User;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.iplat4j.core.web.threadlocal.UserSession; import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
...@@ -12,7 +15,7 @@ import java.util.Map; ...@@ -12,7 +15,7 @@ import java.util.Map;
* @author:songx * @author:songx
* @date:2024/1/15,15:23 * @date:2024/1/15,15:23
*/ */
public class HPXSUserTools { public class HPXSTools {
/** /**
* 统计企业下的用户数量 * 统计企业下的用户数量
...@@ -39,4 +42,44 @@ public class HPXSUserTools { ...@@ -39,4 +42,44 @@ public class HPXSUserTools {
return CollectionUtils.isEmpty(results) ? "" : results.get(0).get("orgId").toString(); return CollectionUtils.isEmpty(results) ? "" : results.get(0).get("orgId").toString();
} }
/**
* @author:songx
* @date:2024/2/4,10:35
*/
public static class XsUser {
/**
* 查询组织机构
*
* @return
*/
public static User get(String loginName) {
AssertUtils.isEmpty(loginName, "用户登录名不能为空");
Map paramMap = new HashMap();
paramMap.put("loginName", loginName);
List<User> results = DaoBase.getInstance().query("HPXSUser.query", paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
}
/**
* @author:songx
* @date:2024/2/4,10:35
*/
public static class XsOrg {
/**
* 查询组织机构
*
* @return
*/
public static Org get(String orgId) {
AssertUtils.isEmpty(orgId, "组织编码不能为空");
Map paramMap = new HashMap();
paramMap.put("orgId", orgId);
List<Org> results = DaoBase.getInstance().query("HPXSOrg.query", paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
}
} }
package com.baosight.hpjx.hp.zl.service;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.sc.domain.HPSC002;
import com.baosight.hpjx.hp.sc.domain.HPSC002A;
import com.baosight.hpjx.hp.zl.domain.HPZL001;
import com.baosight.hpjx.hp.zl.domain.HPZL001A;
import com.baosight.hpjx.hp.zl.tools.HPZLTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import org.apache.commons.collections.CollectionUtils;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/1/25,15:25
*/
public class ServiceHPZL001A extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
public EiInfo initLoad(EiInfo inInfo) {
try {
// 查询物料ID所对应的项目名称和部件名称
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put("id", queryMap.get("checkId"));
List<HPZL001> dbZl001s = dao.query(HPZL001.QUERY, queryMap);
if (CollectionUtils.isNotEmpty(dbZl001s)) {
inInfo.addBlock("detail").addRow(dbZl001s.get(0));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPZL001A().eiMetadata);
}
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPZL001A.QUERY, new HPZL001A());
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HPZL001A fZl001A = new HPZL001A();
fZl001A.fromMap(resultRows.get(i));
// 校验质检单是否已处理
HPZL001 dbZl001 = HPZLTools.getById(fZl001A.getCheckId());
AssertUtils.isTrue(CommonConstant.YesNo.YES_1.equals(dbZl001.getStatus()),
String.format("质检单[%s]状态为\"已处理\",不能上传附件"));
DaoUtils.insert(HPZL001A.INSERT, fZl001A);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HPZL001A fZl001A = new HPZL001A();
fZl001A.fromMap(resultRows.get(i));
// 校验质检单是否已处理
HPZL001 dbZl001 = HPZLTools.getById(fZl001A.getCheckId());
AssertUtils.isTrue(CommonConstant.YesNo.YES_1.equals(dbZl001.getStatus()),
String.format("质检单[%s]状态为\"已处理\",不能删除附件"));
DaoUtils.update(HPZL001A.DELETE, fZl001A);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPZL001A">
<sql id="column">
A.ID as "id",
A.COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
A.DEPT_CODE as "deptCode", <!-- 部门编码 预留 -->
A.CHECK_ID as "checkId", <!-- 检查单ID -->
A.DOC_TYPE as "docType", <!-- 文件类型 -->
A.DOC_ID as "docId", <!-- 文件ID -->
B.DOC_NAME as "docName", <!-- 文件名称 -->
A.CREATED_BY as "createdBy", <!-- 创建人 -->
A.CREATED_NAME as "createdName", <!-- 创建人名称 -->
A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 修改人 -->
A.UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
A.UPDATED_TIME as "updatedTime" <!-- 修改时间 -->
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
A.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deptCode">
A.DEPT_CODE = #deptCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkId">
A.CHECK_ID = #checkId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docType">
A.DOC_TYPE = #docType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
A.DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
A.CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
A.CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
A.CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
A.UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
A.UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
A.UPDATED_TIME = #updatedTime#
</isNotEmpty>
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="createdDateFrom">
A.CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateTo">
A.CREATED_TIME &lt;= CONCAT(REPLACE(#createdDateTo#, '-', ''), '235959')
</isNotEmpty>
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="order">
$orderBy$
</isNotEmpty>
<isEmpty property="order">
A.ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.zl.domain.HPZL001A">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPZL001A A, ${platSchema}.TEUDM02 B
WHERE 1=1
AND A.DOC_ID = B.DOC_ID
<include refid="condition"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPZL001A A, ${platSchema}.TEUDM02 B
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPZL001A (
COMPANY_CODE, <!-- 企业编码 预留 -->
DEPT_CODE, <!-- 部门编码 预留 -->
CHECK_ID, <!-- 巡检单ID -->
DOC_TYPE, <!-- 文件类型 -->
DOC_ID, <!-- 文件ID -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME <!-- 创建时间 -->
) VALUES (
#companyCode#, #deptCode#, #checkId#, #docType#, #docId#, #createdBy#,
#createdName#, #createdTime#
)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPZL001A WHERE ID = #id#
</delete>
</sqlMap>
package com.baosight.hpjx.hp.zl.tools;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.hp.sc.domain.HPSC002;
import com.baosight.hpjx.hp.zl.domain.HPZL001;
import com.baosight.hpjx.util.AssertUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/2/4,11:23
*/
public class HPZLTools {
/**
* 查询
*
* @param id
* @return
*/
public static HPZL001 getById(Long id) {
AssertUtils.isNull(id, "质检单号不能为空");
Map queryMap = new HashMap();
queryMap.put("id", id);
List<HPZL001> results = DaoBase.getInstance().query(HPZL001.QUERY, queryMap);
AssertUtils.isNull(results, String.format("质检单[%s]信息不存在", id));
return results.get(0);
}
/**
* 查询
*
* @param checkNo
* @return
*/
public static HPZL001 get(String checkNo) {
AssertUtils.isEmpty(checkNo, "质检单号不能为空");
Map queryMap = new HashMap();
queryMap.put("checkNo", checkNo);
List<HPZL001> results = DaoBase.getInstance().query(HPZL001.QUERY, queryMap);
AssertUtils.isNull(results, String.format("质检单号[%s]信息不存在", checkNo));
return results.get(0);
}
}
$(function () {
// 登录页加载完成时,进行浏览器版本检测
window.onload = function () {
var BROWSER_VERSION = 9;
var browser = (function () {
var ua = navigator.userAgent, tem,
M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
if (/trident/i.test(M[1])) {
tem = /\brv[ :]+(\d+)/g.exec(ua) || [];
return 'IE ' + (tem[1] || '');
}
if (M[1] === 'Chrome') {
tem = ua.match(/\b(OPR|Edge)\/(\d+)/);
if (tem != null) return tem.slice(1).join(' ').replace('OPR', 'Opera');
}
M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, '-?'];
if ((tem = ua.match(/version\/(\d+)/i)) != null) M.splice(1, 1, tem[1]);
return M.join(' ');
})();
var BrowserVersion = browser.split(" ");
if ((/^(MS)?( )?IE/).test(browser) && BrowserVersion[1] < BROWSER_VERSION) {
$(".warning-window").css("display", "block");
$(".i-overlay").css("display", "block");
}
if ((/^(MS)?( )?IE/).test(browser) && BrowserVersion[1] < BROWSER_VERSION - 1) {
$("#login").attr("disabled", true);
}
};
$(".i-close").on("click", function () {
$(".warning-window").css("display", "none");
$(".i-overlay").css("display", "none");
});
//放大镜
$(".i-zoom-close").on("click", function () {
$(".zoom-window").css("display", "none");
$(".i-overlay").css("display", "none");
});
$(".info-detail").on("click", function () {
$(".zoom-window").css("display", "block");
$(".i-overlay").css("display", "block");
});
$.fn.textScroll = function (options) {
var defaults = {
duration: 8000,//滚动总时长控制
mode: 'normal',//滚动模式:普通normal;逐行line
perDistance: 18//line模式下每次滚动距离
},
that = this,
scrollInterval,
content = this.find(".text-content");
var items = $.extend({}, defaults, options);
//添加占位元素,处理无法滚动到底的情况
function addHoldDiv(stage, textContent) {
if (items.mode === 'no-gap') {
that.append(content.clone().addClass("second-text"));
} else {
var holdDiv = "<div class='hold-scroll'></div>";
stage.append(holdDiv);
var divHeight = stage.height() + textContent.height();
$(".hold-scroll").css({"width": "100%", "height": divHeight, "color": "transparent"});
}
}
//根据不同模式添加动画
function addAnimate() {
if (items.mode === 'normal' || items.mode === 'no-gap') {
var scrollPercent = that.scrollTop() / content.outerHeight(true);
if (that.scrollTop() === 0) {
that.animate({scrollTop: '0'}, 1000);
}
that.animate({scrollTop: content.outerHeight(true)}, Math.round(items.duration * (1 - scrollPercent)), "linear");
that.animate({scrollTop: '0'}, 0, arguments.callee);
} else if (items.mode === 'line') {
var times = Math.ceil(content.outerHeight(true) / items.perDistance);
scrollInterval = setInterval(function () {
if (content.outerHeight(true) - that.scrollTop() <= 0) {
that.animate({scrollTop: 0}, 0);
} else {
that.animate({scrollTop: that.scrollTop() + items.perDistance}, 0);
}
}, Math.round(items.duration / times));
}
}
addHoldDiv(that, content);
that.niceScroll({
'autohidemode': 'false'
});
that.mouseenter(function () {
if (items.mode === 'normal' || items.mode === 'no-gap') {
that.stop(true);
} else if (items.mode === 'line') {
clearInterval(scrollInterval);
}
that.getNiceScroll().show();
});
that.mouseleave(function (e) {
var targetElement = $(e.toElement);
if (targetElement.hasClass("nicescroll-rails-vr") || targetElement.hasClass("nicescroll-cursors")) {
targetElement.one("mouseleave", function (e) {
if ($(e.toElement) !== that && !$(e.toElement).hasClass("nicescroll-rails-vr")) {
that.getNiceScroll().hide();
addAnimate();
}
});
} else if (!targetElement.hasClass("nicescroll-rails-vr") && !targetElement.hasClass("nicescroll-cursors")) {
that.getNiceScroll().hide();
addAnimate();
}
});
that.mouseleave();
};
loginClick = function () {
var loginForm = document.getElementsByTagName("form")[0];
var urlParam = location.href.substr(location.href.indexOf("?") + 1);
if (urlParam.indexOf("p_redirect") !== -1) {
var keyString = urlParam.split('=')[0];
var valueString =urlParam.split('=')[1];
if (keyString === "p_redirect") {
var tmpInput = document.createElement("input");
tmpInput.type = "hidden";
tmpInput.name = "p_redirect";
tmpInput.value = valueString;
loginForm.appendChild(tmpInput);
}
}
loginForm.submit();
// 将密码框的值修改为加密后的值
var loginPublicKey = $("#__LOGIN_PUBLICKEY__").val();
if(isAvailable(loginPublicKey)){
var encrypt = new JSEncrypt();
encrypt.setPublicKey(loginPublicKey);
var encryptedUsername = encrypt.encrypt($("input[name='p_username1']").val());
$("input[name='p_username']").val(encryptedUsername);
var encryptedPassword = encrypt.encrypt($("input[name='p_password1']").val());
$("input[name='p_password']").val(encryptedPassword);
}
};
//判断是否值能获取的方法
function isAvailable(obj) {
if (obj === undefined) {
return false;
}
if (obj === null) {
return false;
}
if (obj === "null") {
return false;
}
return obj !== "";
}
function getParameterByName(name, url) {
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) {
return null;
}
if (!results[2]) {
return null;
}
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
});
function downloadChrome() {
downloadUrl = ctx + "/EU/DM/EUDM31.jsp";
href = downloadUrl;
window.location.href = href;
}
...@@ -79,7 +79,7 @@ let exportPrint = function () { ...@@ -79,7 +79,7 @@ let exportPrint = function () {
if (projCodeTemp == null) { if (projCodeTemp == null) {
projCodeTemp = projCode; projCodeTemp = projCode;
} else if (projCodeTemp != projCode) { } else if (projCodeTemp != projCode) {
message("第" + (i + 1) + "行项目不一致,请选择同一个项目的数据"); message("第" + (i + 1) + "行项目不一致,请选择同一个项目的数据");
return; return;
} }
saleIds.push(rows[i]['id']); saleIds.push(rows[i]['id']);
......
$(function() { let projNameGlobalData = [];
let inventNameGlobalData = [];
let subInventNameGlobalData = [];
let orgNameGlobalData = [];
$(function () {
// 查询 IPLATUI.EFGrid = {
$("#QUERY").on("click", function () { "result": {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询 pageable: {
}); input: true,
numeric: false,
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [{
field: "receiptDate",
attributes: {
class: "i-input-readonly"
}
}, {
field: "operator",
template: function (item) {
let status = item.status;
if (status === "0") {
return '<a style="cursor: pointer;display: flex;justify-content: center;" ' +
'onclick="doProcess(' + item.id + ', \'' + item.checkNo + '\')" >处理</a>';
} else {
return "";
}
}
}, {
field: "problemPhoto",
template: function (item) {
let status = item.status;
if (!isBlank(item.checkNo)) {
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ', 1)" >附件清单</a>';
} else {
return "";
}
}
}, {
field: "processPhoto",
template: function (item) {
let status = item.status;
if (!isBlank(item.checkNo)) {
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ', 2)" >附件清单</a>';
} else {
return "";
}
}
}, {
field: "projCode",
template: function (dataItem) {
for (let i = 0; i < projNameGlobalData.length; i++) {
if (projNameGlobalData[i]['valueField'] === dataItem['projCode']) {
return projNameGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
// 1.部分分派,2.全部分派
inInfo.set("inqu_status-0-statuses", [1, 2]);
inInfo.set("serviceName", "HPSC005");
inInfo.set("methodName", "queryProjComboBox");
inInfo.set("blockId", "proj_prod_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
}, {
field: "inventCode",
template: function (dataItem) {
for (let i = 0; i < inventNameGlobalData.length; i++) {
if (inventNameGlobalData[i]['valueField'] === dataItem['inventCode']) {
return inventNameGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let projCode = options.model["projCode"];
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-projCode", isBlank(projCode) ? " " : projCode);
inInfo.set("serviceName", "HPSC003");
inInfo.set("methodName", "queryInventComboBox");
inInfo.set("blockId", "invent_record_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
}, {
field: "subInventCode",
template: function (dataItem) {
for (let i = 0; i < subInventNameGlobalData.length; i++) {
if (subInventNameGlobalData[i]['valueField'] === dataItem['subInventCode']) {
return subInventNameGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inventCode = options.model["inventCode"];
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-parentPrdtCode", isBlank(inventCode) ? " " : inventCode);
inInfo.set("serviceName", "HPSC004");
inInfo.set("methodName", "queryInventComboBox");
inInfo.set("blockId", "sub_invent_record_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
}, {
field: "orgNo",
template: function (dataItem) {
for (let i = 0; i < orgNameGlobalData.length; i++) {
if (orgNameGlobalData[i]['valueField'] === dataItem['orgNo']) {
return orgNameGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let subInventCode = options.model["subInventCode"];
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-prdtCode", isBlank(subInventCode) ? " " : subInventCode);
inInfo.set("serviceName", "HPSC005");
inInfo.set("methodName", "queryOrgComboBox");
inInfo.set("blockId", "org_prod_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
}, {
field: "createdName",
template: function (options) {
return showUserName(options.createdBy, options.createdName);
}
}]
}
}
// 查询
$("#QUERY").on("click", query);
IPLATUI.EFGrid = {
"result": {
pageable: {
input: true,
numeric: false,
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [{
field: "affix",
template: function (item) {
let affix = item.affix;
if (isBlank(affix)) {
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="openUploadFile(' + item.id + ',1)" >附件上传</a>';
} else {
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + IPLATUI.CONTEXT_PATH + '/EU/DM/EUDM06.jsp?docId=' + affix
+ '" >下载</a>';
}
}
}, {
field: "operator",
template: function (item) {
let chkBillno = item.chkBillno;
let auditStatus = item.status;
if (auditStatus == 0) {
return '<a style="cursor: pointer;display: flex;justify-content: center;" ' +
'onclick="audit(' + item.id + ',\'' + chkBillno + '\')" >提交</a>';
} else {
return '<a style="cursor: pointer;display: flex;justify-content: center;" ' +
'onclick="unAudit(' + item.id + ',\'' + chkBillno + '\')" >撤回</a>';
}
}
}]
}
};
}); });
/** /**
* 文件上传 * 页面加载时执行
*
* @param id
*/ */
function openUploadFile(id) { $(window).load(function () {
JSColorbox.open({ // 项目名称
href: "HPSC099?methodName=initLoad", let inInfo = new EiInfo();
title: "<div style='text-align: center;'>附件上传</div>", EiCommunicator.send("HPSC001", "queryComboBox", inInfo, {
width: "60%", onSuccess: function (ei) {
height: "50%", projNameGlobalData = ei.getBlock("proj_record_block_id").getMappedRows();
callbackName: function (docId) { },
let inEiInfo = new EiInfo(); onFail: function (ei) {
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-affix", docId);
EiCommunicator.send('HPZL001', 'bindDocIdById', inEiInfo, {
onSuccess(response) {
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
} }
}); }, {async: false});
// 部件名称
EiCommunicator.send("HPSC003", "queryInventComboBox", inInfo, {
onSuccess: function (ei) {
inventNameGlobalData = ei.getBlock("invent_record_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
// 零部件名称
EiCommunicator.send("HPSC004", "queryInventComboBox", inInfo, {
onSuccess: function (ei) {
subInventNameGlobalData = ei.getBlock("sub_invent_record_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
// 生产组名称
EiCommunicator.send("HPSC005", "queryOrgComboBox", inInfo, {
onSuccess: function (ei) {
orgNameGlobalData = ei.getBlock("org_prod_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
} }
/** /**
* 提交操作 * 显示附件清单
* *
* @param id * @param id
* @param chkBillno * @param docType
* @param auditStatus
*/ */
function audit(id, chkBillNo) { let showUploadFile = function (id, docType) {
let message = "确认对单号[" + chkBillNo + "]进行提交操作吗? "; JSColorbox.open({
JSUtils.confirm(message, { href: "HPZL001A?methodName=initLoad&inqu_status-0-checkId=" + id + "&inqu_status-0-docType=" + docType,
ok: function () { title: "<div style='text-align: center;'>附件清单</div>",
JSUtils.submitGridsData("result", "HPZL001", "audit", true); width: "80%",
} height: "80%",
}); });
} }
/** /**
* 撤回操作 * 提交操作
* *
* @param id * @param id
* @param chkBillno * @param checkNo
* @param auditStatus
*/ */
function unAudit(id, chkBillNo) { let doProcess = function (id, checkNo) {
let message = "确认对单号[" + chkBillNo + "]进行撤回操作吗? "; let message = "确认将单号[" + checkNo + "]的状态修改为已处理吗? ";
JSUtils.confirm(message, { JSUtils.confirm(message, {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HPZL001", "unAudit", true); JSUtils.submitGridsData("result", "HPZL001", "doProcess", true);
} }
}); });
} }
...@@ -8,56 +8,55 @@ ...@@ -8,56 +8,55 @@
<EF:EFPage title="质量巡检单"> <EF:EFPage title="质量巡检单">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
<EF:EFDatePicker ename="inqu_status-0-receiptDate" cname="单据日期" colWidth="3" <EF:EFDatePicker cname="单据日期" ename="receiptDate" blockId="inqu_status" row="0" colWidth="3"
format="yyyy-MM-dd" readonly="true"/> format="yyyy-MM-dd" readonly="true"/>
<EF:EFSelect ename="inqu_status-0-itemCode" cname="项目名称" colWidth="3" <EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3"/>
valueTemplate="#=textField#" template="#=textField#" <EF:EFInput cname="部件名称" ename="inventName" blockId="inqu_status" row="0" colWidth="3"/>
textField="textField" valueField="valueField" <EF:EFInput cname="零部件名称" ename="subInventName" blockId="inqu_status" row="0" colWidth="3"/>
required="true" locked="true" filter="contains"> </div>
<EF:EFOption label="--请选择--" value=""/> <div class="row">
<EF:EFOptions blockId="proj_record_block_id" textField="textField" valueField="valueField"/> <EF:EFInput cname="工作组" ename="orgName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="检查人" ename="checkUserName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect cname="不良类型" ename="poorType" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.poorType"/>
</EF:EFSelect>
<EF:EFSelect cname="处理状态" ename="status" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFOption label="1-已处理" value="1"></EF:EFOption>
<EF:EFOption label="0-未处理" value="0"></EF:EFOption>
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput ename="inqu_status-0-princ" cname="检查人" colWidth="3" readonly="false"/> </div>
<EF:EFSelect ename="inqu_status-0-status" cname="处理状态" colWidth="3">
<EF:EFOption label="--请选择--" value=""/>
<EF:EFOption label="提交" value="1"></EF:EFOption>
<EF:EFOption label="待提交" value="0"></EF:EFOption>
</EF:EFSelect>
</div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/> <EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="chkBillno" cname="检查单号" enable="false" width="130" align="center"/> <EF:EFColumn ename="operator" cname="操作" enable="false" width="100" readonly="false"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" width="120" align="center" editType="date" <EF:EFColumn ename="checkNo" cname="检查单号" enable="false" width="130" align="center"/>
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/> <EF:EFComboColumn ename="status" cname="状态" enable="false" width="100" align="center">
<EF:EFComboColumn ename="itemCode" cname="项目名称" width="140" columnTemplate="#=textField#" <EF:EFOption label="1-已处理" value="1"></EF:EFOption>
itemTemplate="#=textField#" blockName="proj_record_block_id" <EF:EFOption label="0-未处理" value="0"></EF:EFOption>
textField="textField" valueField="valueField" maxLength="20" </EF:EFComboColumn>
required="true" filter="contains"> <EF:EFColumn ename="receiptDate" cname="单据日期" width="120" align="center" editType="date"
</EF:EFComboColumn> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="unit" cname="生产组" width="100" readonly="false"/> <EF:EFColumn ename="projCode" cname="项目名称" width="140" align="center" required="true"/>
<EF:EFColumn ename="notes" cname="质量问题描述" width="100" readonly="false"/> <EF:EFColumn ename="inventCode" cname="部件名称" width="140" align="center" required="true"/>
<EF:EFColumn ename="princ" cname="检查人" width="100" readonly="true"/> <EF:EFColumn ename="subInventCode" cname="零部件名称" width="140" align="center" required="true"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" align="center" textField="textField" <EF:EFColumn ename="orgNo" cname="生产组名称" width="140" align="center" required="true"/>
valueField="valueField" width="100" optionLabel=" "> <EF:EFComboColumn ename="poorType" cname="不良品类" width="100" align="center" required="true">
<EF:EFOption label="--请选择--" value=""></EF:EFOption> <EF:EFCodeOption codeName="hpjx.hpjx.poorType"/>
<EF:EFOption label="提交" value="1"></EF:EFOption> </EF:EFComboColumn>
<EF:EFOption label="未提交" value="0"></EF:EFOption> <EF:EFColumn ename="problemDesc" cname="质量问题描述" width="140" align="center"/>
</EF:EFComboColumn> <EF:EFColumn ename="problemPhoto" cname="问题照片" enable="false" width="100" align="center"/>
<EF:EFColumn ename="affix" cname="附件" enable="false" width="100" align="center"/> <EF:EFColumn ename="processPhoto" cname="处理照片" enable="false" width="100" align="center"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="100" readonly="false"/> <EF:EFComboColumn ename="checkUser" cname="检查人" width="120" align="center"
<EF:EFColumn ename="createdTime" cname="创建时间" readonly="true" width="150" align="center" enable="false" blockName="user_block_id" textField="textField" valueField="valueField"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss" columnTemplate="#=textField#" itemTemplate="#=textField#">
hidden="true"/> </EF:EFComboColumn>
<EF:EFColumn ename="createdBy" cname="创建人" readonly="true" width="150" align="center" enable="false" <EF:EFColumn ename="createdName" cname="创建人" enable="false" width="150" align="center"/>
hidden="true"/> <EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="150" align="center"
<EF:EFColumn ename="updatedTime" cname="更新时间" readonly="true" width="150" align="center" enable="false" editType="datetime" parseFormats="['yyyyMMddHHmmss']" dateFormat="yyyy-MM-dd HH:mm:ss"/>
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss" </EF:EFGrid>
hidden="true"/> </EF:EFRegion>
<EF:EFColumn ename="updatedBy" cname="更新人" readonly="true" width="150" align="center" enable="false"
hidden="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage> </EF:EFPage>
$(function () {
IPLATUI.EFGrid = {
"result": {
columns: [{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + IPLATUI.CONTEXT_PATH + '/EU/DM/EUDM06.jsp?docId=' + item.docId
+ '" >附件下载</a>';
return template;
}
}],
dataBound: function () {
}
}
};
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
// 附件上传
$("#UPLOAD_FILE").on("click", uploadFile);
// 删除
$("#BTN_DELETE").on("click", deleteFunc);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 隐藏按钮
let status = $("#detail-0-status").val();
if (status == "1") {
$("#UPLOAD_FILE").hide();
$("#BTN_DELETE").hide();
}
// 初始化查询
query();
});
/**
* 查询
*/
var query = function (e) {
resultGrid.dataSource.page(1);
}
/**
* 文件上传
*
* @param id
*/
function uploadFile(id) {
JSColorbox.open({
href: "HPSC099?methodName=initLoad",
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
callbackName: uploadFileCallback
});
}
/**
* 附件上传回调
*
* @param docId
*/
function uploadFileCallback(docId) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-checkId", $("#inqu_status-0-checkId").val());
inEiInfo.set("result-0-docType", $("#inqu_status-0-docType").val());
inEiInfo.set("result-0-docId", docId);
EiCommunicator.send('HPZL001A', 'insert', inEiInfo, {
onSuccess(response) {
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
/**
* 删除
*/
function deleteFunc() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HPZL001A", "delete", true);
}
})
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="附件清单">
<EF:EFRegion id="inqu" title="查询区域" type="query">
<EF:EFInput cname="质量巡检单ID" ename="checkId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="附件类型" ename="docType" blockId="inqu_status" row="0" type="hidden"/>
<div class="row">
<EF:EFInput cname="项目名称" ename="projName" blockId="detail" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="部件名称" ename="inventName" blockId="detail" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="零部件名称" ename="subInventName" blockId="detail" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="生产组" ename="orgName" blockId="detail" row="0" colWidth="3" readonly="true"/>
</div>
<EF:EFInput cname="状态" ename="status" blockId="detail" row="0" colWidth="3" type="hidden"/>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
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