Commit 14a1f6b1 by yukang

项目管理、物料管理、生产计划、生产订单

parent 23a9f843
...@@ -443,6 +443,8 @@ public class HPSC003 extends DaoEPBase { ...@@ -443,6 +443,8 @@ public class HPSC003 extends DaoEPBase {
setUpdatedTime(StringUtils.toString(map.get(FIELD_UPDATED_TIME))); setUpdatedTime(StringUtils.toString(map.get(FIELD_UPDATED_TIME)));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode)); setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark)); setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SCHEDULE)), schedule));
} }
/** /**
...@@ -468,6 +470,7 @@ public class HPSC003 extends DaoEPBase { ...@@ -468,6 +470,7 @@ public class HPSC003 extends DaoEPBase {
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME))); map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE))); map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK))); map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK)));
map.put(FIELD_SCHEDULE, StringUtils.toString(schedule, eiMetadata.getMeta(FIELD_SCHEDULE)));
return map; return map;
} }
......
...@@ -4,6 +4,7 @@ import com.baosight.iplat4j.core.util.NumberUtils; ...@@ -4,6 +4,7 @@ import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn; import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase; import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils; import com.baosight.iplat4j.core.util.StringUtils;
...@@ -48,6 +49,7 @@ public class HPSC004 extends DaoEPBase { ...@@ -48,6 +49,7 @@ public class HPSC004 extends DaoEPBase {
public static final String FIELD_ACTUAL_COMPLETION_DATE = "actualCompletionDate"; /* 实际完工日期*/ public static final String FIELD_ACTUAL_COMPLETION_DATE = "actualCompletionDate"; /* 实际完工日期*/
public static final String FIELD_ACTUAL_COMPLETION_NUM = "actualCompletionNum"; /* 实际完工数量*/ public static final String FIELD_ACTUAL_COMPLETION_NUM = "actualCompletionNum"; /* 实际完工数量*/
public static final String FIELD_ACTUAL_COMPLETION_UNIT_WT = "actualCompletionUnitWt"; /* 实际完工重量*/ public static final String FIELD_ACTUAL_COMPLETION_UNIT_WT = "actualCompletionUnitWt"; /* 实际完工重量*/
public static final String FIELD_PRODUCTION_ORDER_NO = "productionOrderNo"; /* 生产订单号*/
public static final String FIELD_STATUS = "status"; /* 状态 0-未审核,1-已审核*/ public static final String FIELD_STATUS = "status"; /* 状态 0-未审核,1-已审核*/
public static final String FIELD_DEL_STATUS = "delStatus"; /* 状态 1未删除,0已删除*/ public static final String FIELD_DEL_STATUS = "delStatus"; /* 状态 1未删除,0已删除*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/ public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
...@@ -82,6 +84,7 @@ public class HPSC004 extends DaoEPBase { ...@@ -82,6 +84,7 @@ public class HPSC004 extends DaoEPBase {
public static final String COL_ACTUAL_COMPLETION_DATE = "ACTUAL_COMPLETION_DATE"; /* 实际完工日期*/ public static final String COL_ACTUAL_COMPLETION_DATE = "ACTUAL_COMPLETION_DATE"; /* 实际完工日期*/
public static final String COL_ACTUAL_COMPLETION_NUM = "ACTUAL_COMPLETION_NUM"; /* 实际完工数量*/ public static final String COL_ACTUAL_COMPLETION_NUM = "ACTUAL_COMPLETION_NUM"; /* 实际完工数量*/
public static final String COL_ACTUAL_COMPLETION_UNIT_WT = "ACTUAL_COMPLETION_UNIT_WT"; /* 实际完工重量*/ public static final String COL_ACTUAL_COMPLETION_UNIT_WT = "ACTUAL_COMPLETION_UNIT_WT"; /* 实际完工重量*/
public static final String COL_PRODUCTION_ORDER_NO = "PRODUCTION_ORDER_NO"; /* 生产订单号*/
public static final String COL_STATUS = "STATUS"; /* 状态 0-未审核,1-已审核*/ public static final String COL_STATUS = "STATUS"; /* 状态 0-未审核,1-已审核*/
public static final String COL_DEL_STATUS = "DEL_STATUS"; /* 状态 1未删除,0已删除*/ public static final String COL_DEL_STATUS = "DEL_STATUS"; /* 状态 1未删除,0已删除*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/ public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
...@@ -122,6 +125,7 @@ public class HPSC004 extends DaoEPBase { ...@@ -122,6 +125,7 @@ public class HPSC004 extends DaoEPBase {
private String actualCompletionDate = " "; /* 实际完工日期*/ private String actualCompletionDate = " "; /* 实际完工日期*/
private Integer actualCompletionNum = new Integer(0); /* 实际完工数量*/ private Integer actualCompletionNum = new Integer(0); /* 实际完工数量*/
private BigDecimal actualCompletionUnitWt = new BigDecimal("0"); /* 实际完工重量*/ private BigDecimal actualCompletionUnitWt = new BigDecimal("0"); /* 实际完工重量*/
private String productionOrderNo = " "; /* 生产订单号*/
private Integer status = new Integer(0); /* 状态 0-未审核,1-已审核*/ private Integer status = new Integer(0); /* 状态 0-未审核,1-已审核*/
private Integer delStatus = new Integer(0); /* 状态 1未删除,0已删除*/ private Integer delStatus = new Integer(0); /* 状态 1未删除,0已删除*/
private String createdBy = " "; /* 创建人*/ private String createdBy = " "; /* 创建人*/
...@@ -250,6 +254,10 @@ public class HPSC004 extends DaoEPBase { ...@@ -250,6 +254,10 @@ public class HPSC004 extends DaoEPBase {
eiColumn.setDescName("实际完工重量"); eiColumn.setDescName("实际完工重量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRODUCTION_ORDER_NO);
eiColumn.setDescName("生产订单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS); eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态 0-未审核,1-已审核"); eiColumn.setDescName("状态 0-未审核,1-已审核");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -705,6 +713,22 @@ public class HPSC004 extends DaoEPBase { ...@@ -705,6 +713,22 @@ public class HPSC004 extends DaoEPBase {
this.actualCompletionUnitWt = actualCompletionUnitWt; this.actualCompletionUnitWt = actualCompletionUnitWt;
} }
/** /**
* get the productionOrderNo - 生产订单号.
* @return the productionOrderNo
*/
public String getProductionOrderNo() {
return this.productionOrderNo;
}
/**
* set the productionOrderNo - 生产订单号.
*
* @param productionOrderNo - 生产订单号
*/
public void setProductionOrderNo(String productionOrderNo) {
this.productionOrderNo = productionOrderNo;
}
/**
* get the status - 状态 0-未审核,1-已审核. * get the status - 状态 0-未审核,1-已审核.
* @return the status * @return the status
*/ */
...@@ -850,6 +874,7 @@ public class HPSC004 extends DaoEPBase { ...@@ -850,6 +874,7 @@ public class HPSC004 extends DaoEPBase {
setActualCompletionDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACTUAL_COMPLETION_DATE)), actualCompletionDate)); setActualCompletionDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACTUAL_COMPLETION_DATE)), actualCompletionDate));
setActualCompletionNum(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_ACTUAL_COMPLETION_NUM)), actualCompletionNum)); setActualCompletionNum(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_ACTUAL_COMPLETION_NUM)), actualCompletionNum));
setActualCompletionUnitWt(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_ACTUAL_COMPLETION_UNIT_WT)), actualCompletionUnitWt)); setActualCompletionUnitWt(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_ACTUAL_COMPLETION_UNIT_WT)), actualCompletionUnitWt));
setProductionOrderNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRODUCTION_ORDER_NO)), productionOrderNo));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status)); setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setDelStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DEL_STATUS)), delStatus)); setDelStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DEL_STATUS)), delStatus));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy)); setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
...@@ -892,6 +917,7 @@ public class HPSC004 extends DaoEPBase { ...@@ -892,6 +917,7 @@ public class HPSC004 extends DaoEPBase {
map.put(FIELD_ACTUAL_COMPLETION_DATE, StringUtils.toString(actualCompletionDate, eiMetadata.getMeta(FIELD_ACTUAL_COMPLETION_DATE))); map.put(FIELD_ACTUAL_COMPLETION_DATE, StringUtils.toString(actualCompletionDate, eiMetadata.getMeta(FIELD_ACTUAL_COMPLETION_DATE)));
map.put(FIELD_ACTUAL_COMPLETION_NUM, StringUtils.toString(actualCompletionNum, eiMetadata.getMeta(FIELD_ACTUAL_COMPLETION_NUM))); map.put(FIELD_ACTUAL_COMPLETION_NUM, StringUtils.toString(actualCompletionNum, eiMetadata.getMeta(FIELD_ACTUAL_COMPLETION_NUM)));
map.put(FIELD_ACTUAL_COMPLETION_UNIT_WT, StringUtils.toString(actualCompletionUnitWt, eiMetadata.getMeta(FIELD_ACTUAL_COMPLETION_UNIT_WT))); map.put(FIELD_ACTUAL_COMPLETION_UNIT_WT, StringUtils.toString(actualCompletionUnitWt, eiMetadata.getMeta(FIELD_ACTUAL_COMPLETION_UNIT_WT)));
map.put(FIELD_PRODUCTION_ORDER_NO, StringUtils.toString(productionOrderNo, eiMetadata.getMeta(FIELD_PRODUCTION_ORDER_NO)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS))); map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_DEL_STATUS, StringUtils.toString(delStatus, eiMetadata.getMeta(FIELD_DEL_STATUS))); map.put(FIELD_DEL_STATUS, StringUtils.toString(delStatus, eiMetadata.getMeta(FIELD_DEL_STATUS)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY))); map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
......
...@@ -289,14 +289,14 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -289,14 +289,14 @@ public class ServiceHPSC002 extends ServiceBase {
public void autoPlanInfo(String id) { public void autoPlanInfo(String id) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
THPSC002 THPSC002 = (THPSC002) dao.get("HPSC002.query","id",id); THPSC002 THPSC002 = (THPSC002) dao.get("HPSC002.query","id",id);
String SCJHD = "SCJH" + DateUtil.getDateTime("yyyMMddHHmmss",new Date());
//生成生产计划t_hpsc003 //生成生产计划t_hpsc003
HPSC003 HPSC003 = new HPSC003(); HPSC003 HPSC003 = new HPSC003();
HPSC003.setCompanyCode(""); HPSC003.setCompanyCode("");
HPSC003.setProjType(null); HPSC003.setProjType(null);
HPSC003.setProjCode(THPSC002.getProjCode()); HPSC003.setProjCode(THPSC002.getProjCode());
HPSC003.setProjName(THPSC002.getProjName()); HPSC003.setProjName(THPSC002.getProjName());
HPSC003.setPlanInfoNo("SCJH" + DateUtil.getDateTime("yyyMMddHHmmss",new Date())); HPSC003.setPlanInfoNo(SCJHD);
HPSC003.setPrdtCode(THPSC002.getPrdtCode()); HPSC003.setPrdtCode(THPSC002.getPrdtCode());
HPSC003.setPrdtName(THPSC002.getPrdtName()); HPSC003.setPrdtName(THPSC002.getPrdtName());
HPSC003.setPlanCompletionDate(""); HPSC003.setPlanCompletionDate("");
...@@ -307,6 +307,8 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -307,6 +307,8 @@ public class ServiceHPSC002 extends ServiceBase {
HPSC003.setUpdatedTime(null); HPSC003.setUpdatedTime(null);
this.dao.insert("HPSC003.insert", HPSC003.toMap()); this.dao.insert("HPSC003.insert", HPSC003.toMap());
//根据生产计划单号找到ID
HPSC003 ent = (HPSC003) this.dao.get("HPSC003.query","planInfoNo", SCJHD);
//生产计划详情 //生产计划详情
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("id", id); queryMap.put("id", id);
...@@ -319,7 +321,7 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -319,7 +321,7 @@ public class ServiceHPSC002 extends ServiceBase {
HPSC004.setDeptCode(""); HPSC004.setDeptCode("");
HPSC004.setProjCode(StringUtils.toString(domain.get("projCode"))); HPSC004.setProjCode(StringUtils.toString(domain.get("projCode")));
HPSC004.setProjName(StringUtils.toString(domain.get("projName"))); HPSC004.setProjName(StringUtils.toString(domain.get("projName")));
HPSC004.setParentPrdtCode(StringUtils.toString(domain.get("parentPrdtCode"))); HPSC004.setParentPrdtCode(StringUtils.toString(ent.getId()));
HPSC004.setParentPrdtName(StringUtils.toString(domain.get("parentPrdtName"))); HPSC004.setParentPrdtName(StringUtils.toString(domain.get("parentPrdtName")));
HPSC004.setPrdtCode(StringUtils.toString(domain.get("prdtCode"))); HPSC004.setPrdtCode(StringUtils.toString(domain.get("prdtCode")));
HPSC004.setPrdtName(StringUtils.toString(domain.get("prdtName"))); HPSC004.setPrdtName(StringUtils.toString(domain.get("prdtName")));
......
...@@ -2,11 +2,14 @@ package com.baosight.hpjx.hp.sc.service; ...@@ -2,11 +2,14 @@ package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.common.HPConstants; import com.baosight.hpjx.common.HPConstants;
import com.baosight.hpjx.hp.sc.domain.HPSC003; 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.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.util.DateUtil;
import com.baosight.iplat4j.core.web.threadlocal.UserSession; import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
...@@ -84,6 +87,7 @@ public class ServiceHPSC003 extends ServiceBase { ...@@ -84,6 +87,7 @@ public class ServiceHPSC003 extends ServiceBase {
try { try {
HPSC003 HPSC003 = new HPSC003(); HPSC003 HPSC003 = new HPSC003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
if (eiBlock != null) {
for (int i = 0; i < eiBlock.getRowCount(); i++) { for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
HPSC003.fromMap(map); HPSC003.fromMap(map);
...@@ -93,6 +97,31 @@ public class ServiceHPSC003 extends ServiceBase { ...@@ -93,6 +97,31 @@ public class ServiceHPSC003 extends ServiceBase {
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!"); inInfo.setMsg("修改成功!");
}
} catch (PlatException e) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("修改失败", e.getMessage());
return inInfo;
}
return query(inInfo);
}
public EiInfo updateHPSC0004(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
HPSC004 HPSC004 = new HPSC004();
EiBlock eiBlock = inInfo.getBlock("detail");
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPSC004.fromMap(map);
HPSC004.setUpdatedBy(UserSession.getUserId());
HPSC004.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPSC004.updateHPSC0004", HPSC004.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
} catch (PlatException e) { } catch (PlatException e) {
inInfo.setStatus(EiConstant.STATUS_FAILURE); inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!原因参见详细错误描述!"); inInfo.setMsg("操作失败!原因参见详细错误描述!");
...@@ -129,5 +158,89 @@ public class ServiceHPSC003 extends ServiceBase { ...@@ -129,5 +158,89 @@ public class ServiceHPSC003 extends ServiceBase {
return eiInfo; return eiInfo;
} }
/**
* 根据ID获取详情
* @param eiInfo
* @return
*/
public EiInfo getInfo(EiInfo eiInfo) {
Map map = new HashMap();
String id = eiInfo.get("id").toString();
map.put("id", id);
HPSC003 HPSC003 = (HPSC003) this.dao.get("HPSC003.query","id",id);
eiInfo.set("model",HPSC003);
return eiInfo;
}
/**
* 审核生产计划
* @param eiInfo
* @return
*/
public EiInfo checkHPSC0003(EiInfo eiInfo) {
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Map map = new HashMap();
String id = eiInfo.get("id").toString();
map.put("id", id);
HPSC003 HPSC003 = (HPSC003) this.dao.get("HPSC003.query","id",id);
HPSC003.setStatus(1);
HPSC003.setUpdatedBy(UserSession.getUserId());
HPSC003.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPSC003.update", HPSC003.toMap());
//生成生产订单
HashMap params = new HashMap();
params.put("parentPrdtCode",HPSC003.getId());
List list = dao.query("HPSC004.queryDetail",params,0,-999999);
for (int i = 0; i < list.size(); i ++) {
HPSC004 HPSC004 = (HPSC004) list.get(i);
HPSC005 HPSC005 = new HPSC005();
String SCDD = "SCDD" + DateUtil.getDateTime("yyyMMddHHmmss",new Date()) + generateFixedLengthRandomNumber(4);
HPSC005.setProjCode(HPSC003.getProjCode());
HPSC005.setProjName(HPSC003.getProjName());
HPSC005.setProductionOrderNo(SCDD);
HPSC005.setPrdtCode(HPSC004.getPrdtCode());
HPSC005.setPrdtName(HPSC004.getPrdtName());
HPSC005.setPlanCompletionDate(HPSC004.getPlanCompletionDate());
HPSC005.setNum(HPSC004.getNum());
HPSC005.setTotalWt(HPSC004.getUnitWt());
HPSC005.setStatus(0);
HPSC005.setCreatedBy(UserSession.getUserId());
HPSC005.setCreatedTime(sdf.format(new Date()));
HPSC005.setFilePath1(HPSC004.getFilePath1());
HPSC005.setFilePath2(HPSC004.getFilePath2());
HPSC005.setFilePath3(HPSC004.getFilePath3());
HPSC005.setFilePath4(HPSC004.getFilePath4());
HPSC005.setFilePath5(HPSC004.getFilePath5());
this.dao.insert("HPSC005.insert", HPSC005.toMap());
HPSC004.setProductionOrderNo(SCDD);
HPSC004.setUpdatedBy(UserSession.getUserId());
HPSC004.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPSC004.update", HPSC004.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("审核失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("审核失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("审核成功!");
return eiInfo;
}
private static String generateFixedLengthRandomNumber(int length) {
StringBuilder sb = new StringBuilder();
Random rand = new Random();
for (int i = 0; i < length; i++) {
int digit = rand.nextInt(10); // 生成0-9之间的随机数字
sb.append(digit);
}
return sb.toString();
}
} }
package com.baosight.hpjx.hp.sc.service; package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.hp.sc.domain.HPSC004; import com.baosight.hpjx.hp.sc.domain.HPSC004;
import com.baosight.hpjx.hp.sc.domain.THPSC001;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
...@@ -22,9 +21,9 @@ public class ServiceHPSC004 extends ServiceBase { ...@@ -22,9 +21,9 @@ public class ServiceHPSC004 extends ServiceBase {
* 画面初始化. * 画面初始化.
*/ */
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
THPSC001 hpsc001 = new THPSC001(); HPSC004 HPSC004 = new HPSC004();
EiInfo outInfo = super.initLoad(inInfo, hpsc001); EiInfo outInfo = super.initLoad(inInfo, HPSC004);
outInfo.addBlock(EiConstant.resultBlock).addBlockMeta(hpsc001.eiMetadata); outInfo.addBlock(EiConstant.resultBlock).addBlockMeta(HPSC004.eiMetadata);
return inInfo; return inInfo;
} }
...@@ -35,7 +34,7 @@ public class ServiceHPSC004 extends ServiceBase { ...@@ -35,7 +34,7 @@ public class ServiceHPSC004 extends ServiceBase {
@Override @Override
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
/* 调用EI查询方法.*/ /* 调用EI查询方法.*/
EiInfo outInfo = super.query(inInfo, "HPSC001.query", new THPSC001()); EiInfo outInfo = super.query(inInfo, "HPSC004.query", new HPSC004());
return outInfo; return outInfo;
} }
...@@ -47,16 +46,16 @@ public class ServiceHPSC004 extends ServiceBase { ...@@ -47,16 +46,16 @@ public class ServiceHPSC004 extends ServiceBase {
public EiInfo insert(EiInfo inInfo) { public EiInfo insert(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try { try {
THPSC001 hpsc001 = new THPSC001(); HPSC004 HPSC004 = new HPSC004();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) { for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
hpsc001.fromMap(map); HPSC004.fromMap(map);
hpsc001.setCreatedBy(UserSession.getUserId()); HPSC004.setCreatedBy(UserSession.getUserId());
hpsc001.setCreatedTime(sdf.format(new Date())); HPSC004.setCreatedTime(sdf.format(new Date()));
hpsc001.setUpdatedBy(null); HPSC004.setUpdatedBy(null);
hpsc001.setUpdatedTime(null); HPSC004.setUpdatedTime(null);
this.dao.insert("HPSC001.insert", hpsc001.toMap()); this.dao.insert("HPSC004.insert", HPSC004.toMap());
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!"); inInfo.setMsg("新增成功!");
...@@ -78,14 +77,14 @@ public class ServiceHPSC004 extends ServiceBase { ...@@ -78,14 +77,14 @@ public class ServiceHPSC004 extends ServiceBase {
public EiInfo update(EiInfo inInfo) { public EiInfo update(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try { try {
THPSC001 hpsc001 = new THPSC001(); HPSC004 HPSC004 = new HPSC004();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); EiBlock eiBlock = inInfo.getBlock("detail");
for (int i = 0; i < eiBlock.getRowCount(); i++) { for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
hpsc001.fromMap(map); HPSC004.fromMap(map);
hpsc001.setUpdatedBy(UserSession.getUserId()); HPSC004.setUpdatedBy(UserSession.getUserId());
hpsc001.setUpdatedTime(sdf.format(new Date())); HPSC004.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPSC001.update", hpsc001.toMap()); this.dao.update("HPSC004.update", HPSC004.toMap());
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!"); inInfo.setMsg("修改成功!");
...@@ -103,13 +102,13 @@ public class ServiceHPSC004 extends ServiceBase { ...@@ -103,13 +102,13 @@ public class ServiceHPSC004 extends ServiceBase {
* 删除操作. * 删除操作.
*/ */
public EiInfo delete(EiInfo eiInfo) { public EiInfo delete(EiInfo eiInfo) {
THPSC001 hpsc001 = new THPSC001(); HPSC004 HPSC004 = new HPSC004();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock); EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try { try {
for (int i = 0; i < eiBlock.getRowCount(); i++) { for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
hpsc001.fromMap(map); HPSC004.fromMap(map);
this.dao.delete("HPPZ001.delete", hpsc001.toMap()); this.dao.delete("HPPZ001.delete", HPSC004.toMap());
} }
} catch (PlatException e) { } catch (PlatException e) {
...@@ -138,4 +137,18 @@ public class ServiceHPSC004 extends ServiceBase { ...@@ -138,4 +137,18 @@ public class ServiceHPSC004 extends ServiceBase {
outInfo.getBlock("detail").set("limit", list.size()); outInfo.getBlock("detail").set("limit", list.size());
return outInfo; return outInfo;
} }
/**
* 计划审核验证
* @param eiInfo
* @return
*/
public EiInfo inspectDetail(EiInfo eiInfo) {
Map map = new HashMap();
String id = eiInfo.get("id").toString();
map.put("id", id);
List list = this.dao.query("HPSC004.inspectDetail",map);
eiInfo.set("list",list);
return eiInfo;
}
} }
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import java.text.SimpleDateFormat;
import java.util.*;
/**
*
*/
public class ServiceHPSC005 extends ServiceBase {
/**
* 画面初始化.
*/
public EiInfo initLoad(EiInfo inInfo) {
HPSC005 HPSC005 = new HPSC005();
EiInfo outInfo = super.initLoad(inInfo, HPSC005);
outInfo.addBlock(EiConstant.resultBlock).addBlockMeta(HPSC005.eiMetadata);
return inInfo;
}
/**
* 查询操作.
*/
@Override
public EiInfo query(EiInfo inInfo) {
/* 调用EI查询方法.*/
EiInfo outInfo = super.query(inInfo, "HPSC005.query", new HPSC005());
return outInfo;
}
/**
* 新增操作.
*/
@Override
public EiInfo insert(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
HPSC005 HPSC005 = new HPSC005();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPSC005.fromMap(map);
HPSC005.setCreatedBy(UserSession.getUserId());
HPSC005.setCreatedTime(sdf.format(new Date()));
HPSC005.setUpdatedBy(null);
HPSC005.setUpdatedTime(null);
this.dao.insert("HPSC005.insert", HPSC005.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("新增失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("新增失败", e.getMessage());
return inInfo;
}
return query(inInfo);
}
/**
* 修改操作.
*/
public EiInfo update(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
HPSC005 HPSC005 = new HPSC005();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPSC005.fromMap(map);
HPSC005.setUpdatedBy(UserSession.getUserId());
HPSC005.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPSC005.update", HPSC005.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
} catch (PlatException e) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("修改失败", e.getMessage());
return inInfo;
}
return query(inInfo);
}
/**
* 删除操作.
*/
public EiInfo delete(EiInfo eiInfo) {
HPSC005 HPSC005 = new HPSC005();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPSC005.fromMap(map);
this.dao.delete("HPPZ001.delete", HPSC005.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("删除失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("删除失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
return eiInfo;
}
}
...@@ -369,6 +369,7 @@ ...@@ -369,6 +369,7 @@
ACTUAL_COMPLETION_DATE = #actualCompletionDate#, <!-- 实际完工日期 --> ACTUAL_COMPLETION_DATE = #actualCompletionDate#, <!-- 实际完工日期 -->
ACTUAL_COMPLETION_NUM = #actualCompletionNum#, <!-- 实际完工数量 --> ACTUAL_COMPLETION_NUM = #actualCompletionNum#, <!-- 实际完工数量 -->
ACTUAL_COMPLETION_UNIT_WT = #actualCompletionUnitWt#, <!-- 实际完工重量 --> ACTUAL_COMPLETION_UNIT_WT = #actualCompletionUnitWt#, <!-- 实际完工重量 -->
PRODUCTION_ORDER_NO = #productionOrderNo#, <!-- 生产订单号 -->
STATUS = #status#, <!-- 状态 0-未审核,1-已审核 --> STATUS = #status#, <!-- 状态 0-未审核,1-已审核 -->
DEL_STATUS = #delStatus#, <!-- 状态 1未删除,0已删除 --> DEL_STATUS = #delStatus#, <!-- 状态 1未删除,0已删除 -->
CREATED_BY = #createdBy#, <!-- 创建人 --> CREATED_BY = #createdBy#, <!-- 创建人 -->
...@@ -380,6 +381,16 @@ ...@@ -380,6 +381,16 @@
ID = #id# ID = #id#
</update> </update>
<update id="updateHPSC0004">
UPDATE hpjx.T_HPSC004
SET
PLAN_COMMENT_DATE = #planCommentDate#, <!-- 计划开始时间 -->
PLAN_COMPLETION_DATE = #planCompletionDate#, <!-- 计划结束时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE
ID = #id#
</update>
<select id="queryDetail" parameterClass="java.util.HashMap" <select id="queryDetail" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC004"> resultClass="com.baosight.hpjx.hp.sc.domain.HPSC004">
...@@ -429,4 +440,11 @@ ...@@ -429,4 +440,11 @@
</dynamic> </dynamic>
</select> </select>
<select id="inspectDetail" resultClass="int">
SELECT COUNT(*) FROM hpjx.T_HPSC004 WHERE 1=1
AND PARENT_PRDT_CODE = #id# AND (PLAN_COMMENT_DATE = '' OR PLAN_COMMENT_DATE IS NULL
OR PLAN_COMPLETION_DATE = '' OR PLAN_COMPLETION_DATE IS NULL )
</select>
</sqlMap> </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-01-22 15:35:04
Version : 1.0
schema : hpjx
tableName : T_HPSC005
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR,
PROJ_CODE VARCHAR,
PROJ_NAME VARCHAR,
PRODUCTION_ORDER_NO VARCHAR,
PRDT_CODE VARCHAR,
PRDT_NAME VARCHAR,
PLAN_COMPLETION_DATE VARCHAR,
NUM INTEGER,
TOTAL_WT DECIMAL,
STATUS TINYINT,
ORG_NO VARCHAR,
ORG_NAME VARCHAR,
CREATED_BY VARCHAR,
CREATED_TIME DATETIME,
UPDATED_BY VARCHAR,
UPDATED_TIME DATETIME,
DEP_CODE VARCHAR,
REMARK VARCHAR,
FILE_PATH1 VARCHAR,
FILE_PATH2 VARCHAR,
FILE_PATH3 VARCHAR,
FILE_PATH4 VARCHAR,
FILE_PATH5 VARCHAR
-->
<sqlMap namespace="HPSC005">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productionOrderNo">
PRODUCTION_ORDER_NO = #productionOrderNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtCode">
PRDT_CODE = #prdtCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtName">
PRDT_NAME = #prdtName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planCompletionDate">
PLAN_COMPLETION_DATE = #planCompletionDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="num">
NUM = #num#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalWt">
TOTAL_WT = #totalWt#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgNo">
ORG_NO = #orgNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgName">
ORG_NAME = #orgName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remark">
REMARK = #remark#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="filePath1">
FILE_PATH1 = #filePath1#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="filePath2">
FILE_PATH2 = #filePath2#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="filePath3">
FILE_PATH3 = #filePath3#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="filePath4">
FILE_PATH4 = #filePath4#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="filePath5">
FILE_PATH5 = #filePath5#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC005">
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PRODUCTION_ORDER_NO as "productionOrderNo", <!-- 生产订单号 -->
PRDT_CODE as "prdtCode", <!-- 产品编码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
PLAN_COMPLETION_DATE as "planCompletionDate", <!-- 计划完成日期 -->
NUM as "num", <!-- 计划数量 -->
TOTAL_WT as "totalWt", <!-- 计划重量 -->
STATUS as "status", <!-- 状态 0-未派工,1-已派工 -->
ORG_NO as "orgNo", <!-- 生产组编码 -->
ORG_NAME as "orgName", <!-- 生产组名称 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
REMARK as "remark", <!-- 备注 -->
FILE_PATH1 as "filePath1", <!-- 文件地址1 -->
FILE_PATH2 as "filePath2", <!-- 文件地址2 -->
FILE_PATH3 as "filePath3", <!-- 文件地址3 -->
FILE_PATH4 as "filePath4", <!-- 文件地址4 -->
FILE_PATH5 as "filePath5" <!-- 文件地址5 -->
FROM ${hpjxSchema}.T_HPSC005 WHERE 1=1
<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_HPSC005 WHERE 1=1
<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="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productionOrderNo">
PRODUCTION_ORDER_NO = #productionOrderNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtCode">
PRDT_CODE = #prdtCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtName">
PRDT_NAME = #prdtName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planCompletionDate">
PLAN_COMPLETION_DATE = #planCompletionDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="num">
NUM = #num#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalWt">
TOTAL_WT = #totalWt#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgNo">
ORG_NO = #orgNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgName">
ORG_NAME = #orgName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remark">
REMARK = #remark#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPSC005 (ID,
COMPANY_CODE, <!-- 企业编码 预留 -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
PRODUCTION_ORDER_NO, <!-- 生产订单号 -->
PRDT_CODE, <!-- 产品编码 -->
PRDT_NAME, <!-- 产品名称 -->
PLAN_COMPLETION_DATE, <!-- 计划完成日期 -->
NUM, <!-- 计划数量 -->
TOTAL_WT, <!-- 计划重量 -->
STATUS, <!-- 状态 0-未派工,1-已派工 -->
ORG_NO, <!-- 生产组编码 -->
ORG_NAME, <!-- 生产组名称 -->
CREATED_BY, <!-- 创建人 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_TIME, <!-- 更新时间 -->
DEP_CODE, <!-- 部门编码 -->
REMARK, <!-- 备注 -->
FILE_PATH1, <!-- 文件地址1 -->
FILE_PATH2, <!-- 文件地址2 -->
FILE_PATH3, <!-- 文件地址3 -->
FILE_PATH4, <!-- 文件地址4 -->
FILE_PATH5 <!-- 文件地址5 -->
)
VALUES (#id#, #companyCode#, #projCode#, #projName#, #productionOrderNo#, #prdtCode#, #prdtName#, #planCompletionDate#, #num#, #totalWt#, #status#, #orgNo#, #orgName#, #createdBy#, #createdTime#, #updatedBy#, #updatedTime#, #depCode#, #remark#, #filePath1#, #filePath2#, #filePath3#, #filePath4#, #filePath5#)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPSC005 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPSC005
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
PRODUCTION_ORDER_NO = #productionOrderNo#, <!-- 生产订单号 -->
PRDT_CODE = #prdtCode#, <!-- 产品编码 -->
PRDT_NAME = #prdtName#, <!-- 产品名称 -->
PLAN_COMPLETION_DATE = #planCompletionDate#, <!-- 计划完成日期 -->
NUM = #num#, <!-- 计划数量 -->
TOTAL_WT = #totalWt#, <!-- 计划重量 -->
STATUS = #status#, <!-- 状态 0-未派工,1-已派工 -->
ORG_NO = #orgNo#, <!-- 生产组编码 -->
ORG_NAME = #orgName#, <!-- 生产组名称 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
REMARK = #remark#, <!-- 备注 -->
FILE_PATH1 = #filePath1#, <!-- 文件地址1 -->
FILE_PATH2 = #filePath2#, <!-- 文件地址2 -->
FILE_PATH3 = #filePath3#, <!-- 文件地址3 -->
FILE_PATH4 = #filePath4#, <!-- 文件地址4 -->
FILE_PATH5 = #filePath5# <!-- 文件地址5 -->
WHERE
ID = #id#
</update>
</sqlMap>
...@@ -22,6 +22,10 @@ $(function () { ...@@ -22,6 +22,10 @@ $(function () {
IPLATUI.EFGrid = { IPLATUI.EFGrid = {
"result": { "result": {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [ columns: [
{ {
field: "matCode", field: "matCode",
......
...@@ -12,6 +12,10 @@ $(function() { ...@@ -12,6 +12,10 @@ $(function() {
$("#BTN_SAVE").on("click", save); $("#BTN_SAVE").on("click", save);
IPLATUI.EFGrid = { IPLATUI.EFGrid = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
"result": { "result": {
columns: [{ columns: [{
field: "inventCode", field: "inventCode",
......
...@@ -50,12 +50,45 @@ $(function () { ...@@ -50,12 +50,45 @@ $(function () {
// hidden: false, // true时,不显示功能按钮,但保留setting导出按钮 // hidden: false, // true时,不显示功能按钮,但保留setting导出按钮
// add: false, // 不显示新增按钮 // add: false, // 不显示新增按钮
cancel: true, // 不显示取消按钮 cancel: true, // 不显示取消按钮
save: true, // 不显示保存按钮 // save: true, // 不显示保存按钮
// delete: true, // 显示删除按钮 // delete: true, // 显示删除按钮
}, },
onSave: function (e) { onSave: function (e) {
// 不向后台保存 var rowCount = detailGrid.getCheckedRows();
alert('1111') // 检验是否选中数据
if (rowCount == null || rowCount == "") {
NotificationUtil({
msg: '请选择一条或多条数据'
}, "warning");
return false;
}
var btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
IPLAT.submitNode($("#HPSC003"), "HPSC003", "updateHPSC0004", {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
NotificationUtil({
msg: '修改成功'
});
// 绑定grid
detailGrid.setEiInfo(ei);
}
//释放禁用按钮
btnNode.attr("disabled", false);
},
onFail: function (ei) { // onFail 表示失败回调函数
// 发生异常
console.log(ei);
//释放禁用按钮
btnNode.attr("disabled", false);
}
});
}, },
columns: [ columns: [
{ {
...@@ -78,14 +111,30 @@ $(function () { ...@@ -78,14 +111,30 @@ $(function () {
} }
}); });
$("#SAVE_1").on("click", function (e) {
alert('1111')
})
function check(id, auditStatus) { function check(id, auditStatus) {
const inEiInfo = new EiInfo(); const inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id); inEiInfo.set("id", id);
inEiInfo.set("result-0-status", auditStatus); //先判断本身是否填写
EiCommunicator.send('HPSC001', 'check', inEiInfo, { EiCommunicator.send('HPSC003', 'getInfo', inEiInfo, {
onSuccess(ei) {
var model=ei.get("model");
if(!model.planCompletionDate) {
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('HPSC003', 'checkHPSC0003', inEiInfo, {
onSuccess(response) { onSuccess(response) {
NotificationUtil(response.msg); NotificationUtil(response.msg);
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
...@@ -98,4 +147,33 @@ function check(id, auditStatus) { ...@@ -98,4 +147,33 @@ function check(id, auditStatus) {
async: false async: false
} }
); );
}
} else {
NotificationUtil("审核失败!未找到明细信息", "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
} else {
// 反审
}
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
} }
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<EF:EFColumn ename="prdtName" cname="产品名称" readonly="true"/> <EF:EFColumn ename="prdtName" cname="产品名称" readonly="true"/>
<EF:EFColumn ename="planCompletionDate" cname="计划完成日期" editType="date" dateFormat="yyyy/MM/dd" width="150" <EF:EFColumn ename="planCompletionDate" cname="计划完成日期" editType="date" dateFormat="yyyy/MM/dd" width="150"
readonly="false" required='true'/> readonly="false" required='true'/>
<EF:EFColumn ename="schedule" cname="生产完工进度" readonly="true"/> <EF:EFColumn ename="schedule" cname="生产完工进度" format="{0:N2}" readonly="true"/>
<EF:EFComboColumn required="true" ename="status" cname="状态"> <EF:EFComboColumn required="true" ename="status" cname="状态">
<EF:EFOption label="未审核" value="0"/> <EF:EFOption label="未审核" value="0"/>
<EF:EFOption label="已审核" value="1"/> <EF:EFOption label="已审核" value="1"/>
......
$(function () {
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1);
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [
{
field: "operator",
template: function (item) {
let filePath1 = item.filePath1;
let template = '';
if (filePath1 === ' ') {
template = '';
} else {
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'href="'+ctx+'/EU/DM/EUDM06.jsp?docId=' + filePath1 + '" >下载</a>';
}
return template
}
}
],
}
});
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script>
var ctx = "${ctx}";
</script>
<head>
<%-- <link rel="stylesheet" href="${ctx}/css/simulatedOperation.css"/>--%>
</head>
<EF:EFPage title="生产订单">
<EF:EFRegion id="inqu" title="查询条件"><%-- type="query" efRegionShowClear="true" efRegionSave="true"--%>
<div class="row"> <%-- blockId="inqu_status" row="0" --%>
<EF:EFInput blockId="inqu_status" ename="projName" cname="项目名称:" row="0"/>
<EF:EFInput blockId="inqu_status" ename="projType" cname="生产订单号:" row="0"/>
<EF:EFInput blockId="inqu_status" ename="projType" cname="生产组:" row="0"/>
<EF:EFSelect cname="状态:" optionLabel="全部" blockId="inqu_status" ename="status" row="0">
<EF:EFOption label="未派工" value="0"/>
<EF:EFOption label="已派工" value="1"/>
</EF:EFSelect>
</div>
<EF:EFButton ename="QUERY" cname="查询" row="1" class="btn-align-right"></EF:EFButton>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目号"/>
<EF:EFColumn ename="projName" cname="项目名称"/>
<EF:EFColumn ename="productionOrderNo" cname="生产订单号"/>
<EF:EFColumn ename="prdtCode" cname="部件编码"/>
<EF:EFColumn ename="prdtName" cname="部件名称"/>
<EF:EFColumn ename="planCompletionDate" cname="计划完成日期"/>
<EF:EFColumn ename="num" cname="计划数量"/>
<EF:EFColumn ename="totalWt" cname="计划重量"/>
<EF:EFComboColumn required="true" align="center" ename="status" cname="状态">
<EF:EFOption label="未派工" value="0"/>
<EF:EFOption label="已派工" value="1"/>
</EF:EFComboColumn>
<EF:EFColumn ename="orgName" cname="生产组"/>
<EF:EFColumn ename="operator" cname="操作" width="100" enable="false" readonly="false"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HP/SC/HPSC005.js"></script>
\ 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