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());
......
package com.baosight.hpjx.hp.mt.service;
import cn.hutool.core.util.PageUtil;
import cn.hutool.core.util.StrUtil;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoBase;
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.constant.HPSqlConstant;
import com.baosight.hpjx.hp.mt.untils.Base64ToMultipartFile;
import com.baosight.hpjx.hp.mt.untils.Base64Utils;
import com.baosight.hpjx.hp.mt.untils.UploadUtils;
import com.baosight.hpjx.hp.mt.untils.UploadUtils2;
import com.baosight.hpjx.hp.sc.domain.HPSC002A;
import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.hp.xs.domain.User;
import com.baosight.hpjx.hp.zl.domain.HPZL001;
import com.baosight.hpjx.hp.zl.domain.HPZL001A;
import com.baosight.hpjx.util.*;
import com.baosight.iplat4j.common.ed.domain.TEDCM01;
import com.baosight.iplat4j.core.ProjectInfo;
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.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import net.sf.json.JSONObject;
import org.apache.commons.collections.MapUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import javax.imageio.ImageIO;
......@@ -55,34 +67,32 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public EiInfo pmProject(EiInfo inInfo) {
public Map pmProject(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String projName = inInfo.getString("projName");
int offset = inInfo.getInt("offset");//当前页
int pageSize = inInfo.getInt("pageSize");//每页条数
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
sqlMap.put("projName", projName);
List count = this.dao.query("HPMT002.pmProjectCount", sqlMap);
offset=(offset-1)*pageSize;
List<Map> count = this.dao.query("HPMT002.pmProjectCount", sqlMap);
offset=(offset-1)*pageSize;
sqlMap.put("offset", offset);
sqlMap.put("pageSize", pageSize);
List<Map> rows = this.dao.query("HPMT002.pmProject", sqlMap);
List<Map> maps = new ArrayList<>();
for (Map row : rows) {
if (!row.get("actualCompletionNum").equals(row.get("num"))){
maps.add(row);
}
resultMap.put("result",rows);
resultMap.put("count",count.size());
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;
}
EiInfo outInfo = new EiInfo();
EiBlock eiBlock = new EiBlock(EiConstant.resultBlock);
eiBlock.setRows(maps);
outInfo.setBlock(eiBlock);
outInfo.set("count",count.get(0));
return outInfo;
}
/**
......@@ -91,18 +101,24 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public EiInfo pmProjectCount(EiInfo inInfo) {
public Map pmProjectCount(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String projName = inInfo.getString("projName");
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
sqlMap.put("projName", projName);
int count = this.dao.count("HPMT002.pmProjectCount", sqlMap);
inInfo.set("count", count);
return inInfo;
resultMap.put("count",count);
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;
}
}
/**
......@@ -111,20 +127,24 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public EiInfo pmQuality(EiInfo inInfo) {
public Map pmQuality(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String queryMonth = inInfo.getString("queryMonth");
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
sqlMap.put("queryMonth", queryMonth);
List<Map> rows = this.dao.query("HPMT002.pmQuality", sqlMap);
EiInfo outInfo = new EiInfo();
EiBlock eiBlock = new EiBlock(EiConstant.resultBlock);
eiBlock.setRows(rows);
outInfo.setBlock(eiBlock);
return outInfo;
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;
}
}
/**
......@@ -133,15 +153,14 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public EiInfo pmQualityList(EiInfo inInfo) {
public Map pmQualityList(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String status = inInfo.getString("status");
String projName = inInfo.getString("projName");
int offset = inInfo.getInt("offset");//当前页
int pageSize = inInfo.getInt("pageSize");//每页条数
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
sqlMap.put("projName", projName);
......@@ -151,12 +170,16 @@ public class ServiceHPMT002 extends ServiceBase {
sqlMap.put("offset", offset);
sqlMap.put("pageSize", pageSize);
List<Map> rows = this.dao.query("HPMT002.pmQualityList", sqlMap);
EiInfo outInfo = new EiInfo();
EiBlock eiBlock = new EiBlock(EiConstant.resultBlock);
eiBlock.setRows(rows);
outInfo.setBlock(eiBlock);
outInfo.set("count", count.get(0));
return outInfo;
resultMap.put("result",rows);
resultMap.put("count",count.get(0));
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;
}
}
......@@ -166,60 +189,59 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public EiInfo pmQualityDetail(EiInfo inInfo) {
EiInfo outInfo = new EiInfo();
public Map pmQualityDetail(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String id = inInfo.getString("id");
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
outInfo.setMsg("账号异常");
}
Map Map = new HashMap();
Map.put("checkId", id);
Map.put("docType",1);
List<HPZL001A> docIdlist = this.dao.query("HPZL001A.queryDev", Map);
String projectEnv = ProjectInfo.getProjectEnv();
List<HPZL001A> docIdlist = new ArrayList<>();
if(projectEnv.equals("run")){
docIdlist = this.dao.query("HPZL001A.queryRun", Map);
}else{
docIdlist = this.dao.query("HPZL001A.queryDev", Map);
}
List<String> imgList = new ArrayList<>();
for (int i = 0; i < docIdlist.size(); i++) {
Map dirId = new HashMap();
HPZL001A hpzl001A = docIdlist.get(i);
String docId = hpzl001A.getDocId();
dirId.put("docId", docId);
List<Map> query = this.dao.query("HPMT002.queryFile", dirId);
File file = new File(UploadUtils.ROOT_PATH + "/A/" + query.get(0).get("CHG_NAME"));
BufferedImage bf = ImageIO.read(file);
String imgBase64 = UploadUtils.imageToBase64(bf);
imgList.add(imgBase64);
imgList.add(docId);
}
//处理的文件
Map Map2 = new HashMap();
Map2.put("checkId", id);
Map2.put("docType",2);
List<HPZL001A> docIdlist2 = this.dao.query("HPZL001A.queryDev", Map2);
List<HPZL001A> docIdlist2 = new ArrayList<>();
if(projectEnv.equals("run")){
docIdlist2 = this.dao.query("HPZL001A.queryRun", Map2);
}else{
docIdlist2 = this.dao.query("HPZL001A.queryDev", Map2);
}
List<String> imgList2 = new ArrayList<>();
for (int i = 0; i < docIdlist2.size(); i++) {
Map dirId = new HashMap();
HPZL001A hpzl001A = docIdlist2.get(i);
String docId = hpzl001A.getDocId();
dirId.put("docId", docId);
List<Map> query = this.dao.query("HPMT002.queryFile", dirId);
File file = new File(UploadUtils.ROOT_PATH + "/A/" + query.get(0).get("CHG_NAME"));
BufferedImage bf = ImageIO.read(file);
String imgBase64 = UploadUtils.imageToBase64(bf);
imgList2.add(imgBase64);
imgList2.add(docId);
}
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
sqlMap.put("id", id);
List<Map> rows = this.dao.query("HPMT002.pmQualityDetail", sqlMap);
EiBlock eiBlock = new EiBlock(EiConstant.resultBlock);
eiBlock.setRows(rows);
outInfo.setBlock(eiBlock);
outInfo.set("img",imgList);
outInfo.set("img2",imgList2);
} catch (Exception e){
outInfo.setMsg("账号异常");
resultMap.put("result",rows);
resultMap.put("img",imgList);
resultMap.put("img2",imgList2);
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;
}
return outInfo;
}
/**
......@@ -228,16 +250,15 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public EiInfo pmQualityXl(EiInfo inInfo) {
public Map pmQualityXl(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String factoryId= inInfo.getString("factoryId");//工厂id
String prodCode = inInfo.getString("projCode");//项目id
String orgNo = inInfo.getString("orgNo");//生产组id
String inventCode = inInfo.getString("inventCode");//部件id
String subInventCode = inInfo.getString("subInventCode");//零件id
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
sqlMap.put("factoryCode", factoryId);
......@@ -247,16 +268,30 @@ public class ServiceHPMT002 extends ServiceBase {
sqlMap.put("subInventCode", subInventCode);
EiInfo outInfo = new EiInfo();
TEDCM01 tedcm01 = new TEDCM01();
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.APP_MAP_BLOCK_FACTORY), null, false);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.APP_MAP_BLOCK_PROJCODE), sqlMap, false);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.APP_MAP_BLOCK_PRDTCODE), sqlMap, false);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.APP_MAP_BLOCK_ORG_NO), sqlMap, false);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.APP_MAP_BLOCK_PARTCODE), sqlMap, false);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.POOR_TYPE_BLOCK_ID), null, false);
List<Map> queryFactory = this.dao.query("HPMT002.queryFactory", sqlMap);
List<Map> queryProjCode = this.dao.query("HPMT002.queryProjCode", sqlMap);
List<Map> queryPrdtCode = this.dao.query("HPMT002.queryPrdtCode", sqlMap);
List<Map> queryOrgNo = this.dao.query("HPMT002.queryOrgNo", sqlMap);
List<Map> queryPartCode = this.dao.query("HPMT002.queryPartCode", sqlMap);
List<Map> queryTedcm01 = this.dao.query("HPXSOrg.queryTedcm01",tedcm01);
if(subInventCode!=null&&!subInventCode.equals("")){
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.APP_MAP_BLOCK_PRODTASKNO), sqlMap, false);
List<Map> queryProdTaskNo = this.dao.query("HPMT002.queryProdTaskNo",sqlMap);
resultMap.put("ProdTaskNo",queryProdTaskNo);
}
return outInfo;
resultMap.put("Factory",queryFactory);
resultMap.put("ProjCode",queryProjCode);
resultMap.put("PrdtCode",queryPrdtCode);
resultMap.put("OrgNo",queryOrgNo);
resultMap.put("PartCode",queryPartCode);
resultMap.put("Tedcm01",queryTedcm01);
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;
}
}
/**
......@@ -265,56 +300,57 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public EiInfo pmInsertQuality(EiInfo inInfo) {
String docId = inInfo.getString("docId");
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
public Map pmInsertQuality(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
HPZL001 fZl001 = new HPZL001();
Map attr = inInfo.getAttr();
fZl001.fromMap(attr);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
fZl001.setCreatedTime(sdf.format(new Date()));
fZl001.setReceiptDate(DateUtils.shortDate());
fZl001.setCompanyCode(companyCode);
User user = UserSessionUtils.getUser();
fZl001.setCheckUser(user.getUserName());
fZl001.setCheckNo(user.getUserId());
// 生成单据号
fZl001.setCheckNo(SequenceGenerator.getNextSequence(
HPConstant.SequenceId.HPZL001_NUMBER));
fZl001.setDeleteFlag(CommonConstant.YesNo.NO_0);
fZl001.setStatus(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPZL001.INSERT, fZl001);
//处理文件
if(!docId.equals("")) {
Map fZl0012 = new HashMap();
fZl0012.put("checkNo", fZl001.getCheckNo());
List<HPZL001> HPZL001 =dao.query("HPZL001.query", fZl0012);
//绑定文件
String[] docIds = docId.split(",");
int num = 0;
while (num < docIds.length) {
HPZL001A HPZL001A = new HPZL001A();
HPZL001A.setDepCode(CommonConstant.YesNo.YES);
HPZL001A.setDocType(CommonConstant.YesNo.YES_1);
HPZL001A.setBizType("XJ_WC");
HPZL001A.setDocId(docIds[num]);
HPZL001A.setCheckId(HPZL001.get(0).getId());
HPZL001A.setCompanyCode(companyCode);
DaoUtils.insert(HPZL001A.INSERT, HPZL001A);
num++;
String docId = inInfo.getString("docId");
String companyCode = UserSessionUtils.getCompanyCode();
HPZL001 fZl001 = new HPZL001();
Map attr = inInfo.getAttr();
fZl001.fromMap(attr);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
fZl001.setCreatedTime(sdf.format(new Date()));
fZl001.setReceiptDate(DateUtils.shortDate());
fZl001.setCompanyCode(companyCode);
User user = UserSessionUtils.getUser();
fZl001.setCheckUser(user.getUserName());
fZl001.setCheckNo(user.getUserId());
// 生成单据号
fZl001.setCheckNo(SequenceGenerator.getNextSequence(
HPConstant.SequenceId.HPZL001_NUMBER));
fZl001.setDeleteFlag(CommonConstant.YesNo.NO_0);
fZl001.setStatus(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPZL001.INSERT, fZl001);
//处理文件
if (!docId.equals("")) {
Map fZl0012 = new HashMap();
fZl0012.put("checkNo", fZl001.getCheckNo());
List<HPZL001> HPZL001 = dao.query("HPZL001.query", fZl0012);
//绑定文件
String[] docIds = docId.split(",");
int num = 0;
while (num < docIds.length) {
HPZL001A HPZL001A = new HPZL001A();
HPZL001A.setDepCode(CommonConstant.YesNo.YES);
HPZL001A.setDocType(CommonConstant.YesNo.YES_1);
HPZL001A.setBizType("XJ_WC");
HPZL001A.setDocId(docIds[num]);
HPZL001A.setCheckId(HPZL001.get(0).getId());
HPZL001A.setCompanyCode(companyCode);
DaoUtils.insert(HPZL001A.INSERT, HPZL001A);
num++;
}
}
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;
}
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
......@@ -323,13 +359,11 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public EiInfo pmModifyQuality(EiInfo inInfo) {
public Map pmModifyQuality(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String docId = inInfo.getString("docId");
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
try {
HPZL001 fZl001 = new HPZL001();
Map attr = inInfo.getAttr();
fZl001.fromMap(attr);
......@@ -357,11 +391,14 @@ public class ServiceHPMT002 extends ServiceBase {
num++;
}
}
inInfo.setMsg("处理成功!");
resultMap.put("status", EiConstant.STATUS_SUCCESS);
resultMap.put("message", "SUCCESS");
return resultMap;
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "处理失败");
resultMap.put("status", 500);
resultMap.put("message", LogUtils.getMsg(e));
return resultMap;
}
return inInfo;
}
......@@ -371,23 +408,22 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public EiInfo pmUploadFile(EiInfo inInfo) {
String files = inInfo.getString("files");
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
public Map pmUploadFile(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String files = inInfo.getString("files");
CommonsMultipartFile multipartFile = Base64ToMultipartFile.base64toMultipartFile(files);
JSONObject upload = UploadUtils.upload(multipartFile);
inInfo.set("id",upload.getString("docId"));
inInfo.setMsg("上传成功!");
}
catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "上传失败");
System.out.println("--------------------------------转换Base64成功");
JSONObject upload = UploadUtils2.upload(multipartFile);
resultMap.put("id",upload.getString("docId"));
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;
}
return inInfo;
}
}
......@@ -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.domain;
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.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* Project: <br>
* Title:THpsc008.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-04-03 11:12:26 create
*/
public class HPSC010 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id"; /* ID*/
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业编码*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 修改人*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 修改名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 修改时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除 0-否1-是*/
public static final String FIELD_REGISTER_DATE = "registerDate"; /* 登记日期*/
public static final String FIELD_FACTORY_CODE = "factoryCode"; /* 工厂代码*/
public static final String FIELD_WEIGHT = "weight"; /* 产量*/
public static final String FIELD_USER_COUNT = "userCount"; /* 用工人数*/
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_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 修改人*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 修改名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 修改时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除 0-否1-是*/
public static final String COL_REGISTER_DATE = "REGISTER_DATE"; /* 登记日期*/
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 工厂代码*/
public static final String COL_WEIGHT = "WEIGHT"; /* 产量*/
public static final String COL_USER_COUNT = "USER_COUNT"; /* 用工人数*/
public static final String QUERY = "HPSC010.query";
public static final String COUNT = "HPSC010.count";
public static final String INSERT = "HPSC010.insert";
public static final String UPDATE = "HPSC010.update";
public static final String DELETE = "HPSC010.delete";
public static final String DELETE_FLAG = "HPSC010.deleteFlag";
public static final String QUERY_MAX = "HPSC010.queryMax";
private Long id = new Long(0); /* ID*/
private String companyCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 修改人*/
private String updatedName = " "; /* 修改名称*/
private String updatedTime = " "; /* 修改时间*/
private Integer deleteFlag; /* 是否删除 0-否1-是*/
private String registerDate = " "; /* 登记日期*/
private String factoryCode = " "; /* 工厂代码*/
private BigDecimal weight = new BigDecimal("0"); /* 产量*/
private Long userCount = new Long(0); /* 用工人数*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("企业编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("修改人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("修改名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("修改时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("是否删除 0-否1-是");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REGISTER_DATE);
eiColumn.setDescName("登记日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_CODE);
eiColumn.setDescName("工厂代码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(18);
eiColumn.setDescName("产量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_USER_COUNT);
eiColumn.setDescName("用工人数");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HPSC010() {
initMetaData();
}
/**
* get the id - ID.
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id - ID.
*
* @param id - ID
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the companyCode - 企业编码.
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 企业编码.
*
* @param companyCode - 企业编码
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the depCode - 部门编码.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
* @param depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建名称.
*
* @param createdName - 创建名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 修改人.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 修改人.
*
* @param updatedBy - 修改人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 修改名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 修改名称.
*
* @param updatedName - 修改名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 修改时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 修改时间.
*
* @param updatedTime - 修改时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 是否删除 0-否1-是.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 是否删除 0-否1-是.
*
* @param deleteFlag - 是否删除 0-否1-是
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the registerDate - 登记日期.
* @return the registerDate
*/
public String getRegisterDate() {
return this.registerDate;
}
/**
* set the registerDate - 登记日期.
*
* @param registerDate - 登记日期
*/
public void setRegisterDate(String registerDate) {
this.registerDate = registerDate;
}
/**
* get the factoryCode - 工厂代码.
* @return the factoryCode
*/
public String getFactoryCode() {
return this.factoryCode;
}
/**
* set the factoryCode - 工厂代码.
*
* @param factoryCode - 工厂代码
*/
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
/**
* get the weight - 产量.
* @return the weight
*/
public BigDecimal getWeight() {
return this.weight;
}
/**
* set the weight - 产量.
*
* @param weight - 产量
*/
public void setWeight(BigDecimal weight) {
this.weight = weight;
}
/**
* get the userCount - 用工人数.
* @return the userCount
*/
public Long getUserCount() {
return this.userCount;
}
/**
* set the userCount - 用工人数.
*
* @param userCount - 用工人数
*/
public void setUserCount(Long userCount) {
this.userCount = userCount;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setRegisterDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REGISTER_DATE)), registerDate));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight));
setUserCount(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_USER_COUNT)), userCount));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_REGISTER_DATE, StringUtils.toString(registerDate, eiMetadata.getMeta(FIELD_REGISTER_DATE)));
map.put(FIELD_FACTORY_CODE, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_FACTORY_CODE)));
map.put(FIELD_WEIGHT, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT)));
map.put(FIELD_USER_COUNT, StringUtils.toString(userCount, eiMetadata.getMeta(FIELD_USER_COUNT)));
return map;
}
}
package com.baosight.hpjx.hp.sc.domain;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/4/6
*/
public class HPSC096 extends DaoEPBase {
public static final String FIELD_ID = "id"; /* ID*/
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业编码 预留*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码 预留*/
public static final String FIELD_REGISTER_DATE = "registerDate"; /* 登记日期*/
public static final String FIELD_FACTORY_CODE = "factoryCode"; /* 工厂代码*/
public static final String FIELD_GROUP_CODE = "groupCode"; /* 生产组代码*/
public static final String FIELD_GROUP_TYPE = "groupType"; /* 生产类型*/
public static final String FIELD_ORG_TYPE = "orgType"; /* 组织类型*/
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_DELETE_FLAG = "deleteFlag"; /* 是否删除0:否1.是*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 修改人*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 修改人名称*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 修改时间*/
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_REGISTER_DATE = "REGISTER_DATE"; /* 登记日期*/
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 工厂代码*/
public static final String COL_GROUP_CODE = "GROUP_CODE"; /* 生产组代码*/
public static final String COL_GROUP_TYPE = "GROUP_TYPE"; /* 生产类型*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除0:否1.是*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 修改人*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 修改人名称*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 修改时间*/
public static final String QUERY = "HPSC010.query";
public static final String INSERT = "HPSC010.insert";
public static final String UPDATE = "HPSC010.update";
public static final String QUERY_FACTORY_CODE = "HPSC010.queryFactoryCode";
public static final String QUERY_PRODUCTION_TYPE = "HPSC010.queryProductionType";
private Long id = new Long(0); /* ID*/
private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码 预留*/
private String registerDate = " "; /* 登记日期*/
private String factoryCode = " "; /* 工厂代码*/
private String groupCode = " "; /* 生产组代码*/
private String groupType = " "; /* 生产类型*/
private String prdtCode = " "; /* 产品代码*/
private String prdtName = " "; /* 产品名称*/
private BigDecimal weight = new BigDecimal("0"); /* 产量*/
private String remark = " "; /* 备注*/
private Integer deleteFlag; /* 是否删除0:否1.是*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 修改人*/
private String updatedTime = " "; /* 修改人名称*/
private String updatedName = " "; /* 修改时间*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REGISTER_DATE);
eiColumn.setDescName("登记日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_CODE);
eiColumn.setDescName("工厂代码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_GROUP_CODE);
eiColumn.setDescName("生产组代码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_GROUP_TYPE);
eiColumn.setDescName("生产类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRDT_CODE);
eiColumn.setDescName("产品代码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRDT_NAME);
eiColumn.setDescName("产品名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("产量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("是否删除0:否1.是");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("修改人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("修改人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("修改时间");
eiMetadata.addMeta(eiColumn);
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getCompanyCode() {
return companyCode;
}
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
public String getDepCode() {
return depCode;
}
public void setDepCode(String depCode) {
this.depCode = depCode;
}
public String getRegisterDate() {
return registerDate;
}
public void setRegisterDate(String registerDate) {
this.registerDate = registerDate;
}
public String getFactoryCode() {
return factoryCode;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getGroupCode() {
return groupCode;
}
public void setGroupCode(String groupCode) {
this.groupCode = groupCode;
}
public String getGroupType() {
return groupType;
}
public void setGroupType(String groupType) {
this.groupType = groupType;
}
public String getPrdtCode() {
return prdtCode;
}
public void setPrdtCode(String prdtCode) {
this.prdtCode = prdtCode;
}
public String getPrdtName() {
return prdtName;
}
public void setPrdtName(String prdtName) {
this.prdtName = prdtName;
}
public BigDecimal getWeight() {
return weight;
}
public void setWeight(BigDecimal weight) {
this.weight = weight;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public String getCreatedName() {
return createdName;
}
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
public String getCreatedTime() {
return createdTime;
}
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
public String getUpdatedBy() {
return updatedBy;
}
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
public String getUpdatedTime() {
return updatedTime;
}
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
public String getUpdatedName() {
return updatedName;
}
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setRegisterDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REGISTER_DATE)), registerDate));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
setGroupCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_GROUP_CODE)), groupCode));
setGroupType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_GROUP_TYPE)), groupType));
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));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_REGISTER_DATE, StringUtils.toString(registerDate, eiMetadata.getMeta(FIELD_REGISTER_DATE)));
map.put(FIELD_FACTORY_CODE, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_FACTORY_CODE)));
map.put(FIELD_GROUP_CODE, StringUtils.toString(groupCode, eiMetadata.getMeta(FIELD_GROUP_CODE)));
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_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
return map;
}
}
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>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-04-03 11:12:26
Version : 1.0
schema : hpjx
tableName : T_HPSC008
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
REGISTER_DATE VARCHAR,
FACTORY_CODE VARCHAR,
WEIGHT DECIMAL,
USER_COUNT BIGINT
-->
<sqlMap namespace="HPSC010">
<sql id="authCondition">
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCodes">
DEP_CODE IN <iterate close=")" open="(" conjunction="," property="depCodes">#depCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<!--<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>-->
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="registerDate">
REGISTER_DATE = #registerDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="weight">
WEIGHT = #weight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userCount">
USER_COUNT = #userCount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateFrom">
REGISTER_DATE >= #createdDateFrom#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateTo">
REGISTER_DATE &lt;= #createdDateTo#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC010">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
REGISTER_DATE as "registerDate", <!-- 登记日期 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
WEIGHT as "weight", <!-- 产量 -->
USER_COUNT as "userCount" <!-- 用工人数 -->
FROM ${hpjxSchema}.T_HPSC008 WHERE 1=1
<include refid="authCondition" />
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPSC008 WHERE 1=1
<include refid="authCondition" />
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="registerDate">
REGISTER_DATE = #registerDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="weight">
WEIGHT = #weight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userCount">
USER_COUNT = #userCount#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPSC008 (
COMPANY_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
REGISTER_DATE, <!-- 登记日期 -->
FACTORY_CODE, <!-- 工厂代码 -->
WEIGHT, <!-- 产量 -->
USER_COUNT <!-- 用工人数 -->
)
VALUES (#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #registerDate#, #factoryCode#, #weight#, #userCount#)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPSC008 WHERE
ID = #id#
</delete>
<!--逻辑删除-->
<update id="deleteFlag">
UPDATE ${hpjxSchema}.T_HPSC008
SET
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_TIME = #updatedTime#, <!-- 修改人名称 -->
UPDATED_NAME = #updatedName# <!-- 修改时间 -->
WHERE
ID = #id#
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
</update>
<update id="update">
UPDATE ${hpjxSchema}.T_HPSC008
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除 0-否1-是 -->
REGISTER_DATE = #registerDate#, <!-- 登记日期 -->
FACTORY_CODE = #factoryCode#, <!-- 工厂代码 -->
WEIGHT = #weight#, <!-- 产量 -->
USER_COUNT = #userCount# <!-- 用工人数 -->
WHERE
ID = #id#
</update>
<!--查询工厂班组-->
<select id="queryFactoryCode" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
DATE_FORMAT(NOW(), '%Y%m%d') as "registerDate",
ORG_ENAME AS "groupCode",
ORG_TYPE AS "orgType",
FACTORY_CODE as "factoryCode"
FROM iplat.txsog01
WHERE IS_DELETED = '0'
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty property="AND" prepend="orgTypes">
ORG_TYPE NOT IN <iterate close=")" open="(" conjunction="," property="depCodes">#orgTypes[]#</iterate>
</isNotEmpty>
<isEmpty prepend="AND" property="orgTypes">
ORG_TYPE NOT IN ('factory','dept')
</isEmpty>
<isNotEmpty prepend=" AND " property="loginName">
FACTORY_CODE IN (
SELECT FACTORY_CODE FROM iplat.txsog01
WHERE IS_DELETED = '0' and COMPANY_CODE = #companyCode#
and ORG_ID = (
select ORG_ID from iplat.txsog02 T2
INNER JOIN iplat.xs_user xu ON t2.USER_ID = xu.USER_ID
where xu.LOGIN_NAME = #loginName#
order by T2.REC_CREATE_TIME desc
limit 1
)
)
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
SORT_INDEX asc
</isEmpty>
</dynamic>
</select>
<select id="queryProductionType" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
ITEM_CODE as "groupType"
FROM
iplat.tedcm01
where STATUS = '1' and CODESET_CODE = 'hpjx.hpjx.productionType'
<isNotEmpty prepend=" AND " property="itemCode">
$itemCode$
</isNotEmpty>
</select>
<!-- 查询子集组信息,包括生产组和下料组(递归) -->
<select id="queryGroupComboBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
T2.LEVEL AS "level", T3.ORG_ID AS "orgId", T3.ORG_CNAME AS "orgCname",
T3.FACTORY_CODE AS "factoryCode", T5.FACTORY_NAME AS "factoryName"
FROM (
SELECT
@CODES AS CODES,
(SELECT @CODES:=GROUP_CONCAT(ORG_ID)
FROM ${platSchema}.TXSOG01
WHERE FIND_IN_SET(PARENT_ORG_ID, @CODES)
AND COMPANY_CODE = #companyCode#
AND IS_DELETED = 0
) AS T1,
@LEVEL:=@LEVEL+1 AS LEVEL
FROM ${platSchema}.TXSOG01,
<isNotEmpty property="parentOrgId">
(SELECT @CODES:=#parentOrgId#, @LEVEL:= 0) T4
</isNotEmpty>
<isEmpty property="parentOrgId">
(SELECT @CODES:='root', @LEVEL:= 0) T4
</isEmpty>
WHERE @CODES IS NOT NULL
) T2,
${platSchema}.TXSOG01 T3
LEFT JOIN ${platSchema}.TXSOG01 T5 ON T3.FACTORY_CODE = T5.ORG_ID
WHERE 1=1
AND FIND_IN_SET(T3.ORG_ID, T2.CODES)
AND T3.ORG_TYPE IN ('prodGroup', 'cutGroup')
<isNotEmpty prepend=" AND " property="orgType">
T3.ORG_TYPE = #orgType#
</isNotEmpty>
ORDER BY T2.LEVEL, T3.ORG_ID
</select>
<select id="queryMax" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建名称 -->
MAX(CREATED_TIME) as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
REGISTER_DATE as "registerDate", <!-- 登记日期 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
WEIGHT as "weight", <!-- 产量 -->
USER_COUNT as "userCount" <!-- 用工人数 -->
FROM ${hpjxSchema}.T_HPSC008 WHERE 1=1
<include refid="authCondition" />
<isNotEmpty prepend=" AND " property="companyCode">
CREATED_TIME IN (
select MAX(CREATED_TIME)
from hpjx.T_HPSC008
where 1=1
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="registerDate">
REGISTER_DATE = #registerDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
)
</isNotEmpty>
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID desc
</isEmpty>
</dynamic>
</select>
</sqlMap>
\ No newline at end of file
......@@ -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"/>
......
$(function () {
var factoryCodes = __eiInfo.getBlock("factory_code_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
IPLATUI.EFGrid = {
"result": {
copyToAdd:false,
pageable: {
pageSize: 10,
pageSizes: [10, 20, 30, 50, 100, 200],
},
columns: [{
field: "operator",
title: "操作",
template: function (item) {
let auditStatus = item.status;
let template = '';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showGroupDetail(\'' + item.id + '\')" >任务详情</a>';
return template;
}
},{
field: "registerDate",
attributes: {
class: "i-input-readonly"
},
defaultValue: function () {
return currShortDate();
}
},{
field: "factoryCode",
title: "工厂",
template: function (dataItem) {
for (let i = 0; i < factoryCodes.length; i++) {
if (factoryCodes[i]['valueField'] === dataItem['factoryCode']) {
return factoryCodes[i]['textField'];
}
}
return dataItem["factoryCode"];
}
}],
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field == "factoryCode") {
loadChange(grid,e,"groupCode");
}
});
},
afterEdit:function (e) {},
onAdd: function (e) {
e.preventDefault();
addWindowOpen(null);
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
//e.preventDefault();
//let btnNode = $(this);
//禁用按钮
//btnNode.attr("disabled", true);
//saveResult(btnNode);
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'update' || e.eiInfo.extAttr.methodName == 'insert') {
query();
}
},
onRowClick: function (e) {
/*if (e.event.target.innerText!="任务详情"){
updateWindowOpen(e.model.id)
}*/
},
}
}
$("#insert").on("click",function (e) {
addWindowOpen(null);
})
//工厂类型下拉联动
$('input[name="inqu_status-0-factoryCode"]').change(function () {
var inInfo=new EiInfo();
var factoryCode=$("#inqu_status-0-factoryCode").val();
inInfo.set("factoryCode",factoryCode);
inInfo.set("groupType","prodGroup");
EiCommunicator.send("HPSC008", "queryFactoryCode", inInfo, {
onSuccess: function (ei) {
var input=$("#inqu_status-0-groupCode");
let dataEdition=ei.getBlock("group_code_block_id").getMappedRows();
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
optionLabel:"请选择",
dataSource: dataEdition,
template: "#=textField#"
});
}, onFail: function (ei) {
}
}, {async: false});
});
//生产组下拉联动
$('input[name="inqu_status-0-groupCode"]').change(function () {
var inInfo=new EiInfo();
var factoryCode=$("#inqu_status-0-factoryCode").val();
inInfo.set("factoryCode",factoryCode);
var groupCode=$("#inqu_status-0-groupCode").val();
inInfo.set("groupCode",groupCode);
inInfo.set("groupType","prodGroup");
EiCommunicator.send("HPSC008", "queryGroupCode", inInfo, {
onSuccess: function (ei) {
var input=$("#inqu_status-0-userId");
let dataEdition=ei.getBlock("user_id_block_id").getMappedRows();
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
optionLabel:"请选择",
dataSource: dataEdition,
template: "#=textField#"
});
}, onFail: function (ei) {
}
}, {async: false});
});
});
function showUploadFile(id) {
JSColorbox.open({
href: "HPSC002B?methodName=initLoad&inqu_status-0-bizType=WL&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "90%",
});
}
function check(id, auditStatus,planInfoNo) {
const inEiInfo = new EiInfo();
inEiInfo.set("id", id);
inEiInfo.set("planInfoNo",planInfoNo);
//先判断本身是否填写
EiCommunicator.send('HPSC003', 'getInfo', inEiInfo, {
onSuccess(ei) {
var model=ei.get("model");
if(!(model.planCompletionDate).trim()) {
NotificationUtil("提交失败!原因:基本信息中计划完成日期未填写", "error");
return;
} else {
//提交
//提交前先判断明细信息中的计划开始和计划结束时间是否都已经填写,只有填写了之后才能进行提交
if (auditStatus == 1) {
EiCommunicator.send('HPSC004', 'inspectDetail', inEiInfo, {
onSuccess(ei) {
var list=ei.get("list");
if(list) {
var count = list[0];
if (count > 0) {
NotificationUtil("提交失败!原因:明细信息中有未填写的计划开始时间或计划结束时间", "error");
} else {
EiCommunicator.send('HPSC004','queryDetail',inEiInfo,{
onSuccess(ei){
var rows = ei.blocks.detail.rows;
var res = check_time(model,rows);
if (!res){
NotificationUtil("计划结束时间应该大于计划开始时间!", "error");
}
else {
// 提交通过,生成
EiCommunicator.send('HPSC003', 'submitPlan', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
}
}
})
}
} else {
NotificationUtil("提交失败!未找到明细信息", "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
} else {
// 撤回
}
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
}
let query = function () {
resultGrid.dataSource.page(1);
}
function check_time(model,rows){
for (var i=0;i<rows.length;i++){
if (model.planInfoNo == rows[i][5]) {
var start_time = rows[i][22];
var end_time = rows[i][23];
if (end_time < start_time) {
return false;
}
}
}
return true;
}
/**
* 保存汇总
*/
function saveResult(btn) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let planCompletionDate= item.get("planCompletionDate");
if(isBlank(planCompletionDate)){
message("选中的第"+(index+1)+"行\"计划结束时间\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPSC003", "update", true);
//释放禁用按钮
btn.attr("disabled", false);
}
});
}
}
/**
* 保存明细
*/
function saveDetail(btn) {
let rows = detailGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let planCommentDate= item.get("planCommentDate");
let planCompletionDate= item.get("planCompletionDate");
if(isBlank(planCommentDate)){
message("选中的第"+(index+1)+"行\"计划开始时间\",不能为空!");
flag = false;
return false;
}
if(isBlank(planCompletionDate)){
message("选中的第"+(index+1)+"行\"计划结束时间\",不能为空!");
flag = false;
return false;
}
let startT = new Date(planCommentDate).getTime();
let endT = new Date(planCompletionDate).getTime();
if (startT > endT) {
message("选中的第"+(index+1)+"行\"计划开始时间\"不能大于\"计划结束时间\"!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("detail", "HPSC003", "updatePlanDetail", true);
//释放禁用按钮
btn.attr("disabled", false);
}
});
}
}
function loadChange(grid,e,field) {
var cell_label = field,that = grid;
// locked 表示是否为固定列
var locked = that.isCellLocked(cell_label);
// tr 表示 locked 和非 locked 的行,index 表示此行的第几列
var tr,index;
// 获取此 model 元素信息
var item = e.items[0];
var _uid = item.uid;
if (locked) {
tr = $(".k-grid-content-locked tr[data-uid="+ _uid +"]");
index = $("th[data-field='"+cell_label+"']").data("index");
} else {
tr = $(".k-grid-content tr[data-uid="+ _uid +"]");
index = parseInt($("th[data-field='"+cell_label+"']").data("index")) - that.lockedHeader.find("th").length;
}
// 获取子 cell(td)
var td = tr.children("td:eq("+index+")");
// 触发 td.click 事件,
td.trigger("click");
}
/**
* 任务详情
*
* @param let
*/
function showGroupDetail(id) {
window.open("HPSC010A?methodName=initLoad&inqu_status-0-remark=" + id)
}
function addWindowOpen(id) {
JSColorbox.open({
href: "HPSC096?methodName=initLoad&inqu_status-0-methodType=insert&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>新增</div>",
width: "80%",
height: "90%",
callbackName: windowOpenCallback
});
}
function updateWindowOpen(id) {
JSColorbox.open({
href: "HPSC096?methodName=initLoad&inqu_status-0-methodType=update&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>修改</div>",
width: "60%",
height: "50%",
callbackName: windowOpenCallback
});
}
/**
* 回调
*
* @param docId
*/
function windowOpenCallback(docId) {
console.log("关闭回调")
resultGrid.dataSource.page(1);
}
\ No newline at end of file
<%--
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
$(function () {
//var factoryCodes = __eiInfo.getBlock("factory_code_block_id").getMappedRows();
//var groupCodes = __eiInfo.getBlock("group_code1_block_id").getMappedRows();
//var userIds = __eiInfo.getBlock("user_id1_block_id").getMappedRows();
//var factoryCode = __eiInfo.getBlock("factory_code1_block_id").getMappedRows();
//var groupName = __eiInfo.getBlock("group_name_block_id").getMappedRows();
//var userName = __eiInfo.getBlock("user_name_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
IPLATUI.EFGrid = {
"result": {
/*pageable: {
pageSize: 20,
pageSizes: [20, 30, 50, 100, 200],
},*/
pageable:false,
exportGrid:false,
columns: [/*{
field: "operator",
template: function (item) {
console.log(item)
let auditStatus = item.status;
let template = '';
if (item.matId != null) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.matId + ')" >附件清单</a>';
}
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" '
+
'onclick="check(' + item.id + ',1, \'' + item.planInfoNo + '\')" >提交</a>';
}
/!*else {
template += '<a hidden="hidden" style="cursor: pointer;display: inline-flex;justify-content: center;" ' +
'onclick="check(' + item.id + ',0)" >撤回</a>';
}*!/
return template;
}
},*/{
field: "registerDate",
attributes: {
class: "i-input-readonly"
},
defaultValue: function () {
return currShortDate();
}
}],
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field == "factoryCode") {
loadChange(grid,e,"groupCode");
} else if (e.field == "groupCode") {
if (e.items[0].factoryCode.length===0){
loadChange(grid,e,"factoryCode");
}
loadChange(grid,e,"userId");
}else if (e.field == "userId"){
if (e.items[0].groupCode.length===0){
loadChange(grid,e,"groupCode");
}
if (e.items[0].factoryCode.length===0){
loadChange(grid,e,"factoryCode");
}
}
});
},
afterEdit:function (e) {
if (e.field === "groupCode" && e.model["factoryCode"].length === 0){
for (let i = 0; i < groupName.length; i++) {
if (e.model[e.field] === groupName[i]["valueField"]){
e.model["factoryCode"]=groupName[i]["param1Field"]
break;
}
}
}else if (e.field === "userId" && e.model["groupCode"].length === 0){
for (let i = 0; i < userName.length; i++) {
if (e.model[e.field] === userName[i]["valueField"]){
//e.model["factoryCode"]=userName[i]["param1Field"]
e.model["groupCode"]=userName[i]["param2Field"]
break;
}
}
}
},
onAdd: function (e) {
//e.sender.dataSource.options.fields[4].values = factoryCode;
//e.sender.dataSource.options.fields[5].values = groupCode
//e.sender.dataSource.options.fields[6].values = userId;
// 动态设置默认邮箱
/*$.each(e.items, function(index, item){
item['prdtName'] = "demo"+ index + "@baosight.com";
});*/
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
//e.preventDefault();
//let btnNode = $(this);
//禁用按钮
//btnNode.attr("disabled", true);
//saveResult(btnNode);
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'update' || e.eiInfo.extAttr.methodName == 'insert') {
query();
}
},
onRowClick: function (e) {
/*var block = detailGrid.getEiBlock();
if (block != null) {
block.setRows([]);
detailGrid.setEiBlock(block);
}
var info = new EiInfo()
var parentId = e.model['planInfoNo'];
info.set("parentId", parentId);
EiCommunicator.send("HPSC004", "queryDetail", info, {
onSuccess: function (ei) {//返回结果集
detailGrid.setEiInfo(ei);
}, onFail: function (ei) {
}
}, {async: false});*/
},
},
"detail":{
pageable:false,
exportGrid:false,
toolbarConfig:{
hidden: false,
},
columns: [],
}
}
//工厂类型下拉联动
$('input[name="inqu_status-0-factoryCode"]').change(function () {
var inInfo=new EiInfo();
var factoryCode=$("#inqu_status-0-factoryCode").val();
inInfo.set("factoryCode",factoryCode);
inInfo.set("groupType","prodGroup");
EiCommunicator.send("HPSC008", "queryFactoryCode", inInfo, {
onSuccess: function (ei) {
var input=$("#inqu_status-0-groupCode");
let dataEdition=ei.getBlock("group_code_block_id").getMappedRows();
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
optionLabel:"请选择",
dataSource: dataEdition,
template: "#=textField#"
});
}, onFail: function (ei) {
}
}, {async: false});
});
//生产组下拉联动
$('input[name="inqu_status-0-groupCode"]').change(function () {
var inInfo=new EiInfo();
var factoryCode=$("#inqu_status-0-factoryCode").val();
inInfo.set("factoryCode",factoryCode);
var groupCode=$("#inqu_status-0-groupCode").val();
inInfo.set("groupCode",groupCode);
inInfo.set("groupType","prodGroup");
EiCommunicator.send("HPSC008", "queryGroupCode", inInfo, {
onSuccess: function (ei) {
var input=$("#inqu_status-0-userId");
let dataEdition=ei.getBlock("user_id_block_id").getMappedRows();
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
optionLabel:"请选择",
dataSource: dataEdition,
template: "#=textField#"
});
}, onFail: function (ei) {
}
}, {async: false});
});
});
function showUploadFile(id) {
JSColorbox.open({
href: "HPSC002B?methodName=initLoad&inqu_status-0-bizType=WL&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
function check(id, auditStatus,planInfoNo) {
const inEiInfo = new EiInfo();
inEiInfo.set("id", id);
inEiInfo.set("planInfoNo",planInfoNo);
//先判断本身是否填写
EiCommunicator.send('HPSC003', 'getInfo', inEiInfo, {
onSuccess(ei) {
var model=ei.get("model");
if(!(model.planCompletionDate).trim()) {
NotificationUtil("提交失败!原因:基本信息中计划完成日期未填写", "error");
return;
} else {
//提交
//提交前先判断明细信息中的计划开始和计划结束时间是否都已经填写,只有填写了之后才能进行提交
if (auditStatus == 1) {
EiCommunicator.send('HPSC004', 'inspectDetail', inEiInfo, {
onSuccess(ei) {
var list=ei.get("list");
if(list) {
var count = list[0];
if (count > 0) {
NotificationUtil("提交失败!原因:明细信息中有未填写的计划开始时间或计划结束时间", "error");
} else {
EiCommunicator.send('HPSC004','queryDetail',inEiInfo,{
onSuccess(ei){
var rows = ei.blocks.detail.rows;
var res = check_time(model,rows);
if (!res){
NotificationUtil("计划结束时间应该大于计划开始时间!", "error");
}
else {
// 提交通过,生成
EiCommunicator.send('HPSC003', 'submitPlan', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
}
}
})
}
} else {
NotificationUtil("提交失败!未找到明细信息", "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
} else {
// 撤回
}
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
}
let query = function () {
resultGrid.dataSource.page(1);
}
function check_time(model,rows){
for (var i=0;i<rows.length;i++){
if (model.planInfoNo == rows[i][5]) {
var start_time = rows[i][22];
var end_time = rows[i][23];
if (end_time < start_time) {
return false;
}
}
}
return true;
}
/**
* 保存汇总
*/
function saveResult(btn) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let planCompletionDate= item.get("planCompletionDate");
if(isBlank(planCompletionDate)){
message("选中的第"+(index+1)+"行\"计划结束时间\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPSC003", "update", true);
//释放禁用按钮
btn.attr("disabled", false);
}
});
}
}
/**
* 保存明细
*/
function saveDetail(btn) {
let rows = detailGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let planCommentDate= item.get("planCommentDate");
let planCompletionDate= item.get("planCompletionDate");
if(isBlank(planCommentDate)){
message("选中的第"+(index+1)+"行\"计划开始时间\",不能为空!");
flag = false;
return false;
}
if(isBlank(planCompletionDate)){
message("选中的第"+(index+1)+"行\"计划结束时间\",不能为空!");
flag = false;
return false;
}
let startT = new Date(planCommentDate).getTime();
let endT = new Date(planCompletionDate).getTime();
if (startT > endT) {
message("选中的第"+(index+1)+"行\"计划开始时间\"不能大于\"计划结束时间\"!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("detail", "HPSC003", "updatePlanDetail", true);
//释放禁用按钮
btn.attr("disabled", false);
}
});
}
}
function loadChange(grid,e,field) {
var cell_label = field,that = grid;
// locked 表示是否为固定列
var locked = that.isCellLocked(cell_label);
// tr 表示 locked 和非 locked 的行,index 表示此行的第几列
var tr,index;
// 获取此 model 元素信息
var item = e.items[0];
var _uid = item.uid;
if (locked) {
tr = $(".k-grid-content-locked tr[data-uid="+ _uid +"]");
index = $("th[data-field='"+cell_label+"']").data("index");
} else {
tr = $(".k-grid-content tr[data-uid="+ _uid +"]");
index = parseInt($("th[data-field='"+cell_label+"']").data("index")) - that.lockedHeader.find("th").length;
}
// 获取子 cell(td)
var td = tr.children("td:eq("+index+")");
// 触发 td.click 事件,
td.trigger("click");
}
\ 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>
$(function (){
var day1 = new Date();
day1.setTime(day1.getTime());
day1.setDate(day1.getDate());
var month = day1.getMonth() + 1;
var year = day1.getFullYear();
var day = day1.getDate();
var queryBlock = __eiInfo.getBlock("inqu_status").getMappedRows();
//$(".row").children().attr("class", "col-md-3");
$("#inqu").children().children().children().eq(0).hide();
$("#inqu").children().children().children().eq(1).hide();
$("#result").children().children().children().eq(0).hide();
$("#result").children().children().children().eq(1).hide();
$("#detail").children().children().children().eq(0).hide();
$("#detail").children().children().children().eq(1).hide();
IPLATUI.EFDatePicker = {
"inqu_status-0-registerDate": {
start: "day",
depth: "day",
value:year+"-"+month+"-"+day
}
}
IPLATUI.EFGrid = {
"result": {
pageable:false,
exportGrid:false,
toolbarConfig:{
hidden: false,
},
/*pageable: {
pageSize: 10,
pageSizes: [10, 20, 30, 50, 100, 200],
},*/
columns: [{
field: "operator",
title: "操作",
template: function (item) {
let template = '';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="deleteRow(' + item.rowNo + ')" >删除</a>';
return template
}
}/*,{
field: "registerDate",
attributes: {
class: "i-input-readonly"
},
defaultValue: function () {
return currShortDate();
}
}*/],
loadComplete: function(grid) {
$("#ef_grid_result .k-grid-toolbar").attr("style","display: none;");
//$("#delete").attr("style","display: none;");
// 此 grid 对象
if (queryBlock[0]["userCount"] !== undefined || queryBlock[0]["userCount"] != null){
$("#inqu_status-0-userCount").val(queryBlock[0]["userCount"]);
}else {
$("#inqu_status-0-userCount").val(0);
}
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
saveResult(btnNode);
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'update' || e.eiInfo.extAttr.methodName == 'insert') {
query();
}
},
},
"detail":{
pageable:false,
exportGrid:false,
toolbarConfig:{
hidden: false,
},
columns: [{
field: "operator",
title: "操作",
template: function (item) {
let template = '';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="detailDeleteRow(' + item.rowNo + ')" >删除</a>';
return template
}
}],
}
};
/**
* 取消
*/
$('#cancel').on('click', function () {
// 关闭弹窗
parent.JSColorbox.close();
});
/**
* 确认
*/
$('#confirm').on('click', function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let methodType = $("#inqu_status-0-methodType").val();
let registerDate = $("#inqu_status-0-registerDate").val();
if (registerDate.length<=0){
registerDate = currShortDate()
}
let flag = true;
$.each(rows, function(index, item) {
let prdtName= item.get("prdtName");
if(isBlank(prdtName)){
message("选中的第"+(index+1)+"行\"产品\",不能为空!");
flag = false;
return false;
}
let weight= item.get("weight");
if(isBlank(weight)){
message("选中的第"+(index+1)+"行\"组拼产量(T)\",不能为空!");
flag = false;
return false;
}
let weightJh= item.get("weightJh");
if(isBlank(weightJh)){
message("选中的第"+(index+1)+"行\"加焊产量(T)\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
var info = new EiInfo();
info.set("inqu_status-0-userCount",$("#inqu_status-0-userCount").val());
info.set("inqu_status-0-registerDate",registerDate);
info.addBlock(JSUtils.checkedRows2Block("result"));
info.addBlock(JSUtils.checkedRows2Block("detail"))
EiCommunicator.send("HPSC010", methodType, info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
EiCommunicator.send("HPSC096", methodType, info, {
onSuccess: function (ei) {
parent.JSColorbox.setValueCallback(ei);
parent.JSColorbox.close();
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
})
} 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");
}
});
}
});
}
});
})
/**
* 保存汇总
*/
function saveResult(btn) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let methodType = $("#inqu_status-0-methodType").val();
let flag = true;
$.each(rows, function(index, item) {
let prdtName= item.get("prdtName");
if(isBlank(prdtName)){
message("选中的第"+(index+1)+"行\"产品\",不能为空!");
flag = false;
return false;
}
let weight= item.get("weight");
if(isBlank(weight)){
message("选中的第"+(index+1)+"行\"产量(T)\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
var info = new EiInfo();
info.set("inqu_status-0-userCount",$("#inqu_status-0-userCount").val());
info.addBlock(JSUtils.checkedRows2Block("result"));
info.addBlock(JSUtils.checkedRows2Block("detail"))
EiCommunicator.send("HPSC010", methodType, info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
EiCommunicator.send("HPSC096", methodType, info, {
onSuccess: function (ei) {
parent.JSColorbox.setValueCallback(ei);
parent.JSColorbox.close();
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
})
} 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", "HPSC096", methodType, true);
//释放禁用按钮
btn.attr("disabled", false);
}
});
}
}
function deleteRow(rowNo) {
resultGrid.removeRows([rowNo]);// 刷新行号
refreshRowNo();
}
let refreshRowNo = function () {
let allRows = resultGrid.getDataItems();
for (let i = 0; i < allRows.length; i++) {
resultGrid.setCellValue(i, "rowNo", i);
resultGrid.refresh();
}
}
function detailDeleteRow(rowNo) {
//detailGrid.removeRows([rowNo]);// 刷新行号
detailRefreshRowNo(rowNo);
}
let detailRefreshRowNo = function (rowNo) {
let allRows = detailGrid.getDataItems();
for (let i = 0; i < allRows.length; i++) {
if (allRows[i].rowNo == rowNo){
detailGrid.removeRows(allRows[i]);
}else {
detailGrid.setCellValue(i, "rowNo", i);
detailGrid.refresh();
}
}
}
\ No newline at end of file
<%--
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