Commit 5b1b5f60 by liuyang

Merge branch 'dev' of https://gitlab.baocloud.cn/bggf/smart/hp-smart into dev

parents caedef30 d423d2ab
......@@ -253,6 +253,14 @@ public class HPSqlConstant {
// 更新完成数量
public static final String UPDATE_COMPLETE_NUM = "HPSC005A.updateCompleteNum";
}
public class HPSC006 {
// 锁
public static final String LOCK = "HPSC006.lock";
// 更新完成数量
public static final String UPDATE_COMPLETE_NUM = "HPSC006.updateCompleteNum";
}
/**
* 质量巡检单
......
package com.baosight.hpjx.hp.kc.tools;
import com.baosight.hpjx.hp.kc.domain.HPKC004;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.ExcelUtils;
import com.baosight.hpjx.util.MapUtils;
......@@ -21,9 +20,6 @@ import org.apache.poi.ss.util.CellRangeAddress;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.PageContext;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......
......@@ -6,8 +6,10 @@ import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ011;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
......@@ -79,6 +81,16 @@ public class ServiceHPPZ011 extends ServiceBase {
for (Map resultRow : resultRows) {
HPPZ011 fPz011 = new HPPZ011();
fPz011.fromMap(resultRow);
// 校验厂区名是否存在
HPPZ011 dbPz011 = HPPZTools.HpPz011.getByName(fPz011.getFactoryName());
if (dbPz011 != null) {
fPz011.setFactoryCode(dbPz011.getFactoryCode());
} else {
// 生成厂区编码
fPz011.setFactoryCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.FACTORY_CODE));
}
// 设置生产组名称
fPz011.setGroupName(HPXSTools.XsOrg.get(fPz011.getGroupCode()).getOrgCname());
if (fPz011.getId() == null || fPz011.getId() == 0) {
this.add(fPz011);
} else {
......@@ -115,14 +127,6 @@ public class ServiceHPPZ011 extends ServiceBase {
* @param fPz011
*/
private void add(HPPZ011 fPz011) {
// 校验厂区名是否存在
HPPZ011 dbPz011 = HPPZTools.HpPz011.getByName(fPz011.getFactoryName());
if (dbPz011 != null) {
fPz011.setFactoryCode(dbPz011.getFactoryCode());
} else {
// 生成厂区编码
fPz011.setFactoryCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.FACTORY_CODE));
}
fPz011.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPPZ011.INSERT, fPz011);
}
......@@ -167,7 +171,7 @@ public class ServiceHPPZ011 extends ServiceBase {
try {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.FACTORY_RECORD_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, new HashMap<>(), false);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询厂区失败");
}
......@@ -178,7 +182,7 @@ public class ServiceHPPZ011 extends ServiceBase {
try {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.FACTORY_GROUP_ECORD_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, new HashMap<>(), false);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询厂区失败");
}
......@@ -193,7 +197,7 @@ public class ServiceHPPZ011 extends ServiceBase {
try {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.GROUP_RECORD_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, new HashMap<>(), false);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询组失败");
}
......
......@@ -125,6 +125,7 @@
<update id="update">
UPDATE ${hpjxSchema}.T_HPPZ011
SET
FACTORY_CODE = #factoryCode#, <!-- 厂区编码 -->
FACTORY_NAME = #factoryName#, <!-- 厂区名称 -->
GROUP_CODE = #groupCode#, <!-- 组编码 -->
GROUP_NAME = #groupName#, <!-- 组名称 -->
......@@ -156,6 +157,12 @@
FROM ${hpjxSchema}.T_HPPZ011 A, ${platSchema}.TXSOG01 B
WHERE A.DELETE_FLAG = 0
AND A.GROUP_CODE = B.ORG_ID
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupType">
A.GROUP_TYPE = #groupType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
A.FACTORY_CODE = #factoryCode#
</isNotEmpty>
......@@ -174,6 +181,9 @@
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupType">
A.GROUP_TYPE = #groupType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
A.FACTORY_CODE = #factoryCode#
</isNotEmpty>
......
......@@ -67,6 +67,20 @@ public class HPPZTools {
List<HPPZ011> dbPz011s = DaoBase.getInstance().query(HPSqlConstant.HPPZ011.GET, queryMap);
return CollectionUtils.isEmpty(dbPz011s) ? null : dbPz011s.get(0);
}
/**
* 查询厂区名称
*
* @param factoryCode
* @return
*/
public static String getFactoryName(String factoryCode) {
AssertUtils.isEmpty(factoryCode, "厂区编码不能为空");
Map queryMap = new HashMap();
queryMap.put("factoryCode", factoryCode);
List<HPPZ011> dbPz011s = DaoBase.getInstance().query(HPSqlConstant.HPPZ011.GET, queryMap);
return CollectionUtils.isEmpty(dbPz011s) ? null : dbPz011s.get(0).getFactoryName();
}
}
/**
......
......@@ -56,6 +56,8 @@ public class HPSC006 extends DaoEPBase {
public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 存货档案ID*/
public static final String FIELD_MATERIAL = "material"; /* 材质*/
public static final String FIELD_PRDT_NAME = "prdtName"; /* 产品名称*/
public static final String FIELD_PART_NAME = "partName"; /* 零件名称*/
public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
......@@ -90,7 +92,8 @@ public class HPSC006 extends DaoEPBase {
public static final String COL_FILE_PATH1 = "FILE_PATH1"; /* 文件地址1*/
public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 存货档案ID*/
public static final String COL_MATERIAL = "MATERIAL"; /* 材质*/
public static final String COL_PRDT_NAME = "PRDT_NAME"; /* 产品名称*/
public static final String COL_PART_NAME = "PART_NAME"; /* 零件名称*/
public static final String QUERY = "HPSC006.query";
public static final String COUNT = "HPSC006.count";
......@@ -131,7 +134,8 @@ public class HPSC006 extends DaoEPBase {
private String filePath1 = " "; /* 文件地址1*/
private Integer inventRecordId = new Integer(0); /* 存货档案ID*/
private String material = " "; /* 材质*/
private String prdtName = " "; /* 产品名称*/
private String partName = " "; /* 零件名称*/
/**
* initialize the metadata.
*/
......@@ -232,6 +236,13 @@ public class HPSC006 extends DaoEPBase {
eiColumn.setDescName("实际完工数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ACTUAL_COMPLETION_TOTAL_WT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("实际完工重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态 0-计划中,1-生产中,2-已完成");
eiMetadata.addMeta(eiColumn);
......@@ -288,7 +299,13 @@ public class HPSC006 extends DaoEPBase {
eiColumn.setDescName("材质");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRDT_NAME);
eiColumn.setDescName("产品名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PART_NAME);
eiColumn.setDescName("零件名称");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -590,7 +607,7 @@ public class HPSC006 extends DaoEPBase {
* get the actualCompletionTotalWt - 实际完工重量.
* @return the actualCompletionTotalWt
*/
public BigDecimal getactualCompletionTotalWt() {
public BigDecimal getActualCompletionTotalWt() {
return this.actualCompletionTotalWt;
}
......@@ -599,7 +616,7 @@ public class HPSC006 extends DaoEPBase {
*
* @param actualCompletionTotalWt - 实际完工重量
*/
public void setactualCompletionTotalWt(BigDecimal actualCompletionTotalWt) {
public void setActualCompletionTotalWt(BigDecimal actualCompletionTotalWt) {
this.actualCompletionTotalWt = actualCompletionTotalWt;
}
/**
......@@ -827,6 +844,39 @@ public class HPSC006 extends DaoEPBase {
this.material = material;
}
/**
* get the prdtName - 产品名称.
* @return the prdtName
*/
public String getPrdtName() {
return this.prdtName;
}
/**
* set the prdtName - 产品名称.
*
* @param prdtName - 产品名称
*/
public void setPrdtName(String prdtName) {
this.prdtName = prdtName;
}
/**
* get the partName - 零件名称.
* @return the partName
*/
public String getPartName() {
return this.partName;
}
/**
* set the partName - 零件名称.
*
* @param partName - 零件名称
*/
public void setPartName(String partName) {
this.partName = partName;
}
/**
* get the value from Map.
*
* @param map - source data map
......@@ -852,7 +902,7 @@ public class HPSC006 extends DaoEPBase {
setTotalWt(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_TOTAL_WT)), totalWt));
setActualCompletionDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACTUAL_COMPLETION_DATE)), actualCompletionDate));
setActualCompletionNum(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_ACTUAL_COMPLETION_NUM)), actualCompletionNum));
setactualCompletionTotalWt(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_ACTUAL_COMPLETION_TOTAL_WT)), actualCompletionTotalWt));
setActualCompletionTotalWt(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_ACTUAL_COMPLETION_TOTAL_WT)), actualCompletionTotalWt));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setOrgNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ORG_NO)), orgNo));
setOrgName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ORG_NAME)), orgName));
......@@ -867,6 +917,8 @@ public class HPSC006 extends DaoEPBase {
setFilePath1(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_PATH1)), filePath1));
setInventRecordId(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId));
setMaterial(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MATERIAL)), material));
setPrdtName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRDT_NAME)), prdtName));
setPartName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PART_NAME)), partName));
}
/**
......@@ -909,7 +961,8 @@ public class HPSC006 extends DaoEPBase {
map.put(FIELD_FILE_PATH1, StringUtils.toString(filePath1, eiMetadata.getMeta(FIELD_FILE_PATH1)));
map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID)));
map.put(FIELD_MATERIAL, StringUtils.toString(material, eiMetadata.getMeta(FIELD_MATERIAL)));
map.put(FIELD_PRDT_NAME, StringUtils.toString(prdtName, eiMetadata.getMeta(FIELD_PRDT_NAME)));
map.put(FIELD_PART_NAME, StringUtils.toString(partName, eiMetadata.getMeta(FIELD_PART_NAME)));
return map;
}
}
......@@ -37,6 +37,7 @@ public class HPSC007 extends DaoEPBase {
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_REMARK = "remark"; /* 备注*/
public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
public static final String COL_HPSC006_ID = "HPSC006_ID"; /* 生产下料ID*/
......@@ -52,6 +53,9 @@ public class HPSC007 extends DaoEPBase {
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_REMARK = "REMARK"; /* 备注*/
public static final String QUERY = "t_hpsc007.query";
public static final String COUNT = "t_hpsc007.count";
public static final String INSERT = "t_hpsc007.insert";
......@@ -73,6 +77,9 @@ public class HPSC007 extends DaoEPBase {
private String depCode = " "; /* 部门编码*/
private String remark = " "; /* 备注*/
/**
* initialize the metadata.
*/
......@@ -143,6 +150,7 @@ public class HPSC007 extends DaoEPBase {
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -376,6 +384,8 @@ public class HPSC007 extends DaoEPBase {
public void setRemark(String remark) {
this.remark = remark;
}
/**
* get the value from Map.
*
......@@ -398,6 +408,8 @@ public class HPSC007 extends DaoEPBase {
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
}
/**
......@@ -422,6 +434,7 @@ public class HPSC007 extends DaoEPBase {
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK)));
return map;
}
}
......@@ -177,7 +177,7 @@ public class ServiceHPSC003 extends ServiceBase {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPSC003.fromMap(map);
this.dao.delete("HPPZ001.delete", HPSC003.toMap());
this.dao.delete("HPSC003.delete", HPSC003.toMap());
}
} catch (PlatException e) {
......
......@@ -106,7 +106,7 @@ public class ServiceHPSC004 extends ServiceBase {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPSC004.fromMap(map);
this.dao.delete("HPPZ001.delete", HPSC004.toMap());
this.dao.delete("HPSC004.delete", HPSC004.toMap());
}
} catch (PlatException e) {
......
......@@ -122,7 +122,7 @@ public class ServiceHPSC005 extends ServiceBase {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPSC005.fromMap(map);
this.dao.delete("HPPZ001.delete", HPSC005.toMap());
this.dao.delete("HPSC005.delete", HPSC005.toMap());
}
} catch (PlatException e) {
......
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.common.HPConstants;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.ProdOrderStatusEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC005;
import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.hp.pz.domain.HPPZ009;
import com.baosight.hpjx.hp.kc.domain.HPKC006;
import com.baosight.hpjx.hp.pz.domain.HPPZ011;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.domain.HPSC002A;
import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.hp.sc.domain.HPSC005A;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.hpjx.util.ObjectUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
......@@ -54,6 +48,7 @@ public class ServiceHPSC005A extends ServiceBase {
String prodOrderNo = MapUtils.getString(queryMap, "prodOrderNo");
HPSC005 dbSc005 = HPSCTools.HpSc005.get(prodOrderNo);
inInfo.addBlock("detail").addRow(dbSc005);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC005A().eiMetadata);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "初始化失败");
......@@ -127,11 +122,16 @@ public class ServiceHPSC005A extends ServiceBase {
*/
private void add(HPSC005 dbSc005, HPSC005A fSc005a) {
String prodOrderNo = dbSc005.getProductionOrderNo();
// 数据校验
AssertUtils.isEmpty(fSc005a.getFactoryCode(), "请选择厂区");
AssertUtils.isEmpty(fSc005a.getOrgNo(), "请选择生产组");
// 更新订单主表数量
HPSCTools.checkAssignedNum(prodOrderNo, fSc005a.getNum());
// 写入子表数据
fSc005a.setProdTaskNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.PROD_TASK_NO,
new String[]{prodOrderNo}));
// 设置基础信息
this.setBaseInfo(fSc005a);
fSc005a.setProdOrderNo(prodOrderNo);
fSc005a.setTotalWt(fSc005a.getNum().multiply(dbSc005.getUnitWt()));
DaoUtils.insert(HPSC005A.INSERT, fSc005a);
......@@ -225,7 +225,8 @@ public class ServiceHPSC005A extends ServiceBase {
// 更新订单主表数量
HPSCTools.checkAssignedNum(dbSc005.getProductionOrderNo(), dbSc005.getNum());
// 写入子表数据
newSc005a.setProdTaskNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.PROD_TASK_NO));
newSc005a.setProdTaskNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.PROD_TASK_NO,
new String[]{dbSc005.getProductionOrderNo()}));
newSc005a.setProdOrderNo(dbSc005.getProductionOrderNo());
newSc005a.setNum(dbSc005.getNum());
newSc005a.setTotalWt(newSc005a.getNum().multiply(dbSc005.getUnitWt()));
......@@ -243,4 +244,16 @@ public class ServiceHPSC005A extends ServiceBase {
return inInfo;
}
/**
* 设置基础信息
*
* @param fSc005a
*/
private void setBaseInfo(HPSC005A fSc005a) {
// 厂区名称
fSc005a.setFactoryName(HPPZTools.HpPz011.getFactoryName(fSc005a.getFactoryCode()));
// 生产组名称
fSc005a.setOrgName(HPXSTools.XsOrg.get(fSc005a.getOrgNo()).getOrgCname());
}
}
......@@ -5,10 +5,11 @@ 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.sc.domain.HPSC005;
import com.baosight.hpjx.hp.sc.domain.HPSC006;
import com.baosight.hpjx.hp.sc.domain.HPSC007;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.util.*;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
......@@ -17,6 +18,8 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.*;
/**
......@@ -30,13 +33,17 @@ public class ServiceHPSC007 extends ServiceBase {
*/
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, "HPSC007.query", new HPSC007());
Map map = new HashMap();
map.put("companyCode", UserSessionUtils.getCompanyCode());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_BLOCK_ID), map,true);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), null);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
Long hpsc006Id = MapUtils.getLong(queryMap, "hpsc006Id");
HPSC006 HPSC006 = HPSCTools.Hpsc006.getById(hpsc006Id);
String productionOrderNo = HPSC006.getProductionOrderNo();
HPSC005 HPSC005 = HPSCTools.HpSc005.get(productionOrderNo);
HPSC006.setPrdtName(HPSC005.getPrdtName());
HPSC006.setPartName(HPSC005.getPartName());
inInfo.addBlock("detail").addRow(HPSC006);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC007().eiMetadata);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
......@@ -59,14 +66,44 @@ public class ServiceHPSC007 extends ServiceBase {
@Override
public EiInfo insert(EiInfo inInfo) {
try {
HPSC006 HPSC006 = new HPSC006();
Map<?, ?> map06 = inInfo.getBlock("detail").getRow(0);
HPSC006.fromMap(map06);
HPSC006 =(HPSC006) this.dao.get("HPSC006.query","id",HPSC006.getId());
//锁单
HPSCTools.Hpsc006.lock(HPSC006.getId());
HPSC007 HPSC007 = new HPSC007();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
BigDecimal totalNum = new BigDecimal(0);
BigDecimal actualCompletionTotalWt = new BigDecimal(0);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPSC007.fromMap(map);
HPSC007.setHpsc006Id(HPSC006.getId());
// 计算总重
BigDecimal num = HPSC007.getActualCompletionNum();
totalNum = totalNum.add(num);
BigDecimal unitWt = HPSC006.getUnitWt();
DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue())));
actualCompletionTotalWt = actualCompletionTotalWt.add(totalWt);
HPSC007.setactualCompletionTotalWt(totalWt);
DaoUtils.insert("HPSC007.insert",HPSC007);
}
// 修改下料表中的字段
HPSC006.setActualCompletionNum(HPSC006.getActualCompletionNum().add(totalNum));
HPSC006.setActualCompletionTotalWt(HPSC006.getActualCompletionTotalWt().add(actualCompletionTotalWt));
if (HPSC006.getActualCompletionNum().compareTo(HPSC006.getNum()) >= 0) {
HPSC006.setStatus(2);
HPSC006.setActualCompletionDate(DateUtils.shortDateTime());
}
HPSCTools.Hpsc006.updateCompleteNum(HPSC006.getId(),HPSC006.getActualCompletionNum(),HPSC006.getActualCompletionTotalWt(),
HPSC006.getStatus(),HPSC006.getActualCompletionDate());
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.addBlock("detail").addRow(HPSC006);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC007().eiMetadata);
inInfo.setMsg("新增成功!");
} catch (PlatException e) {
......@@ -85,14 +122,48 @@ public class ServiceHPSC007 extends ServiceBase {
*/
public EiInfo update(EiInfo inInfo) {
try {
HPSC006 HPSC006 = new HPSC006();
Map<?, ?> map06 = inInfo.getBlock("detail").getRow(0);
HPSC006.fromMap(map06);
HPSC006 =(HPSC006) this.dao.get("HPSC006.query","id",HPSC006.getId());
//锁单
HPSCTools.Hpsc006.lock(HPSC006.getId());
HPSC007 HPSC007 = new HPSC007();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
BigDecimal totalNum = new BigDecimal(0);
BigDecimal actualCompletionTotalWt = new BigDecimal(0);
DecimalFormat decimalFormat = new DecimalFormat("#.000");
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPSC007.fromMap(map);
DaoUtils.update("HPSC007.update",HPSC007);
//初始对象
HPSC007 cshpsc007 = (HPSC007) this.dao.get("HPSC007.query","id",HPSC007.getId());
// 计算总重
BigDecimal num = HPSC007.getActualCompletionNum();
//差异
totalNum = totalNum.add(num.subtract(cshpsc007.getActualCompletionNum()));
BigDecimal unitWt = HPSC006.getUnitWt();
BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue())));
actualCompletionTotalWt = actualCompletionTotalWt.add(new BigDecimal(decimalFormat.format(Math.round(totalNum.multiply(unitWt).floatValue()))));
HPSC007.setactualCompletionTotalWt(totalWt);
DaoUtils.insert("HPSC007.update",HPSC007);
}
// 修改下料表中的字段
HPSC006.setActualCompletionNum(HPSC006.getActualCompletionNum().add(totalNum));
HPSC006.setActualCompletionTotalWt(HPSC006.getActualCompletionTotalWt().add(actualCompletionTotalWt));
if (HPSC006.getActualCompletionNum().compareTo(HPSC006.getNum()) >= 0) {
HPSC006.setStatus(2);
HPSC006.setActualCompletionDate(DateUtils.shortDateTime());
} else {
HPSC006.setStatus(1);
HPSC006.setActualCompletionDate(" ");
}
HPSCTools.Hpsc006.updateCompleteNum(HPSC006.getId(),HPSC006.getActualCompletionNum(),HPSC006.getActualCompletionTotalWt(),
HPSC006.getStatus(),HPSC006.getActualCompletionDate());
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.addBlock("detail").addRow(HPSC006);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC007().eiMetadata);
inInfo.setMsg("修改成功!");
} catch (PlatException e) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
......@@ -107,26 +178,58 @@ public class ServiceHPSC007 extends ServiceBase {
/**
* 删除操作.
*/
public EiInfo delete(EiInfo eiInfo) {
HPSC007 HPSC007 = new HPSC007();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
public EiInfo delete(EiInfo inInfo) {
try {
HPSC006 HPSC006 = new HPSC006();
Map<?, ?> map06 = inInfo.getBlock("detail").getRow(0);
HPSC006.fromMap(map06);
HPSC006 =(HPSC006) this.dao.get("HPSC006.query","id",HPSC006.getId());
//锁单
HPSCTools.Hpsc006.lock(HPSC006.getId());
HPSC007 HPSC007 = new HPSC007();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
BigDecimal totalNum = new BigDecimal(0);
BigDecimal actualCompletionTotalWt = new BigDecimal(0);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPSC007.fromMap(map);
this.dao.delete("HPSC007.delete", HPSC007.toMap());
// 计算总重
BigDecimal num = HPSC007.getActualCompletionNum();
totalNum = totalNum.add(num);
this.dao.delete("HPSC007.delete",HPSC007.toMap());
}
// 修改下料表中的字段
BigDecimal unitWt = HPSC006.getUnitWt();
DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(totalNum.multiply(unitWt).floatValue())));
actualCompletionTotalWt = actualCompletionTotalWt.add(totalWt);
HPSC006.setActualCompletionNum(HPSC006.getActualCompletionNum().subtract(totalNum));
HPSC006.setActualCompletionTotalWt(HPSC006.getActualCompletionTotalWt().subtract(actualCompletionTotalWt));
if (HPSC006.getActualCompletionNum().compareTo(HPSC006.getNum()) >= 0) {
HPSC006.setStatus(2);
HPSC006.setActualCompletionDate(DateUtils.shortDateTime());
} else {
HPSC006.setStatus(1);
HPSC006.setActualCompletionDate(" ");
}
HPSCTools.Hpsc006.updateCompleteNum(HPSC006.getId(),HPSC006.getActualCompletionNum(),HPSC006.getActualCompletionTotalWt(),
HPSC006.getStatus(),HPSC006.getActualCompletionDate());
inInfo.setMsg("删除成功!");
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.addBlock("detail").addRow(HPSC006);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC007().eiMetadata);
return inInfo;
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("删除失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("删除失败,原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("删除失败!", e.getMessage());
return eiInfo;
return inInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
return eiInfo;
}
}
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.pz.domain.HPPZ011;
import com.baosight.hpjx.hp.sc.domain.HPSC004;
import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.xservices.xs.og.domain.XSOG01;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
*/
public class ServiceHPSC098 extends ServiceBase {
/**
* 画面初始化.
*/
public EiInfo initLoad(EiInfo inInfo) {
try {
Map queryMap = new HashMap();
queryMap.put("orgType", "dept");
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.ORG_RECORD_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID), null);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPPZ011().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 画面初始化
*
* @param inInfo
* @return
*/
public EiInfo initLoad(EiInfo inInfo) {
try {
Map queryMap = new HashMap();
queryMap.put("orgType", "dept");
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.ORG_RECORD_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID), null);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPPZ011().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询
......
......@@ -37,24 +37,9 @@
<isNotEmpty prepend=" AND " property="docId">
A.DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
A.CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
A.CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
A.CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
A.UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
A.UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
A.UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docName">
B.DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
</sql>
<sql id="customCondition">
......@@ -69,7 +54,7 @@
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="order">
$orderBy$
$order$
</isNotEmpty>
<isEmpty property="order">
A.ID DESC
......
......@@ -99,7 +99,7 @@
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="order">
$orderBy$
$order$
</isNotEmpty>
<isEmpty property="order">
ID ASC
......
......@@ -297,6 +297,7 @@
SET
STATUS = #status#, <!-- 状态 0-未派工,1-已派工 -->
ORG_NO = #orgNo#, <!-- 生产组编码 -->
ORG_NAME = #orgName#,
FACTORY_CODE = #factoryCode#, <!-- 厂区编码 -->
FACTORY_NAME = #factoryName#, <!-- 厂区名称 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
......@@ -304,4 +305,24 @@
WHERE
ID = #id#
</update>
<update id="lock">
UPDATE ${hpjxSchema}.T_HPSC006
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
</update>
<update id="updateCompleteNum">
UPDATE ${hpjxSchema}.T_HPSC006
SET
ACTUAL_COMPLETION_DATE = #actualCompletionDate#, <!-- 实际完工日期 -->
ACTUAL_COMPLETION_NUM = #actualCompletionNum#, <!-- 实际完工数量 -->
ACTUAL_COMPLETION_TOTAL_WT = #actualCompletionTotalWt#,
STATUS = #status# <!-- 状态 0-计划中,1-生产中,2-已完成 -->
WHERE
ID = #id#
</update>
</sqlMap>
......@@ -8,15 +8,10 @@ import com.baosight.hpjx.hp.kc.domain.HPKC003;
import com.baosight.hpjx.hp.kc.domain.HPKC005;
import com.baosight.hpjx.hp.kc.domain.HPKC010;
import com.baosight.hpjx.hp.pz.domain.HPPZ004;
import com.baosight.hpjx.hp.sc.domain.HPSC001;
import com.baosight.hpjx.hp.sc.domain.HPSC002;
import com.baosight.hpjx.hp.sc.domain.HPSC003;
import com.baosight.hpjx.hp.sc.domain.HPSC004;
import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.hp.sc.domain.HPSC005A;
import com.baosight.hpjx.hp.sc.domain.HPSC005B;
import com.baosight.hpjx.hp.sc.domain.*;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.ObjectUtils;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.iplat4j.core.exception.PlatException;
import org.apache.commons.collections.CollectionUtils;
......@@ -461,4 +456,69 @@ public class HPSCTools {
}
}
public static class Hpsc006 {
/**
* 锁
*
* @param id
* @return
*/
public static void lock(Long id) {
AssertUtils.isNull(id, "生产下料号不能为空");
Map queryMap = new HashMap();
queryMap.put("id", id);
DaoBase.getInstance().update(HPSqlConstant.HPSC006.LOCK, queryMap);
}
/**
* 更新已完成数量
*
* @param prodTaskNo
* @param completeNum
*/
public static void updateCompleteNum(Long id, BigDecimal actualCompletionNum,BigDecimal actualCompletionTotalWt,
Integer status, String actualCompletionDate) {
AssertUtils.isNull(id, "生产下料号不能为空");
AssertUtils.isGt(BigDecimal.ZERO, actualCompletionNum, "更新后的实际完成数量小于0,请检查");
Map queryMap = new HashMap();
queryMap.put("id", id);
queryMap.put("status", status);
queryMap.put("actualCompletionNum", actualCompletionNum);
queryMap.put("actualCompletionTotalWt", actualCompletionTotalWt);
queryMap.put("actualCompletionDate", actualCompletionDate);
DaoBase.getInstance().update(HPSqlConstant.HPSC006.UPDATE_COMPLETE_NUM, queryMap);
}
/**
* 查询
*
* @param id
* @return
*/
public static HPSC006 getById(Long id) {
AssertUtils.isNull(id, "生产下料ID不能为空");
Map queryMap = new HashMap();
queryMap.put("id", id);
List<HPSC006> results = DaoBase.getInstance().query(HPSC006.QUERY, queryMap);
AssertUtils.isNull(results, String.format("生产下料ID[%s]信息不存在", id));
return results.get(0);
}
}
public static class Hpsc007 {
/**
* 查询
*
* @param id
* @return
*/
public static HPSC007 getById(Long id) {
AssertUtils.isNull(id, "生产下料ID不能为空");
Map queryMap = new HashMap();
queryMap.put("id", id);
List<HPSC007> results = DaoBase.getInstance().query(HPSC007.QUERY, queryMap);
AssertUtils.isNull(results, String.format("生产下料ID[%s]信息不存在", id));
return results.get(0);
}
}
}
let factoryGlobalData = [];
$(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [{
field: "factoryName",
template: function (dataItem) {
for (let i = 0; i < factoryGlobalData.length; i++) {
if (factoryGlobalData[i]['textField'] === dataItem['factoryName']) {
resultGrid.setCellValue(0, "factoryCode", factoryGlobalData[i]['valueField']);
return factoryGlobalData[i]['textField'];
}
}
return dataItem["factoryName"] == null ? "" : dataItem["factoryName"];
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("serviceName", "HPPZ011");
inInfo.set("methodName", "queryComboBox");
inInfo.set("blockId", "factory_record_block_id");
inInfo.set("field", options.field);
factoryGlobalData = refreshInputSelect(container, inInfo);
}
}],
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
......@@ -25,6 +46,15 @@ $(function () {
* 页面加载时执行
*/
$(window).load(function () {
// 厂区名称
let inInfo = new EiInfo();
EiCommunicator.send("HPPZ011", "queryComboBox", inInfo, {
onSuccess: function (ei) {
factoryGlobalData = ei.getBlock("factory_record_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
// 查询
query();
});
......
......@@ -19,13 +19,14 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="factoryCode" cname="厂区编码" enable="false" width="120" align="center"/>
<EF:EFPopupColumn ename="factoryName" cname="厂区名称" width="120" popupType="ServiceGrid"
popupTitle="厂区列表" serviceName="HPPZ011" methodName="queryComboBox"
resultId="factory_record_block_id"
columnEnames="valueField,textField" columnCnames="厂区代码,厂区名称"
backFillColumnIds="valueField,textField" backFillFieldIds="factoryCode,factoryName"
valueField="textField" textField="textField" required="true"/>
<EF:EFColumn ename="factoryCode" cname="厂区编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="factoryName" cname="厂区名称" width="120" align="center" required="true"/>
<%-- <EF:EFPopupColumn ename="factoryName" cname="厂区名称" width="120" popupType="ServiceGrid"--%>
<%-- popupTitle="厂区列表" serviceName="HPPZ011" methodName="queryComboBox"--%>
<%-- resultId="factory_record_block_id"--%>
<%-- columnEnames="valueField,textField" columnCnames="厂区代码,厂区名称"--%>
<%-- backFillColumnIds="valueField,textField" backFillFieldIds="factoryCode,factoryName"--%>
<%-- valueField="textField" textField="textField" required="true"/>--%>
<EF:EFComboColumn ename="groupCode" cname="生产组名称" width="120" align="center"
blockName="org_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#"
......
......@@ -11,7 +11,7 @@
<div class="row">
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="部件名称" ename="prdtName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFDateSpan startCname="创建日期(从)" endCname="至" blockId="inqu_status"
startName="createdDateFrom" endName="createdDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
......
......@@ -77,14 +77,15 @@
<%-- <EF:EFOption label="已删除" value="0"/>--%>
<%-- <EF:EFOption label="启用" value="1"/>--%>
<%-- </EF:EFComboColumn>--%>
<EF:EFColumn enable="false" ename="num" readonly="true" cname="计划数量"/>
<EF:EFColumn enable="false" ename="unitWt" readonly="true" cname="计划重量"/>
<EF:EFColumn enable="false" ename="num" readonly="true" cname="数量"/>
<EF:EFColumn enable="false" ename="unitWt" readonly="true" cname="单重"/>
<EF:EFColumn ename="totalWt" cname="总重" enable="false"/>
<EF:EFColumn ename="planCommentDate" required='true' cname="计划开始时间" editType="date" dateFormat="yyyy/MM/dd" width="150"/>
<EF:EFColumn ename="planCompletionDate" required='true' cname="计划结束时间" editType="date" dateFormat="yyyy/MM/dd" width="150"/>
<EF:EFColumn ename="actualCompletionDate" cname="实际完成时间" editType="date" dateFormat="yyyy/MM/dd" width="150"
<EF:EFColumn ename="actualCompletionDate" cname="完成时间" editType="date" dateFormat="yyyy/MM/dd" width="150"
enable="false"/>
<EF:EFColumn enable="false" ename="actualCompletionNum" cname="实际完工数量" readonly="true"/>
<EF:EFColumn enable="false" ename="actualCompletionUnitWt" cname="实际完工重量" readonly="true"/>
<EF:EFColumn enable="false" ename="actualCompletionNum" cname="完成数量" readonly="true"/>
<EF:EFColumn enable="false" ename="actualCompletionUnitWt" cname="完成总重" readonly="true"/>
<EF:EFColumn ename="operator" cname="操作" width="100" enable="false" readonly="false"/>
</EF:EFGrid>
</EF:EFRegion>
......
......@@ -18,10 +18,15 @@ $(function () {
columns: [{
field: "operator",
template: function (item) {
let status = item.status;
let prodOrderNo = item.productionOrderNo;
let filePath1 = item.filePath1;
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="tearAssign(\'' + prodOrderNo + '\')" >拆单派工</a>';
let template = '';
// 非全部派工时展示拆单派工按钮
if (status != 2) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="tearAssign(\'' + prodOrderNo + '\')" >拆单派工</a>';
}
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showGroupDetail(\'' + prodOrderNo + '\')" >详情</a>';
if (filePath1) {
......@@ -51,7 +56,7 @@ function tearAssign(prodOrderNo) {
href: "HPSC005A?methodName=initLoad&inqu_status-0-prodOrderNo=" + prodOrderNo,
title: "<div style='text-align: center;'>拆单派工</div>",
width: "80%",
height: "80%",
height: "90%",
callbackName: tearAssignCallback
});
}
......@@ -75,8 +80,9 @@ function assign() {
message("请至少选择一条需要分派的数据");
return;
}
// groupType=1:仅查询生产组
JSColorbox.open({
href: "HPSC098?methodName=initLoad",
href: "HPSC098?methodName=initLoad&inqu_status-0-groupType=1",
title: "<div style='text-align: center;'>选择组织</div>",
width: "70%",
height: "70%",
......
......@@ -29,24 +29,24 @@
<EF:EFGrid blockId="result" autoDraw="override">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="150" align="center"/>
<EF:EFColumn ename="productionOrderNo" cname="生产订单号" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="90" align="center">
<EF:EFOption label="未派工" value="0"/>
<EF:EFOption label="部分派工" value="1"/>
<EF:EFOption label="全部派工" value="2"/>
</EF:EFComboColumn>
<EF:EFColumn ename="projCode" cname="项目号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="prdtSpec" cname="部件规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="remark" cname="部件备注" enable="false"/>
<EF:EFColumn ename="partName" cname="零件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partSpec" cname="零件规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="remark1" cname="零件备注"/>
<EF:EFColumn ename="planCompletionDate" cname="计划完成日期" enable="false" width="120" align="center"/>
<EF:EFColumn ename="assignedNum" cname="已派工数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="num" cname="计划数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="totalWt" cname="计划重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="remark" cname="部件备注" enable="false"/>
<EF:EFColumn ename="remark1" cname="零件备注" enable="false"/>
<EF:EFColumn ename="projCode" cname="项目号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="productionOrderNo" cname="生产订单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prdtCode" cname="部件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="partCode" cname="零件编码" enable="false" width="120" align="center" hidden="true"/>
</EF:EFGrid>
......
let factoryGroupGlobalData = [];
$(function () {
IPLATUI.EFGrid = {
......@@ -7,10 +8,31 @@ $(function () {
pageSizes: [10, 20, 50, 70, 100],
},
columns: [{
field: "factoryName",
field: "orgName",
attributes: {
class: "i-input-readonly"
}
}, {
field: "orgNo",
template: function (dataItem) {
for (let i = 0; i < factoryGroupGlobalData.length; i++) {
if (factoryGroupGlobalData[i]['valueField'] === dataItem['orgNo']) {
return factoryGroupGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-factoryCode", options.model["factoryCode"]);
// 1:生产组
inInfo.set("inqu_status-0-groupType", 1);
inInfo.set("serviceName", "HPPZ011");
inInfo.set("methodName", "queryGroupComboBox");
inInfo.set("blockId", "group_record_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
}],
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
......@@ -33,6 +55,16 @@ $(function () {
* 页面加载时执行
*/
$(window).load(function () {
// 生产组名称
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-groupType", 1);
EiCommunicator.send("HPPZ011", "queryGroupComboBox", inInfo, {
onSuccess: function (ei) {
factoryGroupGlobalData = ei.getBlock("group_record_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
// 查询
query();
});
......
......@@ -37,20 +37,29 @@
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="id" cname="任务ID" enable="false" width="80" align="center"/>
<EF:EFColumn ename="prodTaskNo" cname="任务单号" enable="false" hidden="true"/>
<EF:EFColumn ename="factoryCode" cname="厂区编码" enable="false" hidden="true"/>
<EF:EFPopupColumn ename="factoryName" cname="厂区" width="200" align="center" popupType="ServiceGrid"
popupTitle="厂区信息" serviceName="HPPZ011" methodName="queryComboBoxAll"
<EF:EFComboColumn ename="factoryCode" cname="厂区" width="110" align="center" required="true"
filter="contains" readonly="true">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="factoryName" cname="厂区名称" enable="false" align="center" hidden="true"/>
<EF:EFColumn ename="orgNo" cname="生产组" width="110" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" align="center" hidden="true"/>
<%--<EF:EFColumn ename="orgNo" cname="生产组代码" enable="false" hidden="true"/>--%>
<%--<EF:EFPopupColumn ename="orgName" cname="生产组" width="200" align="center" popupType="ServiceGrid"
popupTitle="生产组信息" serviceName="HPPZ011" methodName="queryComboBoxAll"
resultId="factory_group_ecord_block_id"
columnEnames="textField,param2Field"
columnCnames="厂区,生产组"
backFillColumnIds="param2Field,param1Field,valueField,textField"
backFillFieldIds="orgName,orgNo,factoryCode,factoryName"
valueField="textField" textField="textField" readonly="true" required="true"/>
<EF:EFColumn ename="orgNo" cname="生产组代码" enable="false" hidden="true"/>
<EF:EFColumn ename="orgName" cname="生产组" enable="false" align="center"/>
valueField="textField" textField="textField" readonly="true" required="true"/>--%>
<%--<EF:EFColumn ename="factoryCode" cname="厂区编码" enable="false" hidden="true"/>
<EF:EFColumn ename="factoryName" cname="厂区" enable="false" align="center"/>--%>
<EF:EFColumn ename="num" cname="分派数量" format="{0:N3}" required="true"/>
<EF:EFColumn ename="totalWt" cname="分派重量" enable="false" format="{0:N3}"/>
<EF:EFColumn ename="completeNum" cname="已完工数量" enable="false" format="{0:N3}"/>
</EF:EFGrid>
<br/>
<span style='color: red;font-size: 13px;'>说明:厂区和生产组仅新增的时候可以编辑</span>
</EF:EFRegion>
</EF:EFPage>
......@@ -95,30 +95,22 @@ $(function () {
field: "operator",
template: function (item) {
let filePath1 = item.id;
let status = item.status;
let template = '';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + filePath1 + ')" >附件清单</a>';
if (status >= 1) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="checkIn(' + filePath1 + ')" >登记</a>';
}
return template
// template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
// + 'onclick="openUploadFile(' + item.id + ',1)" >附件上传</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ')" >附件清单</a>';
if (lv === '3') {
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="check(' + item.id + ',1)" >提交</a>';
} /*else {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="check(' + item.id + ',0)" >撤回</a>';
}*/
}
return template;
}
},{
field: "inventName",
query: function (container, options) {
let eiInfo = new EiInfo();
eiInfo.set("inventType", options.model["inventType"]);
eiInfo.set("inventType", "7");
return eiInfo;
}
}
......@@ -139,6 +131,19 @@ function showUploadFile(id) {
height: "80%",
});
}
function checkIn(id) {
JSColorbox.open({
href: "HPSC007?methodName=initLoad&inqu_status-0-hpsc006Id=" + id,
title: "<div style='text-align: center;'>下料登记</div>",
width: "80%",
height: "80%",
callbackName: checkInCallback
});
}
checkInCallback = function () {
}
assignCallback = function (id) {
var info = new EiInfo()
info.set("ids",ids.join(','));
......
......@@ -46,9 +46,9 @@
<EF:EFInput ename="productionOrderNo" type="hidden"/>
<EF:EFGrid blockId="detail" autoDraw="no">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn cname="材料类型" ename="inventType" width="90" align="center" required="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('7')"/>
</EF:EFComboColumn>
<%-- <EF:EFComboColumn cname="材料类型" ename="inventType" width="90" align="center" required="true">--%>
<%-- <EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('7')"/>--%>
<%-- </EF:EFComboColumn>--%>
<EF:EFPopupColumn ename="inventName" cname="材料名称" width="200" popupType="ServiceGrid"
popupTitle="材料信息" serviceName="HPPZ004" methodName="queryComboBox" resultId="invent_name_block_id"
columnEnames="textField,valueField"
......@@ -56,7 +56,7 @@
backFillColumnIds="textField,valueField"
backFillFieldIds="inventName,inventCode"
valueField="textField" textField="textField"/>
<EF:EFColumn ename="inventCode" enable="false" cname="材料编码"/>
<EF:EFColumn ename="inventCode" enable="false" cname="材料编码" hidden="true"/>
<EF:EFColumn ename="inventLength" cname="长" format="{0:N3}"/>
<EF:EFColumn ename="inventWidth" cname="宽" format="{0:N3}"/>
<EF:EFColumn ename="inventThick" cname="厚" format="{0:N3}"/>
......@@ -69,7 +69,7 @@
<EF:EFColumn ename="actualCompletionDate" cname="实际完成时间" editType="date" dateFormat="yyyy/MM/dd" width="150"
enable="false"/>
<EF:EFColumn enable="false" ename="actualCompletionNum" cname="实际完工数量" readonly="true"/>
<EF:EFColumn enable="false" ename="actualCompletionUnitWt" cname="实际完工重量" readonly="true"/>
<EF:EFColumn enable="false" ename="actualCompletionTotalWt" cname="实际完工重量" readonly="true"/>
<EF:EFComboColumn enable="false" align="center" ename="status" cname="状态">
<EF:EFOption label="计划中" value="0"/>
<EF:EFOption label="生产中" value="1"/>
......
......@@ -6,22 +6,18 @@ $(function () {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [{
field: "factoryName",
attributes: {
class: "i-input-readonly"
}
}],
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'update'
||e.eiInfo.extAttr.methodName == 'insert'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
}
}
}
......@@ -45,22 +41,6 @@ function query() {
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPSC005A", "save", true);
}
});
}
/**
* 删除
*/
let deleteFunc = function () {
......@@ -71,7 +51,7 @@ let deleteFunc = function () {
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPSC005A", "delete", true);
JSUtils.submitGridsData("result", "HPSC007", "delete", true);
}
});
}
......@@ -7,41 +7,48 @@
<EF:EFPage title="下料登记">
<EF:EFRegion id="inqu" title="订单详情">
<EF:EFInput ename="detail-0-id" type="hidden"/>
<div class="row">
<EF:EFInput ename="detail-0-projCode" cname="项目号" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-projName" cname="项目名称" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-prdtName" cname="部件名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-partName" cname="零部件名称" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-partName" cname="零部件名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-inventName" cname="材料名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-num" cname="计划数量" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-unitWt" cname="单重" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-totalWt" cname="计划重量" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-actualCompletionNum" cname="完工数量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-actualCompletionUnitWt" cname="完工重量" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-actualCompletionTotalWt" cname="完工重量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-planCompletionDate" cname="计划完成日期" colWidth="4" readonly="true"/>
<EF:EFSelect ename="detail-0-status" cname="状态" colWidth="4" readonly="true">
<EF:EFOption label="下料中" value="0"/>
<EF:EFOption label="完工" value="1"/>
<EF:EFOption label="计划中" value="0"/>
<EF:EFOption label="生产中" value="1"/>
<EF:EFOption label="已完成" value="2"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFInput ename="productionOrderNo" type="hidden"/>
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="actualCompletionDate" cname="完成日期" enable="false" hidden="true"/>
<EF:EFColumn ename="userId" cname="完成人" enable="false" align="center"/>
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="actualCompletionDate" required='true' cname="完成日期" editType="date" dateFormat="yyyy/MM/dd" />
<EF:EFPopupColumn ename="userId" cname="完成人" popupType="ServiceGrid"
popupTitle="人员信息" serviceName="HPXSUser" methodName="queryComboBox" resultId="user_block_id"
columnEnames="textField,valueField"
columnCnames="登录名称,用户名"
backFillColumnIds="textField,valueField"
backFillFieldIds="userName,userId"
valueField="valueField" textField="valueField"/>
<EF:EFColumn ename="userName" cname="完成名称" hidden="true"/>
<EF:EFColumn ename="actualCompletionNum" cname="完成数量" format="{0:N3}" />
<EF:EFColumn ename="totalWt" cname="分派重量" enable="false" format="{0:N3}"/>
<EF:EFColumn ename="actualCompletionTotalWt" cname="完成重量" enable="false" format="{0:N3}"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -7,6 +7,7 @@
<EF:EFPage title="组织机构">
<EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput cname="组类型" ename="groupType" blockId="inqu_status" row="0" type="hidden"/>
<div class="row">
<EF:EFInput cname="厂区名称" ename="factoryName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="生产组名称" ename="groupName" blockId="inqu_status" row="0" colWidth="3"/>
......
......@@ -102,7 +102,7 @@
String loginPublicKey = LoginConstants.loginRsaPublicKey;
String cryptoPasswordEnable = LoginConstants.cryptoPasswordEnable;
String companyCode = UserSessionUtils.getCompanyCode();
String loginPrefix = StringUtils.isBlank(companyCode) ? "" : HPPZTools.getPz009(companyCode).getLoginPrefix();
String loginPrefix = StringUtils.isBlank(companyCode) ? "" : HPPZTools.HpPz009.getByCode(companyCode).getLoginPrefix();
%>
<c:set var="pwdRgx" value="<%=passwordRegex%>"/>
<c:set var="pwdDesc" value="<%=passwordDesc%>"/>
......
......@@ -21,7 +21,7 @@
request.setAttribute("passwordTip", "密码由不超过255位的英文字母或者数字字符或下划线组成。");
}
String companyCode = UserSessionUtils.getCompanyCode();
String loginPrefix = StringUtils.isBlank(companyCode) ? "" : HPPZTools.getPz009(companyCode).getLoginPrefix();
String loginPrefix = StringUtils.isBlank(companyCode) ? "" : HPPZTools.HpPz009.getByCode(companyCode).getLoginPrefix();
String username = UserSession.getUser().getUsername();
String passwordRegex = StringUtils.defaultIfEmpty(PlatApplicationContext.getProperty("xservices.security.checkpassword.regex"), "^(?=.*?[a-zA-Z])(?=.*?[0-9]).{1,}$");
String passwordDesc = StringUtils.defaultIfEmpty(PlatApplicationContext.getProperty("xservices.security.checkpassword.desc"), "密码必须包含英文及数字");
......
......@@ -126,8 +126,49 @@ function refreshSelect(container, inInfo) {
dataTextField: "textField",
dataValueField: "valueField",
dataSource: dataSource,
template: "#=textField#"
template: "#=textField#",
filter: "contains"
});
return dataSource;
}
/**
* 刷新下拉框,可手动输入
*
* @param container
* @param inInfo
*/
function refreshInputSelect(container, inInfo) {
let grid = container.closest(".k-grid").data("kendoGrid");
let cellIndex = grid.cellIndex(container);
let input = $('<input />');
let field = inInfo.get("field");
input.attr("name", field);
input.attr("id", field);
input.appendTo(container);
let dataSource;
let serviceName = inInfo.get("serviceName");
let methodName = inInfo.get("methodName");
let blockId = inInfo.get("blockId");
EiCommunicator.send(serviceName, methodName, inInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock(blockId).getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
input.kendoAutoComplete({
valuePrimitive: true,
dataSource: dataSource,
dataTextField: "textField",
dataValueField: "valueField",
required: "true",
optionLabelTemplate: "#:textField#",
valueTemplate: "#:valueField#",
template: "#:textField#",
filter: "contains"
});
return dataSource;
}
/**
......
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