Commit 71d94636 by yukang

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/main/webapp/HP/SC/HPSC002.js
parents b8049e85 f0cd30e1
......@@ -65,6 +65,13 @@ public enum DdynamicEnum {
SPEC_NAME_BLOCK_ID("spec_name_block_id", "spec", "spec", "HPPZ006.queryComboBoxSpecName"),
/**
* 模块:存货档案(单位)
* 用途:存货档案下拉框
* 编写:wwl
*/
UNIT_NAME_BLOCK_ID("unit_name_block_id", "unit", "unit", "HPPZ006.queryComboBoxUnit"),
/**
* 模块:仓库档案
* 用途:仓库档案下拉框
* 编写:wwl
......
......@@ -38,44 +38,6 @@ public class DaoUtils {
}
/**
* 查询
*
* @param sql
* @param obj
* @return
*/
public static List query(String sql, Object obj){
if (obj instanceof DaoEPBase) {
// 企业编码
try {
String companyCode;
try {
companyCode = UserSessionUtils.getCompanyCode();
} catch (Exception e) {
companyCode = "";
}
BeanUtils.setProperty(obj, "companyCode", companyCode);
} catch (Exception e) {
log.warn("写入企业编码失败", e);
}
} else if (obj instanceof Map) {
// 创建人企业编码
try {
String companyCode;
try {
companyCode = UserSessionUtils.getCompanyCode();
} catch (Exception e) {
companyCode = "";
}
((Map) obj).put("companyCode", companyCode);
} catch (Exception e) {
log.warn("写入企业编码失败", e);
}
}
return DaoBase.getInstance().query(sql, obj);
}
/**
* insert method.
*
* @param sql
......
......@@ -7,6 +7,56 @@ package com.baosight.hpjx.hp.constant;
public class HPSqlConstant {
/**
* HPKC001 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HPKC001 {
// 统计
public static final String STAT_DATE = "HPKC001.statDate";
// 锁
public static final String LOCK = "HPKC001.lock";
}
/**
* HPKC002 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HPKC002 {
// 统计
public static final String STAT_DATE = "HPKC002.statDate";
}
/**
* HPKC003 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HPKC003 {
// 统计
public static final String STAT_DATE = "HPKC003.statDate";
}
/**
* HPKC004 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HPKC004 {
// 统计
public static final String STAT_DATE = "HPKC004.statDate";
}
/**
* HPKC005 SQL 定义
*
* @author:songx
......@@ -32,6 +82,8 @@ public class HPSqlConstant {
public static final String QUERY_SUM = "HPKC006.querySum";
// 锁
public static final String LOCK = "HPKC006.lock";
// 统计
public static final String STAT_DATE = "HPKC006.statDate";
}
/**
......@@ -46,6 +98,8 @@ public class HPSqlConstant {
public static final String QUERY_SUM = "HPKC007.querySum";
// 锁
public static final String LOCK = "HPKC007.lock";
// 统计
public static final String STAT_DATE = "HPKC007.statDate";
}
/**
......
......@@ -76,11 +76,9 @@ public class ServiceHPKC002 extends ServiceBase {
List query = dao.query("HPPZ007.queryByWhCode", params);
insertEntity.setWhName(((HPPZ007) query.get(0)).getWhName());
//存货类型
insertEntity.setMaterialTypeName(InventTypeEnun.getNameByCode(insertEntity.getMaterialType()));
insertEntity.setInventType(InventTypeEnun.getNameByCode(insertEntity.getInventType()));
// 生成单据号
insertEntity.setDocumentCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC002_NUMBER));
insertEntity.setStatus(1);
insertEntity.setApprovalStatus(0);
insertEntity.setReqCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC002_NUMBER));
dao.insert("HPKC002.insert", insertEntity);
}
inInfo = this.query(inInfo);
......@@ -107,8 +105,8 @@ public class ServiceHPKC002 extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) {
HPKC002 entity = new HPKC002();
entity.fromMap(resultRows.get(i));
AssertUtils.isEmpty(entity.getMaterialType(), "存货类型不能为空");
AssertUtils.isEmpty(entity.getMaterialCode(), "物料不能为空");
AssertUtils.isEmpty(entity.getInventType(), "存货类型不能为空");
AssertUtils.isEmpty(entity.getInventCode(), "物料不能为空");
AssertUtils.isEmpty(entity.getWhCode(), "仓库不能为空");
}
......@@ -135,7 +133,7 @@ public class ServiceHPKC002 extends ServiceBase {
List query = dao.query("HPPZ007.queryByWhCode", params);
updateEntity.setWhName(((HPPZ007) query.get(0)).getWhName());
//存货类型
updateEntity.setMaterialTypeName(InventTypeEnun.getNameByCode(updateEntity.getMaterialType()));
updateEntity.setInventType(InventTypeEnun.getNameByCode(updateEntity.getInventType()));
dao.insert("HPKC002.update", updateEntity);
}
inInfo = this.query(inInfo);
......
......@@ -96,6 +96,9 @@ public class ServiceHPKC005 extends ServiceBase {
// 生成单据号
fKc005.setCheckNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.CHECK_NO));
DaoUtils.insert(HPKC005.INSERT, fKc005);
// 修改库存
HPKCTools.updateStock(fKc005.getWhCode(), fKc005.getInventRecordId(),
fKc005.getDiffAmount(), fKc005.getDiffWeight());
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
......@@ -34,6 +34,7 @@ public class ServiceHPKC008 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.UNIT_NAME_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC008().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
......
......@@ -191,6 +191,7 @@
WH_CODE AS "whCode",
INVENT_TYPE AS "inventType",
INVENT_CODE AS "inventCode",
INVENT_RECORD_ID AS "inventRecordId",
COALESCE(SUM(AMOUNT), 0) AS "amount",
COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hpjxSchema}.T_HPKC006
......@@ -198,7 +199,7 @@
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, INVENT_TYPE, INVENT_CODE
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, INVENT_TYPE, INVENT_CODE, INVENT_RECORD_ID
</select>
</sqlMap>
......@@ -185,14 +185,15 @@
WH_CODE AS "whCode",
INVENT_TYPE AS "inventType",
INVENT_CODE AS "inventCode",
INVENT_RECORD_ID AS "inventRecordId",
COALESCE(SUM(AMOUNT), 0) AS "amount",
COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hpjxSchema}.T_HPKC004
FROM ${hpjxSchema}.T_HPKC007
WHERE 1=1
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, INVENT_TYPE, INVENT_CODE
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, INVENT_TYPE, INVENT_CODE, INVENT_RECORD_ID
</select>
</sqlMap>
......@@ -2,10 +2,7 @@ package com.baosight.hpjx.hp.kc.tools;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC005;
import com.baosight.hpjx.hp.kc.domain.HPKC006;
import com.baosight.hpjx.hp.kc.domain.HPKC007;
import com.baosight.hpjx.hp.kc.domain.HPKC010;
import com.baosight.hpjx.hp.kc.domain.*;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
......@@ -67,6 +64,50 @@ public class HPKCTools {
}
return results.stream().collect(Collectors.toMap(HPKC005::getCheckNo, item -> item));
}
/**
* 锁
*
* @param otherEnterNos
* @return
*/
public static void lockKc001(List<String> otherEnterNos) {
if (CollectionUtils.isEmpty(otherEnterNos)) {
return;
}
Map queryMap = new HashMap();
queryMap.put("otherEnterNos", otherEnterNos);
DaoBase.getInstance().update(HPSqlConstant.HPKC001.LOCK, queryMap);
}
/**
* 查询其他入库信息
*
* @param otherEnterNos
* @return
*/
public static List<HPKC001> listKc001(List<String> otherEnterNos) {
if (CollectionUtils.isEmpty(otherEnterNos)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("otherEnterNos", otherEnterNos);
return DaoBase.getInstance().query(HPKC001.QUERY, queryMap);
}
/**
* 查询其他入库信息
*
* @param otherEnterNos
* @return
*/
public static Map<String, HPKC001> mapKc001(List<String> otherEnterNos) {
List<HPKC001> results = listKc001(otherEnterNos);
if (CollectionUtils.isEmpty(results)) {
return null;
}
return results.stream().collect(Collectors.toMap(HPKC001::getPurchaseCode, item -> item));
}
/**
* 锁
......
......@@ -206,5 +206,22 @@ public class ServiceHPPZ006 extends ServiceBase {
}
return inInfo;
}
/**
* 单位下拉框
*
* @param inInfo
* @return
*/
public EiInfo queryComboBoxUnit(EiInfo inInfo) {
try {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.UNIT_NAME_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询规格失败");
}
return inInfo;
}
}
......@@ -198,4 +198,15 @@
ORDER BY ID
</select>
<!-- 单位下拉框 -->
<select id="queryComboBoxUnit" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT UNIT AS "unit"
FROM hpjx.t_hppz006
WHERE DELETE_FLAG = 0
AND STATUS = 1
<include refid="condition"/>
<include refid="customCondition"/>
ORDER BY ID
</select>
</sqlMap>
......@@ -61,7 +61,7 @@ public class HPPZTools {
}
Map queryMap = new HashMap();
queryMap.put("inventCodes", inventCodes);
return DaoBase.getInstance().query("HPPZ004.query", queryMap);
return DaoBase.getInstance().query(HPPZ004.QUERY, queryMap);
}
/**
......
......@@ -309,9 +309,8 @@ public class ServiceHPSC002 extends ServiceBase {
return eiInfo;
}
/**
* 审核 反审.
* 绑定附件
*/
public EiInfo bindDocIdById(EiInfo eiInfo) {
HPSC002 hppz002 = new HPSC002();
......
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC002;
import com.baosight.hpjx.hp.kc.domain.HPKC005;
import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.hp.sc.domain.HPSC002A;
import com.baosight.hpjx.hp.sc.domain.THPSC002;
import com.baosight.hpjx.util.BeanUtils;
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.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/1/25,15:25
*/
public class ServiceHPSC002A extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
public EiInfo initLoad(EiInfo inInfo) {
try {
// 查询物料ID所对应的项目名称和产品名称
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
List<THPSC002> dbSc002s = dao.query("HPSC002.query", queryMap);
THPSC002 dbSc002 = dbSc002s.get(0);
inInfo.set("inqu_status-0-matId", queryMap.get("id"));
inInfo.set("inqu_status-0-projName", dbSc002.getProjName());
inInfo.set("inqu_status-0-prdtName", dbSc002.getPrdtName());
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC002A().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPSC002A.QUERY, new HPSC002A());
} 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++) {
HPSC002A fSc002A = new HPSC002A();
fSc002A.fromMap(resultRows.get(i));
DaoUtils.insert(HPSC002A.INSERT, fSc002A);
}
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++) {
HPSC002A fSc002A = new HPSC002A();
fSc002A.fromMap(resultRows.get(i));
DaoUtils.update(HPSC002A.DELETE, fSc002A);
}
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="HPSC002A">
<sql id="column">
A.ID as "id",
A.COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
A.DEPT_CODE as "deptCode", <!-- 部门编码 预留 -->
A.MAT_ID as "matId", <!-- 物料ID -->
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="matId">
A.MAT_ID = #matId#
</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(#depositDateFrom#, '-', ''), '000000')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateTo">
A.CREATED_TIME &lt;= CONCAT(REPLACE(#depositDateTo#, '-', ''), '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.sc.domain.HPSC002A">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPSC002A 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_HPSC002A A, ${platSchema}.TEUDM02 B
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPSC002A (
COMPANY_CODE, <!-- 企业编码 预留 -->
DEPT_CODE, <!-- 部门编码 预留 -->
MAT_ID, <!-- 物料ID -->
DOC_ID, <!-- 文件ID -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME <!-- 创建时间 -->
) VALUES (
#companyCode#, #deptCode#, #matId#, #docId#, #createdBy#,
#createdName#, #createdTime#
)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPSC002A WHERE ID = #id#
</delete>
</sqlMap>
......@@ -25,7 +25,7 @@ public class LogUtils {
* @param title 标题
* @return
*/
public static void setDetailMsg(EiInfo inInfo, Exception e, String title) {
public static void setDetailMsg(EiInfo inInfo, Throwable e, String title) {
title = StringUtils.isEmpty(title) ? "服务异常" : title;
// 打印日志
print(e, title);
......@@ -58,7 +58,7 @@ public class LogUtils {
* @param title 标题
* @return
*/
public static void setMsg(EiInfo inInfo, Exception e, String title) {
public static void setMsg(EiInfo inInfo, Throwable e, String title) {
title = StringUtils.isEmpty(title) ? "服务异常" : title;
// 打印日志
print(e, title);
......@@ -86,7 +86,7 @@ public class LogUtils {
* @param e 异常堆栈
* @param title 标题
*/
private static void print(Exception e, String title) {
private static void print(Throwable e, String title) {
if (e != null) {
logger.error(title.concat(":{}"), e.getMessage(), e);
}
......
package com.baosight.iplat4j.core.data.ibatis.dao;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.util.ObjectUtils;
import com.baosight.iplat4j.core.service.soa.DomainQuery.PageStatus;
import com.baosight.iplat4j.core.util.ExceptionUtil;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/1/24,9:00
*/
public class SqlMapDaoLogProxy extends SqlMapDao {
public static final String QUERY = "query";
public SqlMapDaoLogProxy() {
}
public List query(String name, Object parameters) {
try {
// 初始化参数
this.initParam(name, parameters);
List ret = super.query(name, parameters);
return ret;
} catch (RuntimeException var4) {
throw var4;
}
}
public List queryAll(String name, Object parameters) {
try {
// 初始化参数
this.initParam(name, parameters);
List ret = super.queryAll(name, parameters);
return ret;
} catch (RuntimeException var4) {
throw var4;
}
}
public List query(String name, Object parameters, int offset, int limit) {
try {
// 初始化参数
this.initParam(name, parameters);
List ret = super.query(name, parameters, offset, limit);
return ret;
} catch (RuntimeException var6) {
throw var6;
}
}
public List query(String name, Object parameters, PageStatus pageStatus) {
int limit = pageStatus.getPageSize();
int offset = pageStatus.getPageNumber() * pageStatus.getPageSize();
try {
List ret = super.query(name, parameters, offset, limit);
return ret;
} catch (RuntimeException var7) {
ExceptionUtil.getRootCauseMessage(var7);
throw var7;
}
}
public int count(String name, Object parameters) {
String var3 = this.autoCount ? "query" : "count";
try {
// 初始化参数
this.initParam(name, parameters);
int ret = super.count(name, parameters);
return ret;
} catch (RuntimeException var5) {
throw var5;
}
}
public void insert(String name, Object object) {
String var3 = "insert";
try {
super.insert(name, object);
} catch (RuntimeException var5) {
throw var5;
}
}
public int update(String name, Object object) {
String var3 = "update";
try {
int ret = super.update(name, object);
return ret;
} catch (RuntimeException var5) {
throw var5;
}
}
public int delete(String name, Object parameters) {
String var3 = "delete";
try {
int ret = super.delete(name, parameters);
return ret;
} catch (RuntimeException var5) {
throw var5;
}
}
public int insertBatch(String name, Collection parameters) {
String operation = "insert";
try {
this.getStatementName(operation, name);
int ret = super.insertBatch(name, parameters);
return ret;
} catch (RuntimeException var5) {
throw var5;
}
}
public int updateBatch(String name, Collection parameters) {
String operation = "update";
try {
this.getStatementName(operation, name);
int ret = super.updateBatch(name, parameters);
return ret;
} catch (RuntimeException var5) {
throw var5;
}
}
public int deleteBatch(String name, Collection parameters) {
String operation = "delete";
try {
this.getStatementName(operation, name);
int ret = super.deleteBatch(name, parameters);
return ret;
} catch (RuntimeException var5) {
throw var5;
}
}
/**
* 初始化参数
*
* @param name
* @param parameters
*/
private void initParam(String name, Object parameters) {
// 查询登录用户信息时不设置企业编码,否则会形成死循环
// 仅限业务模块的查询需要设置企业编码
if ("HPXSUser.query".equals(name) || !name.startsWith("HP") || !(parameters instanceof Map)) {
return;
}
if (parameters == null) {
parameters = new HashMap();
}
// 企业编码
((Map) parameters).put("companyCode", UserSessionUtils.getCompanyCode());
// 部门编码
// ((Map) parameters).put("depCode", UserSessionUtils.getDepCode());
}
}
......@@ -9,49 +9,50 @@
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker ename="inqu_status-0-documentTime" cname="单据日期" format="yyyy-MM-dd" required="true"/>
<EF:EFInput ename="inqu_status-0-documentCode" cname="采购入库单号" colWidth="4" readonly="false"/>
<EF:EFSelect cname="存货类型" blockId="inqu_status" ename="materialType" row="0" colWidth="3">
<EF:EFDatePicker cname="单据日期" ename="inqu_status-0-receiptDate" colWidth="3"
role="date" format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="采购单号" ename="inqu_status-0-chpurchaseCodeeckNo" colWidth="3"/>
<EF:EFSelect cname="存货类型" ename="inqu_status-0-inventType" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" />
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-whCode" cname="仓库名称"
valueTemplate="#=textField#" filter="contains"
required="false" defultValue="ALL"
template="#=textField#">
<EF:EFOption label="请选择" value=""></EF:EFOption>
<EF:EFSelect cname="仓库名称" ename="inqu_status-0-whCode" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-materialCode" cname="存货名称"
valueTemplate="#=textField#" filter="contains"
required="false" defultValue="ALL"
template="#=textField#">
<EF:EFOption label="请选择" value=""></EF:EFOption>
</div>
<div class="row">
<EF:EFSelect cname="存货名称" ename="inqu_status-0-inventCode" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="规格" ename="inqu_status-0-spec" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="false" isFloat="true" autoFit="true">
<EF:EFColumn ename="id" cname="主键id" hidden="true"/>
<EF:EFColumn ename="documentTime" cname="单据日期" editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" width="100" required="true"/>
<EF:EFColumn ename="documentCode" cname="采购入库单号" width="100" readonly="false" align="center" required="false" enable="false" />
<EF:EFComboColumn ename="materialType" cname="存货类型" width="90" align="center">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" />
</EF:EFComboColumn>
<EF:EFColumn ename="whCode" cname="仓库名称" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="whName" cname="仓库名称" width="100" readonly="false" hidden="true"/>
<EF:EFColumn ename="materialCode" cname="存货名称" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="materialName" cname="存货名称" width="100" readonly="false" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" width="120" readonly="false" align="center" required="true"/>
<EF:EFColumn ename="unit" cname="单位" width="80" readonly="false" align="center" enable="false" required="true"/>
<EF:EFColumn ename="quantity" cname="数量" width="80" defaultValue="0" data-regex="/^[0-9]\\\d*$/" data-errorprompt="请输入正整数" readonly="false" align="right" required="true"/>
<EF:EFColumn ename="weight" cname="重量" defaultValue="0" data-rules="number" maxLength="20" width="100" align="right" readonly="false"/>
<EF:EFComboColumn ename="approvalStatus" cname="审批状态" width="90" align="center">
<EF:EFCodeOption codeName="hpjx.hpjx.approvalStatus" />
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="purchaseCode" cname="采购单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" width="90" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="100" align="center" required="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="remarks" cname="备注" width="100" readonly="false"/>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="spec" cname="规格" width="120" align="center"/>
<EF:EFColumn ename="material" cname="材质" width="120" align="center"/>
<EF:EFColumn ename="unit" cname="单位" width="120" align="center"/>
<EF:EFColumn ename="amount" cname="数量" format="{0:N3}" maxLength="20" width="90" align="right"/>
<EF:EFColumn ename="weight" cname="重量" format="{0:N3}" maxLength="20" width="90" align="right"/>
<EF:EFColumn ename="remark" cname="备注" width="150" readonly="true"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid>
</EF:EFRegion>
......
......@@ -19,12 +19,12 @@
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect cname="存货名称" ename="inqu_status-0-inventCode" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect cname="规格" ename="inqu_status-0-spec" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
......@@ -56,7 +56,7 @@
align="right" sumType="all" readonly="true"/>
<EF:EFColumn ename="diffWeight" cname="差异重量" enable="false" format="{0:N3}" maxLength="20" width="100"
align="right" sumType="all" readonly="true"/>
<EF:EFColumn ename="notes" cname="备注" width="150" readonly="true"/>
<EF:EFColumn ename="remark" cname="备注" width="150" readonly="true"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
......
......@@ -40,7 +40,7 @@ $(window).load(function () {
var data = resultGrid.getDataItems();
if (action == true) {
resultGrid.setCellValue(rowNo, "entityAmount", parseFloat(data[rowNo]["amount"]));
resultGrid.setCellValue(i, "entityWeight", parseFloat(rowData[i]["weight"]));
resultGrid.setCellValue(rowNo, "entityWeight", parseFloat(data[rowNo]["weight"]));
}
});
......
let unitNameGlobalData = [];
$(function() {
// 查询
......@@ -7,7 +8,27 @@ $(function() {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200]
}
},
columns: [{
field: "unit",
template: function (dataItem) {
for (let i = 0; i < unitNameGlobalData.length; i++) {
if (unitNameGlobalData[i]['valueField'] === dataItem['unit']) {
return unitNameGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventCode", options.model["inventCode"]);
inInfo.set("serviceName", "HPPZ006");
inInfo.set("methodName", "queryComboBoxUnit");
inInfo.set("blockId", "unit_name_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
}]
}
});
......@@ -16,6 +37,15 @@ $(function() {
* 页面加载时执行
*/
$(window).load(function () {
let inInfo = new EiInfo();
// 规格
EiCommunicator.send("HPPZ006", "queryComboBoxUnit", inInfo, {
onSuccess: function (ei) {
unitNameGlobalData = ei.getBlock("unit_name_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
// 查询
query();
});
......
......@@ -27,7 +27,7 @@
<EF:EFComboColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true">
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="unit" cname="单位" width="100" align="center" maxLength="2"/>
<EF:EFColumn ename="unit" cname="单位" width="100" align="center" required="true"/>
<EF:EFColumn ename="amount" cname="数量" width="120" align="right" format="{0:N3}" sumType="all"
required="true"/>
<EF:EFColumn ename="price" cname="单价" width="120" align="right" format="{0:C3}" required="true"/>
......
......@@ -35,10 +35,10 @@
<EF:EFComboColumn ename="status" cname="状态" align="center" width="100" required="true">
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFComboColumn>
<EF:EFColumn ename="createdBy" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<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="updatedBy" cname="更新人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="updatedName" cname="更新人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="updatedTime" cname="更新时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid>
......
......@@ -37,8 +37,7 @@
<EF:EFColumn ename="material" cname="材质" width="100" align="center" required="true"/>
<EF:EFColumn ename="coefficient" cname="系数" width="100" align="right" format="{0:N2}" maxLength="10"/>
<EF:EFColumn ename="unit" cname="单位" width="100" align="center" required="true"/>
<EF:EFComboColumn ename="status" cname="状态" align="center" width="100" required="true"
columnTemplate="#=valueField#-#=textField#" itemTemplate="#=valueField#-#=textField#">
<EF:EFComboColumn ename="status" cname="状态" align="center" width="100" required="true">
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFComboColumn>
<EF:EFColumn ename="createdName" cname="创建人名称" enable="false" width="100" align="center"/>
......
......@@ -9,7 +9,6 @@ if (url.indexOf("?") != -1) { //判断是否有参数
strs = str.split("="); //用等号进行分隔 (因为知道只有一个参数 所以直接用等号进分隔 如果有多个参数 要用&号分隔 再用等号进行分隔)
console.log('strs=' + strs) //直接弹出第一个参数 (如果有多个参数 还要进行循环的)
}
$(function () {
IPLATUI.EFTree = {
"materialTree": {
......@@ -183,20 +182,14 @@ $(function () {
template: function (item) {
console.log(item)
let auditStatus = item.status;
let filePath1 = item.filePath1;
let leaf = item.leaf
let template = '';
if (filePath1 === ' ') {
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="openUploadFile(' + item.id + ',1)" >附件上传</a>';
} else if (!filePath1) {
} else {
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'href="'+ctx+'/EU/DM/EUDM06.jsp?docId=' + filePath1 + '" >下载</a>';
}
if (leaf === '1') {
if (auditStatus == 0) {
// template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
// + 'onclick="openUploadFile(' + item.id + ',1)" >附件上传</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ')" >附件清单</a>';
if (leaf === '1') {
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="check(' + item.id + ',1)" >审核</a>';
} else {
......@@ -320,6 +313,20 @@ function openUploadFile(id) {
rowId = id;
}
/**
* 显示附件清单
*
* @param id
*/
function showUploadFile(id) {
JSColorbox.open({
href: "HPSC002A?methodName=initLoad&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
function check(id, auditStatus) {
const inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
......
$(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.filePath
+ '" >附件下载</a>';
return template;
}
}],
dataBound: function () {
}
}
};
// 关闭事件
IPLATUI.EFWindow = {
"uploadFile": {
close: function (e) {
let $iframe = uploadFileWindow.element.children("iframe");
let iframejQuery = $iframe[0].contentWindow.$; // 子窗口中的jQuery对象
let uploadFile = iframejQuery("#fileDocId").val();
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-matId", $("#inqu_status-0-matId").val());
inEiInfo.set("result-0-docId", uploadFile);
EiCommunicator.send('HPSC002A', 'insert', inEiInfo, {
onSuccess(response) {
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
}
};
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
// 附件上传
$("#UPLOAD_FILE").on("click", uploadFile);
// 查询
$("#BTN_DELETE").on("click", deleteFunc);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
});
/**
* 查询
*/
var query = function (e) {
resultGrid.dataSource.page(1);
}
/**
* 文件上传
*
*/
function uploadFile() {
uploadFileWindow.open().center();
}
/**
* 删除
*/
function deleteFunc() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HPSC002A", "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="matId" blockId="inqu_status" row="0" type="hidden"/>
<div class="row">
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="产品名称" ename="prdtName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
<EF:EFDateSpan startCname="创建日期(从)" endCname="至" blockId="inqu_status"
startName="createdDateFrom" endName="createdDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
</div>
</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>
<%-- EEDM8010页面加载时,不会加载EEDM6000 (lazyload="true") --%>
<EF:EFWindow id="uploadFile" url="${ctx}/web/HPSC099" lazyload="true" refresh="true">
</EF:EFWindow>
</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