Commit 055e978a by 宋祥

1.收发存汇总

parent c827f072
......@@ -44,6 +44,14 @@ public enum DdynamicEnum {
INVENT_RECORD_BLOCK_ID("invent_record_block_id","id","inventName","HPPZ006.queryComboBox"),
/**
* 模块:存货档案
* 用途:存货档案下拉框
* 编写:wwl
*/
INVENT_SPEC_BLOCK_ID("invent_spec_block_id","spec","spec","HPPZ006.queryComboBoxSpec"),
/**
* 模块:仓库档案
* 用途:仓库档案下拉框
* 编写:wwl
......
......@@ -24,4 +24,18 @@ public class CommonConstant {
public static final String NO = "N";
}
/**
* 日期类型
*
* @author:songx
* @date:2024/1/20,15:04
*/
public static class DateType {
// 月
public static final String MONTH = "MONTH";
// 日
public static final String DAY = "DAY";
}
}
......@@ -46,6 +46,11 @@ public class DaoUtils {
setCreator((DaoEPBase) obj);
} else if (obj instanceof Map) {
setCreator((Map) obj);
} else if (obj instanceof List) {
for (Object o : ((List) obj)) {
insert(sql, o);
}
return;
}
DaoBase.getInstance().insert(sql, obj);
}
......
package com.baosight.hpjx.hp.constant;
/**
* @author:songx
* @date:2024/1/18,17:16
*/
public class HPConstant {
/**
* 序列号
*
* @author:songx
* @date:2021/8/17,15:22
*/
public class SequenceId {
// 盘点单号
public static final String STATISTICAL_NUMBER = "STATISTICAL_NUMBER";
// 统计单号
public static final String HPKC008_NUMBER = "HPKC008_NUMBER";
// 巡检单号
public static final String HPZL001_NUMBER = "HPZL001_NUMBER";
}
/**
* 库存类型
*
* @author:songx
* @date:2024/1/20,15:18
*/
public class KcType {
// 采购
public static final String CG = "CG";
// 生产
public static final String SC = "SC";
// 其他
public static final String QT = "QT";
}
}
package com.baosight.hpjx.hp.constant;
/**
* @author:songx
* @date:2024/1/18,17:16
*/
public class HPSqlConstant {
/**
* HPPZ010 SQL 定义
*
* @author:songx
* @date:2024/1/18,17:17
*/
public class HPPZ010 {
// 新增
public static final String INSERT = "HPPZ010.insert";
// 查询
public static final String QUERY = "HPPZ010.query";
}
}
......@@ -14,7 +14,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
* THpkc003
*
*/
public class THpkc003 extends DaoEPBase {
public class HPKC003 extends DaoEPBase {
private Long id = 0L;
private String companyCode = " "; /* 企业编码 预留*/
......@@ -113,7 +113,7 @@ EiColumn eiColumn;
/**
* the constructor
*/
public THpkc003() {
public HPKC003() {
initMetaData();
}
......
......@@ -28,9 +28,10 @@ public class HPKC005 extends DaoEPBase {
public static final String FIELD_STATISTICAL_NUMBER = "statisticalNumber"; /* 盘点单号*/
public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/
public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/
public static final String FIELD_MAT_TYPE = "matType"; /* 物料类型*/
public static final String FIELD_MAT_CODE = "matCode"; /* 物料编码*/
public static final String FIELD_MAT_NAME = "matName"; /* 物料名称*/
public static final String FIELD_INVENT_TYPE = "inventType"; /* 物料类型*/
public static final String FIELD_INVENT_CODE = "inventCode"; /* 物料编码*/
public static final String FIELD_INVENT_NAME = "inventName"; /* 物料名称*/
public static final String FIELD_SPEC = "spec"; /* 规格*/
public static final String FIELD_BOOK_AMOUNT = "bookAmount"; /* 账面数量*/
public static final String FIELD_BOOK_WEIGHT = "bookWeight"; /* 账面重量*/
public static final String FIELD_ENTITY_AMOUNT = "entityAmount"; /* 实物数量*/
......@@ -51,9 +52,10 @@ public class HPKC005 extends DaoEPBase {
public static final String COL_STATISTICAL_NUMBER = "STATISTICAL_NUMBER"; /* 盘点单号*/
public static final String COL_WH_CODE = "WH_CODE"; /* 仓库编码*/
public static final String COL_WH_NAME = "WH_NAME"; /* 仓库名称*/
public static final String COL_MAT_TYPE = "MAT_TYPE"; /* 物料类型*/
public static final String COL_MAT_CODE = "MAT_CODE"; /* 物料编码*/
public static final String COL_MAT_NAME = "MAT_NAME"; /* 物料名称*/
public static final String COL_INVENT_TYPE = "INVENT_TYPE"; /* 物料类型*/
public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 物料编码*/
public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 物料名称*/
public static final String COL_SPEC = "SPEC"; /* 规格*/
public static final String COL_BOOK_AMOUNT = "BOOK_AMOUNT"; /* 账面数量*/
public static final String COL_BOOK_WEIGHT = "BOOK_WEIGHT"; /* 账面重量*/
public static final String COL_ENTITY_AMOUNT = "ENTITY_AMOUNT"; /* 实物数量*/
......@@ -80,9 +82,10 @@ public class HPKC005 extends DaoEPBase {
private String statisticalNumber = " "; /* 盘点单号*/
private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/
private String matType = " "; /* 物料类型*/
private String matCode = " "; /* 物料编码*/
private String matName = " "; /* 物料名称*/
private String inventType = " "; /* 物料类型*/
private String inventCode = " "; /* 物料编码*/
private String inventName = " "; /* 物料名称*/
private String spec = " "; /* 规格*/
private BigDecimal bookAmount = new BigDecimal(0.00); /* 账面数量*/
private BigDecimal bookWeight = new BigDecimal(0.00); /* 账面重量*/
private BigDecimal entityAmount = new BigDecimal(0.00); /* 实物数量*/
......@@ -128,16 +131,20 @@ public class HPKC005 extends DaoEPBase {
eiColumn.setDescName("仓库名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MAT_TYPE);
eiColumn.setDescName("物料类型");
eiColumn = new EiColumn(FIELD_INVENT_TYPE);
eiColumn.setDescName("存货类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MAT_CODE);
eiColumn.setDescName("物料编码");
eiColumn = new EiColumn(FIELD_INVENT_CODE);
eiColumn.setDescName("存货编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MAT_NAME);
eiColumn.setDescName("物料名称");
eiColumn = new EiColumn(FIELD_INVENT_NAME);
eiColumn.setDescName("存货名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SPEC);
eiColumn.setDescName("规格");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_BOOK_AMOUNT);
......@@ -320,50 +327,59 @@ public class HPKC005 extends DaoEPBase {
* get the matType - 物料类型.
* @return the matType
*/
public String getMatType() {
return this.matType;
public String getInventType() {
return this.inventType;
}
/**
* set the matType - 物料类型.
*
* @param matType - 物料类型
* @param inventType - 物料类型
*/
public void setMatType(String matType) {
this.matType = matType;
public void setInventType(String inventType) {
this.inventType = inventType;
}
/**
* get the matCode - 物料编码.
* @return the matCode
*/
public String getMatCode() {
return this.matCode;
public String getInventCode() {
return this.inventCode;
}
/**
* set the matCode - 物料编码.
*
* @param matCode - 物料编码
* @param inventCode - 物料编码
*/
public void setMatCode(String matCode) {
this.matCode = matCode;
public void setInventCode(String inventCode) {
this.inventCode = inventCode;
}
/**
* get the matName - 物料名称.
* @return the matName
*/
public String getMatName() {
return this.matName;
public String getInventName() {
return this.inventName;
}
/**
* set the matName - 物料名称.
*
* @param matName - 物料名称
* @param inventName - 物料名称
*/
public void setMatName(String matName) {
this.matName = matName;
public void setInventName(String inventName) {
this.inventName = inventName;
}
public String getSpec() {
return spec;
}
public void setSpec(String spec) {
this.spec = spec;
}
/**
* get the bookAmount - 账面数量.
* @return the bookAmount
......@@ -586,9 +602,10 @@ public class HPKC005 extends DaoEPBase {
setStatisticalNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_STATISTICAL_NUMBER)), statisticalNumber));
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode));
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName));
setMatType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MAT_TYPE)), matType));
setMatCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MAT_CODE)), matCode));
setMatName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MAT_NAME)), matName));
setInventType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_TYPE)), inventType));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode));
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SPEC)), spec));
setBookAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_BOOK_AMOUNT)), bookAmount));
setBookWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_BOOK_WEIGHT)), bookWeight));
setEntityAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_ENTITY_AMOUNT)), entityAmount));
......@@ -617,9 +634,10 @@ public class HPKC005 extends DaoEPBase {
map.put(FIELD_STATISTICAL_NUMBER, StringUtils.toString(statisticalNumber, eiMetadata.getMeta(FIELD_STATISTICAL_NUMBER)));
map.put(FIELD_WH_CODE, StringUtils.toString(whCode, eiMetadata.getMeta(FIELD_WH_CODE)));
map.put(FIELD_WH_NAME, StringUtils.toString(whName, eiMetadata.getMeta(FIELD_WH_NAME)));
map.put(FIELD_MAT_TYPE, StringUtils.toString(matType, eiMetadata.getMeta(FIELD_MAT_TYPE)));
map.put(FIELD_MAT_CODE, StringUtils.toString(matCode, eiMetadata.getMeta(FIELD_MAT_CODE)));
map.put(FIELD_MAT_NAME, StringUtils.toString(matName, eiMetadata.getMeta(FIELD_MAT_NAME)));
map.put(FIELD_INVENT_TYPE, StringUtils.toString(inventType, eiMetadata.getMeta(FIELD_INVENT_TYPE)));
map.put(FIELD_INVENT_CODE, StringUtils.toString(inventCode, eiMetadata.getMeta(FIELD_INVENT_CODE)));
map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME)));
map.put(FIELD_SPEC, StringUtils.toString(spec, eiMetadata.getMeta(FIELD_SPEC)));
map.put(FIELD_BOOK_AMOUNT, StringUtils.toString(bookAmount, eiMetadata.getMeta(FIELD_BOOK_AMOUNT)));
map.put(FIELD_BOOK_WEIGHT, StringUtils.toString(bookWeight, eiMetadata.getMeta(FIELD_BOOK_WEIGHT)));
map.put(FIELD_ENTITY_AMOUNT, StringUtils.toString(entityAmount, eiMetadata.getMeta(FIELD_ENTITY_AMOUNT)));
......
package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InitiateModeEnum;
import com.baosight.hpjx.common.InventTypeEnun;
import com.baosight.hpjx.hp.kc.domain.THpkc003;
import com.baosight.hpjx.hp.pz.domain.THppz006;
import com.baosight.hpjx.hp.kc.domain.HPKC003;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.iplat4j.core.ei.EiBlock;
......@@ -13,8 +9,6 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
......@@ -28,7 +22,7 @@ public class ServiceHPKC003 extends ServiceBase {
* 画面初始化.
*/
public EiInfo initLoad(EiInfo inInfo) {
THpkc003 hpkc003 = new THpkc003();
HPKC003 hpkc003 = new HPKC003();
EiInfo outInfo = new EiInfo();
outInfo.addBlock(EiConstant.resultBlock);
outInfo.getBlock(EiConstant.resultBlock).addBlockMeta(hpkc003.eiMetadata);
......@@ -41,7 +35,7 @@ public class ServiceHPKC003 extends ServiceBase {
@Override
public EiInfo query(EiInfo inInfo) {
/* 调用EI查询方法.*/
EiInfo outInfo = super.query(inInfo, "HPKC003.query", new THpkc003());
EiInfo outInfo = super.query(inInfo, "HPKC003.query", new HPKC003());
return outInfo;
}
......@@ -84,7 +78,7 @@ public class ServiceHPKC003 extends ServiceBase {
public EiInfo update(EiInfo inInfo) {
try {
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
THpkc003 hpkc003 = new THpkc003();
HPKC003 hpkc003 = new HPKC003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
......@@ -109,7 +103,7 @@ public class ServiceHPKC003 extends ServiceBase {
* 删除操作.
*/
public EiInfo delete(EiInfo eiInfo) {
THpkc003 hpkc003 = new THpkc003();
HPKC003 hpkc003 = new HPKC003();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
......
package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC005;
import com.baosight.hpjx.hp.kc.domain.HPKC008;
import com.baosight.hpjx.hp.pz.domain.HPPZ007;
import com.baosight.hpjx.hp.pz.domain.THppz004;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -10,9 +17,13 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.MapUtils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
......@@ -25,11 +36,13 @@ public class ServiceHPKC008 extends ServiceBase {
* 画面初始化.
*/
public EiInfo initLoad(EiInfo inInfo) {
HPKC008 HPKC008 = new HPKC008();
EiInfo outInfo = super.initLoad(inInfo, HPKC008);
outInfo.addBlock(EiConstant.queryBlock).setCell(0,"datemonth",CommonMethod.getCurrentSameYearMonth());
outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
return outInfo;
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC008().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
......@@ -37,11 +50,18 @@ public class ServiceHPKC008 extends ServiceBase {
*/
@Override
public EiInfo query(EiInfo inInfo) {
String datemonth = inInfo.getCellStr(EiConstant.queryBlock,0,"datemonth");
inInfo.setCell(EiConstant.queryBlock,0,"datemonth", StringUtil.removeHorizontalLine(datemonth));
/* 调用EI查询方法.*/
return super.query(inInfo, "HPKC008.query", new HPKC008());
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String receiptDate = MapUtils.getString(queryRow, "receiptDate");
queryRow.put("receiptDate", StringUtil.removeSpecifiedCharacter(receiptDate,
StringUtil.DEFAULT_CHARACTER_TO_BE_REMOVED));
inInfo = super.query(inInfo, "HPKC008.query", new HPKC008());
List sum = dao.query("HPKC008.querySum", queryRow);
inInfo.getBlock(EiConstant.resultBlock).set(EiConstant.COLUMN_TOTAL_SUM, sum.get(0));
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
......@@ -49,13 +69,30 @@ public class ServiceHPKC008 extends ServiceBase {
*/
@Override
public EiInfo insert(EiInfo inInfo) {
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
for (int i = 0; i < inInfo.getBlock(EiConstant.resultBlock).getRowCount(); i++) {
String datemonth = inInfo.getCellStr(EiConstant.resultBlock,i,"datemonth");
inInfo.setCell(EiConstant.resultBlock,i,"datemonth", StringUtil.removeHorizontalLine(datemonth));
try {
CommonMethod.creatorInfo(inInfo, EiConstant.resultBlock);
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
Map resultRow = resultRows.get(i);
// 去除日期字符串中的-
String datemonth = MapUtils.getString(resultRow, "datemonth");
resultRow.put("datemonth", StringUtil.removeHorizontalLine(datemonth));
// 物料名称
Map params1 = new HashMap<>();
params1.put("inventCode", MapUtils.getString(resultRow, "materialCode"));
List query1 = dao.query("HPPZ004.queryMatNameByCode", params1);
String matName = ((THppz004) query1.get(0)).getInventName();
resultRow.put("materialName", matName);
// 生成单据号
resultRow.put("statisticalNumber", SequenceGenerator.getNextSequence(
HPConstant.SequenceId.HPKC008_NUMBER));
DaoUtils.insert("HPKC008.insert", resultRow);
}
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return super.insert(inInfo,"HPKC008.insert");
return inInfo;
}
......
......@@ -41,6 +41,9 @@
<isNotEmpty prepend=" AND " property="documentCode">
DOCUMENT_CODE LIKE CONCAT('%',CONCAT( #documentCode#,'%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
......@@ -49,7 +52,6 @@
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
......@@ -170,4 +172,23 @@
WHERE ID = #id#
</update>
<!-- 按天统计 -->
<select id="statDay" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC001">
SELECT
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
WH_CODE AS "whCode",
MATERIAL_TYPE AS "materialType",
MATERIAL_CODE AS "materialCode",
SPEC AS "spec",
COALESCE(SUM(QUANTITY), 0) AS "quantity",
COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hpjxSchema}.T_HPKC001
WHERE 1=1
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, MATERIAL_TYPE, MATERIAL_CODE, SPEC
</select>
</sqlMap>
......@@ -170,4 +170,23 @@
WHERE ID = #id#
</update>
<!-- 按天统计 -->
<select id="statDay" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC002">
SELECT
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
WH_CODE AS "whCode",
MATERIAL_TYPE AS "materialType",
MATERIAL_CODE AS "materialCode",
SPEC AS "spec",
COALESCE(SUM(QUANTITY), 0) AS "quantity",
COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hpjxSchema}.T_HPKC002
WHERE 1=1
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, MATERIAL_TYPE, MATERIAL_CODE, SPEC
</select>
</sqlMap>
......@@ -25,7 +25,7 @@
<sqlMap namespace="HPKC003">
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.kc.domain.THpkc003">
resultClass="com.baosight.hpjx.hp.kc.domain.HPKC003">
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
......@@ -173,4 +173,22 @@
ID = #id#
</update>
<!-- 按天统计 -->
<select id="statDay" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC003">
SELECT
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
WAREHOUSE_CODE AS "warehouseCode",
MATERIAL_TYPE AS "materialType",
MATERIAL_CODE AS "materialCode",
COALESCE(SUM(NUMBER), 0) AS "number",
COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hpjxSchema}.T_HPKC003
WHERE 1=1
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WAREHOUSE_CODE, MATERIAL_TYPE, MATERIAL_CODE
</select>
</sqlMap>
......@@ -247,4 +247,22 @@
ID = #id#
</update>
<!-- 按天统计 -->
<select id="statDay" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC004">
SELECT
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
WH_CODE AS "whCode",
MAT_TYPE AS "matType",
MAT_CODE AS "matCode",
COALESCE(SUM(AMOUNT), 0) AS "amount",
COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hpjxSchema}.T_HPKC004
WHERE 1=1
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, MAT_TYPE, MAT_CODE
</select>
</sqlMap>
......@@ -120,4 +120,22 @@
ID = #id#
</update>
<!-- 按天统计 -->
<select id="statDay" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC006">
SELECT
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
WH_CODE AS "whCode",
MAT_TYPE AS "matType",
MAT_CODE AS "matCode",
COALESCE(SUM(AMOUNT), 0) AS "amount",
COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hpjxSchema}.T_HPKC006
WHERE 1=1
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, MAT_TYPE, MAT_CODE
</select>
</sqlMap>
......@@ -163,4 +163,22 @@
ID = #id#
</update>
<!-- 按天统计 -->
<select id="statDay" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC007">
SELECT
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
WH_CODE AS "whCode",
MAT_TYPE AS "matType",
MAT_CODE AS "matCode",
COALESCE(SUM(AMOUNT), 0) AS "amount",
COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hpjxSchema}.T_HPKC004
WHERE 1=1
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, MATERIAL_TYPE, MATERIAL_CODE
</select>
</sqlMap>
<?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">
<!-- table information
Generate time : 2024-01-09 18:54:54
Version : 1.0
tableName :hpjx.t_hpkc008
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
DATEMONTH VARCHAR NOT NULL,
STATISTICAL_NUMBER VARCHAR NOT NULL,
MATERIAL_CODE VARCHAR NOT NULL,
MATERIAL_NAME VARCHAR NOT NULL,
UNIT VARCHAR,
AMOUNT DECIMAL NOT NULL,
PRICE DECIMAL NOT NULL,
TOTAL_PRICE DECIMAL NOT NULL,
NOTES VARCHAR,
CREATED_BY VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_TIME VARCHAR
-->
<sqlMap namespace="HPKC008">
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.kc.domain.HPKC008">
SELECT
<sql id="column">
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DATEMONTH as "datemonth", <!-- 月份 -->
......@@ -40,7 +18,9 @@
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime" <!-- 更新时间 -->
FROM hpjx.t_hpkc008 WHERE 1=1
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
......@@ -50,15 +30,21 @@
<isNotEmpty prepend=" AND " property="statisticalNumber">
STATISTICAL_NUMBER = #statisticalNumber#
</isNotEmpty>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC008">
SELECT
<include refid="column"/>
FROM hpjx.t_hpkc008 WHERE 1=1
<include refid="condition"/>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
ID DESC
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
......@@ -68,37 +54,36 @@
</isNotEmpty>
</select>
<!-- 查询统计 -->
<select id="querySum" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC008">
SELECT
COALESCE(SUM(AMOUNT), 0) AS "amount", <!-- 数量 -->
COALESCE(SUM(TOTAL_PRICE), 0) AS "totalPrice" <!-- 金额 -->
FROM ${hpjxSchema}.t_hpkc008
WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO hpjx.t_hpkc008 (
COMPANY_CODE, <!-- 企业编码 预留 -->
DATEMONTH, <!-- 月份 -->
STATISTICAL_NUMBER, <!-- 统计单单号 -->
MATERIAL_CODE, <!-- 物料编码 -->
MATERIAL_NAME, <!-- 物料名称 -->
UNIT, <!-- 单位 -->
AMOUNT, <!-- 数量 -->
PRICE, <!-- 单价 -->
TOTAL_PRICE, <!-- 金额 -->
NOTES, <!-- 备注 -->
CREATED_BY, <!-- 创建人 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_TIME <!-- 更新时间 -->
COMPANY_CODE, DATEMONTH, STATISTICAL_NUMBER, MATERIAL_CODE,
MATERIAL_NAME, UNIT, AMOUNT, PRICE, TOTAL_PRICE, NOTES,
CREATED_BY, CREATED_TIME
) VALUES (
#companyCode#, #datemonth#, #statisticalNumber#, #materialCode#, #materialName#,
#unit#, #amount#, #price#, #totalPrice#, #notes#, #createdBy#, #createdTime#,
#updatedBy#, #updatedTime#
)
VALUES (#companyCode#, #datemonth#, #statisticalNumber#, #materialCode#, #materialName#, #unit#, #amount#, #price#, #totalPrice#, #notes#, #createdBy#, #createdTime#, #updatedBy#, #updatedTime#)
</insert>
<delete id="delete">
DELETE FROM hpjx.t_hpkc008 WHERE
ID = #id#
DELETE FROM hpjx.t_hpkc008 WHERE ID = #id#
</delete>
<update id="update">
UPDATE hpjx.t_hpkc008
SET
DATEMONTH = #datemonth#, <!-- 月份 -->
STATISTICAL_NUMBER = #statisticalNumber#, <!-- 统计单单号 -->
MATERIAL_CODE = #materialCode#, <!-- 物料编码 -->
MATERIAL_NAME = #materialName#, <!-- 物料名称 -->
UNIT = #unit#, <!-- 单位 -->
......@@ -108,8 +93,7 @@
NOTES = #notes#, <!-- 备注 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE
ID = #id#
WHERE ID = #id#
</update>
</sqlMap>
<?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="HPKC009">
<sql id="column">
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
KC_TYPE as "kcType", <!-- 库存类型:CG:采购,SC:生产,QT:其他 -->
DATE_TYPE as "dateType", <!-- 日期类型:DAY:天,MONTH:月 -->
DATE_PROC as "dateProc", <!-- 日期 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
SPEC as "spec", <!-- 规格 -->
INIT_AMOUNT as "initAmount", <!-- 期初数量 -->
INIT_WEIGHT as "initWeight", <!-- 期初重量 -->
STOCKIN_AMOUNT as "stockinAmount", <!-- 入库数量 -->
STOCKIN_WEIGHT as "stockinWeight", <!-- 入库重量 -->
STOCKOUT_AMOUNT as "stockoutAmount", <!-- 出库数量 -->
STOCKOUT_WEIGHT as "stockoutWeight", <!-- 出库重量 -->
END_AMOUNT as "endAmount", <!-- 期末数量 -->
END_WEIGHT as "endWeight", <!-- 期末重量 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime" <!-- 更新时间 -->
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="dateType">
DATE_TYPE = #dateType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="datemonth">
DATEMONTH = #datemonth#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
SPEC = #spec#
</isNotEmpty>
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
</sql>
<!-- 查询 -->
<select id="query" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC009">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPKC009
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPKC009 WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPKC009 (
COMPANY_CODE, DEP_CODE, KC_TYPE, DATE_TYPE, DATE_PROC, WH_CODE, WH_NAME, INVENT_TYPE,
INVENT_CODE, INVENT_NAME, SPEC, INIT_AMOUNT, INIT_WEIGHT, STOCKIN_AMOUNT,
STOCKIN_WEIGHT, STOCKOUT_AMOUNT, STOCKOUT_WEIGHT, END_AMOUNT, END_WEIGHT,
CREATED_BY, CREATED_NAME, CREATED_TIME
) VALUES (
#companyCode#, #depCode#, #kcType#, #dateType#, #dateProc#, #whCode#, #whName#, #inventType#,
#inventCode#, #inventName#, #spec#, #initAmount#, #initWeight#, #stockinAmount#,
#stockinWeight#, #stockoutAmount#, #stockoutWeight#, #endAmount#, #endWeight#,
#createdBy#, #createdName#, #createdTime#
)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPKC009 WHERE ID = #id#
</delete>
</sqlMap>
......@@ -5,14 +5,18 @@ import com.baosight.hpjx.common.InitiateModeEnum;
import com.baosight.hpjx.common.InventTypeEnun;
import com.baosight.hpjx.hp.pz.domain.THppz006;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
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.ServiceBase;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
......@@ -133,4 +137,21 @@ public class ServiceHPPZ006 extends ServiceBase {
return eiInfo;
}
/**
* 规格下拉框
*
* @param inInfo
* @return
*/
public EiInfo queryComboBoxSpec(EiInfo inInfo) {
try {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.INVENT_SPEC_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "规格下拉框");
}
return inInfo;
}
}
package com.baosight.hpjx.hp.pz.service;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ009;
import com.baosight.hpjx.hp.pz.domain.HPPZ010;
import com.baosight.hpjx.hp.xs.tools.HPXSUserTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.RsaUtils;
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.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import com.baosight.xservices.xs.constants.LoginConstants;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 数据授权
*
* @author:songx
* @date:2024/1/18,17:15
*/
public class ServiceHPPZ010 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPPZ010().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPSqlConstant.HPPZ010.QUERY, new HPPZ010());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HPPZ009 fPz009 = new HPPZ009();
fPz009.fromMap(resultRows.get(i));
if (fPz009.getId() == null || fPz009.getId() == 0) {
this.add(fPz009);
} else {
this.modify(fPz009);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param resultRows
*/
private void checkSaveData(List<Map> resultRows) {
// 数据校验
for (int i = 0; i < resultRows.size(); i++) {
HPPZ009 hppz009 = new HPPZ009();
hppz009.fromMap(resultRows.get(i));
AssertUtils.isEmpty(hppz009.getCompanyName(), "企业名称不能为空");
AssertUtils.isNull(hppz009.getValidFlag(), "是否启用不能为空");
}
}
/**
* 新增企业信息
*
* @param fPz009
* @throws Exception
*/
private void add(HPPZ009 fPz009) throws Exception {
// 生成企业编码
fPz009.setCompanyCode(SequenceGenerator.getNextSequence("COMPANY_CODE"));
fPz009.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert("HPPZ009.insert", fPz009);
// 默认新增企业管理员账号
this.initUser(fPz009);
// 关联企业管理员角色
this.insertGroupMember(fPz009);
}
/**
* 修改数据
*
* @param fPz009
*/
private void modify(HPPZ009 fPz009) {
DaoUtils.update("HPPZ009.update", fPz009);
}
/**
* 新增操作.
*
* @param inInfo
* @return
*/
@Override
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 数据写入
for (int i = 0; i < resultRows.size(); i++) {
HPPZ009 fPz009 = new HPPZ009();
fPz009.fromMap(resultRows.get(i));
this.add(fPz009);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 初始化用户
*
* @param hppz009
*/
private void initUser(HPPZ009 hppz009) throws Exception {
String companyCode = hppz009.getCompanyCode();
Map inInfoRowMap = new HashMap();
inInfoRowMap.put("userId", companyCode);
inInfoRowMap.put("loginName", companyCode);
inInfoRowMap.put("userName", hppz009.getCompanyName());
// 使用公钥加密密码
String password = RsaUtils.encryptByPublicKey(LoginConstants.rsaPublicKey, companyCode);
inInfoRowMap.put("password", password);
inInfoRowMap.put("rePass", password);
inInfoRowMap.put("email", " ");
inInfoRowMap.put("mobile", " ");
inInfoRowMap.put("companyCode", hppz009.getCompanyCode());
EiInfo inInfo = new EiInfo();
inInfo.addBlock("details").addRow(inInfoRowMap);
inInfo.set(EiConstant.serviceName, "XS0102");
inInfo.set(EiConstant.methodName, "insert");
EiInfo outInfo = XLocalManager.call(inInfo);
if (outInfo.getStatus() < 0) {
throw new PlatException(outInfo.getMsg());
}
}
/**
* 用户关联角色
*
* @param hppz009
*/
private void insertGroupMember(HPPZ009 hppz009) {
String companyCode = hppz009.getCompanyCode();
Map inInfoRowMap = new HashMap();
inInfoRowMap.put("memberId", companyCode);
inInfoRowMap.put("memberName", hppz009.getCompanyName());
// TODO 该用户组固定不能修改,代码中其他地方有写死的地方
inInfoRowMap.put("parentId", "companyManage");
inInfoRowMap.put("parentName", "企业管理员");
inInfoRowMap.put("memberType", "USER");
EiInfo inInfo = new EiInfo();
inInfo.addBlock(EiConstant.resultBlock).addRow(inInfoRowMap);
inInfo.set(EiConstant.serviceName, "XS03");
inInfo.set(EiConstant.methodName, "insert");
EiInfo outInfo = XLocalManager.call(inInfo);
if (outInfo.getStatus() < 0) {
throw new PlatException(outInfo.getMsg());
}
}
/**
* 修改操作
*
* @param inInfo
* @return
*/
public EiInfo update(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
for (int i = 0; i < resultRows.size(); i++) {
HPPZ009 hppz009 = new HPPZ009();
hppz009.fromMap(resultRows.get(i));
DaoUtils.update("HPPZ009.update", hppz009);
}
inInfo = this.query(inInfo);
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++) {
HPPZ009 fPz009 = new HPPZ009();
fPz009.fromMap(resultRows.get(i));
// 校验企业下是否存在用户
int count = HPXSUserTools.countByCompany(fPz009.getCompanyCode());
if (count > 0) {
throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户",
fPz009.getCompanyName()));
}
DaoUtils.update("HPPZ009.delete", fPz009);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
}
......@@ -195,4 +195,19 @@
</isNotEmpty>
ORDER BY INVENT_CODE
</select>
<!-- 规格下拉框 -->
<select id="queryComboBoxSpec" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
SPEC AS "spec"
FROM hpjx.t_hppz006 WHERE STATUS=1
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
ORDER BY ID
</select>
</sqlMap>
<?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="HPPZ010">
<sql id="column">
ID as "id",
SUBJECT_ID as "subjectId", <!-- 授权主体ID -->
SUBJECT_TYPE as "subjectType", <!-- 授权主体类别 -->
OBJECT_ID as "objectId", <!-- 授权客体ID -->
OBJECT_TYPE as "objectType", <!-- 授权客体类别 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime" <!-- 更新时间 -->
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="subjectId">
SUBJECT_ID = #subjectId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="subjectType">
SUBJECT_TYPE = #subjectType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="objectId">
OBJECT_ID = #objectId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="objectType">
OBJECT_TYPE = #objectType#
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ010">
SELECT <include refid="column"/>
FROM ${hpjxSchema}.T_HPPZ010
WHERE 1=1
<include refid="condition" />
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPPZ010 WHERE 1=1
<include refid="condition" />
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPPZ010 (
SUBJECT_ID, <!-- 授权主体ID -->
SUBJECT_TYPE, <!-- 授权主体类别 -->
OBJECT_ID, <!-- 授权客体ID -->
OBJECT_TYPE, <!-- 授权客体类别 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME <!-- 创建时间 -->
) VALUES (
#subjectId#, #subjectType#, #objectId#, #objectType#, #createdBy#,
#createdName#, #createdTime#
)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPPZ010 WHERE ID = #id#
</delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPPZ010
SET
SUBJECT_ID = #subjectId#, <!-- 授权主体ID -->
SUBJECT_TYPE = #subjectType#, <!-- 授权主体类别 -->
OBJECT_ID = #objectId#, <!-- 授权客体ID -->
OBJECT_TYPE = #objectType#, <!-- 授权客体类别 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE ID = #id#
</update>
</sqlMap>
package com.baosight.hpjx.hp.zl.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC008;
import com.baosight.hpjx.hp.pz.domain.THppz004;
import com.baosight.hpjx.hp.sc.domain.THPSC001;
import com.baosight.hpjx.hp.sc.domain.THPSC002;
import com.baosight.hpjx.hp.zl.domain.HPZL001;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.iplat4j.core.ei.EiBlock;
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.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.MapUtils;
import java.util.*;
......@@ -23,15 +34,10 @@ public class ServiceHPZL001 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
HPZL001 HPZL001 = new HPZL001();
EiInfo outInfo = super.initLoad(inInfo, HPZL001);
outInfo.addBlock(EiConstant.queryBlock).setCell(0,"receiptDate",CommonMethod.getCurrentSameYearMonthDay());
outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
CommonMethod.initBlock(outInfo,
Arrays.asList(
DdynamicEnum.PROJ_RECORD_BLOCK_ID),
new HashMap<String,String>(1) {{
put("status", "1" );
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID),
new HashMap<String,String>(1) {{put("status", "1" );
}});
return outInfo;
}
......@@ -40,11 +46,16 @@ public class ServiceHPZL001 extends ServiceBase {
*/
@Override
public EiInfo query(EiInfo inInfo) {
String receiptDate = inInfo.getCellStr(EiConstant.queryBlock,0,"receiptDate");
inInfo.setCell(EiConstant.queryBlock,0,"receiptDate", StringUtil.removeHorizontalLine(receiptDate));
/* 调用EI查询方法.*/
return super.query(inInfo, "HPZL001.query", new HPZL001());
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String receiptDate = MapUtils.getString(queryMap, "receiptDate");
queryMap.put("receiptDate", StringUtil.removeSpecifiedCharacter(receiptDate,
StringUtil.DEFAULT_CHARACTER_TO_BE_REMOVED));
inInfo = super.query(inInfo, "HPZL001.query", new HPKC008());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
......@@ -52,16 +63,29 @@ public class ServiceHPZL001 extends ServiceBase {
*/
@Override
public EiInfo insert(EiInfo inInfo) {
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
for (int i = 0; i < inInfo.getBlock(EiConstant.resultBlock).getRowCount(); i++) {
String itemName =inInfo.getCellStr(EiConstant.resultBlock,i,"itemName");
String[] str = itemName.split("-");
inInfo.setCell(EiConstant.resultBlock,i,"itemCode", str[0]);
inInfo.setCell(EiConstant.resultBlock,i,"itemName", str[1]);
String receiptDate = inInfo.getCellStr(EiConstant.resultBlock,i,"receiptDate");
inInfo.setCell(EiConstant.resultBlock,i,"receiptDate", StringUtil.removeHorizontalLine(receiptDate));
try {
CommonMethod.creatorInfo(inInfo, EiConstant.resultBlock);
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
Map resultRow = resultRows.get(i);
// 去除日期字符串中的-
String datemonth = MapUtils.getString(resultRow, "receiptDate");
resultRow.put("datemonth", StringUtil.removeHorizontalLine(datemonth));
// 项目名称
Map params1 = new HashMap<>();
params1.put("itemCode", MapUtils.getString(resultRow, "itemCode"));
List<THPSC001> query1 = dao.query("HPSC001.query", params1);
resultRow.put("itemName", query1.get(0).getProjName());
// 生成单据号
resultRow.put("chkBillno", SequenceGenerator.getNextSequence(
HPConstant.SequenceId.HPZL001_NUMBER));
DaoUtils.insert("HPZL001.insert", resultRow);
}
return super.insert(inInfo,"HPZL001.insert");
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
......@@ -131,13 +155,29 @@ public class ServiceHPZL001 extends ServiceBase {
public EiInfo operator(EiInfo inInfo) {
HPZL001 HPZL001 = new HPZL001();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
CommonMethod.updateuserInfo(inInfo,EiConstant.resultBlock);
return super.update(inInfo,"HPZL001.operator");
CommonMethod.updateuserInfo(inInfo, EiConstant.resultBlock);
return super.update(inInfo, "HPZL001.operator");
}
/**
* 导入数据
* 上传附件
*
* @param inInfo
* @return
*/
public EiInfo bindDocIdById(EiInfo inInfo) {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
try {
for (int i = 0; i < resultRows.size(); i++) {
Map resultRow = resultRows.get(i);
DaoUtils.update("HPZL001.updateAffix", resultRow);
}
inInfo.setMsg("更新附件成功!");
} 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">
<!-- table information
Generate time : 2024-01-10 14:47:08
Version : 1.0
tableName :hpjx.t_hpzl001
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
RECEIPT_DATE VARCHAR NOT NULL,
CHK_BILLNO VARCHAR NOT NULL,
ITEM_CODE VARCHAR NOT NULL,
ITEM_NAME VARCHAR NOT NULL,
UNIT VARCHAR,
DESC VARCHAR,
PRINC VARCHAR NOT NULL,
STATUS TINYINT NOT NULL,
AFFIX VARCHAR,
CREATED_BY VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_TIME VARCHAR,
DEP_CODE VARCHAR
-->
<sqlMap namespace="HPZL001">
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.zl.domain.HPZL001">
<select id="query" resultClass="com.baosight.hpjx.hp.zl.domain.HPZL001">
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
......@@ -63,10 +41,9 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
ID DESC
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
......@@ -76,57 +53,6 @@
</isNotEmpty>
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="chkBillno">
CHK_BILLNO = #chkBillno#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemCode">
ITEM_CODE = #itemCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemName">
ITEM_NAME = #itemName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unit">
UNIT = #unit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="desc">
NOTES = #notes#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="princ">
PRINC = #princ#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="affix">
AFFIX = #affix#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO hpjx.t_hpzl001 (
COMPANY_CODE, <!-- 企业编码 预留 -->
......@@ -141,19 +67,19 @@
AFFIX, <!-- 附件 -->
CREATED_BY, <!-- 创建人 -->
CREATED_TIME <!-- 创建时间 -->
) VALUES (
#companyCode#, #receiptDate#, #chkBillno#, #itemCode#, #itemName#, #unit#,
#notes#, #createdBy#, #status#, #affix#, #createdBy#, #createdTime#
)
VALUES (#companyCode#, #receiptDate#, #chkBillno#, #itemCode#, #itemName#, #unit#, #notes#, #createdBy#, #status#, #affix#, #createdBy#, #createdTime#)
</insert>
<delete id="delete">
DELETE FROM hpjx.t_hpzl001 WHERE
ID = #id#
DELETE FROM hpjx.t_hpzl001 WHERE ID = #id#
</delete>
<update id="update">
UPDATE hpjx.t_hpzl001
SET
RECEIPT_DATE = #receiptDate#, <!-- 单据日期 -->
CHK_BILLNO = #chkBillno#, <!-- 检查单号 -->
ITEM_CODE = #itemCode#, <!-- 项目号 -->
......@@ -165,19 +91,27 @@
AFFIX = #affix#, <!-- 附件 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE
ID = #id#
WHERE ID = #id#
</update>
<!-- 审核操作 -->
<update id="operator">
UPDATE hpjx.t_hpzl001
SET
STATUS = #status#, <!-- 单据状态 0待审核 1已审核 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE
ID = #id#
WHERE ID = #id#
</update>
<!-- 更新附件信息 -->
<update id="updateAffix">
UPDATE hpjx.t_hpzl001
SET
AFFIX = #affix#, <!-- 附件 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE ID = #id#
</update>
</sqlMap>
package com.baosight.hpjx.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
/**
* 实体类之间的属性复制
*
* @author:songx
* @date:2020/7/30,15:34
*/
public class BeanUtils extends org.springframework.beans.BeanUtils {
private static Logger logger = LoggerFactory.getLogger(BeanUtils.class);
/**
* 单个实体类之间的属性复制
*
* @param object
* @param clazz
* @param <T>
* @return
*/
public static <T> T copy(Object object, Class<T> clazz) {
return copy(object, clazz, false);
}
/**
* 单个对象实例化
*
* @param object
* @param clazz
* @param <T>
* @return
*/
public static <T> T copyOrEmpty(Object object, Class<T> clazz) {
return copy(object, clazz, true);
}
/**
* 单个对象实例化
*
* @param object
* @param clazz
* @param isNewEmpty 是否构建空对象,true:是
* @param <T>
* @return
*/
private static <T> T copy(Object object, Class<T> clazz, boolean isNewEmpty) {
if (object == null && !isNewEmpty) {
return null;
}
try {
T t = clazz.newInstance();
if (object != null) {
copyProperties(object, t);
}
return t;
} catch (Exception e) {
logger.error("clazz newInstance is error:{}", e.getMessage(), e);
return null;
}
}
/**
* 实体类之间的转换
*
* @param sources 来源
* @param clazz 目标对象
* @return
*/
public static <T> List<T> copy(Collection<?> sources, Class<T> clazz) {
return copy(sources, clazz, false);
}
/**
* 实体类之间的转换
*
* @param sources 来源
* @param clazz 目标对象
* @return
*/
public static <T> List<T> copyOrEmpty(Collection<?> sources, Class<T> clazz) {
return copy(sources, clazz, true);
}
/**
* 实体类之间的转换
*
* @param sources
* @param clazz
* @param isNewEmpty 是否构建空对象,true:是
* @param <T>
* @return
*/
private static <T> List<T> copy(Collection<?> sources, Class<T> clazz, boolean isNewEmpty) {
if (sources == null) {
return isNewEmpty ? Collections.emptyList() : null;
}
return sources.stream().map(source -> copy(source, clazz)).collect(Collectors.toList());
}
}
......@@ -33,18 +33,19 @@ public class LogUtils {
if (inInfo == null) {
return;
}
inInfo.setMsg(title.concat(",原因:"));
inInfo.setMsg(title);
if (e == null) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setDetailMsg("未知");
return;
}
// 由于平台调用链不支持查看detailMsg的消息内容,因此这里修改成往Msg中写错误信息
inInfo.setMsg(inInfo.getMsg().concat(e.getMessage()));
inInfo.setDetailMsg(e.getMessage());
if (e instanceof PlatException) {
inInfo.setMsg(inInfo.getMsg().concat(",原因:").concat(e.getMessage()));
inInfo.setStatus(EiConstant.STATUS_FAILURE);
} else {
inInfo.setMsg(inInfo.getMsg().concat(",原因参见详细错误描述!"));
inInfo.setStatus(EiConstant.STATUS_FAILURE);
}
}
......@@ -69,11 +70,9 @@ public class LogUtils {
if (e == null) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg(msg.concat("未知"));
inInfo.setDetailMsg("未知");
return;
}
inInfo.setMsg(msg.concat(e.getMessage()));
inInfo.setDetailMsg(e.getMessage());
if (e instanceof PlatException) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
} else {
......
......@@ -13,7 +13,7 @@ public class StringUtil {
/**
* 默认的待去除字符, 用于{@link }静态方法.
*/
private static final Character DEFAULT_CHARACTER_TO_BE_REMOVED = '-';
public static final Character DEFAULT_CHARACTER_TO_BE_REMOVED = '-';
/**
......
var inventNameGlobalData = [];
var specGlobalData = [];
$(function() {
var eiInfo = new EiInfo();
var globalData = [];
var day1 = new Date();
day1.setTime(day1.getTime());
var s1 = day1.getFullYear() + "-" + (day1.getMonth() + 1) + "-" + day1.getDate();
$("#inqu_status-0-receiptDate").val(s1);
// var day1 = new Date();
// day1.setTime(day1.getTime());
// var s1 = day1.getFullYear() + "-" + (day1.getMonth() + 1) + "-" + day1.getDate();
// $("#inqu_status-0-receiptDate").val(s1);
// 查询
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询
var dataSource;
eiInfo = new EiInfo();
EiCommunicator.send("HPPZ004", "queryComboBox", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("invent_name_block_id").getMappedRows();
globalData = dataSource;
}, onFail: function (ei) {
}
}, {async: false});
});
$("#QUERY").on("click", query);
IPLATUI.EFGrid = {
// 保存
$("#BTN_SAVE").on("click", save);
IPLATUI.EFGrid = {
"result": {
columns: [
{
field: "matCode",
template: function(dataItem) {
for (var i = 0 ; i < globalData.length ; i++) {
if ( globalData[i]['valueField'] === dataItem['matCode']) {
return globalData[i]['textField'];
columns: [{
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) {
var grid = container.closest(".k-grid").data("kendoGrid");
......@@ -41,18 +30,17 @@ $(function() {
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
eiInfo.set("inventType", options.model["matType"]);
let eiInfo = new EiInfo();
eiInfo.set("inventType", options.model["inventType"]);
var dataSource;
EiCommunicator.send("HPPZ004", "queryComboBox", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("invent_name_block_id").getMappedRows();
globalData = dataSource;
}, onFail: function (ei) {
inventNameGlobalData = dataSource;
},
onFail: function (ei) {
}
}, {async: false});
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
......@@ -61,85 +49,49 @@ $(function() {
template: "#=textField#"
});
}
}, {
field: "spec",
template: function (dataItem) {
for (let i = 0; i < specGlobalData.length; i++) {
if (specGlobalData[i]['valueField'] === dataItem['spec']) {
return specGlobalData[i]['textField'];
}
],
loadComplete: function (grid) {
// 新增
$("#BTN_INSERT").on("click", function () {
var btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
IPLAT.submitNode($("#HPKC005"), "HPKC005", "insert", {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
// 绑定grid
resultGrid.setEiInfo(ei);
NotificationUtil({
msg: '新增成功'
});
}
//释放禁用按钮
btnNode.attr("disabled", false);
resultGrid.dataSource.page(1);
return "";
},
onFail: function (ei) { // onFail 表示失败回调函数
// 发生异常
console.log(ei);
//释放禁用按钮
btnNode.attr("disabled", false);
}
});
});
// 修改
$("#BTN_UPDATE").on("click", function () {
var rowCount = resultGrid.getCheckedRows();
// 检验是否选中数据
if (rowCount == null || rowCount == "") {
NotificationUtil({
msg : '请选择一条或多条数据'
}, "warning");
return false;
}
var btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
IPLAT.submitNode($("#HPKC005"), "HPKC005", "update", {
editor: function (container, options) {
var grid = container.closest(".k-grid").data("kendoGrid");
var cellIndex = grid.cellIndex(container);
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
let eiInfo = new EiInfo();
eiInfo.set("inqu_status-0-inventCode", options.model["inventCode"]);
var dataSource;
EiCommunicator.send("HPPZ006", "queryComboBoxSpec", eiInfo, {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
NotificationUtil({
msg: '修改成功'
});
// 绑定grid
resultGrid.setEiInfo(ei);
}
//释放禁用按钮
btnNode.attr("disabled", false);
dataSource = ei.getBlock("invent_spec_block_id").getMappedRows();
specGlobalData = dataSource;
},
onFail: function (ei) { // onFail 表示失败回调函数
// 发生异常
console.log(ei);
//释放禁用按钮
btnNode.attr("disabled", false);
onFail: function (ei) {
}
}, {async: false});
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
dataSource: dataSource,
template: "#=textField#"
});
});
}
}],
loadComplete: function (grid) {
//删除
$("#DELETE").on("click", function () {
var btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
var dataItems = resultGrid.getCheckedRows();
if (dataItems == null || dataItems == "") {
NotificationUtil({
......@@ -157,31 +109,62 @@ $(function() {
NotificationUtil({
msg: '删除成功'
});
// 绑定grid
resultGrid.setEiInfo(ei);
}
//释放禁用按钮
btnNode.attr("disabled", false);
},
onFail: function (ei) {// onFail
// 表示失败回调函数
onFail: function (ei) {
// 发生异常
console.log(ei);
//释放禁用按钮
btnNode.attr("disabled", false);
}
});
});
}
},
};
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询
// 存货名称
let eiInfo = new EiInfo();
EiCommunicator.send("HPPZ004", "queryComboBox", eiInfo, {
onSuccess: function (ei) {
inventNameGlobalData = ei.getBlock("invent_name_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
// 规格
EiCommunicator.send("HPPZ006", "queryComboBoxSpec", eiInfo, {
onSuccess: function (ei) {
specGlobalData = ei.getBlock("invent_spec_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPKC005", "save", true);
}
});
}
......@@ -6,76 +6,64 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="库存盘点单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker ename="inqu_status-0-receiptDate" cname="单据日期"
format="yyyy-MM-dd" required="true"/>
<EF:EFSelect ename="inqu_status-0-matType" cname="物料类型" filter="contains" required="false"
template="#=textField#" valueTemplate="#=textField#" defaultValue="">
<EF:EFOption label="请选择" value=""></EF:EFOption>
<EF:EFOption label="1-原材料" value="1"></EF:EFOption>
<EF:EFOption label="2-耗材" value="2"></EF:EFOption>
<EF:EFOption label="3-半成品" value="3"></EF:EFOption>
<EF:EFOption label="4-产成品" value="4"></EF:EFOption>
role="date" format="yyyy-MM-dd" readonly="true"/>
<EF:EFSelect ename="inqu_status-0-inventType" cname="存货类型" filter="contains" defaultValue="">
<EF:EFOption label="请选择" value=""/>
<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 ename="inqu_status-0-whCode" cname="仓库名称" filter="contains" defultValue="">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="whName_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-status" cname="单据状态" filter="contains" required="false"
<%--<EF:EFSelect ename="inqu_status-0-status" cname="单据状态" filter="contains" required="false"
template="#=textField#" valueTemplate="#=textField#" defaultValue="">
<EF:EFOption label="请选择" value=""></EF:EFOption>
<EF:EFOption label="0-待审核" value="0"></EF:EFOption>
<EF:EFOption label="1-已审核" value="1"></EF:EFOption>
</EF:EFSelect>
</EF:EFSelect>--%>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="false" isFloat="true" autoFit="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" width="100" readonly="false" />
<EF:EFColumn ename="statisticalNumber" cname="盘点单号" width="100" readonly="false" />
<EF:EFComboColumn ename="whCode"
cname="仓库编码"
columnTemplate="#=textField#"
itemTemplate="#=textField#"
blockName="wh_record_block_id"
textField="textField"
valueField="valueField"
align="center"
filter="contains"
width="100"
>
</EF:EFComboColumn>
<%-- <EF:EFColumn ename="whName" cname="仓库名称" width="100" readonly="false"/>--%>
<EF:EFComboColumn ename="matType" cname="物料类型" width="100" readonly="false"
textField="textField" valueField="valueField" align="center">
<EF:EFOption label="1-原材料" value="1"></EF:EFOption>
<EF:EFOption label="2-耗材" value="2"></EF:EFOption>
<EF:EFOption label="3-半成品" value="3"></EF:EFOption>
<EF:EFOption label="4-产成品" value="4"></EF:EFOption>
</EF:EFComboColumn>
<EF:EFColumn ename="matCode" cname="物料编码" width="100" readonly="false" align="center"/>
<%-- <EF:EFColumn ename="matName" cname="物料名称" width="100" readonly="false"/>--%>
<EF:EFColumn ename="bookAmount" cname="账面数量" format="{0:N3}" maxLength="20" width="100" readonly="false"/>
<EF:EFColumn ename="bookWeight" cname="账面重量" format="{0:N3}" maxLength="20" width="100" readonly="false"/>
<EF:EFColumn ename="entityAmount" cname="实物数量" format="{0:N3}" maxLength="20" width="100" readonly="false"/>
<EF:EFColumn ename="entityWeight" cname="实物重量" format="{0:N3}" maxLength="20" width="100" readonly="false"/>
<EF:EFColumn ename="diffAmount" cname="差异数量" format="{0:N3}" maxLength="20" width="100" readonly="false"/>
<EF:EFColumn ename="diffWeight" cname="差异重量" format="{0:N3}" maxLength="20" width="100" readonly="false"/>
<EF:EFComboColumn ename="status" cname="单据状态" width="100" readonly="true"
<EF:EFColumn ename="statisticalNumber" cname="盘点单号" enable="false" width="130" algin="center"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" editType="date" dateFormat="yyyy-MM-dd"
parseFormats="['yyyyMMdd']" width="90" align="center"/>
<%--<EF:EFComboColumn ename="status" cname="单据状态" enable="false" width="100" readonly="true"
textField="textField" valueField="valueField" align="center">
<EF:EFOption label="0-待审核" value="0"></EF:EFOption>
<EF:EFOption label="1-已审核" value="1"></EF:EFOption>
</EF:EFComboColumn>--%>
<EF:EFComboColumn ename="whCode" cname="仓库编码" columnTemplate="#=textField#"
itemTemplate="#=textField#" blockName="wh_record_block_id"
textField="textField" valueField="valueField"
align="center" filter="contains" width="100">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="90" align="center">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" />
</EF:EFComboColumn>
<EF:EFColumn ename="notes" cname="备注" width="100" readonly="false"/>
<EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center"/>
<EF:EFColumn ename="spec" cname="规格" width="120" align="center"/>
<EF:EFColumn ename="bookAmount" cname="账面数量" format="{0:N3}" maxLength="20" width="90" align="right"
sumType="all"/>
<EF:EFColumn ename="bookWeight" cname="账面重量" format="{0:N3}" maxLength="20" width="90" align="right"
sumType="all"/>
<EF:EFColumn ename="entityAmount" cname="实物数量" format="{0:N3}" maxLength="20" width="100" align="right"
sumType="all"/>
<EF:EFColumn ename="entityWeight" cname="实物重量" format="{0:N3}" maxLength="20" width="100" align="right"
sumType="all"/>
<EF:EFColumn ename="diffAmount" cname="差异数量" format="{0:N3}" maxLength="20" width="100" align="right"
sumType="all"/>
<EF:EFColumn ename="diffWeight" cname="差异重量" format="{0:N3}" maxLength="20" width="100" align="right"
sumType="all"/>
<EF:EFColumn ename="notes" cname="备注" width="100"/>
<EF:EFColumn ename="createdBy" 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>
......
$(function() {
$("#inqu_status-0-receiptDate").val(__eiInfo.blocks.inqu_status.rows[0]);
// $("#inqu_status-0-receiptDate").val(__eiInfo.blocks.inqu_status.rows[0]);
// 查询
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询
});
$(function () {
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1);
});
IPLATUI.EFGrid.result = {
IPLATUI.EFGrid = {
result:{
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
pageSizes: [10, 20, 30, 50, 100, 200],
},
columns: [
{
field:"money",
valueType:"N",//小计设置
type:"N",
},
{
field:"assessmentAmount",
valueType:"N",//小计设置
type:"N",
columns: [{
field: "datemonth",
attributes: {
'class': 'i-input-readonly',
required: true
}
}]
}
]
}
});
});
......@@ -6,38 +6,35 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="数据统计单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker ename="inqu_status-0-datemonth" cname="单据日期"
format="yyyy-MM" start="year" depth="year" required="true"/>
format="yyyy-MM" start="year" depth="year" readonly="true" required="true"/>
<EF:EFInput ename="inqu_status-0-statisticalNumber" cname="统计单单号" colWidth="4" readonly="false"/>
</div>
<EF:EFButton ename="QUERY" cname="查询" row="1" class="btn-align-right"></EF:EFButton>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="false" isFloat="true" autoFit="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" autoFit="true">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="datemonth" cname="月份" editType="date" dateFormat="yyyy-MM" parseFormats="['yyyyMM']" start="year" depth="year" width="100" readonly="false" />
<EF:EFColumn ename="statisticalNumber" cname="统计单单号" width="100" readonly="false" />
<EF:EFColumn ename="materialCode" cname="物料编码" width="100" readonly="false"/>
<EF:EFColumn ename="materialName" cname="物料名称" width="100" readonly="false"/>
<EF:EFColumn ename="unit" cname="单位" width="100" readonly="false"/>
<EF:EFColumn ename="amount" cname="数量" width="100" readonly="false"/>
<EF:EFColumn ename="price" cname="单价" width="100" readonly="false"/>
<EF:EFColumn ename="totalPrice" cname="金额" width="100" readonly="false"/>
<EF:EFColumn ename="statisticalNumber" cname="统计单单号" enable="false" width="130" align="center"/>
<EF:EFColumn ename="datemonth" cname="月份" editType="date" dateFormat="yyyy-MM" parseFormats="['yyyyMM']"
start="year" depth="year" width="100" align="center"/>
<EF:EFComboColumn ename="materialCode" cname="存货名称" width="120" align="center">
<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="amount" cname="数量" width="100" align="right" format="{0:N3}" sumType="all"/>
<EF:EFColumn ename="price" cname="单价" width="100" align="right" format="{0:C3}"/>
<EF:EFColumn ename="totalPrice" cname="金额" width="100" align="right" format="{0:C3}" sumType="all"/>
<EF:EFColumn ename="notes" cname="备注" width="100" readonly="false"/>
<EF:EFColumn ename="createdTime" cname="创建时间" readonly="true" width="150" align="center" enable="false" parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="createdTime" cname="创建时间" readonly="true" width="150" align="center" enable="false"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="createdBy" cname="创建人" readonly="true" width="150" align="center" enable="false"/>
<EF:EFColumn ename="updatedTime" cname="更新时间" readonly="true" width="150" align="center" enable="false" parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="updatedTime" cname="更新时间" readonly="true" width="150" align="center" enable="false"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="updatedBy" cname="更新人" readonly="true" width="150" align="center" enable="false"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
}
// 查询
$("#QUERY").on("click", query);
// 保存
$("#BTN_SAVE").on("click", save);
// 删除
$("#BTN_DELETE").on("click", deleteFunc);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ009", "save", true);
}
});
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ009", "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>
<div class="row" style="margin: 0 -10px;">
<div class="col-md-4">
<EF:EFRegion title="系统菜单树" id="tree" fitHeight="true">
<EF:EFTree bindId="groupsTree" ename="node" textField="text" valueField="label" hasChildren="leaf"
serviceName="XS0705" methodName="query" style="height:435px;">
</EF:EFTree>
</EF:EFRegion>
</div>
<div class="col-md-8">
<EF:EFRegion title="查询区" id="inqu">
<div class="row" >
<EF:EFInput type="hidden" cname="授权主体ID" ename="subjectId" row="0" blockId="inqu_status"/>
<EF:EFInput type="hidden" ename="objectCname" row ="0" blockId="inqu_status"/>
<EF:EFInput type="hidden" cname="授权类别" ename="operationType" row="0" blockId="inqu_status" value="ACCESS"/>
<EF:EFInput row="0" blockId="inqu_status" ename="objectEname" cname="授权客体名称" type="hidden"/>
<div class="col-xs-4">
<div class="form-group">
<label class="col-md-5 control-label">
授权主体名称
</label>
<div class="col-md-7">
<input name="inqu_status-0-subjectName" data-query="gt" class="k-textbox input-time query-need"
placeholder="请输入授权主体名称" />
</div>
</div>
</div>
<EF:EFSelect blockId="inqu_status" cname="授权主体类别" ename="subjectType" row="0" defaultValue="全部" colWidth="4" ratio="5:7">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="iplat.xs.subjectType" textField="label" valueField="value"/>
</EF:EFSelect>
<div class="col-xs-4">
<div class="form-group">
<label class="col-md-5 control-label">
授权客体名称
</label>
<div class="col-md-7">
<input name="inqu_status-0-objectName" data-query="gt" class="k-textbox input-time query-need"
placeholder="请输入授权客体名称" />
</div>
</div>
</div>
<EF:EFSelect blockId="inqu_status" cname="授权客体类别" colWidth="4" ename="objectType" row="0" defaultValue="全部" ratio="5:7">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="xs.og.objectType" textField="label" valueField="value"/>
</EF:EFSelect>
<div class="col-xs-8" style="text-align: right" id="inqu_inside"></div>
</div>
</EF:EFRegion>
<EF:EFInput ename="objectCname" cname="授权主体名称" type="hidden"/>
<EF:EFRegion title="记录集" id="result" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="false">
<EF:EFColumn ename="subjectId" cname="授权主体ID" hidden="true"/>
<EF:EFColumn ename="subjectName" cname="授权主体名称" readonly="true" locked="true"/>
<EF:EFComboColumn enable="false" cname="授权主体类别" locked="true" ename="subjectType"
defaultValue="USER" style="text-align:center;">
<EF:EFCodeOption codeName="iplat.xs.subjectType" textField="label" valueField="value"/>
</EF:EFComboColumn>
<EF:EFColumn ename="objectId" cname="授权客体ID" hidden="true"/>
<EF:EFColumn ename="objectName" cname="授权客体名称" readonly="true" locked="true"/>
<EF:EFComboColumn enable="false" cname="授权客体类别" locked="true" ename="objectType"
defaultValue="RESOURCE" style="text-align:center;">
<EF:EFCodeOption codeName="xs.og.objectType" textField="label" valueField="value"/>
</EF:EFComboColumn>
<EF:EFComboColumn cname="操作类型" ename="operationType" readonly="true"
defaultValue="ACCESS" style="text-align:center;">
<EF:EFCodeOption codeName="services.xs.operationType" textField="label" valueField="value"/>
</EF:EFComboColumn>
<EF:EFColumn ename="sortIndex" cname="排序" style="text-align:center;"/>
<EF:EFColumn ename="recCreator" cname="创建人" style="text-align:center;" readonly="true"/>
<EF:EFColumn ename="recCreateTime" cname="创建时间" editType="datetime" readonly="true" displayType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']" style="text-align:center;"/>
<EF:EFColumn ename="recRevisor" cname="修改人" style="text-align:center;" readonly="true"/>
<EF:EFColumn ename="recReviseTime" cname="修改时间" readonly="true" editType="datetime" displayType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']" style="text-align:center;"/>
<EF:EFColumn ename="archiveFlag" cname="归档标记" style="text-align:center;"/>
</EF:EFGrid>
</EF:EFRegion>
</div>
</div>
<EF:EFWindow id="authSubject" width="58%" top="100px" left="280px">
<div id="ef_popup_gridA" >
<EF:EFRegion id="inquA" title="查询条件" type="query" efRegionShowClear="true" efRegionSave="true">
<div class="row">
<div class="col-xs-2 control-label">
<span>用户组英文名</span>
</div>
<div class="col-xs-2">
<EF:EFInput ename="inqu_status-0-groupEname" cname="用户组英文名" inline="true"/>
</div>
<div class="col-xs-3 control-label">
<span>用户组中文名</span>
</div>
<div class="col-xs-2">
<EF:EFInput ename="inqu_status-0-groupCname" cname="用户组中文名" inline="true"/>
</div>
<div class="col-xs-2" style="text-align: right" id="inqua_inside"></div>
</div>
</EF:EFRegion>
<EF:EFRegion id="resultA" title="记录集">
<div class="text-right">
<EF:EFButton cname="确定" ename="ef_popup_gridA_commit"></EF:EFButton>
</div>
<EF:EFGrid blockId="resultA" queryMethod="queryForGridSubject" autoDraw="false">
<EF:EFColumn ename="groupId" locked="true" cname="群组ID" hidden="true" primaryKey="true"/>
<EF:EFColumn ename="groupEname" locked="true" cname="群组英文名" readonly="true" width="300"/>
<EF:EFColumn ename="groupCname" cname="群组中文名" readonly="true" width="300"/>
</EF:EFGrid>
</EF:EFRegion>
</div>
</EF:EFWindow>
<EF:EFWindow id="menuPageAuth" url="${ctx}/web/XS0707" width="78%" top="80px" left="120px"></EF:EFWindow>
</EF:EFPage>
let rowId;
$(function() {
var day1 = new Date();
day1.setTime(day1.getTime());
day1.setDate(day1.getDate()-1);
var month = day1.getMonth() + 1;
var year = day1.getFullYear();
var day = day1.getDate();
let inqu = $("#inqu")
,result = $("#result")
,from = $("#from")
,receiptDate = $("#inqu_status-0-receiptDate");
receiptDate.val(year+"-"+month+"-"+day)
$("#inqu_status-0-receiptDate").val(year+"-"+month+"-"+day);
// var day1 = new Date();
// day1.setTime(day1.getTime());
// day1.setDate(day1.getDate()-1);
// var month = day1.getMonth() + 1;
// var year = day1.getFullYear();
// var day = day1.getDate();
// let inqu = $("#inqu")
// ,result = $("#result")
// ,from = $("#from")
// ,receiptDate = $("#inqu_status-0-receiptDate");
// receiptDate.val(year+"-"+month+"-"+day)
//
// $("#inqu_status-0-receiptDate").val(year+"-"+month+"-"+day);
// 查询
$("#QUERY").on("click", function () {
......@@ -27,87 +26,100 @@ $(function() {
input: true,
numeric: false,
pageSize: 20,
pageSizes: [10,20,30,50,100,200]
},
columns:[
{
field: "receiptDate",
title: "单据日期",
},
{
field: "chkBillno",
title: "检查单号",
},
{
field: "itemName",
title: "项目名称",
},
{
field: "unit",
title: "生产组",
},
{
field: "notes",
title: "质量问题描述",
},
{
field: "princ",
title: "检查人",
},
{
field: "status",
title: "状态",
pageSizes: [10, 20, 30, 50, 100, 200]
},
{
columns: [{
field: "affix",
title: "附件",
},
{
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){
template: function (item) {
let chkBillno = item.chkBillno;
let auditStatus = item.status;
if(auditStatus == 0) {
if (auditStatus == 0) {
return '<a style="cursor: pointer;display: flex;justify-content: center;" ' +
'onclick="audit('+item.id+',1)" >审核</a>';
}else{
'onclick="audit(' + item.id + ',\'' + chkBillno + '\',1)" >审核</a>';
} else {
return '<a style="cursor: pointer;display: flex;justify-content: center;" ' +
'onclick="audit('+item.id+',0)" >反审</a>';
'onclick="audit(' + item.id + ',\'' + chkBillno + '\',0)" >反审</a>';
}
}
}]
}
],
};
// 关闭事件
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-id", rowId);
inEiInfo.set("result-0-affix", uploadFile);
EiCommunicator.send('HPZL001', 'bindDocIdById', inEiInfo, {
onSuccess(response) {
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
},
}
};
});
function audit(id,auditStatus){
/**
* 文件上传
*
* @param id
*/
function openUploadFile(id) {
uploadFileWindow.open().center();
rowId = id;
}
/**
* 审核操作
*
* @param id
* @param chkBillno
* @param auditStatus
*/
function audit(id, chkBillno, auditStatus) {
let message = "确认对单号[" + chkBillno + "]进行" + (auditStatus == 1 ? "审核" : "反审") + "操作吗? ";
JSUtils.confirm(message, {
ok: function () {
const inEiInfo = new EiInfo();
inEiInfo.set("result-0-id",id);
inEiInfo.set("result-0-status",auditStatus );
EiCommunicator.send('HPZL001','operator', inEiInfo, {
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-status", auditStatus);
EiCommunicator.send('HPZL001', 'operator', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
if(response.status >= 0){
resultGrid.dataSource.page(1);
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
}, {
async: false
});
}
);
});
}
......@@ -6,19 +6,14 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="质量巡检单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker ename="inqu_status-0-receiptDate" cname="单据日期" colWidth="3"
format="yyyy-MM-dd" required="true"/>
format="yyyy-MM-dd" readonly="true"/>
<EF:EFSelect ename="inqu_status-0-itemCode" cname="项目名称" colWidth="3"
valueTemplate="#=textField#"
template="#=textField#"
textField="textField"
valueField="valueField"
required="true"
locked="true"
filter="contains">
valueTemplate="#=textField#" template="#=textField#"
textField="textField" valueField="valueField"
required="true" locked="true" filter="contains">
<EF:EFOption label="--请选择--" value=""/>
<EF:EFOptions blockId="proj_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
......@@ -29,49 +24,45 @@
<EF:EFOption label="待审核" value="0"></EF:EFOption>
</EF:EFSelect>
</div>
<EF:EFButton ename="QUERY" cname="查询" row="1" class="btn-align-right"></EF:EFButton>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="false" isFloat="true" autoFit="true">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" width="100" readonly="false" />
<EF:EFColumn ename="chkBillno" cname="检查单号" width="100" readonly="false" />
<EF:EFComboColumn ename="itemName" cname="项目名称"
columnTemplate="#=textField#"
itemTemplate="#=textField#"
blockName="proj_record_block_id"
textField="textField"
valueField="textField"
maxLength="20"
readonly="false"
style="color:blue;"
required="true"
filter="contains"
width="220">
<EF:EFColumn ename="chkBillno" cname="检查单号" enable="false" width="130" align="center"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" editType="date" dateFormat="yyyy-MM-dd"
parseFormats="['yyyyMMdd']" width="120" readonly="false"/>
<EF:EFComboColumn ename="itemCode" cname="项目名称" columnTemplate="#=textField#"
itemTemplate="#=textField#" blockName="proj_record_block_id"
textField="textField" valueField="valueField" maxLength="20"
readonly="false" style="color:blue;" required="true" filter="contains" width="220">
</EF:EFComboColumn>
<EF:EFColumn ename="unit" cname="生产组" width="100" readonly="false"/>
<EF:EFColumn ename="notes" cname="质量问题描述" width="100" readonly="false"/>
<EF:EFColumn ename="princ" cname="检查人" width="100" readonly="true"/>
<EF:EFComboColumn ename="status" cname="状态" align="center" columnTemplate="#=valueField#-#=textField#" optionLabel=" "
<EF:EFComboColumn ename="status" cname="状态" enable="false" align="center"
columnTemplate="#=valueField#-#=textField#"
itemTemplate="#=valueField#-#=textField#" textField="textField"
valueField="valueField" width="100" required="true">
valueField="valueField" width="100" required="true" optionLabel=" ">
<EF:EFOption label="--请选择--" value=""></EF:EFOption>
<EF:EFOption label="审核" value="1"></EF:EFOption>
<EF:EFOption label="未审核" value="0"></EF:EFOption>
</EF:EFComboColumn>
<EF:EFColumn ename="affix" cname="附件" width="100" readonly="false"/>
<EF:EFColumn ename="operator" cname="操作" width="100" readonly="false"/>
<EF:EFColumn ename="affix" cname="附件" enable="false" width="100" align="center"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="100" readonly="false"/>
<EF:EFColumn ename="createdTime" cname="创建时间" readonly="true" width="150" align="center" enable="false"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss" hidden ="true" />
<EF:EFColumn ename="createdBy" cname="创建人" readonly="true" width="150" align="center" enable="false" hidden ="true"/>
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"
hidden="true"/>
<EF:EFColumn ename="createdBy" cname="创建人" readonly="true" width="150" align="center" enable="false"
hidden="true"/>
<EF:EFColumn ename="updatedTime" cname="更新时间" readonly="true" width="150" align="center" enable="false"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss" hidden ="true"/>
<EF:EFColumn ename="updatedBy" cname="更新人" readonly="true" width="150" align="center" enable="false" hidden ="true"/>
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"
hidden="true"/>
<EF:EFColumn ename="updatedBy" cname="更新人" readonly="true" width="150" align="center" enable="false"
hidden="true"/>
</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