Commit 951b5ba2 by wancheng

采购订单更新

parent 639aed0e
......@@ -74,6 +74,14 @@ public class HPCG003A extends DaoEPBase {
public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 厂区名称*/
public static final String COL_PARENT_ID = "PARENT_ID"; /* 父级ID*/
public static final String FIELD_SPEC = "spec"; /* 规格*/
public static final String FIELD_LENGTH = "length"; /* 长*/
public static final String FIELD_WIDTH = "width"; /* 宽*/
public static final String FIELD_THICK = "thick"; /* 厚*/
public static final String FIELD_MATERIAL = "material"; /* 材质*/
public static final String FIELD_COEFFICIENT = "coefficient"; /* 系数*/
public static final String FIELD_UNIT = "unit"; /* 单位*/
public static final String QUERY = "HPCG003A.query";
public static final String COUNT = "HPCG003A.count";
public static final String INSERT = "HPCG003A.insert";
......@@ -106,6 +114,14 @@ public class HPCG003A extends DaoEPBase {
private String factoryName = " "; /* 厂区名称*/
private Long parentId = new Long(0); /* 父级ID*/
private String spec = " "; /* 规格*/
private BigDecimal length = new BigDecimal(0.000); /* 长*/
private BigDecimal width = new BigDecimal(0.000); /* 宽*/
private BigDecimal thick = new BigDecimal(0.000); /* 厚*/
private String material = " "; /* 材质*/
private BigDecimal coefficient = new BigDecimal(0.000); /* 系数*/
private String unit = " "; /* 单位*/
/**
* initialize the metadata.
*/
......@@ -228,6 +244,45 @@ public class HPCG003A extends DaoEPBase {
eiColumn.setDescName("父级ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SPEC);
eiColumn.setDescName("规格");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_LENGTH);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(10);
eiColumn.setDescName("长");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WIDTH);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(10);
eiColumn.setDescName("宽");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_THICK);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(10);
eiColumn.setDescName("厚");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MATERIAL);
eiColumn.setDescName("材质");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COEFFICIENT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(10);
eiColumn.setDescName("系数");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UNIT);
eiColumn.setDescName("单位");
eiMetadata.addMeta(eiColumn);
}
......@@ -638,6 +693,120 @@ public class HPCG003A extends DaoEPBase {
public void setParentId(Long parentId) {
this.parentId = parentId;
}
/**
* get the spec - 规格.
* @return the spec
*/
public String getSpec() {
return this.spec;
}
/**
* set the spec - 规格.
*
* @param spec - 规格
*/
public void setSpec(String spec) {
this.spec = spec;
}
/**
* get the length - 长.
* @return the length
*/
public BigDecimal getLength() {
return this.length;
}
/**
* set the length - 长.
*
* @param length - 长
*/
public void setLength(BigDecimal length) {
this.length = length;
}
/**
* get the width - 宽.
* @return the width
*/
public BigDecimal getWidth() {
return this.width;
}
/**
* set the width - 宽.
*
* @param width - 宽
*/
public void setWidth(BigDecimal width) {
this.width = width;
}
/**
* get the thick - 厚.
* @return the thick
*/
public BigDecimal getThick() {
return this.thick;
}
/**
* set the thick - 厚.
*
* @param thick - 厚
*/
public void setThick(BigDecimal thick) {
this.thick = thick;
}
/**
* get the material - 材质.
* @return the material
*/
public String getMaterial() {
return this.material;
}
/**
* set the material - 材质.
*
* @param material - 材质
*/
public void setMaterial(String material) {
this.material = material;
}
/**
* get the coefficient - 系数.
* @return the coefficient
*/
public BigDecimal getCoefficient() {
return this.coefficient;
}
/**
* set the coefficient - 系数.
*
* @param coefficient - 系数
*/
public void setCoefficient(BigDecimal coefficient) {
this.coefficient = coefficient;
}
/**
* get the unit - 单位.
* @return the unit
*/
public String getUnit() {
return this.unit;
}
/**
* set the unit - 单位.
*
* @param unit - 单位
*/
public void setUnit(String unit) {
this.unit = unit;
}
/**
* get the value from Map.
*
......@@ -671,6 +840,14 @@ public class HPCG003A extends DaoEPBase {
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
setFactoryName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_NAME)), factoryName));
setParentId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PARENT_ID)), parentId));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SPEC)), spec));
setLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_LENGTH)), length));
setWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WIDTH)), width));
setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_THICK)), thick));
setMaterial(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MATERIAL)), material));
setCoefficient(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_COEFFICIENT)), coefficient));
setUnit(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UNIT)), unit));
}
/**
......@@ -706,6 +883,14 @@ public class HPCG003A extends DaoEPBase {
map.put(FIELD_FACTORY_NAME, StringUtils.toString(factoryName, eiMetadata.getMeta(FIELD_FACTORY_NAME)));
map.put(FIELD_PARENT_ID, StringUtils.toString(parentId, eiMetadata.getMeta(FIELD_PARENT_ID)));
map.put(FIELD_SPEC, StringUtils.toString(spec, eiMetadata.getMeta(FIELD_SPEC)));
map.put(FIELD_LENGTH, StringUtils.toString(length, eiMetadata.getMeta(FIELD_LENGTH)));
map.put(FIELD_WIDTH, StringUtils.toString(width, eiMetadata.getMeta(FIELD_WIDTH)));
map.put(FIELD_THICK, StringUtils.toString(thick, eiMetadata.getMeta(FIELD_THICK)));
map.put(FIELD_MATERIAL, StringUtils.toString(material, eiMetadata.getMeta(FIELD_MATERIAL)));
map.put(FIELD_COEFFICIENT, StringUtils.toString(coefficient, eiMetadata.getMeta(FIELD_COEFFICIENT)));
map.put(FIELD_UNIT, StringUtils.toString(unit, eiMetadata.getMeta(FIELD_UNIT)));
return map;
}
}
......@@ -126,7 +126,7 @@ public class ServiceHPCG002A extends ServiceBase {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpcg002A.fromMap(map);
this.dao.delete(HPXS006.DELETE, hpcg002A.toMap());
this.dao.delete(HPCG002A.DELETE, hpcg002A.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
......@@ -194,7 +194,7 @@ public class ServiceHPCG002A extends ServiceBase {
hpcg003.setInventType(inventType);
hpcg003.setProPlanNo(hpcg002s.get(0).getProPlanNo());
//生成采购订单单号
hpcg003.setProPlanNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.PRO_ORDER_NO));
hpcg003.setProOrderNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.PRO_ORDER_NO));
//添加采购订单
DaoUtils.insert(HPCG003.INSERT,hpcg003);
List<HPCG003> hpcg003s = this.dao.query(HPCG003.QUERY,new HashMap<String,Object>(){{
......
package com.baosight.hpjx.hp.cg.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.hp.cg.domain.HPCG002;
import com.baosight.hpjx.hp.cg.domain.HPCG003;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.contants.ACConstants;
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.Arrays;
/**
*
*/
public class ServiceHPCG003 extends ServiceBase {
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "采购计划",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPCG003.QUERY, new HPCG003());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUPPLIER_RECORD_BLOCK_ID), null, false);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@Override
@OperationLogAnnotation(operModul = "采购计划",operType = "查询")
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "createdDateFrom",
DateUtils.formatShort(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "createdDateFrom")));
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "createdDateTo",
DateUtils.formatShort(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "createdDateTo")));
EiInfo outInfo = super.query(inInfo, HPCG003.QUERY, new HPCG003());
return outInfo;
}
}
package com.baosight.hpjx.hp.cg.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.cg.domain.HPCG002;
import com.baosight.hpjx.hp.cg.domain.HPCG002A;
import com.baosight.hpjx.hp.cg.domain.HPCG003;
import com.baosight.hpjx.hp.cg.domain.HPCG003A;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.xs.domain.HPXS006;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants;
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 java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
/**
*
*/
public class ServiceHPCG003A extends ServiceBase {
// 指定存货类型
private static final Integer[] DEFAULT_INVENT_CODE = {InventTypeEnum.RAW.getCode(),
InventTypeEnum.CONSUMABLE.getCode()};
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "采购计划详情",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPCG003A.QUERY, new HPCG003A());
Map queryMap = new HashMap();
queryMap.put("inventTypes", DEFAULT_INVENT_CODE);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_ALL_BLOCK_ID), queryMap, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPCG003A().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@Override
@OperationLogAnnotation(operModul = "采购计划详情",operType = "查询")
public EiInfo query(EiInfo inInfo) {
EiInfo outInfo = super.query(inInfo, HPCG003A.QUERY, new HPCG003A());
return outInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "采购计划详情",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HPCG003A hpcg003A = new HPCG003A();
hpcg003A.fromMap(resultRows.get(i));
// 根据规格计算单重
BigDecimal UnitWeight = HPPZTools.HpPz006.calcUnitWeight(hpcg003A.getInventRecordId());
// 计算总重
hpcg003A.setProWeight(hpcg003A.getProAmount().multiply(UnitWeight).divide(new BigDecimal("1000")));
if (hpcg003A.getId() == null || hpcg003A.getId() == 0) {
this.add(hpcg003A);
} else {
this.modify(hpcg003A);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param hpcg003A
* @throws Exception
*/
private void add(HPCG003A hpcg003A) throws Exception {
DaoUtils.insert(HPCG003A.INSERT, hpcg003A);
}
/**
* 修改数据
*
* @param hpcg003A
*/
private void modify(HPCG003A hpcg003A) {
DaoUtils.update(HPCG003A.UPDATE, hpcg003A);
}
/**
* 删除操作.
*/
@OperationLogAnnotation(operModul = "采购计划详情",operType = "删除")
public EiInfo delete(EiInfo eiInfo) {
HPCG003A hpcg003A = new HPCG003A();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpcg003A.fromMap(map);
this.dao.delete(HPCG003A.DELETE, hpcg003A.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("删除失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("删除失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
return query(eiInfo);
}
}
......@@ -163,7 +163,7 @@
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPCG002A WHERE 1=1
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPCG002A A WHERE 1=1
<include refid="condition" />
<include refid="authCondition" />
</select>
......
......@@ -22,6 +22,15 @@
-->
<sqlMap namespace="HPCG003">
<sql id="authCondition">
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCodes">
DEP_CODE IN <iterate close=")" open="(" conjunction="," property="depCodes">#depCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
......@@ -68,6 +77,12 @@
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateFrom">
PRO_ORDER_DATE &gt;= #createdDateFrom#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateTo">
PRO_ORDER_DATE &lt;= #createdDateTo#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......@@ -90,6 +105,7 @@
INVENT_TYPE as "inventType" <!-- 存货类型 -->
FROM ${hpjxSchema}.T_HPCG003 WHERE 1=1
<include refid="condition" />
<include refid="authCondition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
......@@ -104,6 +120,7 @@
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPCG003 WHERE 1=1
<include refid="condition" />
<include refid="authCondition" />
</select>
<!--
......
......@@ -31,115 +31,132 @@
PARENT_ID BIGINT
-->
<sqlMap namespace="HPCG003A">
<sql id="authCondition">
<isNotEmpty prepend=" AND " property="depCode">
A.DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCodes">
A.DEP_CODE IN <iterate close=")" open="(" conjunction="," property="depCodes">#depCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
A.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
A.DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
A.CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
A.CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
A.CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
A.UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
A.UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
A.UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
A.DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
A.WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
A.WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
A.INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
A.INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
A.INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventRecordId">
INVENT_RECORD_ID = #inventRecordId#
A.INVENT_RECORD_ID = #inventRecordId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planAmount">
PLAN_AMOUNT = #planAmount#
A.PLAN_AMOUNT = #planAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planWeight">
PLAN_WEIGHT = #planWeight#
A.PLAN_WEIGHT = #planWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="proAmount">
PRO_AMOUNT = #proAmount#
A.PRO_AMOUNT = #proAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="proWeight">
PRO_WEIGHT = #proWeight#
A.PRO_WEIGHT = #proWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="proMoney">
PRO_MONEY = #proMoney#
A.PRO_MONEY = #proMoney#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remark">
REMARK = #remark#
A.REMARK = #remark#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
A.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
A.FACTORY_NAME = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
A.PARENT_ID = #parentId#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.cg.domain.HPCG003A">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID -->
PLAN_AMOUNT as "planAmount", <!-- 计划数量 -->
PLAN_WEIGHT as "planWeight", <!-- 计划重量 -->
PRO_AMOUNT as "proAmount", <!-- 采购数量 -->
PRO_WEIGHT as "proWeight", <!-- 采购重量 -->
PRO_MONEY as "proMoney", <!-- 采购金额 -->
REMARK as "remark", <!-- 备注 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
PARENT_ID as "parentId" <!-- 父级ID -->
FROM ${hpjxSchema}.T_HPCG003A WHERE 1=1
A.ID as "id", <!-- ID -->
A.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
A.DEP_CODE as "depCode", <!-- 部门编码 -->
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", <!-- 修改时间 -->
A.DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
A.WH_CODE as "whCode", <!-- 仓库编码 -->
A.WH_NAME as "whName", <!-- 仓库名称 -->
A.INVENT_TYPE as "inventType", <!-- 存货类型 -->
A.INVENT_CODE as "inventCode", <!-- 存货编码 -->
A.INVENT_NAME as "inventName", <!-- 存货名称 -->
A.INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID -->
B.SPEC as "spec", <!-- 规格 -->
B.LENGTH as "length", <!-- 长 -->
B.WIDTH as "width", <!-- 宽 -->
B.THICK as "thick", <!-- 厚 -->
B.MATERIAL as "material", <!-- 材质 -->
B.COEFFICIENT as "coefficient", <!-- 系数 -->
B.UNIT as "unit", <!-- 单位 -->
A.PLAN_AMOUNT as "planAmount", <!-- 计划数量 -->
A.PLAN_WEIGHT as "planWeight", <!-- 计划重量 -->
A.PRO_AMOUNT as "proAmount", <!-- 采购数量 -->
A.PRO_WEIGHT as "proWeight", <!-- 采购重量 -->
A.PRO_MONEY as "proMoney", <!-- 采购金额 -->
A.REMARK as "remark", <!-- 备注 -->
A.FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
A.FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
A.PARENT_ID as "parentId" <!-- 父级ID -->
FROM ${hpjxSchema}.T_HPCG003A A
LEFT JOIN ${hpjxSchema}.T_HPPZ006 B ON B.ID = A.INVENT_RECORD_ID
WHERE 1=1
<include refid="condition" />
<include refid="authCondition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
......@@ -154,6 +171,7 @@
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPCG003A WHERE 1=1
<include refid="condition" />
<include refid="authCondition" />
</select>
<!--
......
$(function () {
$("#QUERY").on("click", query);
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [
{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="jump(' + item.id + ')" >订单详情</a>';
return template;
}
}
],
}
});
let query = function () { resultGrid.dataSource.page(1);}
function jump(id) {
var herf = ctx + "\\web\\" + "HPCG003A?inqu_status-0-parentId=" + id + "&efParentFormEname=HPCG003";
window.open(herf);
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/3/25
Time: 16:17
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ 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}"/>
<script>
var ctx = "${ctx}";
</script>
<EF:EFPage title="采购订单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<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>
<EF:EFSelect cname="供应商名称" ename="inqu_status-0-custCode" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="supplier_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货类型" ename="inqu_status-0-inventType" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2')"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" primaryKey="true" cname="主键" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="公司编码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="custCode" cname="供应商名称" width="120" align="center" required="true"
blockName="supplier_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="proOrderDate" cname="采购订单日期" width="100" align="center" editType="date" readonly="true"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" />
<EF:EFColumn ename="proPlanNo" cname="采购计划单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="proOrderNo" cname="采购订单单号" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="80" align="center" readonly="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2')"/>
</EF:EFComboColumn>
<%-- <EF:EFColumn cname="创建人" ename="createdName" align="center" width="150" readonly="true" required="false" enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="150" readonly="true" required="false"
enable="false"/>
<EF:EFColumn cname="修改人" ename="updatedName" align="center" width="150" readonly="true" required="false" enable="false"/>
<EF:EFColumn cname="修改时间" ename="updatedTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="150" readonly="true" required="false"
enable="false"/>--%>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
let whNameGlobalData = [];
let inventNameGlobalData = [];
let inventAllGlobalData = [];
$(function () {
$("#QUERY").on("click", query);
IPLATUI.EFGrid = {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 30, 50, 100, 200],
},
columns: [],
loadComplete: function (grid) {
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
//let btnNode = $(this);
//禁用按钮
//btnNode.attr("disabled", true);
//saveResult(btnNode);
save();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save') {
query();
}
},
onRowClick: function (e) {
},
}
}
downKeyUp();
});
let query = function () { resultGrid.dataSource.page(1);}
/**
* 删除
*/
/*function deleteFunc() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HPSC002A", "delete", true);
}
})
}*/
function save() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
for (let i = 0; i < rows.length; i++) {
if (!isPositiveInteger(rows[i]['proAmount'])) {
message("勾选的第" + (i + 1) + "行\"采购数量\"必须是大于0的整数");
return;
}
if(!isPositiveNumber(rows[i]['proMoney'])){
message("选中的第"+(i+1)+"行\"采购金额\"必须是大于0的数");
return ;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HPCG003A", "save", true);
}
})
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/3/25
Time: 16:17
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ 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="查询条件">
<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:EFInput cname="父ID" ename="inqu_status-0-parentId" colWidth="3" type="hidden"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" primaryKey="true" cname="主键" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="公司编码" hidden="true"/>
<EF:EFColumn ename="inventCode" cname="存货编码" width="120" align="center" readonly="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="150" align="center" readonly="true"/>
<EF:EFColumn ename="inventRecordId" cname="规格ID" width="120" align="center" readonly="true" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" width="120" align="center" readonly="true"/>
<EF:EFColumn ename="length" cname="长(MM)" width="80" align="right" format="{0:N3}" readonly="true"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="80" align="right" format="{0:N3}" readonly="true"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="80" align="right" format="{0:N3}" readonly="true"/>
<EF:EFColumn ename="coefficient" cname="系数" width="80" align="right" format="{0:N3}" readonly="true"/>
<EF:EFColumn ename="material" cname="材质" width="80" align="center" readonly="true"/>
<EF:EFColumn ename="unit" cname="单位" width="80" align="center" readonly="true"/>
<EF:EFColumn ename="planAmount" cname="计划数量" format="{0:N0}" maxLength="20" width="100" align="right"
enable="false"/>
<EF:EFColumn ename="planWeight" cname="计划重量(T)" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="proAmount" cname="采购数量" format="{0:N0}" maxLength="20" width="100" align="right"
required="true"/>
<EF:EFColumn ename="proWeight" cname="采购重量(T)" width="120" align="right" format="{0:N3}"
enable="false"/>
<EF:EFColumn ename="proMoney" cname="采购金额" width="120" align="right" format="{0:N3}"
required="true"/>
<%-- <EF:EFColumn cname="创建人" ename="createdName" align="center" width="150" readonly="true" required="false" enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="150" readonly="true" required="false"
enable="false"/>
<EF:EFColumn cname="修改人" ename="updatedName" align="center" width="150" readonly="true" required="false" enable="false"/>
<EF:EFColumn cname="修改时间" ename="updatedTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="150" readonly="true" required="false"
enable="false"/>--%>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment