Commit 69bea29a by 宋祥

1.fixBug:物料清单已派工时不能删除

2.新增物料计划提交不生效问题修复
parent 8af6de4c
......@@ -38,4 +38,16 @@ public class CommonConstant {
public static final String DAY = "DAY";
}
/**
* 常用字段常量
*
* @author:songx
* @date:2024/2/22,15:33
*/
public static class Field {
// DETAIL
public static final String DETAIL = "detail";
}
}
......@@ -73,4 +73,18 @@ public class HPConstant {
public static final String QT = "QT";
}
/**
* 计划状态常量
*
* @author:songx
* @date:2024/2/22,13:57
*/
public static class planStatus {
// 计划中
public static final Integer S_0 = 0;
// 生产中
public static final Integer S_1 = 1;
}
}
......@@ -217,6 +217,20 @@ public class HPSqlConstant {
}
/**
* HPSC003 SQL名称定义
*
* @author:songx
* @date:2024/2/5,10:16
*/
public class HPSC003 {
// 修改状态
public static final String UPDATE_STATUS = "HPSC003.updateStatus";
// 修改时间
public static final String UPDATE_DATE = "HPSC003.updateDate";
}
/**
* HPSC004 SQL名称定义
*
* @author:songx
......@@ -226,8 +240,14 @@ public class HPSqlConstant {
// 锁
public static final String LOCK = "HPSC004.lock";
// 更新时间完工情况
// 根据材料号删除
public static final String DELETE_BY_MAT = "HPSC004.deleteByMat";
// 更新计划完工情况
public static final String UPDATE_PLAN_DATE = "HPSC004.updatePlanDate";
// 更新实际完工情况
public static final String UPDATE_COMPLETE = "HPSC004.updateComplete";
// 更新订单号
public static final String UPDATE_PROD_ORDER_NO = "HPSC004.updateProdOrderNo";
}
/**
......
package com.baosight.hpjx.hp.sc.domain;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* Project: <br>
......@@ -16,7 +17,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-02-05 14:06:35 create
* @history 2024-02-22 10:52:56 create
*/
public class HPSC005 extends DaoEPBase {
......@@ -25,7 +26,7 @@ public class HPSC005 extends DaoEPBase {
public static final String FIELD_ID = "id";
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业编码 预留*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_PRODUCTION_ORDER_NO = "productionOrderNo"; /* 生产订单号*/
public static final String FIELD_PROD_ORDER_NO = "prodOrderNo"; /* 生产订单号*/
public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String FIELD_PRDT_TYPE = "prdtType"; /* 产品类型*/
......@@ -72,7 +73,7 @@ public class HPSC005 extends DaoEPBase {
public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_PRODUCTION_ORDER_NO = "PRODUCTION_ORDER_NO"; /* 生产订单号*/
public static final String COL_PROD_ORDER_NO = "PROD_ORDER_NO"; /* 生产订单号*/
public static final String COL_PROJ_CODE = "PROJ_CODE"; /* 项目编码*/
public static final String COL_PROJ_NAME = "PROJ_NAME"; /* 项目名称*/
public static final String COL_PRDT_TYPE = "PRDT_TYPE"; /* 产品类型*/
......@@ -125,7 +126,7 @@ public class HPSC005 extends DaoEPBase {
private Long id;
private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码*/
private String productionOrderNo = " "; /* 生产订单号*/
private String prodOrderNo = " "; /* 生产订单号*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private Integer prdtType; /* 产品类型*/
......@@ -153,7 +154,7 @@ public class HPSC005 extends DaoEPBase {
private String factoryName = " "; /* 厂区名称*/
private String orgNo = " "; /* 生产组编码*/
private String orgName = " "; /* 生产组名称*/
private Boolean documentType; /* 单据类型 0-非子母单;1-子母单*/
private Integer documentType; /* 单据类型 0-非子母单;1-子母单*/
private String remark = " "; /* 备注*/
private String remark1 = " "; /* 备注*/
private String createdBy = " "; /* 创建人*/
......@@ -188,7 +189,7 @@ public class HPSC005 extends DaoEPBase {
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRODUCTION_ORDER_NO);
eiColumn = new EiColumn(FIELD_PROD_ORDER_NO);
eiColumn.setDescName("生产订单号");
eiMetadata.addMeta(eiColumn);
......@@ -452,20 +453,20 @@ public class HPSC005 extends DaoEPBase {
this.depCode = depCode;
}
/**
* get the productionOrderNo - 生产订单号.
* @return the productionOrderNo
* get the prodOrderNo - 生产订单号.
* @return the prodOrderNo
*/
public String getProductionOrderNo() {
return this.productionOrderNo;
public String getProdOrderNo() {
return this.prodOrderNo;
}
/**
* set the productionOrderNo - 生产订单号.
* set the prodOrderNo - 生产订单号.
*
* @param productionOrderNo - 生产订单号
* @param prodOrderNo - 生产订单号
*/
public void setProductionOrderNo(String productionOrderNo) {
this.productionOrderNo = productionOrderNo;
public void setProdOrderNo(String prodOrderNo) {
this.prodOrderNo = prodOrderNo;
}
/**
* get the projCode - 项目编码.
......@@ -903,7 +904,7 @@ public class HPSC005 extends DaoEPBase {
* get the documentType - 单据类型 0-非子母单;1-子母单.
* @return the documentType
*/
public Boolean getDocumentType() {
public Integer getDocumentType() {
return this.documentType;
}
......@@ -912,7 +913,7 @@ public class HPSC005 extends DaoEPBase {
*
* @param documentType - 单据类型 0-非子母单;1-子母单
*/
public void setDocumentType(Boolean documentType) {
public void setDocumentType(Integer documentType) {
this.documentType = documentType;
}
/**
......@@ -1150,7 +1151,7 @@ public class HPSC005 extends DaoEPBase {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setProductionOrderNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRODUCTION_ORDER_NO)), productionOrderNo));
setProdOrderNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROD_ORDER_NO)), prodOrderNo));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setPrdtType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_PRDT_TYPE)), prdtType));
......@@ -1178,7 +1179,7 @@ public class HPSC005 extends DaoEPBase {
setFactoryName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_NAME)), factoryName));
setOrgNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ORG_NO)), orgNo));
setOrgName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ORG_NAME)), orgName));
setDocumentType(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_DOCUMENT_TYPE)), documentType));
setDocumentType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DOCUMENT_TYPE)), documentType));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
setRemark1(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK1)), remark1));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
......@@ -1205,7 +1206,7 @@ public class HPSC005 extends DaoEPBase {
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_PRODUCTION_ORDER_NO, StringUtils.toString(productionOrderNo, eiMetadata.getMeta(FIELD_PRODUCTION_ORDER_NO)));
map.put(FIELD_PROD_ORDER_NO, StringUtils.toString(prodOrderNo, eiMetadata.getMeta(FIELD_PROD_ORDER_NO)));
map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE)));
map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
map.put(FIELD_PRDT_TYPE, StringUtils.toString(prdtType, eiMetadata.getMeta(FIELD_PRDT_TYPE)));
......
......@@ -81,7 +81,7 @@ public class ServiceHPSC005A extends ServiceBase {
public EiInfo save(EiInfo inInfo) {
try {
Map detailMap = EiInfoUtils.getFirstRow(inInfo, "detail");
String prodOrderNo = MapUtils.getString(detailMap, "productionOrderNo");
String prodOrderNo = MapUtils.getString(detailMap, "prodOrderNo");
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 生产任务号
List<String> prodTaskNos = ObjectUtils.listKey(resultRows, "prodTaskNo");
......@@ -121,7 +121,7 @@ public class ServiceHPSC005A extends ServiceBase {
* @param fSc005a
*/
private void add(HPSC005 dbSc005, HPSC005A fSc005a) {
String prodOrderNo = dbSc005.getProductionOrderNo();
String prodOrderNo = dbSc005.getProdOrderNo();
// 数据校验
AssertUtils.isEmpty(fSc005a.getFactoryCode(), "请选择厂区");
AssertUtils.isEmpty(fSc005a.getOrgNo(), "请选择生产组");
......@@ -145,7 +145,7 @@ public class ServiceHPSC005A extends ServiceBase {
* @param mapSc005a
*/
private void modify(HPSC005 dbSc005, HPSC005A fSc005a, Map<String, HPSC005A> mapSc005a) {
String prodOrderNo = dbSc005.getProductionOrderNo();
String prodOrderNo = dbSc005.getProdOrderNo();
// 数据校验
HPSC005A dbSc005a = mapSc005a.get(fSc005a.getProdTaskNo());
AssertUtils.isGt(dbSc005a.getCompleteNum(), fSc005a.getNum(),
......@@ -168,7 +168,7 @@ public class ServiceHPSC005A extends ServiceBase {
public EiInfo delete(EiInfo inInfo) {
try {
Map detailMap = EiInfoUtils.getFirstRow(inInfo, "detail");
String prodOrderNo = MapUtils.getString(detailMap, "productionOrderNo");
String prodOrderNo = MapUtils.getString(detailMap, "prodOrderNo");
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HPSC005A fSc005a = new HPSC005A();
......@@ -220,14 +220,15 @@ public class ServiceHPSC005A extends ServiceBase {
// 校验主订单是否已分派
HPSC005 dbSc005 = HPSCTools.HpSc005.getById(Long.parseLong(orderId));
AssertUtils.isTrue(!ProdOrderStatusEnum.NOT_ASSIGN.getCode().equals(dbSc005.getStatus()),
String.format("生产订单[%s]已分派,不能在进行批量分派,请检查!", dbSc005.getProductionOrderNo()));
HPSC005A newSc005a = new HPSC005A();
String.format("生产订单[%s]已分派,不能在进行批量分派,请检查!", dbSc005.getProdOrderNo()));
// 更新订单主表数量
HPSCTools.checkAssignedNum(dbSc005.getProductionOrderNo(), dbSc005.getNum());
HPSCTools.checkAssignedNum(dbSc005.getProdOrderNo(), dbSc005.getNum());
// 写入子表数据
HPSC005A newSc005a = new HPSC005A();
newSc005a.setProdTaskNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.PROD_TASK_NO,
new String[]{dbSc005.getProductionOrderNo()}));
newSc005a.setProdOrderNo(dbSc005.getProductionOrderNo());
new String[]{dbSc005.getProdOrderNo()}));
newSc005a.setProdOrderNo(dbSc005.getProdOrderNo());
newSc005a.setNum(dbSc005.getNum());
newSc005a.setTotalWt(newSc005a.getNum().multiply(dbSc005.getUnitWt()));
newSc005a.setOrgNo(dbPz011.getGroupCode());
......
<?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">
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPSC003">
<sql id="condition">
......@@ -59,6 +59,13 @@
</isNotEmpty>
</sql>
<!-- 公共修改字段 -->
<sql id="updateRevise">
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime# <!-- 修改时间 -->
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC003">
SELECT
......@@ -195,12 +202,17 @@
UPDATE hpjx.T_HPSC003
SET
PLAN_COMPLETION_DATE = #planCompletionDate#, <!-- 计划完成日期 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE
COMPANY_CODE = #companyCode#
AND PROJ_CODE = #projCode#
AND PLAN_INFO_NO = #planInfoNo#
<include refid="updateRevise"/>
WHERE PLAN_INFO_NO = #planInfoNo#
</update>
<!-- 修改状态 -->
<update id="updateStatus">
UPDATE hpjx.T_HPSC003
SET
STATUS = #status#,
<include refid="updateRevise"/>
WHERE ID = #id#
</update>
</sqlMap>
......@@ -6,7 +6,7 @@
A.ID as "id",
A.PROJ_CODE as "projCode", <!-- 项目编码 -->
A.PROJ_NAME as "projName", <!-- 项目名称 -->
A.PRODUCTION_ORDER_NO as "productionOrderNo", <!-- 生产订单号 -->
A.PROD_ORDER_NO as "prodOrderNo", <!-- 生产订单号 -->
A.PRDT_CODE as "prdtCode", <!-- 部件编码 -->
A.PRDT_NAME as "prdtName", <!-- 部件名称 -->
A.PRDT_SPEC as "prdtSpec",
......@@ -43,8 +43,8 @@
<isNotEmpty prepend=" AND " property="id">
A.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productionOrderNo">
A.PRODUCTION_ORDER_NO LIKE CONCAT('%', #productionOrderNo#, '%')
<isNotEmpty prepend=" AND " property="prodOrderNo">
A.PROD_ORDER_NO LIKE CONCAT('%', #prodOrderNo#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
A.PROJ_CODE = #projCode#
......
......@@ -3,22 +3,21 @@ package com.baosight.hpjx.hp.sc.tools;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC001;
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.*;
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.HPSC006;
import com.baosight.hpjx.hp.sc.domain.HPSC007;
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;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -131,7 +130,7 @@ public class HPSCTools {
* @param prdtCode
* @return
*/
public static HPSC002 get(String prdtCode) {
public static HPSC002 getByPrdt(String prdtCode) {
AssertUtils.isEmpty(prdtCode, "部件编码不能为空");
Map queryMap = new HashMap();
queryMap.put("prdtCode", prdtCode);
......@@ -139,6 +138,35 @@ public class HPSCTools {
AssertUtils.isNull(results, String.format("部件编码[%s]信息不存在", prdtCode));
return results.get(0);
}
/**
* 查询节点
*
* @param id
* @return
*/
public static HPSC002 get(Long id) {
AssertUtils.isNull(id, "节点ID不能为空");
Map queryMap = new HashMap();
queryMap.put("id", id);
List<HPSC002> results = DaoBase.getInstance().query("HPSC002.queryEntityByParentPrtdCode", queryMap);
AssertUtils.isNull(results, String.format("节点ID[%s]信息不存在", id));
return results.get(0);
}
/**
* 查询叶子节点
*
* @param parentId
* @return
*/
public static List<HPSC002> queryByParent(String parentId) {
AssertUtils.isEmpty(parentId, "节点ID不能为空");
Map queryMap = new HashMap();
queryMap.put("parentId", parentId);
return DaoBase.getInstance().query("HPSC002.queryEntityByParentPrtdCode", queryMap);
}
}
/**
......@@ -163,6 +191,48 @@ public class HPSCTools {
AssertUtils.isNull(results, String.format("物料ID[%s]信息不存在", id));
return results.get(0);
}
/**
* 查询
*
* @param matId 物料ID
* @return
*/
public static HPSC003 queryByMat(Long matId) {
AssertUtils.isNull(matId, "物料ID不能为空");
Map queryMap = new HashMap();
queryMap.put("matId", matId);
List<HPSC003> results = DaoBase.getInstance().query(HPSC003.QUERY, queryMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 修改状态
*
* @param id
* @param status
*/
public static void updateStatus(Long id, Integer status) {
AssertUtils.isNull(id, "节点ID不能为空");
Map map = new HashMap();
map.put("id", id);
map.put("status", status);
DaoUtils.update(HPSqlConstant.HPSC003.UPDATE_STATUS, map);
}
/**
* 修改计划完成时间
*
* @param planInfoNo
* @param planCompletionDate
*/
public static void updateDate(String planInfoNo, String planCompletionDate) {
AssertUtils.isNull(planInfoNo, "计划号不能为空");
Map map = new HashMap();
map.put("planInfoNo", planInfoNo);
map.put("planCompletionDate", planCompletionDate);
DaoUtils.update(HPSqlConstant.HPSC003.UPDATE_DATE, map);
}
}
/**
......@@ -204,6 +274,21 @@ public class HPSCTools {
}
/**
* 根据材料号删除
*
* @param matId
* @return
*/
public static void deleteByMat(Long matId) {
if (matId == null) {
return;
}
Map queryMap = new HashMap();
queryMap.put("matId", matId);
DaoBase.getInstance().update(HPSqlConstant.HPSC004.DELETE_BY_MAT, queryMap);
}
/**
* 查询
*
* @param prodOrderNo
......@@ -212,11 +297,38 @@ public class HPSCTools {
public static HPSC004 get(String prodOrderNo) {
AssertUtils.isEmpty(prodOrderNo, "生产订单号不能为空");
Map queryMap = new HashMap();
queryMap.put("productionOrderNo", prodOrderNo);
queryMap.put("prodOrderNo", prodOrderNo);
List<HPSC004> results = DaoBase.getInstance().query(HPSC004.QUERY, queryMap);
AssertUtils.isNull(results, String.format("生产订单号[%s]信息不存在", prodOrderNo));
return results.get(0);
}
/**
* 查询
*
* @param matId 物料ID
* @return
*/
public static HPSC004 queryByMat(Long matId) {
AssertUtils.isNull(matId, "物料ID不能为空");
Map queryMap = new HashMap();
queryMap.put("matId", matId);
List<HPSC004> results = DaoBase.getInstance().query(HPSC004.QUERY, queryMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 根据父级ID查询
*
* @param parentId
* @return
*/
public static List<HPSC004> queryByParent(String parentId) {
AssertUtils.isNull(parentId, "计划ID不能为空");
Map queryMap = new HashMap();
queryMap.put("parentId", parentId);
return DaoBase.getInstance().query(HPSC004.QUERY, queryMap);
}
}
/**
......@@ -327,7 +439,7 @@ public class HPSCTools {
public static HPSC005 get(String prodOrderNo) {
AssertUtils.isEmpty(prodOrderNo, "生产订单号不能为空");
Map queryMap = new HashMap();
queryMap.put("productionOrderNo", prodOrderNo);
queryMap.put("prodOrderNo", prodOrderNo);
List<HPSC005> results = DaoBase.getInstance().query(HPSC005.QUERY, queryMap);
AssertUtils.isNull(results, String.format("生产订单[%s]信息不存在", prodOrderNo));
return results.get(0);
......@@ -474,8 +586,6 @@ public class HPSCTools {
/**
* 更新已完成数量
*
* @param prodTaskNo
* @param completeNum
*/
public static void updateCompleteNum(Long id, BigDecimal actualCompletionNum,BigDecimal actualCompletionTotalWt,
Integer status, String actualCompletionDate) {
......
......@@ -214,7 +214,10 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
if (StringUtils.isBlank(dateTime)) {
return dateTime;
}
return dateTime.replaceAll("-", "").replaceAll(":", "").replaceAll(" ", "");
return dateTime.replaceAll("-", "")
.replaceAll("/", "")
.replaceAll(":", "")
.replaceAll(" ", "");
}
}
......@@ -192,7 +192,7 @@ $(function () {
*/
onDelete: function (e) {
// 不向后台保存
console.log(e)
console.log("DELETE -> ", e)
var tree = $("#materialTree").data("kendoTreeView");
var inInfo = new EiInfo();
EiCommunicator.send("HPSC002", "queryTreeNode", inInfo, {//传入参数
......@@ -213,7 +213,6 @@ $(function () {
field: "operator",
title: "操作",
template: function (item) {
console.log(item)
let auditStatus = item.status;
let lv = item.lv
let template = '';
......
......@@ -44,8 +44,8 @@
<EF:EFGrid blockId="result" autoDraw="override" checkMode="single">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="level" cname="层级" hidden="true"/>
<EF:EFColumn enable="false" ename="projCode" cname="项目编码"/>
<EF:EFColumn enable="false" ename="projName" cname="项目名称"/>
<EF:EFColumn enable="false" ename="projCode" cname="项目编码" hidden="true"/>
<EF:EFColumn enable="false" ename="projName" cname="项目名称" hidden="true"/>
<%--<EF:EFComboColumn cname="部件类型" ename="prdtType" width="90" align="center" required="true"
columnTemplate="#=textField#"
itemTemplate="#=textField#"
......
$(function () {
$("#QUERY").on("click", function () {
query();
});
$("#QUERY").on("click", query);
IPLATUI.EFGrid = {
"result" : {
"result": {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [
{
columns: [{
field: "operator",
template: function (item) {
console.log(item)
let auditStatus = item.status;
let template = '';
if (item.matId != null){
if (item.matId != null) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.matId + ')" >附件清单</a>';
}
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" ' +
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" '
+
'onclick="check(' + item.id + ',1)" >提交</a>';
}
/*else {
......@@ -33,26 +29,24 @@ $(function () {
}*/
return template;
}
},
{
}, {
field: "planCompletionDate",
template: function (item){
template: function (item) {
let auditStatus = item.status;
let template = '';
if (auditStatus == 1){
if (auditStatus == 1) {
template += 'this.blur();';
}
return template;
}
}
],
}],
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'update'
||e.eiInfo.extAttr.methodName == 'insert'){
if (e.eiInfo.extAttr.methodName == 'update'
|| e.eiInfo.extAttr.methodName == 'insert') {
query();
}
},
onRowClick : function(e) {
onRowClick: function (e) {
var block = detailGrid.getEiBlock();
if (block != null) {
block.setRows([]);
......@@ -60,12 +54,13 @@ $(function () {
}
var info = new EiInfo()
var parentId = e.model['planInfoNo'];
info.set("parentId",parentId);
EiCommunicator.send("HPSC004","queryDetail",info,{
onSuccess:function(ei){//返回结果集
info.set("parentId", parentId);
EiCommunicator.send("HPSC004", "queryDetail", info, {
onSuccess: function (ei) {//返回结果集
detailGrid.setEiInfo(ei);
},onFail:function(ei){}
},{async:false});
}, onFail: function (ei) {
}
}, {async: false});
},
},
"detail":{
......@@ -103,7 +98,7 @@ $(function () {
var btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
IPLAT.submitNode($("#HPSC003"), "HPSC003", "updateHPSC0004", {
IPLAT.submitNode($("#HPSC003"), "HPSC003", "updatePlanDetail", {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
......@@ -126,7 +121,6 @@ $(function () {
btnNode.attr("disabled", false);
}
});
},
afterEdit: function (e) {
if (e.field === "planCompletionDate") {
......@@ -141,8 +135,7 @@ $(function () {
}
}
},
columns: [
{
columns: [{
field: "operator",
title: "操作",
template: function (item) {
......@@ -154,11 +147,8 @@ $(function () {
}
return template
}
}]
}
],
}
}
//部件类型下拉联动
......@@ -223,7 +213,7 @@ function check(id, auditStatus) {
}
else {
// 提交通过,生成
EiCommunicator.send('HPSC003', 'checkHPSC0003', inEiInfo, {
EiCommunicator.send('HPSC003', 'submitPlan', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
resultGrid.dataSource.page(1);
......@@ -272,6 +262,7 @@ function check(id, auditStatus) {
}
let query = function () {
resultGrid.dataSource.page(1);
}
......
......@@ -4,21 +4,12 @@
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<head>
<%-- <link rel="stylesheet" href="${ctx}/css/simulatedOperation.css"/>--%>
</head>
<EF:EFPage title="生产计划">
<EF:EFRegion id="inqu" title="查询条件" align-item="center"><%-- type="query" efRegionShowClear="true" efRegionSave="true"--%>
<div class="row" > <%-- blockId="inqu_status" --%>
<EF:EFPage title="生产计划">
<EF:EFRegion id="inqu" title="查询条件" align-item="center">
<div class="row" >
<EF:EFInput blockId="inqu_status" ename="projCode" colWidth="3" cname="项目编号:" />
<EF:EFInput blockId="inqu_status" ename="projName" colWidth="3" cname="项目名称:" />
<%--<EF:EFSelect ename="inqu_status-0-prdtType" cname="部件类型" colWidth="3" filter="contains"
template="#=textField#" valueTemplate="#=textField#">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('3','4')"/>
</EF:EFSelect>--%>
<EF:EFSelect ename="inqu_status-0-prdtCode" cname="部件名称" filter="contains" required="false" colWidth="3"
template="#=textField#" valueTemplate="#=valueField#" defaultValue="请选择">
<EF:EFOption label="请选择" value=""/>
......@@ -32,7 +23,6 @@
<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="基本信息">
......@@ -48,8 +38,8 @@
<EF:EFColumn enable="false" ename="prdtName" cname="部件名称" readonly="true"/>
<EF:EFColumn enable="false" ename="spec" cname="规格" readonly="true"/>
<EF:EFColumn enable="false" ename="remark" cname="备注" readonly="true"/>
<EF:EFColumn ename="planCompletionDate" cname="计划完成日期" editType="date" dateFormat="yyyy/MM/dd" width="150"
required='true'/>
<EF:EFColumn ename="planCompletionDate" cname="计划完成日期" width="150" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required='true'/>
<EF:EFColumn enable="false" ename="schedule" cname="生产完工进度" format="{0:N2}" readonly="true"/>
<EF:EFComboColumn enable="false" ename="status" cname="状态">
<EF:EFOption label="未提交" value="0"/>
......@@ -73,15 +63,13 @@
<EF:EFColumn enable="false" ename="prdtName" readonly="true" cname="零部件名称"/>
<EF:EFColumn enable="false" ename="spec" cname="规格" readonly="true"/>
<EF:EFColumn enable="false" ename="remark" cname="备注" readonly="true"/>
<%-- <EF:EFComboColumn enable="false" ename="delStatus" cname="状态">--%>
<%-- <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 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="planCommentDate" required='true' cname="计划开始时间" width="150" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="planCompletionDate" required='true' cname="计划结束时间" width="150" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="actualCompletionDate" cname="完成时间" editType="date" dateFormat="yyyy/MM/dd" width="150"
enable="false"/>
<EF:EFColumn enable="false" ename="actualCompletionNum" cname="完成数量" readonly="true"/>
......@@ -90,7 +78,3 @@
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HP/SC/HPSC003.js"></script>
......@@ -19,7 +19,7 @@ $(function () {
field: "operator",
template: function (item) {
let status = item.status;
let prodOrderNo = item.productionOrderNo;
let prodOrderNo = item.prodOrderNo;
let filePath1 = item.filePath1;
let template = '';
// 非全部派工时展示拆单派工按钮
......@@ -49,7 +49,7 @@ function query() {
/**
* 拆单派工
*
* @param productionOrderNo
* @param prodOrderNo
*/
function tearAssign(prodOrderNo) {
JSColorbox.open({
......
......@@ -8,7 +8,7 @@
<EF:EFPage title="生产订单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="生产订单号" blockId="inqu_status" ename="productionOrderNo" row="0" colWidth="3"/>
<EF:EFInput cname="生产订单号" blockId="inqu_status" ename="prodOrderNo" row="0" colWidth="3"/>
<EF:EFInput cname="项目号" blockId="inqu_status" ename="projCode" row="0" colWidth="3"/>
<EF:EFInput cname="项目名称" blockId="inqu_status" ename="projName" row="0" colWidth="3"/>
<EF:EFInput cname="部件名称" blockId="inqu_status" ename="prdtName" row="0" colWidth="3"/>
......@@ -39,14 +39,15 @@
<EF:EFColumn ename="prdtSpec" cname="部件规格" enable="false" width="120" align="center"/>
<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="planCompletionDate" cname="计划完成日期" enable="false" width="120" align="center"/>
<EF:EFColumn ename="planCompletionDate" cname="计划完成日期" enable="false" width="120" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<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="prodOrderNo" 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>
......
......@@ -11,7 +11,7 @@
<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"/>
<EF:EFInput ename="detail-0-productionOrderNo" cname="生产订单号" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-prodOrderNo" cname="生产订单号" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-prdtName" cname="部件名称" colWidth="4" readonly="true"/>
......
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