Commit a92aa82a by liuyang

Merge branch 'dev' of http://git.pseer.com/platform/hp-smart into dev-ly

parents 26dc84e3 9570f81b
...@@ -74,6 +74,14 @@ public class HPCG003A extends DaoEPBase { ...@@ -74,6 +74,14 @@ public class HPCG003A extends DaoEPBase {
public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 厂区名称*/ public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 厂区名称*/
public static final String COL_PARENT_ID = "PARENT_ID"; /* 父级ID*/ 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 QUERY = "HPCG003A.query";
public static final String COUNT = "HPCG003A.count"; public static final String COUNT = "HPCG003A.count";
public static final String INSERT = "HPCG003A.insert"; public static final String INSERT = "HPCG003A.insert";
...@@ -106,6 +114,14 @@ public class HPCG003A extends DaoEPBase { ...@@ -106,6 +114,14 @@ public class HPCG003A extends DaoEPBase {
private String factoryName = " "; /* 厂区名称*/ private String factoryName = " "; /* 厂区名称*/
private Long parentId = new Long(0); /* 父级ID*/ 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. * initialize the metadata.
*/ */
...@@ -228,6 +244,45 @@ public class HPCG003A extends DaoEPBase { ...@@ -228,6 +244,45 @@ public class HPCG003A extends DaoEPBase {
eiColumn.setDescName("父级ID"); eiColumn.setDescName("父级ID");
eiMetadata.addMeta(eiColumn); 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 { ...@@ -638,6 +693,120 @@ public class HPCG003A extends DaoEPBase {
public void setParentId(Long parentId) { public void setParentId(Long parentId) {
this.parentId = 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. * get the value from Map.
* *
...@@ -671,6 +840,14 @@ public class HPCG003A extends DaoEPBase { ...@@ -671,6 +840,14 @@ public class HPCG003A extends DaoEPBase {
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode)); setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
setFactoryName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_NAME)), factoryName)); setFactoryName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_NAME)), factoryName));
setParentId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PARENT_ID)), parentId)); 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 { ...@@ -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_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_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; return map;
} }
} }
...@@ -126,7 +126,7 @@ public class ServiceHPCG002A extends ServiceBase { ...@@ -126,7 +126,7 @@ public class ServiceHPCG002A extends ServiceBase {
for (int i = 0; i < eiBlock.getRowCount(); i++) { for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
hpcg002A.fromMap(map); hpcg002A.fromMap(map);
this.dao.delete(HPXS006.DELETE, hpcg002A.toMap()); this.dao.delete(HPCG002A.DELETE, hpcg002A.toMap());
} }
} catch (PlatException e) { } catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE); eiInfo.setStatus(EiConstant.STATUS_FAILURE);
...@@ -194,7 +194,7 @@ public class ServiceHPCG002A extends ServiceBase { ...@@ -194,7 +194,7 @@ public class ServiceHPCG002A extends ServiceBase {
hpcg003.setInventType(inventType); hpcg003.setInventType(inventType);
hpcg003.setProPlanNo(hpcg002s.get(0).getProPlanNo()); 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); DaoUtils.insert(HPCG003.INSERT,hpcg003);
List<HPCG003> hpcg003s = this.dao.query(HPCG003.QUERY,new HashMap<String,Object>(){{ 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);
}
}
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
CREATED_TIME desc PRO_PLAN_DATE,CREATED_TIME desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
......
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
</select> </select>
<select id="count" resultClass="int"> <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="condition" />
<include refid="authCondition" /> <include refid="authCondition" />
</select> </select>
...@@ -335,6 +335,7 @@ ...@@ -335,6 +335,7 @@
<update id="check"> <update id="check">
UPDATE ${hpjxSchema}.T_HPCG002A UPDATE ${hpjxSchema}.T_HPCG002A
SET SET
CUST_CODE = #custCode#, <!-- 供应商编码 -->
PRO_APPLY_STATUS = #proApplyStatus# <!-- 提交状态 0-未提交 1-已提交 --> PRO_APPLY_STATUS = #proApplyStatus# <!-- 提交状态 0-未提交 1-已提交 -->
WHERE WHERE
ID = #id# ID = #id#
......
...@@ -22,6 +22,15 @@ ...@@ -22,6 +22,15 @@
--> -->
<sqlMap namespace="HPCG003"> <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"> <sql id="condition">
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
...@@ -68,6 +77,12 @@ ...@@ -68,6 +77,12 @@
<isNotEmpty prepend=" AND " property="inventType"> <isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType# INVENT_TYPE = #inventType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateFrom">
PRO_ORDER_DATE &gt;= #createdDateFrom#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateTo">
PRO_ORDER_DATE &lt;= #createdDateTo#
</isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
...@@ -90,12 +105,13 @@ ...@@ -90,12 +105,13 @@
INVENT_TYPE as "inventType" <!-- 存货类型 --> INVENT_TYPE as "inventType" <!-- 存货类型 -->
FROM ${hpjxSchema}.T_HPCG003 WHERE 1=1 FROM ${hpjxSchema}.T_HPCG003 WHERE 1=1
<include refid="condition" /> <include refid="condition" />
<include refid="authCondition" />
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy"> <isNotEmpty property="orderBy">
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
ID asc PRO_ORDER_DATE,CREATED_TIME desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
...@@ -104,6 +120,7 @@ ...@@ -104,6 +120,7 @@
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPCG003 WHERE 1=1 SELECT COUNT(*) FROM ${hpjxSchema}.T_HPCG003 WHERE 1=1
<include refid="condition" /> <include refid="condition" />
<include refid="authCondition" />
</select> </select>
<!-- <!--
......
...@@ -31,115 +31,132 @@ ...@@ -31,115 +31,132 @@
PARENT_ID BIGINT PARENT_ID BIGINT
--> -->
<sqlMap namespace="HPCG003A"> <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"> <sql id="condition">
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# A.ID = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode# A.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode"> <isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode# A.DEP_CODE = #depCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy"> <isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy# A.CREATED_BY = #createdBy#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName"> <isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName# A.CREATED_NAME = #createdName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime"> <isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime# A.CREATED_TIME = #createdTime#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy"> <isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy# A.UPDATED_BY = #updatedBy#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName"> <isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName# A.UPDATED_NAME = #updatedName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime"> <isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime# A.UPDATED_TIME = #updatedTime#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag"> <isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag# A.DELETE_FLAG = #deleteFlag#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode"> <isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode# A.WH_CODE = #whCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="whName"> <isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName# A.WH_NAME = #whName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType"> <isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType# A.INVENT_TYPE = #inventType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode"> <isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode# A.INVENT_CODE = #inventCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName"> <isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName# A.INVENT_NAME = #inventName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventRecordId"> <isNotEmpty prepend=" AND " property="inventRecordId">
INVENT_RECORD_ID = #inventRecordId# A.INVENT_RECORD_ID = #inventRecordId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="planAmount"> <isNotEmpty prepend=" AND " property="planAmount">
PLAN_AMOUNT = #planAmount# A.PLAN_AMOUNT = #planAmount#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="planWeight"> <isNotEmpty prepend=" AND " property="planWeight">
PLAN_WEIGHT = #planWeight# A.PLAN_WEIGHT = #planWeight#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="proAmount"> <isNotEmpty prepend=" AND " property="proAmount">
PRO_AMOUNT = #proAmount# A.PRO_AMOUNT = #proAmount#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="proWeight"> <isNotEmpty prepend=" AND " property="proWeight">
PRO_WEIGHT = #proWeight# A.PRO_WEIGHT = #proWeight#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="proMoney"> <isNotEmpty prepend=" AND " property="proMoney">
PRO_MONEY = #proMoney# A.PRO_MONEY = #proMoney#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="remark"> <isNotEmpty prepend=" AND " property="remark">
REMARK = #remark# A.REMARK = #remark#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode"> <isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode# A.FACTORY_CODE = #factoryCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName"> <isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName# A.FACTORY_NAME = #factoryName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId"> <isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId# A.PARENT_ID = #parentId#
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.cg.domain.HPCG003A"> resultClass="com.baosight.hpjx.hp.cg.domain.HPCG003A">
SELECT SELECT
ID as "id", <!-- ID --> A.ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 公司编码 --> A.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
DEP_CODE as "depCode", <!-- 部门编码 --> A.DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 --> A.CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 --> A.CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 --> A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 --> A.UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改人名称 --> A.UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 --> A.UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 --> A.DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
WH_CODE as "whCode", <!-- 仓库编码 --> A.WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 --> A.WH_NAME as "whName", <!-- 仓库名称 -->
INVENT_TYPE as "inventType", <!-- 存货类型 --> A.INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 --> A.INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 --> A.INVENT_NAME as "inventName", <!-- 存货名称 -->
INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID --> A.INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID -->
PLAN_AMOUNT as "planAmount", <!-- 计划数量 --> B.SPEC as "spec", <!-- 规格 -->
PLAN_WEIGHT as "planWeight", <!-- 计划重量 --> B.LENGTH as "length", <!-- 长 -->
PRO_AMOUNT as "proAmount", <!-- 采购数量 --> B.WIDTH as "width", <!-- 宽 -->
PRO_WEIGHT as "proWeight", <!-- 采购重量 --> B.THICK as "thick", <!-- 厚 -->
PRO_MONEY as "proMoney", <!-- 采购金额 --> B.MATERIAL as "material", <!-- 材质 -->
REMARK as "remark", <!-- 备注 --> B.COEFFICIENT as "coefficient", <!-- 系数 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 --> B.UNIT as "unit", <!-- 单位 -->
FACTORY_NAME as "factoryName", <!-- 厂区名称 --> A.PLAN_AMOUNT as "planAmount", <!-- 计划数量 -->
PARENT_ID as "parentId" <!-- 父级ID --> A.PLAN_WEIGHT as "planWeight", <!-- 计划重量 -->
FROM ${hpjxSchema}.T_HPCG003A WHERE 1=1 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="condition" />
<include refid="authCondition" />
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy"> <isNotEmpty property="orderBy">
$orderBy$ $orderBy$
...@@ -154,6 +171,7 @@ ...@@ -154,6 +171,7 @@
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPCG003A WHERE 1=1 SELECT COUNT(*) FROM ${hpjxSchema}.T_HPCG003A WHERE 1=1
<include refid="condition" /> <include refid="condition" />
<include refid="authCondition" />
</select> </select>
<!-- <!--
......
...@@ -82,6 +82,7 @@ function check(id, auditStatus,custCode,parentid,proPlanStatus) { ...@@ -82,6 +82,7 @@ function check(id, auditStatus,custCode,parentid,proPlanStatus) {
inEiInfo.set("result-0-parentId", parentid); inEiInfo.set("result-0-parentId", parentid);
inEiInfo.set("result-0-proApplyStatus", auditStatus); inEiInfo.set("result-0-proApplyStatus", auditStatus);
inEiInfo.set("result-0-proPlanStatus", proPlanStatus); inEiInfo.set("result-0-proPlanStatus", proPlanStatus);
inEiInfo.set("result-0-custCode", custCode);
EiCommunicator.send('HPCG002A', 'check', inEiInfo, { EiCommunicator.send('HPCG002A', 'check', inEiInfo, {
onSuccess(response) { onSuccess(response) {
//NotificationUtil(response.msg); //NotificationUtil(response.msg);
......
$(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