Commit 97b66809 by 宋祥

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

parents 511cb98c c1dfd1c0
......@@ -345,6 +345,13 @@ public enum DdynamicEnum {
APP_MAP_BLOCK_PRODTASKNO("app_map_block_prodtaskno","prodTaskNo","prodorderNo","HPMT002.queryProdTaskNo"),
/**
* 模块:组管理
* 用途:组管理下拉框
* 编写:songx
*/
GROUP_RECORD1_BLOCK_ID("group_record_block_id","orgId","orgCname","HPSC010.queryGroupComboBox"),
/**
* 模块:工人管理
* 用途:工人管理下拉框
* 编写:wwl
......
......@@ -665,7 +665,7 @@ public class ServiceHPBI002 extends ServiceBase {
Map result1 = (Map) result.get("a02eed6a3e3f4dd39dbd0851e6a7572a");
List<Map> list1 = (List) result1.get("data");
JSONArray tempArr = new JSONArray();
String json = "项目名称,计划完成时间,计划产量,实际产量,进度";
String json = "项目名称,计划完成时间,计划产量,实际产量,生产进度,发货进度";
List tempContentList = Arrays.asList(json.split(","));
tempArr.add(tempContentList);
JSONObject item = new JSONObject();
......@@ -676,7 +676,8 @@ public class ServiceHPBI002 extends ServiceBase {
datalist.add(obj.get("计划完成时间"));
datalist.add(obj.get("计划产量"));
datalist.add(obj.get("实际产量"));
datalist.add(obj.get("进度"));
datalist.add(obj.get("生产进度"));
datalist.add(obj.get("发货进度"));
tempArr.add(datalist);
});
JSONArray ids = new JSONArray();
......
......@@ -52,6 +52,7 @@ public class HPKC011 extends DaoEPBase {
public static final String FIELD_VERSION = "version"; /* 版本号*/
public static final String FIELD_FACTORY_CODE = "factoryCode"; /* 厂区编码*/
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 工厂*/
public static final String FIELD_DELIVERY_DATE = "deliveryDate"; /* 交货日期*/
public static final String COL_ID = "FIELD_ID";
public static final String COL_COMPANY_CODE = "FIELD_COMPANY_CODE"; /* 企业编码*/
......@@ -82,6 +83,7 @@ public class HPKC011 extends DaoEPBase {
public static final String COL_VERSION = "FIELD_VERSION"; /* 版本号*/
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 厂区编码*/
public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 工厂*/
public static final String COL_DELIVERY_DATE = "DELIVERY_DATE"; /* 交货日期*/
public static final String QUERYKC = "HPKC011.queryKc";
public static final String QUERY = "HPKC011.query";
......@@ -122,6 +124,8 @@ public class HPKC011 extends DaoEPBase {
private String factoryCode = " "; /* 厂区编码*/
private String factoryName = " "; /* 工厂*/
private String deliveryDate = " "; /*交货日期*/
/**
* initialize the metadata.
*/
......@@ -263,7 +267,9 @@ public class HPKC011 extends DaoEPBase {
eiColumn.setDescName("工厂");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("deliveryDate");
eiColumn.setDescName("交货日期");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -662,6 +668,14 @@ public class HPKC011 extends DaoEPBase {
this.factoryName = factoryName;
}
public String getDeliveryDate() {
return deliveryDate;
}
public void setDeliveryDate(String deliveryDate) {
this.deliveryDate = deliveryDate;
}
/**
* get the value from Map.
*
......@@ -699,6 +713,7 @@ public class HPKC011 extends DaoEPBase {
setVersion(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_VERSION)), version));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
setFactoryName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_NAME)), factoryName));
setDeliveryDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DELIVERY_DATE)), deliveryDate));
}
/**
......@@ -737,7 +752,7 @@ public class HPKC011 extends DaoEPBase {
map.put(FIELD_VERSION, StringUtils.toString(version, eiMetadata.getMeta(FIELD_VERSION)));
map.put(FIELD_FACTORY_CODE, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_FACTORY_CODE)));
map.put(FIELD_FACTORY_NAME, StringUtils.toString(factoryName, eiMetadata.getMeta(FIELD_FACTORY_NAME)));
map.put(FIELD_DELIVERY_DATE,StringUtils.toString(deliveryDate, eiMetadata.getMeta(FIELD_DELIVERY_DATE)));
return map;
}
}
......@@ -159,7 +159,7 @@ public class ServiceHPKC002A extends ServiceEPBase {
newKc002.setReqNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC002_NUMBER));
newKc002.setReceiptDate(DateUtils.shortDate());
newKc002.setAmount(applyAmount);
newKc002.setWeight(dbKc010.getUnitWeight().multiply(applyAmount));
newKc002.setWeight(dbKc010.getUnitWeight().multiply(applyAmount).divide(new BigDecimal(1000)));
newKc002.setRemark(applyRemark);
newKc002.setKcId(kcId);
newKc002.setDeleteFlag(CommonConstant.YesNo.NO_0);
......
......@@ -150,7 +150,7 @@ public class ServiceHPKC002B extends ServiceEPBase {
newKc002.setReqNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC002_NUMBER));
newKc002.setReceiptDate(DateUtils.shortDate());
newKc002.setAmount(applyAmount);
newKc002.setWeight(dbKc010.getUnitWeight().multiply(applyAmount));
newKc002.setWeight(dbKc010.getUnitWeight().multiply(applyAmount).divide(new BigDecimal("1000")));
newKc002.setRemark(applyRemark);
newKc002.setKcId(kcId);
newKc002.setDeleteFlag(CommonConstant.YesNo.NO_0);
......
......@@ -142,7 +142,7 @@ public class ServiceHPKC003A extends ServiceEPBase {
newKc003.setRemark(MapUtils.getString(row, "remark1"));
newKc003.setWhName(HPPZTools.HpPz007.getByCode(whCode).getWhName());
newKc003.setAmount(applyNum);
newKc003.setWeight(applyNum.multiply(dbSc005b.getUnitWt()));
newKc003.setWeight(applyNum.multiply(dbSc005b.getUnitWt()).divide(new BigDecimal("1000")));
newKc003.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPKC003.INSERT, newKc003);
// 同步生产计划
......
......@@ -107,7 +107,7 @@ public class ServiceHPKC004A extends ServiceEPBase {
newKc004.setSaleNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC004_SALE_NO));
newKc004.setReceiptDate(DateUtils.shortDate());
newKc004.setAmount(applyAmount);
newKc004.setWeight(applyAmount.multiply(dbKc011.getUnitWeight()));
newKc004.setWeight(applyAmount.multiply(dbKc011.getUnitWeight()).divide(new BigDecimal("1000")));
newKc004.setRemark(applyRemark);
newKc004.setKcId(kcId);
newKc004.setIsPrint(CommonConstant.YesNo.NO_0);
......
......@@ -150,7 +150,7 @@ public class ServiceHPKC004B extends ServiceEPBase {
newKc004.setAmount(applyAmount);
//转换t
newKc004.setWeight(multiply.divide(new BigDecimal(1000)));
newKc004.setUnitWeight(newKc004.getUnitWeight().divide(new BigDecimal(1000)));
newKc004.setUnitWeight(newKc004.getUnitWeight());
newKc004.setRemark(applyRemark);
newKc004.setKcId(kcId);
newKc004.setIsPrint(CommonConstant.YesNo.NO_0);
......
......@@ -180,8 +180,8 @@ public class ServiceHPKC005 extends ServiceBase {
fKc005.setBookUnitWeight(unitWeight);
fKc005.setEntityUnitWeight(unitWeight);
// 计算总重
fKc005.setBookWeight(fKc005.getBookAmount().multiply(unitWeight));
fKc005.setEntityWeight(fKc005.getEntityAmount().multiply(unitWeight));
fKc005.setBookWeight(fKc005.getBookAmount().multiply(unitWeight).divide(new BigDecimal("1000")));
fKc005.setEntityWeight(fKc005.getEntityAmount().multiply(unitWeight).divide(new BigDecimal("1000")));
// 差异数量
fKc005.setDiffAmount(fKc005.getEntityAmount().subtract(fKc005.getBookAmount()));
// 差异重量
......
......@@ -139,7 +139,7 @@ public class ServiceHPKC005A extends ServiceEPBase {
newKc005.setCheckNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.CHECK_NO));
newKc005.setReceiptDate(DateUtils.shortDate());
newKc005.setEntityAmount(entityAmount);
newKc005.setEntityWeight(dbKc010.getUnitWeight().multiply(entityAmount));
newKc005.setEntityWeight(dbKc010.getUnitWeight().multiply(entityAmount).divide(new BigDecimal("1000")));
newKc005.setBookAmount(dbKc010.getAmount());
newKc005.setBookWeight(dbKc010.getWeight());
newKc005.setDiffAmount(entityAmount.subtract(dbKc010.getAmount()));
......
......@@ -147,7 +147,7 @@ public class ServiceHPKC006 extends ServiceBase {
// 根据规格计算单重
fKc006.setUnitWeight(HPPZTools.HpPz006.calcUnitWeight(dbPz006));
// 计算总重
fKc006.setWeight(fKc006.getAmount().multiply(fKc006.getUnitWeight()));
fKc006.setWeight(fKc006.getAmount().multiply(fKc006.getUnitWeight()).divide(new BigDecimal("1000")));
fKc006.setInventRecordId(dbPz006.getId());
fKc006.setInventCode(dbPz006.getInventCode());
fKc006.setDeleteFlag(CommonConstant.YesNo.NO_0);
......@@ -155,7 +155,7 @@ public class ServiceHPKC006 extends ServiceBase {
fKc006.setOtherEnterNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.OTHER_ENTER_NO));
DaoUtils.insert(HPKC006.INSERT, fKc006);
// 修改库存
HPKCTools.updateStock(fKc006.getWhCode(), fKc006.getInventRecordId(), fKc006.getAmount(),
HPKCTools.updateStock(fKc006.getWhCode(), fKc006.getInventRecordId(), fKc006.getAmount(),fKc006.getUnitWeight(),
fKc006.getWeight(), fKc006.getFactoryCode());
}
......
......@@ -143,7 +143,7 @@ public class ServiceHPKC007A extends ServiceEPBase {
kc007.setOtherOuterNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.OTHER_OUTER_NO));
kc007.setReceiptDate(DateUtils.shortDate());
kc007.setAmount(applyAmount);
kc007.setWeight(dbKc010.getUnitWeight().multiply(applyAmount));
kc007.setWeight(dbKc010.getUnitWeight().multiply(applyAmount).divide(new BigDecimal("1000")));
kc007.setKcId(kcId);
kc007.setRemark(applyRemark);
kc007.setDeleteFlag(CommonConstant.YesNo.NO_0);
......
......@@ -3,114 +3,116 @@
<sqlMap namespace="HPKC011">
<sql id="column">
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
PROD_NO as "prodNo", <!-- 生产单号 -->
PROJ_CODE as "projCode", <!-- 生产单号 -->
PROJ_NAME as "projName", <!-- 生产单号 -->
INVENT_CODE as "inventCode", <!-- 部件编码 -->
INVENT_NAME as "inventName", <!-- 部件名称 -->
SUB_INVENT_CODE as "subInventCode", <!-- 零件编码 -->
SUB_INVENT_NAME as "subInventName", <!-- 零件名称 -->
LENGTH as "length", <!-- 长 -->
WIDTH as "width", <!-- 宽 -->
THICK as "thick", <!-- 厚 -->
PRDT_SPEC as "prdtSpec", <!-- 产品规格 -->
AMOUNT as "amount", <!-- 数量 -->
UNIT_WEIGHT as "unitWeight", <!-- 单重 -->
WEIGHT as "weight", <!-- 重量 -->
REMARK as "remark", <!-- 备注 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
VERSION as "version", <!-- 版本号 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName" <!-- 工厂 -->
a.ID as "id",
a.COMPANY_CODE as "companyCode", <!-- 企业编码 -->
a.DEP_CODE as "depCode", <!-- 部门编码 -->
a.WH_CODE as "whCode", <!-- 仓库编码 -->
a.WH_NAME as "whName", <!-- 仓库名称 -->
a.PROD_NO as "prodNo", <!-- 生产单号 -->
a.PROJ_CODE as "projCode", <!-- 生产单号 -->
a.PROJ_NAME as "projName", <!-- 生产单号 -->
a.INVENT_CODE as "inventCode", <!-- 部件编码 -->
a.INVENT_NAME as "inventName", <!-- 部件名称 -->
a.SUB_INVENT_CODE as "subInventCode", <!-- 零件编码 -->
a.SUB_INVENT_NAME as "subInventName", <!-- 零件名称 -->
a.LENGTH as "length", <!-- 长 -->
a.WIDTH as "width", <!-- 宽 -->
a.THICK as "thick", <!-- 厚 -->
a.PRDT_SPEC as "prdtSpec", <!-- 产品规格 -->
a.AMOUNT as "amount", <!-- 数量 -->
a.UNIT_WEIGHT as "unitWeight", <!-- 单重 -->
a.WEIGHT as "weight", <!-- 重量 -->
a.REMARK as "remark", <!-- 备注 -->
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.VERSION as "version", <!-- 版本号 -->
a.FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
a.FACTORY_NAME as "factoryName", <!-- 工厂 -->
b.DELIVERY_DATE as "deliveryDate"
</sql>
<sql id="authCondition">
<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="depCodes">
DEP_CODE IN <iterate close=")" open="(" conjunction="," property="depCodes">#depCodes[]#</iterate>
a.DEP_CODE IN <iterate close=")" open="(" conjunction="," property="depCodes">#depCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="condition">
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
a.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
a.WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME LIKE CONCAT('%', #whName#, '%')
a.WH_NAME LIKE CONCAT('%', #whName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodNo">
PROD_NO = #prodNo#
a.PROD_NO = #prodNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE LIKE CONCAT('%', #projCode#, '%')
a.PROJ_CODE LIKE CONCAT('%', #projCode#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME LIKE CONCAT('%', #projName#, '%')
a.PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
a.INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME LIKE CONCAT('%', #inventName#, '%')
a.INVENT_NAME LIKE CONCAT('%', #inventName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="subInventCode">
SUB_INVENT_CODE = #subInventCode#
a.SUB_INVENT_CODE = #subInventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="subInventName">
SUB_INVENT_NAME LIKE CONCAT('%', #subInventName#, '%')
a.SUB_INVENT_NAME LIKE CONCAT('%', #subInventName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
a.CREATED_BY = #createdBy#
</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="updatedTime">
UPDATED_TIME = #updatedTime#
a.UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="version">
VERSION = #version#
a.VERSION = #version#
</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>
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
a.ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC011">
SELECT <include refid="column"/>
FROM hpjx.T_HPKC011
FROM hpjx.T_HPKC011 a
JOIN hpjx.T_HPSC001 b on a.PROJ_CODE = b.PROJ_CODE
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
......@@ -119,15 +121,16 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
a.ID DESC
</isEmpty>
</dynamic>
</select>
<select id="queryKc" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC011">
SELECT <include refid="column"/>
FROM hpjx.T_HPKC011
WHERE 1=1 AND AMOUNT!=0
FROM hpjx.T_HPKC011 a
JOIN hpjx.T_HPSC001 b on a.PROJ_CODE = b.PROJ_CODE
WHERE 1=1 AND a.AMOUNT!=0
<include refid="condition"/>
<include refid="customCondition"/>
<dynamic prepend="ORDER BY">
......@@ -135,21 +138,24 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
a.ID DESC
</isEmpty>
</dynamic>
</select>
<select id="queryByCondition" resultClass="java.util.HashMap">
SELECT <include refid="column"/>
FROM hpjx.T_HPKC011
FROM hpjx.T_HPKC011 a
JOIN hpjx.T_HPSC001 b on a.PROJ_CODE = b.PROJ_CODE
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.T_HPKC011
SELECT COUNT(*)
FROM hpjx.T_HPKC011 a
JOIN hpjx.T_HPSC001 b on a.PROJ_CODE = b.PROJ_CODE
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
......
......@@ -103,7 +103,10 @@ public class ServiceHPMT001 extends ServiceBase {
resultMap.put("actualWt_s_qoq", 0);//实际环比
} else {
resultMap.put("actualWt_s", row4.get(0).get("actualWt"));
BigDecimal actualWt = (BigDecimal) row2.get(0).get("actualWt");
BigDecimal actualWt = BigDecimal.ZERO;
if(row2.get(0).get("actualWt")!=null){
actualWt = (BigDecimal) row2.get(0).get("actualWt");
}
BigDecimal actualWt2 = (BigDecimal) row4.get(0).get("actualWt");
resultMap.put("actualWt_s_qoq",actualWt.subtract(actualWt2).divide(actualWt2,BigDecimal.ROUND_UP).
multiply(new BigDecimal(100)).doubleValue());
......@@ -124,7 +127,10 @@ public class ServiceHPMT001 extends ServiceBase {
resultMap.put("actualWt_h_yoy", 0);//实际同比
} else {
resultMap.put("actualWt_h", row6.get(0).get("actualWt"));
BigDecimal actualWt = (BigDecimal) row2.get(0).get("actualWt");
BigDecimal actualWt = BigDecimal.ZERO;
if(row2.get(0).get("actualWt")!=null){
actualWt = (BigDecimal) row2.get(0).get("actualWt");
}
BigDecimal actualWt2 = (BigDecimal) row6.get(0).get("actualWt");
resultMap.put("actualWt_h_yoy", actualWt.subtract(actualWt2).divide(actualWt2,BigDecimal.ROUND_UP).
multiply(new BigDecimal(100)).doubleValue());
......
......@@ -286,13 +286,9 @@ public class ServiceHPMT003 extends ServiceBase {
public Map queryPmCompanyInfo(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String date = inInfo.getString("date").replace("-","");
String factorycode = inInfo.getString("factorycode");
String companyCode = UserSessionUtils.getCompanyCode();
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
sqlMap.put("date", date);
sqlMap.put("factorycode", factorycode);
List<Map> rows = this.dao.query("HPMT003.queryPmCompanyInfo", sqlMap);
List<Map> maps = new ArrayList<>();
resultMap.put("result",rows);
......@@ -307,5 +303,33 @@ public class ServiceHPMT003 extends ServiceBase {
}
/**
* APP驾驶舱-最新登记日期
*
* @param inInfo
* @return
*/
public Map queryMaxDate(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String factorycode = inInfo.getString("factorycode");
String companyCode = UserSessionUtils.getCompanyCode();
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
sqlMap.put("factorycode", factorycode);
List<Map> rows = this.dao.query("HPMT003.queryMaxDate", sqlMap);
if(rows.get(0).get("registerDate")==null){
rows.get(0).put("registerDate",DateUtils.yesterday());
}
List<Map> maps = new ArrayList<>();
resultMap.put("result",rows);
resultMap.put("status",EiConstant.STATUS_SUCCESS);
resultMap.put("message","SUCCESS");
return resultMap;
} catch (Exception e) {
resultMap.put("status", 500);
resultMap.put("message",LogUtils.getMsg(e));
return resultMap;
}
}
}
......@@ -4,20 +4,20 @@
<select id="queryPmRCLInfo" resultClass="java.util.HashMap">
select
concat(ifnull(YGL,0),'工') as YGL,
concat(format(ifnull(JHCL,0),2),'T') as JHCL,
concat(format(ifnull(SJCL,0),2),'T') as SJCL,
case when ifnull(YGL,0) = 0 then '0.00T'
else concat(format(ifnull(SJCL,0)/ifnull(YGL,0),2),'T') end as RJCL
concat(ifnull(YGL,0),'工') as YGL,
concat(format(ifnull(JHCL,0),2),'T') as JHCL,
concat(format(ifnull(SJCL,0),2),'T') as SJCL,
case when ifnull(YGL,0) = 0 then '0.00T'
else concat(format(ifnull(SJCL,0)/ifnull(YGL,0),2),'T') end as RJCL
from (select
(select count(*) FROM hpjx.T_HPPZ014
where COMPANY_CODE = #companyCode# and REG_DATE = #date# and FACTORY_CODE = #factorycode#
group by FACTORY_CODE) as YGL,
0 as JHCL,
(select sum(WEIGHT) FROM hpjx.T_HPXS001
where COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode#
group by FACTORY_CODE) as SJCL
from dual) a
(select sum(USER_COUNT)
FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode# ) as YGL,
0 as JHCL,
(select sum(WEIGHT)
FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode# ) as SJCL
from dual) a
</select>
<select id="queryPmYCLinfo" resultClass="java.util.HashMap">
......@@ -28,13 +28,11 @@
case when ifnull(YGL,0) = 0 then '0.00T'
else concat(format(ifnull(SJCL,0)/ifnull(YGL,0),2),'T') end as LJRJCL
from (select
(select count(*) FROM hpjx.T_HPPZ014
where COMPANY_CODE = #companyCode# and left(REG_DATE,6) = left(#date#,6) and REG_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode#
group by FACTORY_CODE,left(REG_DATE,6)) as YGL,
(select sum(USER_COUNT) FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,6) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as YGL,
0 as JHCL,
(select sum(WEIGHT) FROM hpjx.T_HPXS001
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,6) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode#
group by FACTORY_CODE,left(REGISTER_DATE,6)) as SJCL
(select sum(WEIGHT) FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,6) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as SJCL
from dual) a
</select>
......@@ -46,13 +44,15 @@
case when ifnull(YGL,0) = 0 then '0.00T'
else concat(format(ifnull(SJCL,0)/ifnull(YGL,0),2),'T') end as NLJRJCL
from (select
(select count(*) FROM hpjx.T_HPPZ014
where COMPANY_CODE = #companyCode# and left(REG_DATE,4) = left(#date#,4) and REG_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode#
group by FACTORY_CODE,left(REG_DATE,4)) as YGL,
(select
sum(USER_COUNT)
FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,4) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as YGL,
0 as JHCL,
(select sum(WEIGHT) FROM hpjx.T_HPXS001
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,4) = left(#date#,4) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode#
group by FACTORY_CODE,left(REGISTER_DATE,4)) as SJCL
(select
sum(WEIGHT)
FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,4) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as SJCL
from dual) a
</select>
......@@ -242,18 +242,19 @@
<select id="queryPmXMinfo" resultClass="java.util.HashMap">
select PROJ_NAME,JHDATE,JHCL,SJCL,JD from (select
a.PROJ_NAME ,
select
a.PROJ_NAME,
concat(left(max(a.PLAN_COMPLETION_DATE),4),'年',substring(max(a.PLAN_COMPLETION_DATE),5,2),'月',right(max(a.PLAN_COMPLETION_DATE),2),'日') as JHDATE,
concat(format(ifnull(sum(b.TOTAL_WT ),0),2),'吨') as JHCL,
concat(format(ifnull(sum(ACTUAL_COMPLETION_UNIT_WT),0),2),'吨') as SJCL,
concat(format((ifnull( sum( ACTUAL_COMPLETION_NUM ), 0 ) / ifnull( sum( b.NUM ), 0 ) * 100),2),'%') as JD
concat(format(ifnull(sum(b.NUM*b.UNIT_WT ),0),2),'吨') as JHCL,
concat(format(ifnull(sum(c.WEIGHT),0),2),'吨') as SJCL,
concat(format((ifnull( sum( c.WEIGHT ), 0 ) / ifnull( sum( b.NUM*b.UNIT_WT ), 0 ) * 100),2),'%') as SCJD,
concat(format((ifnull( sum( d.WEIGHT ), 0 ) / ifnull( sum( b.NUM*b.UNIT_WT ), 0 ) * 100),2),'%') as FHJD
from hpjx.T_HPSC003 a
join hpjx.T_HPSC004 b on b.PARENT_ID = a.PLAN_INFO_NO
join hpjx.T_HPSC005A c on c.PROD_ORDER_NO = b.PROD_ORDER_NO
left join hpjx.T_HPkC003 c on c.PROD_ORDER_NO = b.PROD_ORDER_NO
left join hpjx.T_HPkC004 d on d.PROD_NO = b.PROD_ORDER_NO
where a.COMPANY_CODE = #companyCode# and c.FACTORY_CODE = #factorycode#
group by a.PROJ_NAME) a
where JD <![CDATA[<>]]> 100
group by a.PROJ_NAME
</select>
<select id="queryPmCompanyInfo" resultClass="java.util.HashMap">
......@@ -261,4 +262,17 @@
from iplat.TXSOG01
where ORG_TYPE = 'factory' and COMPANY_CODE = #companyCode# and IS_DELETED = 0
</select>
<select id="queryMaxDate" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
MAX(REGISTER_DATE) as "registerDate" <!-- 最新登记日期 -->
FROM ${hpjxSchema}.T_HPXS001
WHERE 1=1 AND DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<!-- <isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>-->
</select>
</sqlMap>
......@@ -2,6 +2,7 @@ package com.baosight.hpjx.hp.pz.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.CompanyTypeEnum;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InitiateModeEnum;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
......@@ -18,6 +19,7 @@ import com.baosight.hpjx.hp.pz.domain.HPPZ003;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -187,5 +189,10 @@ public class ServiceHPPZ003 extends ServiceBase {
}
return inInfo;
}
public EiInfo queryCustCode(EiInfo inInfo){
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), null);
return inInfo;
}
}
......@@ -121,6 +121,9 @@ public class HPPZTools {
Map queryMap = new HashMap();
queryMap.put("inventCode", inventCode);
List<HPPZ004> pz004s = DaoBase.getInstance().query(HPPZ004.QUERY, queryMap);
if(pz004s!=null&&pz004s.size()==0){
pz004s = null;
}
AssertUtils.isNull(pz004s, String.format("存货编码[%s]不存在", inventCode));
return pz004s.get(0);
}
......
......@@ -138,7 +138,7 @@ public class HPSC002 extends DaoEPBase {
@ExcelAnno(index = 6)
private BigDecimal num = new BigDecimal(0.000); /* 数量*/
@ExcelAnno(index = 7)
private BigDecimal unitWt = new BigDecimal(0.000); /* 单重*/
private BigDecimal unitWt = new BigDecimal(0.0); /* 单重*/
private BigDecimal totalWt = new BigDecimal(0.000); /* 总重*/
private String filePath1 = " "; /* 文件地址1*/
private String filePath2 = " "; /* 文件地址2*/
......@@ -225,21 +225,21 @@ public class HPSC002 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_LENGTH);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(12);
eiColumn.setDescName("长");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WIDTH);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(12);
eiColumn.setDescName("宽");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_THICK);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(12);
eiColumn.setDescName("厚");
eiMetadata.addMeta(eiColumn);
......@@ -261,7 +261,7 @@ public class HPSC002 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_UNIT_WT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setScaleLength(1);
eiColumn.setFieldLength(15);
eiColumn.setDescName("单重");
eiMetadata.addMeta(eiColumn);
......
......@@ -4,6 +4,8 @@ import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.math.BigInteger;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
......@@ -33,6 +35,7 @@ public class HPSC008 extends DaoEPBase {
public static final String FIELD_PRDT_CODE = "prdtCode"; /* 产品代码*/
public static final String FIELD_PRDT_NAME = "prdtName"; /* 产品名称*/
public static final String FIELD_WEIGHT = "weight"; /* 产量*/
public static final String FIELD_WEIGHT_JH = "weightJh"; /* 产量*/
public static final String FIELD_REMARK = "remark"; /* 备注*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除0:否1.是*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
......@@ -68,6 +71,9 @@ public class HPSC008 extends DaoEPBase {
public static final String UPDATE = "HPSC008.update";
public static final String DELETE = "HPSC008.delete";
public static final String DELETE_FLAG = "HPSC008.deleteFlag";
public static final String DELETE_REMARK = "HPSC008.deleteRemark";
public static final String QUERY_DETAIL = "HPSC008.queryDetail";
public static final String QUERY_RESULT = "HPSC008.queryResult";
private Long id = new Long(0); /* ID*/
private String companyCode = " "; /* 企业编码 预留*/
......@@ -80,6 +86,7 @@ public class HPSC008 extends DaoEPBase {
private String prdtCode = " "; /* 产品代码*/
private String prdtName = " "; /* 产品名称*/
private BigDecimal weight = new BigDecimal("0"); /* 产量*/
private BigDecimal weightJh = new BigDecimal(BigInteger.ZERO); /*加焊产量*/
private String remark = " "; /* 备注*/
private Integer deleteFlag; /* 是否删除0:否1.是*/
private String createdBy = " "; /* 创建人*/
......@@ -140,7 +147,14 @@ public class HPSC008 extends DaoEPBase {
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("产量");
eiColumn.setDescName("组拼产量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WEIGHT_JH);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("加焊产量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REMARK);
......@@ -361,6 +375,15 @@ public class HPSC008 extends DaoEPBase {
public void setWeight(BigDecimal weight) {
this.weight = weight;
}
public BigDecimal getWeightJh() {
return weightJh;
}
public void setWeightJh(BigDecimal weightJh) {
this.weightJh = weightJh;
}
/**
* get the remark - 备注.
* @return the remark
......@@ -508,6 +531,7 @@ public class HPSC008 extends DaoEPBase {
setPrdtCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRDT_CODE)), prdtCode));
setPrdtName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRDT_NAME)), prdtName));
setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight));
setWeightJh(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT_JH)), weightJh));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
......@@ -535,7 +559,8 @@ public class HPSC008 extends DaoEPBase {
map.put(FIELD_GROUP_TYPE, StringUtils.toString(groupType, eiMetadata.getMeta(FIELD_GROUP_TYPE)));
map.put(FIELD_PRDT_CODE, StringUtils.toString(prdtCode, eiMetadata.getMeta(FIELD_PRDT_CODE)));
map.put(FIELD_PRDT_NAME, StringUtils.toString(prdtName, eiMetadata.getMeta(FIELD_PRDT_NAME)));
map.put(FIELD_WEIGHT, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT)));
map.put(FIELD_WEIGHT, StringUtils.toString(weightJh, eiMetadata.getMeta(FIELD_WEIGHT_JH)));
map.put(FIELD_WEIGHT_JH, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT)));
map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
......
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.CompanyTypeEnum;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.HPConstants;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ003;
import com.baosight.hpjx.hp.sc.domain.HPSC002;
import com.baosight.hpjx.hp.sc.domain.HPSC004;
import com.baosight.hpjx.util.*;
......@@ -112,6 +114,15 @@ public class ServiceHPSC001 extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) {
HPSC001 hpsc001 = new HPSC001();
hpsc001.fromMap(resultRows.get(i));
HPPZ003 fPz003 = new HPPZ003();
if (hpsc001.getPrinc2().trim().isEmpty()) {
fPz003.setCustCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPPZ003_CUST_CODE));
fPz003.setCustType(CompanyTypeEnum.GQ.getCode());
fPz003.setCustName(resultRows.get(i).get("princ2Name").toString());
fPz003.setCompanyName(resultRows.get(i).get("princ2Name").toString());
DaoUtils.insert("HPPZ003.insert", fPz003);
hpsc001.setPrinc2(fPz003.getCustCode());
}
if (hpsc001.getId() == null || hpsc001.getId() == 0) {
this.add(hpsc001);
} else {
......@@ -119,6 +130,7 @@ public class ServiceHPSC001 extends ServiceBase {
}
}
inInfo = this.query(inInfo);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), null);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
......
......@@ -157,6 +157,7 @@ public class ServiceHPSC002 extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) {
HPSC002 hpsc002 = new HPSC002();
hpsc002.fromMap(resultRows.get(i));
hpsc002.setDeliveryDate(DateUtils.formatShort(hpsc002.getDeliveryDate()));
if (hpsc002.getId() == null || hpsc002.getId() == 0) {
hpsc002.setDeliveryDate(DateUtils.formatShort(hpsc002.getDeliveryDate()));
this.add(hpsc002);
......@@ -178,6 +179,9 @@ public class ServiceHPSC002 extends ServiceBase {
public EiInfo add(HPSC002 hpsc002) {
EiInfo inInfo = new EiInfo();
try {
//单独新增需要拿到销售单的交货日期
HPSC001 hpsc001 = HPSCTools.HpSc001.get(hpsc002.getProjCode());
hpsc002.setDeliveryDate(hpsc001.getDeliveryDate());
hpsc002.setLeaf("1");
// 计算总重
BigDecimal num = hpsc002.getNum();
......@@ -499,6 +503,8 @@ public class ServiceHPSC002 extends ServiceBase {
HPSC003.setWidth(hppz002.getWidth());
HPSC003.setThick(hppz002.getThick());
HPSC003.setSpec(HPPZTools.HpPz006.jointSpec(HPSC003.getLength(),HPSC003.getWidth(),HPSC003.getThick()));
HPSC003.setDeliveryDate(hppz002.getDeliveryDate());
HPSC003.setPlanCompletionDate(hppz002.getDeliveryDate());
DaoUtils.update("HPSC003.update", HPSC003.toMap());
}
......@@ -510,6 +516,7 @@ public class ServiceHPSC002 extends ServiceBase {
HPSC004.setUnitWt(hppz002.getUnitWt());
HPSC004.setTotalWt(hppz002.getTotalWt());
HPSC004.setSpec(HPPZTools.HpPz006.jointSpec(HPSC004.getLength(),HPSC004.getWidth(),HPSC004.getThick()));
// HPSC004.setDeliveryDate(hppz002.getDeliveryDate());
DaoUtils.update("HPSC004.update", HPSC004.toMap());
}
......@@ -843,18 +850,48 @@ public class ServiceHPSC002 extends ServiceBase {
String projName = (String) params.get("projName");
String deliveryDate = (String) params.get("deliveryDate");
String parentPrdtName = (String) params.get("parentPrdtName");
int lv = Integer.parseInt((String) params.get("lv")) +1;
Boolean checkStatus = false;
StringBuffer sb = new StringBuffer();
// 写入数据
for (HPSC002 hpsc002:dataList) {
hpsc002.setParentId(parentId);
hpsc002.setProjCode(projCode);
hpsc002.setProjName(projName);
hpsc002.setParentPrdtName(parentPrdtName);
hpsc002.setDeliveryDate(deliveryDate);
hpsc002.setStatus(CommonConstant.YesNo.NO_0.intValue());
add(hpsc002);
for (int i = 0;i < dataList.size(); i++) {
HPSC002 hpsc002 = new HPSC002();
hpsc002 = dataList.get(i);
hpsc002.setLv(lv);
//产品类型是否为空
if(hpsc002.getPrdtType()==null){
sb.append("导入失败:数据错误第"+(i+1)+"条,产品类型不能为空!!");
checkStatus = true;
}else{
//层级2
if (hpsc002.getLv() == 2 && hpsc002.getPrdtType() != 4) {
sb.append("导入失败:数据错误第"+(i+1)+"条,层级关系错误,当前层级只能导入部件清单!!");
checkStatus = true;
} else if (hpsc002.getLv() == 3) {
if (!(hpsc002.getPrdtType() == 3 || hpsc002.getPrdtType() == 2)) {
sb.append("导入失败:数据错误第"+(i+1)+"条,层级关系错误,当前层级只能导入零件或耗材清单!!");
checkStatus = true;
}
}
}
}
if (checkStatus) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg(sb.toString());
}else{
for (HPSC002 hpsc002: dataList) {
hpsc002.setLv(lv);
hpsc002.setParentId(parentId);
hpsc002.setProjCode(projCode);
hpsc002.setProjName(projName);
hpsc002.setParentPrdtName(parentPrdtName);
hpsc002.setDeliveryDate(deliveryDate);
hpsc002.setStatus(CommonConstant.YesNo.NO_0.intValue());
add(hpsc002);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + dataList.size() + "]条数据保存成功!");
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + dataList.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
......
......@@ -135,7 +135,7 @@ public class ServiceHPSC005A extends ServiceBase {
// 设置基础信息
this.setBaseInfo(fSc005a);
fSc005a.setProdOrderNo(prodOrderNo);
fSc005a.setTotalWt(fSc005a.getNum().multiply(dbSc005.getUnitWt()));
fSc005a.setTotalWt(fSc005a.getNum().multiply(dbSc005.getUnitWt()).divide(new BigDecimal("1000")));
DaoUtils.insert(HPSC005A.INSERT, fSc005a);
}
......@@ -157,7 +157,7 @@ public class ServiceHPSC005A extends ServiceBase {
// 更新订单主表数量
HPSCTools.checkAssignedNum(prodOrderNo, diffNum);
// 更新子单
fSc005a.setTotalWt(fSc005a.getNum().multiply(dbSc005.getUnitWt()));
fSc005a.setTotalWt(fSc005a.getNum().multiply(dbSc005.getUnitWt()).divide(new BigDecimal("1000")));
DaoUtils.update(HPSC005A.UPDATE, fSc005a);
}
......
......@@ -8,6 +8,7 @@ import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.pz.domain.HPPZ013;
import com.baosight.hpjx.hp.sc.domain.HPSC008;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants;
......@@ -20,6 +21,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
......@@ -184,4 +186,26 @@ public class ServiceHPSC008 extends ServiceEPBase {
}});
return inInfo;
}
public EiInfo queryMaxDate(EiInfo inInfo) {
String companyCode = UserSessionUtils.getCompanyCode();
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
List<Map> result = this.dao.query("HPSC008.queryMaxDate", sqlMap);
String registerDate = "";
if(result==null||result.size()==0||result.get(0).get("registerDate")==null){
registerDate = DateUtils.yesterday();
}else{
registerDate = (String) result.get(0).get("registerDate");
}
registerDate = registerDate.substring(0,4)+"-"+registerDate.substring(4,6)+"-"+registerDate.substring(6,8);
inInfo.set("registerDate",registerDate);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
return inInfo;
}
}
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.sc.domain.HPSC008;
import com.baosight.hpjx.hp.sc.domain.HPSC009;
import com.baosight.hpjx.hp.sc.domain.HPSC010;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.StringUtils;
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.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/4/3
*/
public class ServiceHPSC010 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC009.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
final EiInfo outEiInfo = super.query(inInfo, HPSC010.QUERY, new HPSC010().eiMetadata);
CommonMethod.initBlock(outEiInfo,
Arrays.asList(DdynamicEnum.FACTORY_CODE_BLOCK_ID), new HashMap<String,Object>());
return outEiInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
EiBlock block = inInfo.getBlock(EiConstant.queryBlock);
String startDate = block.getCellStr(ACConstants.ROW_CODE_0,"createdDateFrom");
String endDate = block.getCellStr(ACConstants.ROW_CODE_0,"createdDateTo");
if (!endDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,"createdDateTo", StringUtil.removeHorizontalLine(endDate));
}
if (!startDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"createdDateFrom",StringUtil.removeHorizontalLine(startDate));
}
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC008.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
return super.query(inInfo,HPSC010.QUERY,new HPSC010());
}
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HPSC010 hpxs010 = new HPSC010();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs010.fromMap(map);
hpxs010.setDeleteFlag(CommonConstant.YesNo.YES_1);
delRows(hpxs010.getId().toString());
DaoUtils.update(HPSC010.DELETE_FLAG, hpxs010.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("删除失败", e.getMessage());
return inInfo;
}
return inInfo;
}
@Override
public EiInfo update(EiInfo inInfo) {
int i = 0;
try {
HPSC010 hpxs010 = new HPSC010();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs010.fromMap(map);
hpxs010.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.update(HPSC010.UPDATE, hpxs010);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleUpdateException(inInfo,i,e);
logError("修改失败", e.getMessage());
return inInfo;
}
return inInfo;
}
@Override
public EiInfo insert(EiInfo inInfo) {
int i = 0;
try {
HPSC010 hpxs010 = new HPSC010();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
List<Map> list = eiBlock.getRows();
list.addAll(inInfo.getBlock(CommonConstant.Field.DETAIL).getRows());
double weight = 0;
//BigDecimal weight = new BigDecimal("0");
for (i = 0; i < list.size(); i++) {
Map<?, ?> map = list.get(i);
HPSC008 hpsc008 = new HPSC008();
hpsc008.fromMap(map);
weight = weight+hpsc008.getWeight().doubleValue()+hpsc008.getWeightJh().doubleValue();
}
String registerDate = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_REGISTER_DATE);
hpxs010.fromMap(eiBlock.getRow(0));
hpxs010.setDeleteFlag(CommonConstant.YesNo.NO_0);
hpxs010.setWeight(BigDecimal.valueOf(weight));
hpxs010.setRegisterDate(StringUtil.removeHorizontalLine(registerDate));
hpxs010.setUserCount(Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_USER_COUNT)));
DaoUtils.insert(HPSC010.INSERT, hpxs010);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.insert", "新增")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleInsertException(inInfo,i,e);
logError("新增失败", e.getMessage());
return inInfo;
}
return inInfo;
}
public void delRows(String id){
HPSC008 hpxs001 = new HPSC008();
hpxs001.setRemark(id);
hpxs001.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPSC008.DELETE_REMARK, hpxs001);
}
}
\ No newline at end of file
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.sc.domain.HPSC008;
import com.baosight.hpjx.util.CommonMethod;
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.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.HashMap;
/**
* @author LiuYang
* @version 1.0 2024/4/7
*/
public class ServiceHPSC010A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC008.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
final EiInfo outEiInfo = super.query(inInfo, HPSC008.QUERY_RESULT, new HPSC008());
EiInfo detailEiInfo = super.query(inInfo, HPSC008.QUERY_DETAIL, new HPSC008());
EiBlock detailBlock = new EiBlock(CommonConstant.Field.DETAIL);
detailBlock.setBlockMeta(new HPSC008().eiMetadata);
detailBlock.setRows(detailEiInfo.getBlock(EiConstant.resultBlock).getRows());
outEiInfo.setBlock(detailBlock);
CommonMethod.initBlock(outEiInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(outEiInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD1_BLOCK_ID), null, false);
//拼接名称 包含逻辑删除数据
return outEiInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
EiBlock block = inInfo.getBlock(EiConstant.queryBlock);
String startDate = block.getCellStr(ACConstants.ROW_CODE_0,"createdDateFrom");
String endDate = block.getCellStr(ACConstants.ROW_CODE_0,"createdDateTo");
if (!endDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,"createdDateTo", StringUtil.removeHorizontalLine(endDate));
}
if (!startDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"createdDateFrom",StringUtil.removeHorizontalLine(startDate));
}
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC008.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
return super.query(inInfo, HPSC008.QUERY,new HPSC008());
}
}
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.sc.domain.HPSC008;
import com.baosight.hpjx.hp.sc.domain.HPSC010;
import com.baosight.hpjx.hp.sc.domain.HPSC096;
import com.baosight.hpjx.hp.sc.domain.HPSC098;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.ErrorCodeUtils;
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.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import java.math.BigDecimal;
import java.util.*;
/**
* @author LiuYang
* @version 1.0 2024/4/3
*/
public class ServiceHPSC096 extends ServiceEPBase {
@OperationLogAnnotation(operModul = "报工管理",operType = "查询",operDesc = "初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
String methodType = inInfo.getString("inqu_status-0-methodType"); //操作类型
List<Map> listFactoryCode;
if ("update".equals(methodType)) {
String id = inInfo.getString("inqu_status-0-id");
listFactoryCode = this.dao.query(HPSC008.QUERY,new HashMap<String,Object>(){{
put(HPSC008.FIELD_REMARK,id);
}},EiConstant.defaultOffset,100);
EiInfo eiInfo = super.query(inInfo,HPSC010.QUERY,new HPSC010());
if (eiInfo.getBlock(EiConstant.resultBlock).getRows().size() >0) {
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC010.FIELD_USER_COUNT,
eiInfo.getCellStr(EiConstant.resultBlock,ACConstants.ROW_CODE_0,HPSC010.FIELD_USER_COUNT));
}
inInfo.addBlock(EiConstant.resultBlock).setRows(listFactoryCode);
}else {
List<Map> listResult = new ArrayList<>();
List<Map> listdetail = new ArrayList<>();
String loginName = UserSession.getLoginName();
Map queryMap = new HashMap();
queryMap.put("loginName", loginName);
listFactoryCode = this.dao.query(HPSC096.QUERY_FACTORY_CODE,queryMap,EiConstant.defaultOffset,100);
//List<Map> listProducTionType = this.dao.query(HPSC096.QUERY_PRODUCTION_TYPE,new HashMap<>());
int rowNo = 0;
int detrowNo = 0;
for (int i = 0; i < listFactoryCode.size(); i++) {
if ("prodGroup".equals(listFactoryCode.get(i).get(HPSC096.FIELD_ORG_TYPE))) {
rowNo++;
Map result = new HashMap();
result.putAll(listFactoryCode.get(i));
result.put(HPSC008.FIELD_WEIGHT,0);
result.put(HPSC008.FIELD_WEIGHT_JH,0);
result.put(HPSC008.FIELD_GROUP_TYPE,1);
result.put("rowNo",rowNo);
listResult.add(result);
}else if ("cutGroup".equals(listFactoryCode.get(i).get(HPSC096.FIELD_ORG_TYPE))){
Map detailMap = new HashMap();
detailMap.putAll(listFactoryCode.get(i));
detailMap.put(HPSC008.FIELD_WEIGHT,0);
detailMap.put(HPSC008.FIELD_WEIGHT_JH,0);
detailMap.put("rowNo",detrowNo);
listdetail.add(detailMap);
detrowNo++;
}
}
inInfo.addBlock(EiConstant.resultBlock).setRows(listResult);
inInfo.addBlock(CommonConstant.Field.DETAIL).setRows(listdetail);
}
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC096().eiMetadata);
inInfo.addBlock(CommonConstant.Field.DETAIL).addBlockMeta(new HPSC096().eiMetadata);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"methodType",methodType);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.GROUP_RECORD1_BLOCK_ID,DdynamicEnum.FACTORY_CODE_BLOCK_ID),
new HashMap<String,Object>(){{
put(HPSC008.FIELD_COMPANY_CODE, UserSessionUtils.getCompanyCode());
}}
);
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
return super.query(inInfo);
}
@OperationLogAnnotation(operModul = "报工管理",operType = "修改",operDesc = "修改操作")
@Override
public EiInfo update(EiInfo inInfo) {
int i = 0;
try {
HPSC008 hpxs002 = new HPSC008();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs002.fromMap(map);
hpxs002.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.update(HPSC008.UPDATE, hpxs002);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleUpdateException(inInfo,i,e);
logError("修改失败", e.getMessage());
return inInfo;
}
return inInfo;
}
@OperationLogAnnotation(operModul = "报工管理",operType = "新增",operDesc = "新增操作")
@Override
public EiInfo insert(EiInfo inInfo) {
int i = 0;
try {
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
Map queryMap = new HashMap();
queryMap.put(HPSC010.FIELD_REGISTER_DATE,eiBlock.getCellStr(ACConstants.ROW_CODE_0,HPSC010.FIELD_REGISTER_DATE));
queryMap.put(HPSC010.FIELD_FACTORY_CODE,eiBlock.getCellStr(ACConstants.ROW_CODE_0,HPSC010.FIELD_FACTORY_CODE));
List<Map> list = this.dao.query(HPSC010.QUERY_MAX,queryMap);
List<Map> listResult = eiBlock.getRows();
listResult.addAll(inInfo.getBlock(CommonConstant.Field.DETAIL).getRows());
String registerDate = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_REGISTER_DATE);
HPSC008 hpxs008 = new HPSC008();
for (i = 0; i < listResult.size(); i++) {
Map<?, ?> map = listResult.get(i);
hpxs008.fromMap(map);
hpxs008.setRegisterDate(StringUtil.removeHorizontalLine(registerDate));
hpxs008.setDeleteFlag(CommonConstant.YesNo.NO_0);
for (Map map1:list) {
hpxs008.setRemark(map1.get(HPSC010.FIELD_ID).toString());
}
DaoUtils.insert(HPSC008.INSERT, hpxs008);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.insert", "新增")});
} catch (PlatException e) {
e.printStackTrace();
ErrorCodeUtils.handleInsertException(inInfo,i,e);
logError("新增失败", e.getMessage());
return inInfo;
}
return inInfo;
}
}
......@@ -89,6 +89,7 @@
PRDT_CODE as "prdtCode", <!-- 产品代码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
WEIGHT as "weight", <!-- 产量 -->
WEIGHT_JH as "weightJh",
REMARK as "remark", <!-- 备注 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0:否1.是 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
......@@ -110,6 +111,78 @@
</select>
<select id="queryResult" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC008">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
REGISTER_DATE as "registerDate", <!-- 登记日期 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
GROUP_CODE as "groupCode", <!-- 生产组代码 -->
USER_ID as "userId", <!-- 员工代码 -->
GROUP_TYPE as "groupType", <!-- 生产类型 -->
PRDT_CODE as "prdtCode", <!-- 产品代码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
WEIGHT as "weight", <!-- 产量 -->
WEIGHT_JH as "weightJh",
REMARK as "remark", <!-- 备注 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0:否1.是 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_TIME as "updatedTime", <!-- 修改人名称 -->
UPDATED_NAME as "updatedName" <!-- 修改时间 -->
FROM ${hpjxSchema}.T_HPXS001 WHERE 1=1 and GROUP_TYPE in ('1','2')
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
<select id="queryDetail" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
REGISTER_DATE as "registerDate", <!-- 登记日期 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
GROUP_CODE as "groupCode", <!-- 生产组代码 -->
USER_ID as "userId", <!-- 员工代码 -->
GROUP_TYPE as "groupType", <!-- 生产类型 -->
PRDT_CODE as "prdtCode", <!-- 产品代码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
WEIGHT as "weight", <!-- 产量 -->
WEIGHT_JH as "weightJh",
REMARK as "remark", <!-- 备注 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0:否1.是 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_TIME as "updatedTime", <!-- 修改人名称 -->
UPDATED_NAME as "updatedName" <!-- 修改时间 -->
FROM ${hpjxSchema}.T_HPXS001 WHERE 1=1 and GROUP_TYPE not in ('1','2')
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPXS001 WHERE 1=1
<include refid="condition" />
......@@ -187,6 +260,7 @@
PRDT_CODE, <!-- 产品代码 -->
PRDT_NAME, <!-- 产品名称 -->
WEIGHT, <!-- 产量 -->
WEIGHT_JH,
REMARK, <!-- 备注 -->
DELETE_FLAG, <!-- 是否删除0:否1.是 -->
CREATED_BY, <!-- 创建人 -->
......@@ -196,7 +270,7 @@
UPDATED_TIME, <!-- 修改人名称 -->
UPDATED_NAME <!-- 修改时间 -->
)
VALUES (#id#, #companyCode#, #depCode#, #registerDate#, #factoryCode#, #groupCode#, #userId#, #groupType#, #prdtCode#, #prdtName#, #weight#, #remark#, #deleteFlag#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedTime#, #updatedName#)
VALUES (#id#, #companyCode#, #depCode#, #registerDate#, #factoryCode#, #groupCode#, #userId#, #groupType#, #prdtCode#, #prdtName#, #weight#, #weightJh#, #remark#, #deleteFlag#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedTime#, #updatedName#)
</insert>
<delete id="delete">
......@@ -226,6 +300,16 @@
</isNotEmpty>
</update>
<update id="deleteRemark">
UPDATE ${hpjxSchema}.T_HPXS001
SET
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_TIME = #updatedTime#, <!-- 修改人名称 -->
UPDATED_NAME = #updatedName# <!-- 修改时间 -->
WHERE REMARK = #remark#
</update>
<update id="update">
UPDATE ${hpjxSchema}.T_HPXS001
SET
......@@ -239,6 +323,7 @@
PRDT_CODE = #prdtCode#, <!-- 产品代码 -->
PRDT_NAME = #prdtName#, <!-- 产品名称 -->
WEIGHT = #weight#, <!-- 产量 -->
WEIGHT_JH = #weightJh#,
REMARK = #remark#, <!-- 备注 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
......@@ -450,7 +535,18 @@
CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
<select id="queryMaxDate" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
MAX(REGISTER_DATE) as "registerDate" <!-- 最新登记日期 -->
FROM ${hpjxSchema}.T_HPXS001
WHERE 1=1 AND DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<!-- <isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>-->
</select>
</sqlMap>
......@@ -943,6 +943,9 @@ public class HPSCTools {
Map queryMap = new HashMap();
queryMap.put("id", id);
List<HPSC006> results = DaoBase.getInstance().query(HPSC006.QUERY, queryMap);
if(results!=null&&results.size()==0){
results = null;
}
AssertUtils.isNull(results, String.format("生产下料ID[%s]信息不存在", id));
return results.get(0);
}
......
......@@ -39,7 +39,7 @@ public class HPZL001A extends DaoEPBase {
public static final String COL_ID = "ID"; /* 主键ID*/
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码 预留*/
public static final String COL_DEPT_CODE = "DEPT_CODE"; /* 部门编码 预留*/
public static final String COL_DOC_TYPE = "DOC_TYPE"; /* 附件类型*/
public static final String COL_CHECK_ID = "CHECK_ID"; /* 质量巡检单ID*/
public static final String COL_DOC_ID = "DOC_ID"; /* 文件ID*/
......
......@@ -60,7 +60,15 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
public static String date() {
return date(null);
}
/**
* 获取前一天日期字符串(yyyy-MM-dd)
*
* @return
*/
public static String yesterday() {
return LocalDate.now().minusDays(1).format(DATE);
}
/**
* 获取日期字符串(yyyy-MM-dd)
*
......
package com.baosight.iplat4j.core.license;
import com.baosight.iplat4j.core.log.Logger;
import com.baosight.iplat4j.core.log.LoggerFactory;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.Arrays;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Set;
/**
* 重写许可证校验类,无正式许可证的情况不做校验
*
* @author:songx
* @date:2023/6/28,16:00
*/
public class LicenseStub {
private static final int CHECK_INTERVAL = 86400000;
public static String ERROR;
public static boolean OK = false;
public static String AUTHORIZED_ENTERPRISE = null;
private static Logger LOG = LoggerFactory.getLogger(LicenseStub.class);
private static String LICENSE_FILE = "license.xml";
private static String LICENSE_FILE_PATH = null;
private static boolean flag = false;
private static LicenseManager LICENSE;
private static long lastCheckTime = 0L;
public LicenseStub() {
}
public static synchronized void init() {
File f = new File(LICENSE_FILE_PATH);
if (!f.exists()) {
ERROR = "许可证文件[" + LICENSE_FILE_PATH + "]不存在!";
LOG.error(ERROR);
}
LICENSE = LicenseManager.getInstance(LICENSE_FILE_PATH);
}
public static String[] getLicenseInfo() {
String[] info = new String[2];
if (checkLicense() && LICENSE != null) {
info[0] = "0";
info[1] = "许可证文件: " + LICENSE_FILE_PATH + "\n" + LICENSE.getAllInfo();
} else {
info[0] = "1";
info[1] = "许可证文件: " + LICENSE_FILE_PATH + "\n" + (ERROR == null ? "" : ERROR);
}
return info;
}
public static String[] checkLicense2() {
// 无需校验许可证 modify by songx at 20230628
return new String[]{"true", "", "9999999", "true"};
}
public static boolean checkLicense() {
String[] ret = checkLicense2();
return "true".equals(ret[0]);
}
public static void setLicenseDir(String dir) {
if (LICENSE_FILE_PATH == null) {
LOG.info("[LICENSE] check environment <PLAT_LICENSE>...");
String platLicense = System.getenv("PLAT_LICENSE");
if (platLicense != null) {
LOG.info("[LICENSE] environment <PLAT_LICENSE> defined as <" + platLicense + ">.");
File f = new File(platLicense);
if (f.isFile()) {
LICENSE_FILE_PATH = platLicense;
LOG.info("[LICENSE] use <" + LICENSE_FILE_PATH + ">.");
return;
}
LOG.info("[LICENSE] file <" + LICENSE_FILE_PATH + "> not exist.");
} else {
LOG.info("[LICENSE] environment <PLAT_LICENSE> not defined.");
}
LICENSE_FILE_PATH = dir + File.separator + "license" + File.separator + LICENSE_FILE;
LOG.info("[LICENSE] use <" + LICENSE_FILE_PATH + "> instead.");
}
}
private static void setError(String msg) {
OK = false;
ERROR = msg;
LOG.error("[LICENSE] " + msg);
LOG.error(msg);
}
static String checkMac(String macInLicense) {
if (macInLicense != null && macInLicense.trim().length() != 0) {
String[] macs = macInLicense.trim().split("(,|;|\\s)");
Set<String> hostMacs = getHostMac();
if (hostMacs == null) {
return "许可证验证失败,请在Java6或者以上环境运行!";
} else {
String[] var3 = macs;
int var4 = macs.length;
for (int var5 = 0; var5 < var4; ++var5) {
String mac = var3[var5];
String nmac = mac.replaceAll("(:|-)", ":").toUpperCase();
if (hostMacs.contains(nmac)) {
return null;
}
}
StringBuilder sb = new StringBuilder();
sb.append("许可的MAC地址不符:");
sb.append(Arrays.toString(macs));
sb.append("; ");
sb.append("本机MAC地址:");
sb.append(hostMacs);
return sb.toString();
}
} else {
return null;
}
}
private static Set<String> getHostMac() {
Enumeration interfaces = null;
try {
interfaces = NetworkInterface.getNetworkInterfaces();
} catch (SocketException var14) {
LOG.error(var14.getMessage(), var14);
return Collections.EMPTY_SET;
}
HashSet macs = new HashSet();
while (interfaces.hasMoreElements()) {
NetworkInterface ni = (NetworkInterface) interfaces.nextElement();
Object var3 = null;
byte[] address;
try {
Method getHardwareAddress = ni.getClass().getDeclaredMethod("getHardwareAddress", (Class[]) null);
address = (byte[]) ((byte[]) getHardwareAddress.invoke(ni, (Object[]) null));
} catch (NoSuchMethodException var9) {
LOG.error(var9.getMessage(), var9);
return null;
} catch (SecurityException var10) {
LOG.error(var10.getMessage(), var10);
return null;
} catch (IllegalAccessException var11) {
LOG.error(var11.getMessage(), var11);
return null;
} catch (IllegalArgumentException var12) {
LOG.error(var12.getMessage(), var12);
return null;
} catch (InvocationTargetException var13) {
LOG.error(var13.getMessage(), var13);
return null;
}
if (address != null && address.length != 0) {
StringBuilder sb = new StringBuilder(18);
byte[] var5 = address;
int var6 = address.length;
for (int var7 = 0; var7 < var6; ++var7) {
byte b = var5[var7];
if (sb.length() > 0) {
sb.append(':');
}
sb.append(String.format("%02x", b).toUpperCase());
}
String mac = sb.toString().trim();
if (mac.length() > 0) {
LOG.info("[LICENSE] local MAC: " + mac);
macs.add(mac);
}
}
}
return macs;
}
}
......@@ -33,10 +33,11 @@ customerName=\u6B66\u6C49\u5B9D\u4FE1\u5927\u6570\u636E\u4E8B\u4E1A\u90E8
enterpriseName=\u6B66\u6C49\u5B9D\u4FE1\u5927\u6570\u636E\u4E8B\u4E1A\u90E8
datasource.type=dbcp
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://127.0.0.1:3306/iplat?useSSL=false&useUnicode=true&characterEncoding=utf-8
#jdbc.url=jdbc:mysql://10.135.13.5:30005/iplat?useSSL=false&useUnicode=true&characterEncoding=utf-8
jdbc.username=root
jdbc.password=123456
#jdbc.url=jdbc:mysql://127.0.0.1:3306/iplat?useSSL=false&useUnicode=true&characterEncoding=utf-8
jdbc.url=jdbc:mysql://10.135.13.5:30005/iplat?useSSL=false&useUnicode=true&characterEncoding=utf-8
jdbc.username=dbprod32
jdbc.password=t9UrgcELp=
#jdbc.password=123456
jdbc.maxActive=20
jdbc.validationQuery=SELECT 1 FROM ${platSchema}.TEDFA00
......
......@@ -26,11 +26,12 @@ org.quartz.jobStore.isClustered = true
#\uFFFD\u02F4\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u077F\uFFFD\u05BE\u00FB\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u077F\uFFFD\uFFFD\uFFFD\u0635\uFFFD\uFFFD\uFFFD\u03E2
org.quartz.jobStore.clusterCheckinInterval = 20000
org.quartz.dataSource.appDS.driver = com.mysql.jdbc.Driver
#org.quartz.dataSource.appDS.URL = jdbc:mysql://10.24.1.94:3306/iplat?useSSL=false&useUnicode=true&characterEncoding=utf-8
org.quartz.dataSource.appDS.URL = jdbc:mysql://127.0.0.1:3306/iplat?useSSL=false&useUnicode=true&characterEncoding=utf-8
org.quartz.dataSource.appDS.URL = jdbc:mysql://10.135.13.5:30005/iplat?useSSL=false&useUnicode=true&characterEncoding=utf-8
#org.quartz.dataSource.appDS.URL = jdbc:mysql://127.0.0.1:3306/iplat?useSSL=false&useUnicode=true&characterEncoding=utf-8
org.quartz.dataSource.appDS.user = root
org.quartz.dataSource.appDS.password =123456
org.quartz.dataSource.appDS.user = dbprod32
#org.quartz.dataSource.appDS.password =root
org.quartz.dataSource.appDS.password =t9UrgcELp=
org.quartz.dataSource.appDS.maxConnections = 30
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u05B1\uFFFD\uFFFD\uFFFD\uFFFD\u05BE\uFFFD\uFFFD\u00BC\uFFFD\uFFFD\uFFFD
......
......@@ -184,6 +184,8 @@ $(function() {
// 保存
$("#BTN_SAVE").on("click", save);
downKeyUp();
});
/**
......
......@@ -15,6 +15,7 @@ $(function () {
// 选择
$("#BTN_SELECT").on("click", select);
downKeyUp();
});
/**
......
......@@ -65,7 +65,7 @@
<EF:EFColumn ename="amount" cname="库存数量" enable="false" width="120" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="unitWeight" cname="单量(KG)" enable="false" width="170" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="库存重量(KG)" enable="false" width="170" align="right" format="{0:N3}"
<EF:EFColumn ename="weight" cname="库存重量(T)" enable="false" width="170" align="right" format="{0:N3}"
sumType="all"/>
</EF:EFGrid>
</EF:EFRegion>
......
......@@ -51,7 +51,7 @@
<EF:EFColumn ename="amount" cname="库存数量" enable="false" width="120" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="unitWeight" cname="单量(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="库存重量(KG)" enable="false" width="120" align="right" format="{0:N3}"
<EF:EFColumn ename="weight" cname="库存重量(T)" enable="false" width="120" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150" type="hidden"/>
</EF:EFGrid>
......
......@@ -38,7 +38,7 @@ $(function () {
// 选择
$("#BTN_SELECT").on("click", select);
downKeyUp();
});
/**
......
......@@ -61,7 +61,7 @@
<EF:EFColumn ename="amount" cname="数量" enable="false" width="100" align="right" format="{0:N0}"/>
<EF:EFColumn ename="unitWeight" cname="单重(KG)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="总重(T)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFComboColumn ename="isPrint" cname="是否打印" width="80" align="center">
<EF:EFComboColumn ename="isPrint" cname="是否制单" width="80" align="center">
<EF:EFCodeOption codeName="hpjx.hpjx.isPrint"/>
</EF:EFComboColumn>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="100" align="center" />
......
......@@ -2,7 +2,13 @@ $(function () {
IPLATUI.EFGrid = {
"result": {
columns: [],
dataBound: function () {
dataBound: function (e) {
$.each(e.sender.getDataItems(),function(index,item){
let currentDate = getCurrentDate();
if(currentDate>item.deliveryDate){
$('tr[data-uid='+item.uid+']').css({'color':'red'});
}
})
}
}
};
......@@ -14,7 +20,7 @@ $(function () {
// 选择
$("#BTN_SELECT").on("click", select);
downKeyUp();
});
/**
......@@ -67,3 +73,12 @@ let select = function () {
});
}
function getCurrentDate() {
const now = new Date();
const year = now.getFullYear();
const month = (now.getMonth() + 1).toString().padStart(2, '0');
const day = now.getDate().toString().padStart(2, '0');
return year.toString() + month + day;
}
......@@ -34,13 +34,18 @@
<EF:EFColumn ename="applyAmount" cname="申请数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFColumn ename="applyRemark" cname="申请说明" width="150" editType="textarea" copy="true"/>
<EF:EFColumn ename="amount" cname="库存数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="weight" cname="库存重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="库存重量(T)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150" hidden="true"/>
<EF:EFColumn ename="whCode" cname="仓库编码" enable="false" width="140" align="center" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目号" enable="false" width="140" align="center" hidden="true"/>
<EF:EFColumn ename="inventCode" cname="部件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="subInventCode" cname="零件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="prodNo" cname="生产订单号" enable="false" width="140" align="center" hidden="true"/>
<EF:EFColumn ename="deliveryDate" cname="交货日期" width="90" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="true"/>
</EF:EFGrid>
</EF:EFRegion>
<EF:EFRegion title="提示">
<span style="color: red">说明:红色数据是未按销售交货日期出库的数据。</span>
</EF:EFRegion>
</EF:EFPage>
......@@ -15,7 +15,7 @@ $(function () {
// 选择
$("#BTN_SELECT").on("click", select);
downKeyUp();
});
/**
......
......@@ -58,7 +58,7 @@
<EF:EFColumn ename="amount" cname="库存数量" enable="false" width="120" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="unitWeight" cname="单量(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="库存重量(KG)" enable="false" width="120" align="right" format="{0:N3}"
<EF:EFColumn ename="weight" cname="库存重量(T)" enable="false" width="120" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150" hidden="true"/>
</EF:EFGrid>
......
......@@ -56,15 +56,15 @@
<EF:EFColumn ename="inventRecordId" cname="规格" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="bookAmount" cname="账面数量" format="{0:N0}" maxLength="20" width="90" align="right"
sumType="all" required="true" readonly="true"/>
<EF:EFColumn ename="bookWeight" cname="账面重量(KG)" enable="false" format="{0:N3}" maxLength="20" width="90"
<EF:EFColumn ename="bookWeight" cname="账面重量(T)" enable="false" format="{0:N3}" maxLength="20" width="90"
align="right" sumType="all"/>
<EF:EFColumn ename="entityAmount" cname="实物数量" format="{0:N0}" maxLength="20" width="100" align="right"
sumType="all" required="true" readonly="true"/>
<EF:EFColumn ename="entityWeight" cname="实物重量(KG)" enable="false" format="{0:N3}" maxLength="20" width="120"
<EF:EFColumn ename="entityWeight" cname="实物重量(T)" enable="false" format="{0:N3}" maxLength="20" width="120"
align="right" sumType="all"/>
<EF:EFColumn ename="diffAmount" cname="差异数量" enable="false" format="{0:N0}" maxLength="20" width="100"
align="right" sumType="all" readonly="true"/>
<EF:EFColumn ename="diffWeight" cname="差异重量(KG)" enable="false" format="{0:N3}" maxLength="20" width="120"
<EF:EFColumn ename="diffWeight" cname="差异重量(T)" enable="false" format="{0:N3}" maxLength="20" width="120"
align="right" sumType="all" readonly="true"/>
<EF:EFColumn ename="remark" cname="备注" width="150" readonly="true"/>
<EF:EFColumn ename="oldCheckNo" cname="原盘点单号" enable="false" width="140" align="center"/>
......
......@@ -14,7 +14,7 @@ $(function () {
// 选择
$("#BTN_SELECT").on("click", select);
downKeyUp();
});
/**
......
......@@ -50,7 +50,8 @@ $(function() {
for (let i = 0; i < inventNameGlobalData.length; i++) {
if (inventNameGlobalData[i]['textField'] === dataItem['inventName']) {
dataItem['inventCode'] = inventNameGlobalData[i]['valueField']
return inventNameGlobalData[i]['textField'];
dataItem['inventRecordId'] = inventNameGlobalData[i]['param9Field']
return inventNameGlobalData[i]['param1Field'];
} else {
dataItem['inventCode'] = '';
}
......@@ -63,9 +64,9 @@ $(function() {
inInfo.set("inqu_status-0-inventTypes", [1, 2, 5]);
inInfo.set("inqu_status-0-inventType", options.model["inventType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HPPZ004");
inInfo.set("serviceName", "HPPZ006");
inInfo.set("methodName", "queryComboBox");
inInfo.set("blockId", "invent_name_block_id");
inInfo.set("blockId", "invent_spec_all_block_id");
inInfo.set("field", options.field);
refreshInputSelect(container, inInfo);
}
......@@ -120,6 +121,43 @@ $(function() {
}
}],
loadComplete: function (grid) {
// 此grid对象
grid.dataSource.bind("change", function(e) {
if (e.field == "inventName") {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
for (let i = 0; i < inventNameGlobalData.length; i++) {
if (inventNameGlobalData[i]['textField'] === item.inventName) {
resultGrid.setCellValue(item, 'inventName', inventNameGlobalData[i]['param1Field']);
resultGrid.setCellValue(item, 'spec', inventNameGlobalData[i]['param2Field']);
resultGrid.setCellValue(item, 'material', inventNameGlobalData[i]['param3Field']);
resultGrid.setCellValue(item, 'unit', inventNameGlobalData[i]['param4Field']);
resultGrid.setCellValue(item, 'length', inventNameGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, 'width', inventNameGlobalData[i]['param6Field']);
resultGrid.setCellValue(item, 'thick', inventNameGlobalData[i]['param7Field']);
resultGrid.setCellValue(item, 'coefficient', inventNameGlobalData[i]['param8Field']);
resultGrid.refresh();
}
}
}
if (e.field == "spec") {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['textField'] === item.spec) {
resultGrid.setCellValue(item, 'material', inventAllGlobalData[i]['param1Field']);
resultGrid.setCellValue(item, 'unit', inventAllGlobalData[i]['param2Field']);
resultGrid.setCellValue(item, 'length', inventAllGlobalData[i]['param3Field']);
resultGrid.setCellValue(item, 'width', inventAllGlobalData[i]['param4Field']);
resultGrid.setCellValue(item, 'thick', inventAllGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, 'coefficient', inventAllGlobalData[i]['param6Field']);
resultGrid.refresh();
}
}
}
});
},
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
......@@ -127,7 +165,7 @@ $(function() {
save();
},
afterEdit: function (e) {
if (e.field == "spec") {
/* if (e.field == "spec") {
var tr,index;
// 获取此model元素信息
var item = e.model;
......@@ -142,7 +180,7 @@ $(function() {
resultGrid.refresh();
}
}
}
}*/
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
......@@ -158,6 +196,8 @@ $(function() {
// 保存
$("#BTN_SAVE").on("click", save);
downKeyUp();
});
/**
......@@ -199,9 +239,9 @@ let initInvent = function () {
// 1.原料,2.耗材,5.废料
inInfo.set("inqu_status-0-inventTypes", [1, 2, 5]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HPPZ004", "queryComboBox", inInfo, {
EiCommunicator.send("HPPZ006", "queryComboBox", inInfo, {
onSuccess: function (ei) {
inventNameGlobalData = ei.getBlock("invent_name_block_id").getMappedRows();
inventNameGlobalData = ei.getBlock("invent_spec_all_block_id").getMappedRows();
},
onFail: function (ei) {
}
......
......@@ -62,7 +62,7 @@
</EF:EFComboColumn>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventCode" cname="存货编码" hidden="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="150" align="center" required="true" 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="amount" cname="数量" format="{0:N0}" maxLength="20" width="100" align="right"
......
......@@ -14,7 +14,7 @@ $(function () {
// 选择
$("#BTN_SELECT").on("click", select);
downKeyUp();
});
/**
......
......@@ -59,7 +59,7 @@
<EF:EFColumn ename="applyRemark" cname="申请说明" width="150" editType="textarea" copy="true"/>
<EF:EFColumn ename="amount" cname="库存数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="unitWeight" cname="单重(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="库存重量(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="库存重量(T)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
</EF:EFGrid>
</EF:EFRegion>
......
......@@ -52,39 +52,39 @@
</EF:EFComboColumn>
<EF:EFColumn ename="initAmount" cname="期初数量" enable="false" width="100" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="initWeight" cname="期初重量(KG)" enable="false" width="100" align="right" format="{0:N3}"
<EF:EFColumn ename="initWeight" cname="期初重量(T)" enable="false" width="100" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="cgEnterAmount" cname="采购入库数量" enable="false" width="100" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="cgEnterWeight" cname="采购入库重量(KG)" enable="false" width="100" align="right" format="{0:N3}"
<EF:EFColumn ename="cgEnterWeight" cname="采购入库重量(T)" enable="false" width="100" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="qtEnterAmount" cname="其它入库数量" enable="false" width="90" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="qtEnterWeight" cname="其它入库重量(KG)" enable="false" width="90" align="right" format="{0:N3}"
<EF:EFColumn ename="qtEnterWeight" cname="其它入库重量(T)" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="enterAmount" cname="入库数量" enable="false" width="90" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="enterWeight" cname="入库重量(KG)" enable="false" width="90" align="right" format="{0:N3}"
<EF:EFColumn ename="enterWeight" cname="入库重量(T)" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="scOuterAmount" cname="生产领料数量" enable="false" width="90" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="scOuterWeight" cname="生产领料重量(KG)" enable="false" width="90" align="right" format="{0:N3}"
<EF:EFColumn ename="scOuterWeight" cname="生产领料重量(T)" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="qtOuterAmount" cname="其它出库数量" enable="false" width="90" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="qtOuterWeight" cname="其它出库重量(KG)" enable="false" width="90" align="right" format="{0:N3}"
<EF:EFColumn ename="qtOuterWeight" cname="其它出库重量(T)" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="outerAmount" cname="出库数量" enable="false" width="90" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="outerWeight" cname="出库重量(KG)" enable="false" width="90" align="right" format="{0:N3}"
<EF:EFColumn ename="outerWeight" cname="出库重量(T)" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="pdDiffAmount" cname="盘点差异数量" enable="false" width="90" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="pdDiffWeight" cname="盘点差异重量(KG)" enable="false" width="90" align="right" format="{0:N3}"
<EF:EFColumn ename="pdDiffWeight" cname="盘点差异重量(T)" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="endAmount" cname="期末数量" enable="false" width="90" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="endWeight" cname="期末重量(KG)" enable="false" width="90" align="right" format="{0:N3}"
<EF:EFColumn ename="endWeight" cname="期末重量(T)" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
</EF:EFGrid>
</EF:EFRegion>
......
......@@ -57,7 +57,7 @@
<EF:EFColumn ename="unit" cname="单位" enable="false" width="120" align="center"/>
<EF:EFColumn ename="warnNum" cname="预警值" enable="false" width="90" align="right" format="{0:N0}"/>
<EF:EFColumn ename="amount" cname="库存数量" enable="false" width="90" align="right" format="{0:N0}"/>
<EF:EFColumn ename="weight" cname="库存重量(KG)" enable="false" width="90" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="库存重量(T)" enable="false" width="90" align="right" format="{0:N3}"/>
<EF:EFComboColumn ename="princ" cname="仓库负责人" width="120" align="center" enable="false"
blockName="user_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#"
......
......@@ -36,7 +36,7 @@ $(function() {
deleteFunc();
}
}
downKeyUp();
});
/**
......
......@@ -36,7 +36,7 @@ $(function() {
deleteFunc();
}
}
downKeyUp();
});
/**
......
......@@ -36,7 +36,7 @@ $(function() {
deleteFunc();
}
}
downKeyUp();
});
/**
......
......@@ -76,7 +76,7 @@ $(function() {
deleteFunc();
}
}
downKeyUp();
});
/**
......
......@@ -36,7 +36,7 @@ $(function() {
deleteFunc();
}
}
downKeyUp();
});
/**
......
......@@ -49,7 +49,7 @@ $(function () {
// 用工登记
$("#CHECK_IN").on("click", checkIn);
downKeyUp();
});
/**
......
......@@ -15,7 +15,7 @@ $(function () {
// 查询
$("#QUERY").on("click", query);
downKeyUp();
});
/**
......
var prdtNameGlobalData = [];
var resultRows = [];
var princ2Data = [];
$(function () {
$("#QUERY").on("click", function () {
......@@ -11,7 +12,8 @@ $(function () {
return false;
});
princ2Data = __eiInfo.getBlock("customer_record_block_id").getMappedRows();
var gridContainer=$("#ef_grid_result").data("kendoGrid");
IPLATUI.EFGrid= {
"result": {
......@@ -37,13 +39,62 @@ $(function () {
// }
return template;
}
},
{
field: "princ2Name",
title: "客户负责人",
/*query: function (container, options) {
let eiInfo = new EiInfo();
eiInfo.set("inqu_status-0-inventTypes", [3, 4]);
eiInfo.set("inqu_status-0-inventType", options.model["prdtType"]);
return eiInfo;
}*/
template: function (dataItem) {
for (let i = 0; i < princ2Data.length; i++) {
if (princ2Data[i]['textField'] === dataItem['princ2Name']) {
//resultGrid.setCellValue(0, "princ2", princ2Data[i]['valueField']);
dataItem["princ2"] = princ2Data[i]['valueField'];
return princ2Data[i]['textField'];
}else if (!dataItem['princ2Name'] && princ2Data[i]['valueField'] === dataItem['princ2']){
return princ2Data[i]['textField'];
}
}
return dataItem["princ2Name"];
},
editor: function (container, options) {
var grid = container.closest(".k-grid").data("kendoGrid");
gridContainer = grid;
var cellIndex = grid.cellIndex(container);
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
input.kendoAutoComplete({
valuePrimitive: true,
dataSource: __eiInfo.getBlock("customer_record_block_id").getMappedRows(),
dataTextField: "textField",
dataValueField: "valueField",
required: "true",
optionLabelTemplate: "#:textField#",
valueTemplate: "#:valueField#",
template: "#:textField#",
filter: "contains"
});
},
/*afterEdit: function (e) {
for (let i = 0; i < princ2Data.length; i++) {
if (princ2Data[i]['valueField'] === dataItem['princ2']) {
//resultGrid.setCellValue(0, "princ2", princ2Data[i]['valueField']);
e.model["princ2"]= princ2Data[i]['valueField'];
}
}
}*/
}
],
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
saveFunc();
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
......@@ -51,8 +102,7 @@ $(function () {
deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save'
|| e.eiInfo.extAttr.methodName == 'delete') {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
......@@ -79,7 +129,7 @@ $(function () {
info.set("inqu_status-0-lv", 2);
queryDetail(info);
}
},
}
},
"detail":{
/*toolbarConfig: {
......@@ -210,6 +260,14 @@ $(function () {
]
}
}
window.document.addEventListener("keyup",function (event) {
if(event.keyCode === 13){
var grid = $("#ef_grid_result").data("kendoGrid");
// 回填
//grid.addRows(returnRows);
grid.closeCell();
}
})
});
function check(id, auditStatus) {
......@@ -246,7 +304,7 @@ function check(id, auditStatus) {
let projType= item.get("projType");
let projName= item.get("projName");
let princ1= item.get("princ1");
let princ2= item.get("princ2");
//let princ2= item.get("princ2");
if(isBlank(projType)){
message("选中的第"+(index+1)+"行\"项目类型\",不能为空!");
flag = false;
......@@ -262,16 +320,43 @@ function check(id, auditStatus) {
flag = false;
return false;
}
if(isBlank(princ2)){
/*if(isBlank(princ2)){
message("选中的第"+(index+1)+"行\"客户负责人\",不能为空!");
flag = false;
return false;
}
}*/
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPSC001", "save", true);
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HPSC001", "save", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
princ2Data =ei.getBlock("customer_record_block_id").getMappedRows();
//queryCustCode();
resultGrid.setEiInfo(ei);
} catch (e) {
// TODO: handle exception
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
//JSUtils.submitGridsData("result", "HPSC001", "save", true);
}
});
}
......@@ -437,4 +522,20 @@ function showUploadFile(id) {
width: "80%",
height: "80%",
});
}
/**
* 查询客户
*/
function queryCustCode() {
let eiInfo = new EiInfo();
var dataSource;
EiCommunicator.send("HPPZ003", "queryCustCode", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("customer_record_block_id").getMappedRows();
princ2Data = dataSource;
},
onFail: function (ei) {
}
}, {async: false});
}
\ No newline at end of file
......@@ -50,11 +50,13 @@
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="true"
filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="princ2" cname="客户负责人" width="120" align="center" required="true"
<EF:EFColumn ename="princ2" cname="客户负责人" width="120" align="center" maxLength="50" hidden="true"/>
<EF:EFColumn ename="princ2Name" cname="客户负责人" width="120" align="center" maxLength="50" required="true"/>
<%--<EF:EFComboColumn ename="princ2" cname="客户负责人" width="120" align="center" required="true"
blockName="customer_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="true"
filter="contains">
</EF:EFComboColumn>
</EF:EFComboColumn>--%>
<EF:EFColumn ename="deliveryDate" cname="交货日期" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="100" align="center">
......@@ -82,15 +84,15 @@
</EF:EFComboColumn>
<EF:EFColumn ename="prdtCode" cname="部件编码" hidden='true'/>
<EF:EFColumn ename="prdtName" cname="部件名称" width="140" align="center" maxLength="50" required="true"/>
<EF:EFColumn ename="length" cname="长(MM)" width="80" format="{0:N3}" maxLength="12" displayType="0.000"
<EF:EFColumn ename="length" cname="长(MM)" width="80" format="{0:N0}" maxLength="12" displayType="0.000"
data-regex="/^-?[0-9]{1,9}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置9位整数和3位小数!"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="80" format="{0:N3}" maxLength="12" displayType="0.000"
data-errorprompt="请输入数字,该值最大可设置9位整数!"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="80" format="{0:N0}" maxLength="12" displayType="0.000"
data-regex="/^-?[0-9]{1,9}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置9位整数和3位小数!"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="80" format="{0:N3}" maxLength="12" displayType="0.000"
data-errorprompt="请输入数字,该值最大可设置9位整数!"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="80" format="{0:N0}" maxLength="12" displayType="0.000"
data-regex="/^-?[0-9]{1,9}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置9位整数和3位小数!"/>
data-errorprompt="请输入数字,该值最大可设置9位整数!"/>
<EF:EFColumn ename="deliveryDate" cname="交货日期" width="100" editType="date" required='true' align="center"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="num" cname="数量" maxLength="15" displayType="0.000" format="{0:N0}" required="true"
......
......@@ -388,7 +388,8 @@ $(function () {
href: "HPSC097?methodName=initLoad&inqu_status-0-id=route_001&inqu_status-0-parentId="
+ nodeId + "&inqu_status-0-projCode=" + projCode + "&inqu_status-0-projName="
+ projName + "&inqu_status-0-parentPrdtName=" + parentPrdtName
+ "&inqu_status-0-deliveryDate=" + deliveryDate,
+ "&inqu_status-0-deliveryDate=" + deliveryDate
+ "&inqu_status-0-lv=" + lv,
title: "<div style='text-align: center;'>导入</div>",
width: "60%",
height: "50%",
......@@ -396,7 +397,7 @@ $(function () {
// 刷新列表
resultGrid.dataSource.page(1);
// 刷新树
updateTree();
refreshTree();
// 关闭弹窗
JSColorbox.close();
}
......@@ -599,6 +600,7 @@ $(function () {
}
}, {async: false});
});
downKeyUp();
});
$(window).load(function () {
......
......@@ -55,23 +55,23 @@
<EF:EFColumn ename="prdtCode" cname="部件编码" hidden='true'/>
<EF:EFColumn ename="prdtName" cname="部件名称" width="140" align="center" maxLength="50"
required="true"/>
<EF:EFColumn ename="length" cname="长(MM)" width="80" format="{0:N3}" maxLength="12" displayType="0.000"
data-regex="/^-?[0-9]{1,9}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置9位整数和3位小数!"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="80" format="{0:N3}" maxLength="12" displayType="0.000"
data-regex="/^-?[0-9]{1,9}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置9位整数和3位小数!"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="80" format="{0:N3}" maxLength="12" displayType="0.000"
data-regex="/^-?[0-9]{1,9}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置9位整数和3位小数!"/>
<EF:EFColumn ename="length" cname="长/φ(MM)" width="80" format="{0:N0}" maxLength="12" displayType="0"
data-regex="/^-?[0-9]{1,9}$/"
data-errorprompt="请输入数字,该值最大可设置9位整数!"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="80" format="{0:N0}" maxLength="12" displayType="0"
data-regex="/^-?[0-9]{1,9}$/"
data-errorprompt="请输入数字,该值最大可设置9位整数!"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="80" format="{0:N0}" maxLength="12" displayType="0"
data-regex="/^-?[0-9]{1,9}$/"
data-errorprompt="请输入数字,该值最大可设置9位整数!"/>
<EF:EFColumn enable="false" ename="parentId" hidden="true" cname="上级部件名称"/>
<EF:EFColumn enable="false" ename="parentPrdtName" hidden="true" cname="上级部件名称"/>
<EF:EFColumn ename="num" cname="数量" maxLength="15" displayType="0.000" format="{0:N0}"
data-regex="/^-?[0-9]{1,12}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置12位整数和3位小数!"/>
<EF:EFColumn ename="unitWt" format="{0:N3}" cname="单重(KG)" maxLength="15" displayType="0.000"
data-regex="/^-?[0-9]{1,12}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置12位整数和3位小数!"/>
<EF:EFColumn ename="unitWt" format="{0:N1}" cname="单重(KG)" maxLength="15" displayType="0.0"
data-regex="/^-?[0-9]{1,12}([.][0-9])?$/"
data-errorprompt="请输入数字,该值最大可设置12位整数和1位小数!"/>
<EF:EFColumn ename="totalWt" cname="总重(T)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFComboColumn enable="false" ename="status" align="center"
columnTemplate="#=textField#" optionLabel=" "
......
......@@ -142,6 +142,7 @@ $(function () {
}
}, {async: false});
});
downKeyUp();
});
function showUploadFile(id) {
......
......@@ -36,3 +36,4 @@
<EF:EFButton ename="confirm" cname="确认" type="button" class="btn-align-right"/>
</div>
</EF:EFPage>
......@@ -62,7 +62,7 @@ $(function () {
}
$("#QUERY").on("click", query);
downKeyUp();
});
/**
......
......@@ -355,6 +355,7 @@ $(function () {
var href = ctx + "\\HP\\template\\SC\\HPSC006_生产下料.xls";
window.location.href = href;
});
downKeyUp();
});
query = function () {
resultGrid.dataSource.page(1);
......
......@@ -68,23 +68,23 @@
valueField="textField" textField="textField"/>--%>
<EF:EFColumn ename="inventName" cname="材料名称" width="200" align="center" required="true" maxLength="50"/>
<EF:EFColumn ename="inventCode" enable="false" cname="材料编码" hidden="true"/>
<EF:EFColumn ename="inventLength" width="80" cname="长(MM)" format="{0:N3}" maxLength="12" displayType="0.000"
<EF:EFColumn ename="inventLength" width="80" cname="长/φ(MM)" format="{0:N0}" maxLength="12" displayType="0"
data-regex="/^-?[0-9]{1,9}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置9位整数和3位小数!"/>
<EF:EFColumn ename="inventWidth" width="80" cname="宽(MM)" format="{0:N3}" maxLength="12" displayType="0.000"
data-errorprompt="请输入数字,该值最大可设置9位整数!"/>
<EF:EFColumn ename="inventWidth" width="80" cname="宽(MM)" format="{0:N0}" maxLength="12" displayType="0"
data-regex="/^-?[0-9]{1,9}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置9位整数和3位小数!"/>
<EF:EFColumn ename="inventThick" width="80" cname="厚(MM)" format="{0:N3}" maxLength="12" displayType="0.000"
data-errorprompt="请输入数字,该值最大可设置9位整数!"/>
<EF:EFColumn ename="inventThick" width="80" cname="厚(MM)" format="{0:N0}" maxLength="12" displayType="0"
data-regex="/^-?[0-9]{1,9}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置9位整数和3位小数!"/>
data-errorprompt="请输入数字,该值最大可设置9位整数!"/>
<EF:EFColumn ename="material" width="80" cname="材质" />
<EF:EFColumn ename="remark" cname="备注" />
<EF:EFColumn ename="num" width="80" cname="数量" maxLength="12" displayType="0.000"
data-regex="/^-?[0-9]{1,9}$/"
data-errorprompt="请输入数字,该值最大可设置9位整数!"/>
<EF:EFColumn ename="unitWt" format="{0:N3}" width="80" cname="单重(KG)" maxLength="12" displayType="0.000"
<EF:EFColumn ename="unitWt" format="{0:N1}" width="80" cname="单重(KG)" maxLength="12" displayType="0.0"
data-regex="/^-?[0-9]{1,9}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置9位整数和3位小数!"/>
data-errorprompt="请输入数字,该值最大可设置9位整数和1位小数!"/>
<EF:EFColumn enable="false" format="{0:N3}" ename="totalWt" width="80" maxLength="12" displayType="0.000" cname="总重(T)"/>
<EF:EFColumn ename="planCompletionDate" required='true' cname="计划完成时间" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" width="120"/>
......
......@@ -66,7 +66,7 @@
align="right"/>
<EF:EFColumn ename="unitWeight" cname="单重(KG)" enable="false" format="{0:N3}" maxLength="20" width="100"
align="right"/>
<EF:EFColumn ename="weight" cname="重量(KG)" enable="false" format="{0:N3}" maxLength="20" width="100"
<EF:EFColumn ename="weight" cname="重量(T)" enable="false" format="{0:N3}" maxLength="20" width="100"
align="right"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="100" align="center"/>
<EF:EFColumn ename="oldReqNo" cname="原领料单号" enable="false" width="140" align="center"/>
......
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/4/3
Time: 14:04
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="factoryCode" blockId="inqu_status" row="0" colWidth="3"
filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDateSpan startCname="登记日期" endCname="至" blockId="inqu_status"
startName="createdDateFrom" endName="createdDateTo" row="0" role="date"
format="yyyy-MM-dd" satrtRatio="4:8" endRatio="4:8">
</EF:EFDateSpan>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="single">
<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:EFColumn ename="registerDate" cname="登记日期" width="160" align="center" editType="date" readonly="true"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_code_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFColumn ename="weight" cname="产量" width="120" enable="false" format="{0:N2}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,2})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置17位整数和2位小数!"
/>
<EF:EFColumn ename="userCount" cname="用工人数" width="120" enable="true" format="{0:N0}" editType="text"
displayType="0" sort="true" align="right"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置17位整数!"
/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/3/7
Time: 11:20
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="factoryCode" blockId="inqu_status" row="0" colWidth="3"
filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="生产组" ename="groupCode" blockId="inqu_status" row="0" colWidth="3"
filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="group_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="员工" ename="userId" blockId="inqu_status" row="0" colWidth="3"
filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="user_id_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput cname="产品" blockId="inqu_status" ename="prdtName" row="0" colWidth="3"/>
<EF:EFDateSpan startCname="登记日期" endCname="至" blockId="inqu_status"
startName="createdDateFrom" endName="createdDateTo" row="0" role="date"
format="yyyy-MM-dd" satrtRatio="4:8" endRatio="4:8">
</EF:EFDateSpan>
&lt;%&ndash;<EF:EFSelect cname="是否删除" ename="deleteFlag" blockId="inqu_status" row="0" colWidth="3" defaultValue="0">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.deleteFlag"/>
</EF:EFSelect>&ndash;%&gt;
</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="registerDate" cname="登记日期" width="160" align="center" editType="date" readonly="true"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="生产组" blockName="group_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupType" cname="生产类型" hidden="true"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="80" required="true"
align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="hpjx.hpjx.productionType" />
</EF:EFComboColumn>
<EF:EFColumn ename="prdtName" cname="生产内容" enable="false" width="160" align="center" required="true"/>
<EF:EFColumn ename="weight" cname="组拼产量(T)" width="120" enable="false" format="{0:N2}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,2})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置17位整数和2位小数!"
/>
<EF:EFColumn ename="weightJh" cname="加焊产量(T)" width="120" enable="false" format="{0:N2}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,2})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置17位整数和2位小数!"
/>
<%--<EF:EFColumn ename="remark" cname="备注" enable="true" width="200" align="center"/>--%>
</EF:EFGrid>
</EF:EFRegion>
<EF:EFRegion id="detail" title="下料明细信息">
<EF:EFGrid blockId="detail" autoDraw="override" toolbarConfig="{hidden:'all'}" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="registerDate" cname="登记日期" width="160" align="center" editType="date" readonly="true"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="下料组" blockName="group_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<%--<EF:EFComboColumn ename="groupType" cname="下料类型"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="80" required="true"
align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="hpjx.hpjx.productionType" />
</EF:EFComboColumn>--%>
<EF:EFColumn ename="prdtName" cname="下料内容" enable="false" width="160" align="center" required="true"/>
<%--<EF:EFColumn ename="weight" cname="产量(T)" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/>--%>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/4/3
Time: 15:03
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="result" title="生产明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="remark" cname="上级ID" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<%--<EF:EFColumn ename="registerDate" cname="登记日期" width="160" align="center" editType="date" readonly="true"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>--%>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_code_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="生产组" blockName="group_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFColumn ename="prdtName" cname="生产内容" enable="true" width="160" align="center"/>
<EF:EFColumn ename="weight" cname="组拼产量(T)" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" defaultValue="0"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/>
<EF:EFColumn ename="weightJh" cname="加焊产量(T)" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" defaultValue="0"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/>
<EF:EFComboColumn ename="groupType" cname="生产类型"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" hidden="true"
maxLength="16" readonly="true" width="80" required="true"
align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="hpjx.hpjx.productionType" />
</EF:EFComboColumn>
<EF:EFColumn ename="prdtName" cname="产品" enable="true" width="160" align="center" hidden="true"/>
</EF:EFGrid>
</EF:EFRegion>
<EF:EFRegion id="detail" title="下料明细信息">
<EF:EFGrid blockId="detail" autoDraw="override" toolbarConfig="{hidden:'all'}" isFloat="true" checkMode="row">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="remark" cname="上级ID" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<%--<EF:EFColumn ename="registerDate" cname="登记日期" width="160" align="center" editType="date" readonly="true"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>--%>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_code_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="下料组" blockName="group_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFColumn ename="prdtName" cname="下料内容" enable="true" width="160" align="center"/>
<EF:EFComboColumn ename="groupType" cname="下料类型" hidden="true"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="80" required="true"
align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="hpjx.hpjx.productionType" />
</EF:EFComboColumn>
<%--<EF:EFColumn ename="prdtName" cname="产品" enable="true" width="160" align="center"/>--%>
<EF:EFColumn ename="weight" cname="产量(T)" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" hidden="true" defaultValue="0"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/>
<EF:EFColumn ename="weightJh" cname="加焊产量(T)" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" hidden="true" defaultValue="0"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/>
</EF:EFGrid>
</EF:EFRegion>
<EF:EFRegion id="inqu">
<div class="row">
<EF:EFInput cname="用工总人数" blockId="inqu_status" ename="userCount" row="0"
type="number" colWidth="3" value="0" required="true"/>
<EF:EFDatePicker ename="inqu_status-0-registerDate" colWidth="3" cname="登记日期"
required="true" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFInput cname="" blockId="inqu_status" ename="methodType" row="0" colWidth="3" hidden="true"/>
</div>
</EF:EFRegion>
<div class="row">
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-align-right"/>
<EF:EFButton ename="confirm" cname="确认" type="button" class="btn-align-right"/>
</div>
</EF:EFPage>
\ No newline at end of file
......@@ -24,6 +24,7 @@ let upload = function () {
let parentPrdtName = $("#inqu_status-0-parentPrdtName").val();
let productionOrderNo = $("#inqu_status-0-productionOrderNo").val();
let deliveryDate = $("#inqu_status-0-deliveryDate").val();
let lv = $("#inqu_status-0-lv").val();
let _IPLAT = IPLAT;
_IPLAT.progress($("body"), true);
let formData = new FormData();
......@@ -35,6 +36,7 @@ let upload = function () {
formData.append("projName", projName);
formData.append("parentPrdtName", parentPrdtName);
formData.append("deliveryDate", deliveryDate);
formData.append("lv", lv);
}
if(id === 'route_002'){
formData.append("id", id);
......@@ -56,7 +58,11 @@ let upload = function () {
processData: false,
success: function (res) {
_IPLAT.progress($("body"), false);
parent.JSColorbox.setValueCallback();
if(res.status===0){
parent.JSColorbox.setValueCallback();
}else{
NotificationUtil(res.msg, "error");
}
},
error: function (res) {
message(res.msg);
......
......@@ -15,7 +15,8 @@
<EF:EFInput ename="inqu_status-0-projName" cname="项目名称" type="hidden"/>
<EF:EFInput ename="inqu_status-0-parentPrdtName" cname="项目部件名称" type="hidden"/>
<EF:EFInput ename="inqu_status-0-productionOrderNo" cname="生产订单号" type="hidden"/>
<EF:EFInput ename="inqu_status-0-deliveryDate" cname="交货日期" type="hidden"/>
<EF:EFInput ename="inqu_status-0-deliveryDate" cname="交货日期" type="hidden"/>
<EF:EFInput ename="inqu_status-0-lv" cname="级别" type="hidden"/>
<EF:EFInput cname="上传文件" blockId="inqu_status" ename="file" row="0" type="file" />
<%--<button id="btn_upload" type="submit">提交</button>--%>
<%-- <EF:EFButton cname="提交" ename="btn_upload"></EF:EFButton>--%>
......
......@@ -14,7 +14,7 @@ $(function () {
// 选择
$("#BTN_SELECT").on("click", select);
downKeyUp();
});
/**
......
......@@ -422,3 +422,25 @@ function drawGrid(blockId, jsonObj, gridIdSuffix, descNameInited) {
__grid_ef_grid_result.paint();
});
};
/**
* 回车退出编辑状态
*/
function downKeyUp() {
window.document.addEventListener("keyup", function (event) {
if (event.keyCode === 13) {
var grid1 = $("#ef_grid_result").data("kendoGrid");
var grid2 = $("#ef_grid_detail").data("kendoGrid");
// 回填
//grid.addRows(returnRows);
if(grid1 !== undefined){
grid1.closeCell();
}
if(grid2 !== undefined){
grid2.closeCell();
}
}
})
}
\ No newline at end of file
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