Commit c036452d by liuyang

2024-06-12 宏建添加项目档案,生产计划,生产订单,生产任务,生产报工单

parent 8198a183
package com.baosight.hpjx.hp.sc.domain;
import com.baosight.hpjx.common.ExcelAnno;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/8/9
* @description 宏建物料清单
*/
public class HPSC102 extends DaoEPBase {
private static final long serialVersionUID = 1L;
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_PROJ_CODE = "projCode"; /* 项目编码*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String FIELD_PARENT_ID = "parentId"; /* 父节点ID*/
public static final String FIELD_PARENT_PRDT_NAME = "parentPrdtName"; /* 父节点-产品名称*/
public static final String FIELD_TYPE = "type"; /* 类别*/
public static final String FIELD_LEAF = "leaf"; /* 是否有叶子节点*/
public static final String FIELD_SORT = "sort"; /* 排序字段*/
public static final String FIELD_ICON = "icon"; /* 图片地址*/
public static final String FIELD_PRDT_TYPE = "prdtType"; /* 产品类型*/
public static final String FIELD_PRDT_CODE = "prdtCode"; /* 产品编码*/
public static final String FIELD_PRDT_NAME = "prdtName"; /* 产品名称*/
public static final String FIELD_LENGTH = "length"; /* 长*/
public static final String FIELD_WIDTH = "width"; /* 宽*/
public static final String FIELD_THICK = "thick"; /* 厚*/
public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 项目档案ID*/
public static final String FIELD_SPEC = "spec"; /* 规格*/
public static final String FIELD_NUM = "num"; /* 数量*/
public static final String FIELD_UNIT_WT = "unitWt"; /* 单重*/
public static final String FIELD_TOTAL_WT = "totalWt"; /* 总重*/
public static final String FIELD_FILE_PATH1 = "filePath1"; /* 文件地址1*/
public static final String FIELD_FILE_PATH2 = "filePath2"; /* 文件地址2*/
public static final String FIELD_FILE_PATH3 = "filePath3"; /* 文件地址3*/
public static final String FIELD_FILE_PATH4 = "filePath4"; /* 文件地址4*/
public static final String FIELD_FILE_PATH5 = "filePath5"; /* 文件地址5*/
public static final String FIELD_STATUS = "status"; /* 状态 0-未审核,1-已审核*/
public static final String FIELD_DEL_STATUS = "delStatus"; /* 状态 1未删除,0已删除*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 更新人*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 修改人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_REMARK = "remark"; /* 备注*/
public static final String FIELD_PGSTATUS = "pgStatus"; /* 派工状态*/
public static final String FIELD_DELIVERY_DATE = "deliveryDate";
public static final String FIELD_PROJ_STATUS = "projStatus";
public static final String FIELD_LV = "lv"; /* 树的层级*/
public static final String FIELD_CKNUM = "cknum"; /* 树的层级*/
public static final String FIELD_RKNUM = "rknum"; /* 树的层级*/
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_PROJ_CODE = "PROJ_CODE"; /* 项目编码*/
public static final String COL_PROJ_NAME = "PROJ_NAME"; /* 项目名称*/
public static final String COL_PARENT_ID = "PARENT_ID"; /* 父节点ID*/
public static final String COL_PARENT_PRDT_NAME = "PARENT_PRDT_NAME"; /* 父节点-产品名称*/
public static final String COL_TYPE = "TYPE"; /* 类别*/
public static final String COL_LEAF = "LEAF"; /* 是否有叶子节点*/
public static final String COL_SORT = "SORT"; /* 排序字段*/
public static final String COL_ICON = "ICON"; /* 图片地址*/
public static final String COL_PRDT_TYPE = "PRDT_TYPE"; /* 产品类型*/
public static final String COL_PRDT_CODE = "PRDT_CODE"; /* 产品编码*/
public static final String COL_PRDT_NAME = "PRDT_NAME"; /* 产品名称*/
public static final String COL_LENGTH = "LENGTH"; /* 长*/
public static final String COL_WIDTH = "WIDTH"; /* 宽*/
public static final String COL_THICK = "THICK"; /* 厚*/
public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 项目档案ID*/
public static final String COL_SPEC = "SPEC"; /* 规格*/
public static final String COL_NUM = "NUM"; /* 数量*/
public static final String COL_UNIT_WT = "UNIT_WT"; /* 单重*/
public static final String COL_TOTAL_WT = "TOTAL_WT"; /* 总重*/
public static final String COL_FILE_PATH1 = "FILE_PATH1"; /* 文件地址1*/
public static final String COL_FILE_PATH2 = "FILE_PATH2"; /* 文件地址2*/
public static final String COL_FILE_PATH3 = "FILE_PATH3"; /* 文件地址3*/
public static final String COL_FILE_PATH4 = "FILE_PATH4"; /* 文件地址4*/
public static final String COL_FILE_PATH5 = "FILE_PATH5"; /* 文件地址5*/
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_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 修改人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_REMARK = "REMARK"; /* 备注*/
public static final String COL_PGSTATUS = "PGSTATUS"; /* 派工状态*/
public static final String COL_LV = "LV"; /* 树的层级*/
public static final String COL_DELIVERY_DATE = "DELIVERY_DATE";
public static final String APPQUERY = "HPSC002.appQuery";
public static final String QUERY = "HPSC002.query";
public static final String COUNT = "HPSC002.count";
public static final String INSERT = "HPSC002.insert";
public static final String UPDATE = "HPSC002.update";
public static final String DELETE = "HPSC002.delete";
public static final String QUERY_SUM = "HPSC002.querySum";
private Long id;
private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码 预留*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private String parentId = " "; /* 父节点ID*/
private String parentPrdtName = " "; /* 父节点-产品名称*/
private String type = " "; /* 类别*/
private String leaf = "1"; /* 是否有叶子节点*/
private String sort = " "; /* 排序字段*/
private String icon = " "; /* 图片地址*/
@ExcelAnno(index = 0)
private Integer prdtType; /* 产品类型*/
private String prdtCode = " "; /* 产品编码*/
@ExcelAnno(index = 1)
private String prdtName = " "; /* 产品名称*/
@ExcelAnno(index = 2)
private BigDecimal length = new BigDecimal("0"); /* 长*/
@ExcelAnno(index = 3)
private BigDecimal width = new BigDecimal("0"); /* 宽*/
@ExcelAnno(index = 4)
private BigDecimal thick = new BigDecimal("0"); /* 厚*/
private Long inventRecordId; /* 项目档案ID*/
private String spec = " "; /* 规格*/
@ExcelAnno(index = 6)
private BigDecimal num = new BigDecimal(0.000); /* 数量*/
private BigDecimal unitWt = new BigDecimal(0.0); /* 单重*/
@ExcelAnno(index = 7)
private BigDecimal totalWt = new BigDecimal(0.000); /* 总重*/
private String filePath1 = " "; /* 文件地址1*/
private String filePath2 = " "; /* 文件地址2*/
private String filePath3 = " "; /* 文件地址3*/
private String filePath4 = " "; /* 文件地址4*/
private String filePath5 = " "; /* 文件地址5*/
private Integer status; /* 状态 0-未审核,1-已审核*/
private Integer delStatus; /* 状态 1未删除,0已删除*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 更新时间*/
@ExcelAnno(index = 5)
private String remark = " "; /* 备注*/
private String pgStatus = " "; /* 派工状态*/
private Integer lv; /* 树的层级*/
private String deliveryDate = " ";
private Integer cknum ;/* 出库数量*/
private Integer rknum;/* 出库数量*/
private Integer projStatus;/* app项目状态*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_CODE);
eiColumn.setDescName("项目编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_NAME);
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PARENT_ID);
eiColumn.setDescName("父节点ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PARENT_PRDT_NAME);
eiColumn.setDescName("父节点-产品名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_TYPE);
eiColumn.setDescName("类别");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_LEAF);
eiColumn.setDescName("是否有叶子节点");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SORT);
eiColumn.setDescName("排序字段");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ICON);
eiColumn.setDescName("图片地址");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRDT_TYPE);
eiColumn.setDescName("产品类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRDT_CODE);
eiColumn.setDescName("产品编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRDT_NAME);
eiColumn.setDescName("产品名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_LENGTH);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(12);
eiColumn.setDescName("长");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WIDTH);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(12);
eiColumn.setDescName("宽");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_THICK);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(12);
eiColumn.setDescName("厚");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_RECORD_ID);
eiColumn.setDescName("项目档案ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SPEC);
eiColumn.setDescName("规格");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_NUM);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UNIT_WT);
eiColumn.setType("N");
eiColumn.setScaleLength(1);
eiColumn.setFieldLength(15);
eiColumn.setDescName("单重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_TOTAL_WT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("总重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FILE_PATH1);
eiColumn.setDescName("文件地址1");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FILE_PATH2);
eiColumn.setDescName("文件地址2");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FILE_PATH3);
eiColumn.setDescName("文件地址3");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FILE_PATH4);
eiColumn.setDescName("文件地址4");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FILE_PATH5);
eiColumn.setDescName("文件地址5");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态 0-未审核,1-已审核");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEL_STATUS);
eiColumn.setDescName("状态 1未删除,0已删除");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("修改人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REMARK);
eiColumn.setDescName("备注");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_LV);
eiColumn.setDescName("树的层级");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PGSTATUS);
eiColumn.setDescName("派工状态");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELIVERY_DATE);
eiColumn.setDescName("交货状态");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CKNUM);
eiColumn.setDescName("出库数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_RKNUM);
eiColumn.setDescName("入库数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_STATUS);
eiColumn.setDescName("APP项目状态");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HPSC102() {
initMetaData();
}
/**
* get the id .
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id .
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the companyCode - 企业编码 预留.
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 企业编码 预留.
*
* @param companyCode - 企业编码 预留
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the depCode - 部门编码 预留.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码 预留.
*
* @param depCode - 部门编码 预留
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the projCode - 项目编码.
* @return the projCode
*/
public String getProjCode() {
return this.projCode;
}
/**
* set the projCode - 项目编码.
*
* @param projCode - 项目编码
*/
public void setProjCode(String projCode) {
this.projCode = projCode;
}
/**
* get the projName - 项目名称.
* @return the projName
*/
public String getProjName() {
return this.projName;
}
/**
* set the projName - 项目名称.
*
* @param projName - 项目名称
*/
public void setProjName(String projName) {
this.projName = projName;
}
/**
* get the parentId - 父节点ID.
* @return the parentId
*/
public String getParentId() {
return this.parentId;
}
/**
* set the parentId - 父节点ID.
*
* @param parentId - 父节点ID
*/
public void setParentId(String parentId) {
this.parentId = parentId;
}
/**
* get the parentPrdtName - 父节点-产品名称.
* @return the parentPrdtName
*/
public String getParentPrdtName() {
return this.parentPrdtName;
}
/**
* set the parentPrdtName - 父节点-产品名称.
*
* @param parentPrdtName - 父节点-产品名称
*/
public void setParentPrdtName(String parentPrdtName) {
this.parentPrdtName = parentPrdtName;
}
/**
* get the type - 类别.
* @return the type
*/
public String getType() {
return this.type;
}
/**
* set the type - 类别.
*
* @param type - 类别
*/
public void setType(String type) {
this.type = type;
}
/**
* get the leaf - 是否有叶子节点.
* @return the leaf
*/
public String getLeaf() {
return this.leaf;
}
/**
* set the leaf - 是否有叶子节点.
*
* @param leaf - 是否有叶子节点
*/
public void setLeaf(String leaf) {
this.leaf = leaf;
}
/**
* get the sort - 排序字段.
* @return the sort
*/
public String getSort() {
return this.sort;
}
/**
* set the sort - 排序字段.
*
* @param sort - 排序字段
*/
public void setSort(String sort) {
this.sort = sort;
}
/**
* get the icon - 图片地址.
* @return the icon
*/
public String getIcon() {
return this.icon;
}
/**
* set the icon - 图片地址.
*
* @param icon - 图片地址
*/
public void setIcon(String icon) {
this.icon = icon;
}
/**
* get the prdtType - 产品类型.
* @return the prdtType
*/
public Integer getPrdtType() {
return this.prdtType;
}
/**
* set the prdtType - 产品类型.
*
* @param prdtType - 产品类型
*/
public void setPrdtType(Integer prdtType) {
this.prdtType = prdtType;
}
/**
* get the prdtCode - 产品编码.
* @return the prdtCode
*/
public String getPrdtCode() {
return this.prdtCode;
}
/**
* set the prdtCode - 产品编码.
*
* @param prdtCode - 产品编码
*/
public void setPrdtCode(String prdtCode) {
this.prdtCode = prdtCode;
}
/**
* 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 length - 长.
* @return the length
*/
public BigDecimal getLength() {
return this.length;
}
/**
* set the length - 长.
*
* @param length - 长
*/
public void setLength(BigDecimal length) {
this.length = length;
}
/**
* get the width - 宽.
* @return the width
*/
public BigDecimal getWidth() {
return this.width;
}
/**
* set the width - 宽.
*
* @param width - 宽
*/
public void setWidth(BigDecimal width) {
this.width = width;
}
/**
* get the thick - 厚.
* @return the thick
*/
public BigDecimal getThick() {
return this.thick;
}
/**
* set the thick - 厚.
*
* @param thick - 厚
*/
public void setThick(BigDecimal thick) {
this.thick = thick;
}
/**
* get the inventRecordId - 项目档案ID.
* @return the inventRecordId
*/
public Long getInventRecordId() {
return this.inventRecordId;
}
/**
* set the inventRecordId - 项目档案ID.
*
* @param inventRecordId - 项目档案ID
*/
public void setInventRecordId(Long inventRecordId) {
this.inventRecordId = inventRecordId;
}
/**
* get the spec - 规格.
* @return the spec
*/
public String getSpec() {
return this.spec;
}
/**
* set the spec - 规格.
*
* @param spec - 规格
*/
public void setSpec(String spec) {
this.spec = spec;
}
/**
* get the num - 数量.
* @return the num
*/
public BigDecimal getNum() {
return this.num;
}
/**
* set the num - 数量.
*
* @param num - 数量
*/
public void setNum(BigDecimal num) {
this.num = num;
}
/**
* get the unitWt - 单重.
* @return the unitWt
*/
public BigDecimal getUnitWt() {
return this.unitWt;
}
/**
* set the unitWt - 单重.
*
* @param unitWt - 单重
*/
public void setUnitWt(BigDecimal unitWt) {
this.unitWt = unitWt;
}
/**
* get the totalWt - 总重.
* @return the totalWt
*/
public BigDecimal getTotalWt() {
return this.totalWt;
}
/**
* set the totalWt - 总重.
*
* @param totalWt - 总重
*/
public void setTotalWt(BigDecimal totalWt) {
this.totalWt = totalWt;
}
/**
* get the filePath1 - 文件地址1.
* @return the filePath1
*/
public String getFilePath1() {
return this.filePath1;
}
/**
* set the filePath1 - 文件地址1.
*
* @param filePath1 - 文件地址1
*/
public void setFilePath1(String filePath1) {
this.filePath1 = filePath1;
}
/**
* get the filePath2 - 文件地址2.
* @return the filePath2
*/
public String getFilePath2() {
return this.filePath2;
}
/**
* set the filePath2 - 文件地址2.
*
* @param filePath2 - 文件地址2
*/
public void setFilePath2(String filePath2) {
this.filePath2 = filePath2;
}
/**
* get the filePath3 - 文件地址3.
* @return the filePath3
*/
public String getFilePath3() {
return this.filePath3;
}
/**
* set the filePath3 - 文件地址3.
*
* @param filePath3 - 文件地址3
*/
public void setFilePath3(String filePath3) {
this.filePath3 = filePath3;
}
/**
* get the filePath4 - 文件地址4.
* @return the filePath4
*/
public String getFilePath4() {
return this.filePath4;
}
/**
* set the filePath4 - 文件地址4.
*
* @param filePath4 - 文件地址4
*/
public void setFilePath4(String filePath4) {
this.filePath4 = filePath4;
}
/**
* get the filePath5 - 文件地址5.
* @return the filePath5
*/
public String getFilePath5() {
return this.filePath5;
}
/**
* set the filePath5 - 文件地址5.
*
* @param filePath5 - 文件地址5
*/
public void setFilePath5(String filePath5) {
this.filePath5 = filePath5;
}
/**
* get the status - 状态 0-未审核,1-已审核.
* @return the status
*/
public Integer getStatus() {
return this.status;
}
/**
* set the status - 状态 0-未审核,1-已审核.
*
* @param status - 状态 0-未审核,1-已审核
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* get the delStatus - 状态 1未删除,0已删除.
* @return the delStatus
*/
public Integer getDelStatus() {
return this.delStatus;
}
/**
* set the delStatus - 状态 1未删除,0已删除.
*
* @param delStatus - 状态 1未删除,0已删除
*/
public void setDelStatus(Integer delStatus) {
this.delStatus = delStatus;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称.
*
* @param createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人.
*
* @param updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 修改人名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 修改人名称.
*
* @param updatedName - 修改人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 更新时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间.
*
* @param updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the remark - 备注.
* @return the remark
*/
public String getRemark() {
return this.remark;
}
/**
* set the remark - 备注.
*
* @param remark - 备注
*/
public void setRemark(String remark) {
this.remark = remark;
}
/**
* get the lv - 树的层级.
* @return the lv
*/
public Integer getLv() {
return this.lv;
}
/**
* set the lv - 树的层级.
*
* @param lv - 树的层级
*/
public void setLv(Integer lv) {
this.lv = lv;
}
/**
* get the status - 状态 0-未审核,1-已审核.
* @return the status
*/
public String getPgStatus() {
return this.pgStatus;
}
/**
* set the status - 状态 0-未审核,1-已审核.
*
* @param pgStatus - 状态 0-未审核,1-已审核
*/
public void setPgStatus(String pgStatus) {
this.pgStatus = pgStatus;
}
public String getDeliveryDate() {
return deliveryDate;
}
public void setDeliveryDate(String deliveryDate) {
this.deliveryDate = deliveryDate;
}
public Integer getProjStatus() {
return projStatus;
}
public void setProjStatus(Integer projStatus) {
this.projStatus = projStatus;
}
/**
* get the rknum - 入库数量.
* @return the rknum
*/
public Integer getRknum() {
return this.rknum;
}
/**
* set the rknum - 入库数量.
*
* @param rknum - 入库数量
*/
public void setRknum(Integer rknum) {
this.rknum = rknum;
}
/**
* get the cknum - 出库数量.
* @return the cknum
*/
public Integer getCknum() {
return this.cknum;
}
/**
* set the cknum - 出库数量.
*
* @param cknum - 出库数量
*/
public void setCknum(Integer cknum) {
this.cknum = cknum;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setParentId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARENT_ID)), parentId));
setParentPrdtName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARENT_PRDT_NAME)), parentPrdtName));
setType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_TYPE)), type));
setLeaf(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_LEAF)), leaf));
setSort(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SORT)), sort));
setIcon(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ICON)), icon));
setPrdtType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_PRDT_TYPE)), prdtType));
setPrdtCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRDT_CODE)), prdtCode));
setPrdtName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRDT_NAME)), prdtName));
setLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_LENGTH)), length));
setWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WIDTH)), width));
setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_THICK)), thick));
setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SPEC)), spec));
setNum(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_NUM)), num));
setUnitWt(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UNIT_WT)), unitWt));
setTotalWt(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_TOTAL_WT)), totalWt));
setFilePath1(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_PATH1)), filePath1));
setFilePath2(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_PATH2)), filePath2));
setFilePath3(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_PATH3)), filePath3));
setFilePath4(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_PATH4)), filePath4));
setFilePath5(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_PATH5)), filePath5));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setDelStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DEL_STATUS)), delStatus));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
setLv(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_LV)), lv));
setCknum(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_CKNUM)), cknum));
setRknum(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_RKNUM)), rknum));
setPgStatus(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PGSTATUS)), pgStatus));
setDeliveryDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DELIVERY_DATE)), deliveryDate));
setProjStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_PROJ_STATUS)), projStatus));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_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_PARENT_ID, StringUtils.toString(parentId, eiMetadata.getMeta(FIELD_PARENT_ID)));
map.put(FIELD_PARENT_PRDT_NAME, StringUtils.toString(parentPrdtName, eiMetadata.getMeta(FIELD_PARENT_PRDT_NAME)));
map.put(FIELD_TYPE, StringUtils.toString(type, eiMetadata.getMeta(FIELD_TYPE)));
map.put(FIELD_LEAF, StringUtils.toString(leaf, eiMetadata.getMeta(FIELD_LEAF)));
map.put(FIELD_SORT, StringUtils.toString(sort, eiMetadata.getMeta(FIELD_SORT)));
map.put(FIELD_ICON, StringUtils.toString(icon, eiMetadata.getMeta(FIELD_ICON)));
map.put(FIELD_PRDT_TYPE, StringUtils.toString(prdtType, eiMetadata.getMeta(FIELD_PRDT_TYPE)));
map.put(FIELD_PRDT_CODE, StringUtils.toString(prdtCode, eiMetadata.getMeta(FIELD_PRDT_CODE)));
map.put(FIELD_PRDT_NAME, StringUtils.toString(prdtName, eiMetadata.getMeta(FIELD_PRDT_NAME)));
map.put(FIELD_LENGTH, StringUtils.toString(length, eiMetadata.getMeta(FIELD_LENGTH)));
map.put(FIELD_WIDTH, StringUtils.toString(width, eiMetadata.getMeta(FIELD_WIDTH)));
map.put(FIELD_THICK, StringUtils.toString(thick, eiMetadata.getMeta(FIELD_THICK)));
map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID)));
map.put(FIELD_SPEC, StringUtils.toString(spec, eiMetadata.getMeta(FIELD_SPEC)));
map.put(FIELD_NUM, StringUtils.toString(num, eiMetadata.getMeta(FIELD_NUM)));
map.put(FIELD_UNIT_WT, StringUtils.toString(unitWt, eiMetadata.getMeta(FIELD_UNIT_WT)));
map.put(FIELD_TOTAL_WT, StringUtils.toString(totalWt, eiMetadata.getMeta(FIELD_TOTAL_WT)));
map.put(FIELD_FILE_PATH1, StringUtils.toString(filePath1, eiMetadata.getMeta(FIELD_FILE_PATH1)));
map.put(FIELD_FILE_PATH2, StringUtils.toString(filePath2, eiMetadata.getMeta(FIELD_FILE_PATH2)));
map.put(FIELD_FILE_PATH3, StringUtils.toString(filePath3, eiMetadata.getMeta(FIELD_FILE_PATH3)));
map.put(FIELD_FILE_PATH4, StringUtils.toString(filePath4, eiMetadata.getMeta(FIELD_FILE_PATH4)));
map.put(FIELD_FILE_PATH5, StringUtils.toString(filePath5, eiMetadata.getMeta(FIELD_FILE_PATH5)));
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_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK)));
map.put(FIELD_LV, StringUtils.toString(lv, eiMetadata.getMeta(FIELD_LV)));
map.put(FIELD_CKNUM, StringUtils.toString(cknum, eiMetadata.getMeta(FIELD_CKNUM)));
map.put(FIELD_RKNUM, StringUtils.toString(rknum, eiMetadata.getMeta(FIELD_RKNUM)));
map.put(FIELD_PGSTATUS, StringUtils.toString(pgStatus, eiMetadata.getMeta(FIELD_PGSTATUS)));
map.put(FIELD_DELIVERY_DATE,StringUtils.toString(deliveryDate,eiMetadata.getMeta(FIELD_DELIVERY_DATE)));
map.put(FIELD_PROJ_STATUS, StringUtils.toString(projStatus, eiMetadata.getMeta(FIELD_PROJ_STATUS)));
return map;
}
}
package com.baosight.hpjx.hp.sc.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* Project: <br>
* Title:Hpsc108.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-08-10 10:07:01 create
*/
public class HPSC106 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id"; /* ID*/
public static final String FIELD_company_code = "companyCode"; /* 企业编码*/
public static final String FIELD_dep_code = "depCode"; /* 部门编码*/
public static final String FIELD_factory_code = "factoryCode"; /* 厂区编号*/
public static final String FIELD_factory_name = "factoryName"; /* 厂区名称*/
public static final String FIELD_group_code = "groupCode"; /* 生产组编号*/
public static final String FIELD_group_name = "groupName"; /* 生产组名称*/
public static final String FIELD_proj_code = "projCode"; /* 项目编码*/
public static final String FIELD_proj_name = "projName"; /* 项目名称*/
public static final String FIELD_prod_order_no = "prodOrderNo"; /* 生产订单号*/
public static final String FIELD_prod_task_no = "prodTaskNo"; /* 生产任务单号*/
public static final String FIELD_work_code = "workCode";
public static final String FIELD_product_type = "productType"; /* 产品类型*/
public static final String FIELD_product_code = "productCode"; /* 产品编号*/
public static final String FIELD_product_name = "productName"; /* 产品名称*/
public static final String FIELD_register_date = "registerDate"; /* 报工日期*/
public static final String FIELD_quantity = "quantity"; /* 数量*/
public static final String FIELD_single_weight = "singleWeight"; /* 单重*/
public static final String FIELD_total_weight = "totalWeight"; /* 总重*/
public static final String FIELD_created_by = "createdBy"; /* 创建人*/
public static final String FIELD_created_name = "createdName"; /* 创建人名称*/
public static final String FIELD_created_time = "createdTime"; /* 创建时间*/
public static final String FIELD_updated_by = "updatedBy"; /* 更改人*/
public static final String FIELD_updated_name = "updatedName"; /* 修改人名称*/
public static final String FIELD_updated_time = "updatedTime"; /* 修改时间*/
//补充字段
public static final String FIELD_registered_quantity = "registeredQuantity";
public static final String FIELD_registered_weight = "registeredWeight";
public static final String FIELD_unregister_quantity = "unregisterQuantity";
public static final String FIELD_unregister_weight = "unregisterWeight";
public static final String FIELD_task_quantity = "taskQuantity";
public static final String FIELD_task_weight = "taskWeight";
public static final String COL_ID = "ID"; /* ID*/
public static final String COL_company_code = "company_code"; /* 企业编码*/
public static final String COL_dep_code = "dep_code"; /* 部门编码*/
public static final String COL_factory_code = "factory_code"; /* 厂区编号*/
public static final String COL_factory_name = "factory_name"; /* 厂区名称*/
public static final String COL_group_code = "group_code"; /* 生产组编号*/
public static final String COL_group_name = "group_name"; /* 生产组名称*/
public static final String COL_proj_code = "proj_code"; /* 项目编码*/
public static final String COL_proj_name = "proj_name"; /* 项目名称*/
public static final String COL_prod_order_no = "prod_order_no"; /* 生产订单号*/
public static final String COL_prod_task_no = "prod_task_no"; /* 生产任务单号*/
public static final String COL_product_type = "product_type"; /* 产品类型*/
public static final String COL_product_code = "product_code"; /* 产品编号*/
public static final String COL_product_name = "product_name"; /* 产品名称*/
public static final String COL_register_date = "register_date"; /* 报工日期*/
public static final String COL_quantity = "quantity"; /* 数量*/
public static final String COL_single_weight = "single_weight"; /* 单重*/
public static final String COL_total_weight = "total_weight"; /* 总重*/
public static final String COL_created_by = "created_by"; /* 创建人*/
public static final String COL_created_name = "created_name"; /* 创建人名称*/
public static final String COL_created_time = "created_time"; /* 创建时间*/
public static final String COL_updated_by = "updated_by"; /* 更改人*/
public static final String COL_updated_name = "updated_name"; /* 修改人名称*/
public static final String COL_updated_time = "updated_time"; /* 修改时间*/
public static final String QUERY = "HPSC106.query";
public static final String COUNT = "HPSC106.count";
public static final String INSERT = "HPSC106.insert";
public static final String UPDATE = "HPSC106.update";
public static final String DELETE = "HPSC106.delete";
public static final String BATCH_DELETE = "HPSC106.batch_delete";
private Long id = new Long(0); /* ID*/
private String companyCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/
private String factoryCode = " "; /* 厂区编号*/
private String factoryName = " "; /* 厂区名称*/
private String groupCode = " "; /* 生产组编号*/
private String groupName = " "; /* 生产组名称*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private String prodOrderNo = " "; /* 生产订单号*/
private String prodTaskNo = " "; /* 生产任务单号*/
private String workCode = " ";
private Integer productType; /* 产品类型*/
private String productCode = " "; /* 产品编号*/
private String productName = " "; /* 产品名称*/
private String registerDate = " "; /* 报工日期*/
private BigDecimal quantity = new BigDecimal("0"); /* 数量*/
private BigDecimal singleWeight = new BigDecimal("0"); /* 单重*/
private BigDecimal totalWeight = new BigDecimal("0"); /* 总重*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更改人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 修改时间*/
private BigDecimal registeredQuantity = new BigDecimal("0");
private BigDecimal registeredWeight = new BigDecimal(0);
private BigDecimal unregisterQuantity = new BigDecimal("0");
private BigDecimal unregisterWeight = new BigDecimal(0);
private BigDecimal taskQuantity = new BigDecimal("0");
private BigDecimal taskWeight = new BigDecimal(0);
public BigDecimal getRegisteredQuantity() {
return registeredQuantity;
}
public void setRegisteredQuantity(BigDecimal registeredQuantity) {
this.registeredQuantity = registeredQuantity;
}
public BigDecimal getRegisteredWeight() {
return registeredWeight;
}
public void setRegisteredWeight(BigDecimal registeredWeight) {
this.registeredWeight = registeredWeight;
}
public BigDecimal getUnregisterQuantity() {
return unregisterQuantity;
}
public void setUnregisterQuantity(BigDecimal unregisterQuantity) {
this.unregisterQuantity = unregisterQuantity;
}
public BigDecimal getUnregisterWeight() {
return unregisterWeight;
}
public void setUnregisterWeight(BigDecimal unregisterWeight) {
this.unregisterWeight = unregisterWeight;
}
public BigDecimal getTaskQuantity() {
return taskQuantity;
}
public void setTaskQuantity(BigDecimal taskQuantity) {
this.taskQuantity = taskQuantity;
}
public BigDecimal getTaskWeight() {
return taskWeight;
}
public void setTaskWeight(BigDecimal taskWeight) {
this.taskWeight = taskWeight;
}
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_company_code);
eiColumn.setDescName("企业编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_dep_code);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_factory_code);
eiColumn.setDescName("厂区编号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_factory_name);
eiColumn.setDescName("厂区名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_group_code);
eiColumn.setDescName("生产组编号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_group_name);
eiColumn.setDescName("生产组名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_code);
eiColumn.setDescName("项目编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_name);
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_prod_order_no);
eiColumn.setDescName("生产订单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_prod_task_no);
eiColumn.setDescName("生产任务单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_work_code);
eiColumn.setDescName("报工单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_type);
eiColumn.setDescName("产品类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_code);
eiColumn.setDescName("产品编号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_name);
eiColumn.setDescName("产品名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_register_date);
eiColumn.setDescName("报工日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_quantity);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(20);
eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_single_weight);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("单重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_total_weight);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("总重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_created_by);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_created_name);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_created_time);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_updated_by);
eiColumn.setDescName("更改人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_updated_name);
eiColumn.setDescName("修改人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_updated_time);
eiColumn.setDescName("修改时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_registered_quantity);
eiColumn.setDescName("已报工数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_registered_weight);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("已报工重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_unregister_quantity);
eiColumn.setDescName("未报工数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_unregister_weight);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("未报工重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_task_quantity);
eiColumn.setDescName("任务数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_task_weight);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("任务重量");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HPSC106() {
initMetaData();
}
/**
* get the id - ID.
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id - ID.
*
* @param id - ID
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the companyCode - 企业编码.
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 企业编码.
*
* @param companyCode - 企业编码
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the depCode - 部门编码.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
* @param depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the factoryCode - 厂区编号.
* @return the factoryCode
*/
public String getFactoryCode() {
return this.factoryCode;
}
/**
* set the factoryCode - 厂区编号.
*
* @param factoryCode - 厂区编号
*/
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
/**
* get the factoryName - 厂区名称.
* @return the factoryName
*/
public String getFactoryName() {
return this.factoryName;
}
/**
* set the factoryName - 厂区名称.
*
* @param factoryName - 厂区名称
*/
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
}
/**
* get the groupCode - 生产组编号.
* @return the groupCode
*/
public String getGroupCode() {
return this.groupCode;
}
/**
* set the groupCode - 生产组编号.
*
* @param groupCode - 生产组编号
*/
public void setGroupCode(String groupCode) {
this.groupCode = groupCode;
}
/**
* get the groupName - 生产组名称.
* @return the groupName
*/
public String getGroupName() {
return this.groupName;
}
/**
* set the groupName - 生产组名称.
*
* @param groupName - 生产组名称
*/
public void setGroupName(String groupName) {
this.groupName = groupName;
}
/**
* get the projCode - 项目编码.
* @return the projCode
*/
public String getProjCode() {
return this.projCode;
}
/**
* set the projCode - 项目编码.
*
* @param projCode - 项目编码
*/
public void setProjCode(String projCode) {
this.projCode = projCode;
}
/**
* get the projName - 项目名称.
* @return the projName
*/
public String getProjName() {
return this.projName;
}
/**
* set the projName - 项目名称.
*
* @param projName - 项目名称
*/
public void setProjName(String projName) {
this.projName = projName;
}
/**
* get the prodOrderNo - 生产订单号.
* @return the prodOrderNo
*/
public String getProdOrderNo() {
return this.prodOrderNo;
}
/**
* set the prodOrderNo - 生产订单号.
*
* @param prodOrderNo - 生产订单号
*/
public void setProdOrderNo(String prodOrderNo) {
this.prodOrderNo = prodOrderNo;
}
/**
* get the prodTaskNo - 生产任务单号.
* @return the prodTaskNo
*/
public String getProdTaskNo() {
return this.prodTaskNo;
}
/**
* set the prodTaskNo - 生产任务单号.
*
* @param prodTaskNo - 生产任务单号
*/
public void setProdTaskNo(String prodTaskNo) {
this.prodTaskNo = prodTaskNo;
}
/**
* get the productType - 产品类型.
* @return the productType
*/
public Integer getProductType() {
return this.productType;
}
/**
* set the productType - 产品类型.
*
* @param productType - 产品类型
*/
public void setProductType(Integer productType) {
this.productType = productType;
}
/**
* get the productCode - 产品编号.
* @return the productCode
*/
public String getProductCode() {
return this.productCode;
}
/**
* set the productCode - 产品编号.
*
* @param productCode - 产品编号
*/
public void setProductCode(String productCode) {
this.productCode = productCode;
}
/**
* get the productName - 产品名称.
* @return the productName
*/
public String getProductName() {
return this.productName;
}
/**
* set the productName - 产品名称.
*
* @param productName - 产品名称
*/
public void setProductName(String productName) {
this.productName = productName;
}
/**
* get the registerDate - 报工日期.
* @return the registerDate
*/
public String getRegisterDate() {
return this.registerDate;
}
/**
* set the registerDate - 报工日期.
*
* @param registerDate - 报工日期
*/
public void setRegisterDate(String registerDate) {
this.registerDate = registerDate;
}
/**
* get the quantity - 数量.
* @return the quantity
*/
public BigDecimal getQuantity() {
return this.quantity;
}
/**
* set the quantity - 数量.
*
* @param quantity - 数量
*/
public void setQuantity(BigDecimal quantity) {
this.quantity = quantity;
}
/**
* get the singleWeight - 单重.
* @return the singleWeight
*/
public BigDecimal getSingleWeight() {
return this.singleWeight;
}
/**
* set the singleWeight - 单重.
*
* @param singleWeight - 单重
*/
public void setSingleWeight(BigDecimal singleWeight) {
this.singleWeight = singleWeight;
}
/**
* get the totalWeight - 总重.
* @return the totalWeight
*/
public BigDecimal getTotalWeight() {
return this.totalWeight;
}
/**
* set the totalWeight - 总重.
*
* @param totalWeight - 总重
*/
public void setTotalWeight(BigDecimal totalWeight) {
this.totalWeight = totalWeight;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称.
*
* @param createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更改人.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更改人.
*
* @param updatedBy - 更改人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 修改人名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 修改人名称.
*
* @param updatedName - 修改人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 修改时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 修改时间.
*
* @param updatedTime - 修改时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
public String getWorkCode() {
return workCode;
}
public void setWorkCode(String workCode) {
this.workCode = workCode;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_company_code)), companyCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_dep_code)), depCode));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_factory_code)), factoryCode));
setFactoryName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_factory_name)), factoryName));
setGroupCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_group_code)), groupCode));
setGroupName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_group_name)), groupName));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_code)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_name)), projName));
setProdOrderNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_prod_order_no)), prodOrderNo));
setProdTaskNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_prod_task_no)), prodTaskNo));
setWorkCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_work_code)), workCode));
setProductType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_product_type)), productType));
setProductCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_product_code)), productCode));
setProductName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_product_name)), productName));
setRegisterDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_register_date)), registerDate));
setQuantity(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_quantity)), quantity));
setSingleWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_single_weight)), singleWeight));
setTotalWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_total_weight)), totalWeight));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_created_by)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_created_name)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_created_time)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_by)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_name)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_time)), updatedTime));
setRegisteredQuantity(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_registered_quantity)), registeredQuantity));
setRegisteredWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_registered_weight)), registeredWeight));
setUnregisterQuantity(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_unregister_quantity)), unregisterQuantity));
setUnregisterWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_unregister_weight)), unregisterWeight));
setTaskQuantity(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_task_quantity)), taskQuantity));
setTaskWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_task_weight)), taskWeight));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_company_code, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_company_code)));
map.put(FIELD_dep_code, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_dep_code)));
map.put(FIELD_factory_code, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_factory_code)));
map.put(FIELD_factory_name, StringUtils.toString(factoryName, eiMetadata.getMeta(FIELD_factory_name)));
map.put(FIELD_group_code, StringUtils.toString(groupCode, eiMetadata.getMeta(FIELD_group_code)));
map.put(FIELD_group_name, StringUtils.toString(groupName, eiMetadata.getMeta(FIELD_group_name)));
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_prod_order_no, StringUtils.toString(prodOrderNo, eiMetadata.getMeta(FIELD_prod_order_no)));
map.put(FIELD_prod_task_no, StringUtils.toString(prodTaskNo, eiMetadata.getMeta(FIELD_prod_task_no)));
map.put(FIELD_work_code, StringUtils.toString(workCode, eiMetadata.getMeta(FIELD_work_code)));
map.put(FIELD_product_type, StringUtils.toString(productType, eiMetadata.getMeta(FIELD_product_type)));
map.put(FIELD_product_code, StringUtils.toString(productCode, eiMetadata.getMeta(FIELD_product_code)));
map.put(FIELD_product_name, StringUtils.toString(productName, eiMetadata.getMeta(FIELD_product_name)));
map.put(FIELD_register_date, StringUtils.toString(registerDate, eiMetadata.getMeta(FIELD_register_date)));
map.put(FIELD_quantity, StringUtils.toString(quantity, eiMetadata.getMeta(FIELD_quantity)));
map.put(FIELD_single_weight, StringUtils.toString(singleWeight, eiMetadata.getMeta(FIELD_single_weight)));
map.put(FIELD_total_weight, StringUtils.toString(totalWeight, eiMetadata.getMeta(FIELD_total_weight)));
map.put(FIELD_created_by, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_created_by)));
map.put(FIELD_created_name, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_created_name)));
map.put(FIELD_created_time, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_created_time)));
map.put(FIELD_updated_by, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_updated_by)));
map.put(FIELD_updated_name, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_updated_name)));
map.put(FIELD_updated_time, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_updated_time)));
map.put(FIELD_registered_quantity, StringUtils.toString(registeredQuantity, eiMetadata.getMeta(FIELD_registered_quantity)));
map.put(FIELD_registered_weight, StringUtils.toString(registeredWeight, eiMetadata.getMeta(FIELD_registered_weight)));
map.put(FIELD_unregister_quantity, StringUtils.toString(unregisterQuantity, eiMetadata.getMeta(FIELD_unregister_quantity)));
map.put(FIELD_unregister_weight, StringUtils.toString(unregisterWeight, eiMetadata.getMeta(FIELD_unregister_weight)));
map.put(FIELD_task_quantity, StringUtils.toString(taskQuantity, eiMetadata.getMeta(FIELD_task_quantity)));
map.put(FIELD_task_weight, StringUtils.toString(taskWeight, eiMetadata.getMeta(FIELD_task_weight)));
return map;
}
}
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.enums.OrgTypeEnum;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.ds.domain.HPDS002;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.domain.*;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.hp.xs.domain.Org;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.*;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author LiuYang
* @version 1.0 2024/8/8
* @description 宏建物料清单
*/
public class ServiceHPSC102 extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "查询",operDesc = "初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
Map<String, Object> map = new HashMap<>();
map.put("itemCode", "ITEM_CODE in ('2','3','4')");
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID, DdynamicEnum.CODESET_CODE_BLOCK_ID), map,
false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC002().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
inInfo = super.query(inInfo, HPSC002.QUERY, new HPSC002());
List sum = dao.query(HPSC002.QUERY_SUM, queryRow);
inInfo.getBlock(EiConstant.resultBlock).set(EiConstant.COLUMN_TOTAL_SUM, sum.get(0));
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "app查询",operDesc = "app查询")
public EiInfo appQuery(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPSC002.APPQUERY, new HPSC002());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "物料清单",operType = "查询",operDesc = "查询明细detail")
public EiInfo queryDetail(EiInfo inInfo){
//添加返回到前台的块,块名和前台的对应
//HashMap params = new HashMap();
//params.put(HPSC002.FIELD_PROJ_CODE,inInfo.get(HPSC002.FIELD_PROJ_CODE));
//params.put(HPSC002.FIELD_LV,inInfo.get(HPSC002.FIELD_LV));
EiInfo outInfo = super.query(inInfo,HPSC002.QUERY,new HPSC002(),false,new HPSC002().eiMetadata,EiConstant.queryBlock,EiConstant.resultBlock, CommonConstant.Field.DETAIL);
//List list = dao.query(HPSC002.QUERY,params,0,-999999);
//outInfo.addBlock(CommonConstant.Field.DETAIL).addBlockMeta(new HPSC002().eiMetadata);
//outInfo.addBlock(CommonConstant.Field.DETAIL).addRows(list);
//outInfo.getBlock(CommonConstant.Field.DETAIL).set(EiConstant.limitStr, list.size());
return outInfo;
}
/**
* 查询操作物料清单选择校验.
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "查询",operDesc = "查询")
public EiInfo count(EiInfo inInfo) {
try {
HashMap map = new HashMap();
HPSC001 hpsc001 = HPSCTools.HpSc001.getId(inInfo.getString("id"));
map.put(HPSC002.FIELD_PROJ_CODE,hpsc001.getProjCode());
List<HPSC002> results = this.dao.query("HPSC002.queryTree", map);
if (results.size()>1){
inInfo.setStatus(0);
}else{
inInfo.setStatus(1);
inInfo.set(HPSC002.FIELD_PROJ_CODE,hpsc001.getProjCode());
}
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (Map resultRow : resultRows) {
HPSC002 hpsc002 = new HPSC002();
hpsc002.fromMap(resultRow);
AssertUtils.isTrue(hpsc002.getStatus().equals(HPConstant.planStatus.S_1), "物料清单已提交,无法保存!");
if (hpsc002.getId() == null || hpsc002.getId() == 0) {
this.add(hpsc002);
} else {
this.modify(hpsc002);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "保存",operDesc = "保存detil")
public EiInfo saveDetail(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(CommonConstant.Field.DETAIL).getRows();
// 写入数据
for (Map resultRow : resultRows) {
HPSC002 hpsc002 = new HPSC002();
hpsc002.fromMap(resultRow);
hpsc002.setDeliveryDate(DateUtils.formatShort(hpsc002.getDeliveryDate()));
if (hpsc002.getId() == null || hpsc002.getId() == 0) {
hpsc002.setDeliveryDate(DateUtils.formatShort(hpsc002.getDeliveryDate()));
inInfo = this.add(hpsc002);
} else {
inInfo = this.modify(hpsc002);
}
}
/* inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");*/
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作.
*/
public EiInfo add(HPSC002 hpsc002) {
EiInfo inInfo = new EiInfo();
try {
//单独新增需要拿到销售单的交货日期
HPSC001 hpsc001 = HPSCTools.HpSc001.get(hpsc002.getProjCode());
hpsc002.setDeliveryDate(hpsc001.getDeliveryDate());
hpsc002.setLeaf("1");
// 计算总重
//BigDecimal num = hpsc002.getNum();
//BigDecimal unitWt = hpsc002.getUnitWt();
//DecimalFormat decimalFormat = new DecimalFormat("#.000");
//BigDecimal totalWt = new BigDecimal(decimalFormat.format(num.multiply(unitWt).floatValue()/1000));
hpsc002.setDelStatus(CommonConstant.YesNo.NO_0.intValue());
//hpsc002.setTotalWt(totalWt);
// if (StringUtils.isNotEmpty(hppz002.getPrdtCode()) && !hppz002.getParentId().equals("root")) {
// hppz002.setPrdtName(HPPZTools.getPz004ByCode(hppz002.getPrdtCode()).getInventName());
// }
hpsc002.setSpec(HPPZTools.HpPz006.jointSpec(hpsc002.getLength(),hpsc002.getWidth(),hpsc002.getThick()));
if(hpsc002.getParentId().equals("root")){
hpsc002.setLv(new Integer(1));
}else{
hpsc002.setPrdtCode(HPPZTools.HpPz004.checkAndSave(hpsc002.getPrdtType(),hpsc002.getPrdtName()));
Integer lv = (Integer) this.dao.get("HPSC002.queryLv","id",hpsc002.getParentId());
hpsc002.setLv(lv.intValue()+1);
}
DaoUtils.insert("HPSC002.insert", hpsc002.toMap());
//更新零件后,更新部件重量
if(hpsc002.getPrdtType()==3){
this.updatePrdtWt(hpsc002.getParentId());
}
if (!hpsc002.getParentId().equals("root")) {
this.checkTreeNodeLeaf(hpsc002.getParentId());
}
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 inInfo;
}
/**
* 修改操作.
*/
public EiInfo modify(HPSC002 hpsc002) {
EiInfo inInfo = new EiInfo();
try {
//处理已经派单的任务不允许修改
//如果是部件修改 LV = 2 ;零件耗材 LV = 3
if (hpsc002.getLv() == 2) {
//根据002表的ID找到003表
HPSC003 HPSC003 = HPSCTools.HpSc003.queryByMat(hpsc002.getId());
//根据生产计划单号找到对应的生产订单详情
if (HPSC003 != null) {
if (StringUtils.isNotBlank(HPSC003.getPlanInfoNo())) {
List<HPSC004> hpsc004List = HPSCTools.HpSc004.queryByParent(HPSC003.getPlanInfoNo());
if (CollectionUtils.isNotEmpty(hpsc004List)) {
List<Long> matIds = hpsc004List.stream().map(HPSC004 :: getMatId).sorted().collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(matIds)) {
List<HPSC005> hpsc005List = HPSCTools.HpSc005.listByMatId(matIds);
if (CollectionUtils.isNotEmpty(hpsc005List)) {
List<HPSC005> stausList = hpsc005List.stream().filter(
HPSC005 -> HPSC005.getStatus() > 0
).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(stausList)) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!原因参见详细错误描述!");
inInfo.setDetailMsg("部件名称为 " + hpsc002.getPrdtName() + "的生产订单已经分派,不允许进行修改!");
logError("修改失败", "部件名称为 " + hpsc002.getPrdtName() + "的生产订单已经分派,不允许进行修改!");
return inInfo;
} else {
// 只修改 003 表
this.updateHPSC002(hpsc002);
this.updateHPSC003(hpsc002, HPSC003);
//修改5表中部件的长宽厚
for (HPSC005 hpsc005 : hpsc005List) {
hpsc005.setPrdtLength(hpsc002.getLength());
hpsc005.setPrdtWidth(hpsc002.getWidth());
hpsc005.setPrdtThick(hpsc002.getThick());
hpsc005.setPrdtSpec(HPPZTools.HpPz006.jointSpec(hpsc005.getPrdtLength(),hpsc005.getPrdtWidth(),hpsc005.getPrdtThick()));
DaoUtils.update("HPSC005.update", hpsc005.toMap());
}
}
} else {
this.updateHPSC002(hpsc002);
this.updateHPSC003(hpsc002, HPSC003);
}
}
}
}
} else {
this.updateHPSC002(hpsc002);
}
} else if (hpsc002.getLv() == 3) {
HPSC004 HPSC004 = HPSCTools.HpSc004.queryByMat(hpsc002.getId());
HPSC005 HPSC005 = HPSCTools.HpSc005.queryByMat(hpsc002.getId());
if (HPSC004 != null) {
if (HPSC005 != null) {
if (HPSC005.getStatus() > 0) {
// 已经分派
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!原因参见详细错误描述!");
inInfo.setDetailMsg("零件(耗材)名称为 " + hpsc002.getPrdtName() + "的生产订单已经分派,不允许进行修改!");
logError("修改失败", "零件(耗材)名称为 " + hpsc002.getPrdtName() + "的生产订单已经分派,不允许进行修改!");
return inInfo;
} else {
this.updateHPSC002(hpsc002);
this.updateHPSC004(hpsc002, HPSC004);
HPSC005.setPartLength(hpsc002.getLength());
HPSC005.setPartWidth(hpsc002.getWidth());
HPSC005.setPartThick(hpsc002.getThick());
HPSC005.setNum(hpsc002.getNum());
HPSC005.setUnitWt(hpsc002.getUnitWt());
HPSC005.setTotalWt(hpsc002.getTotalWt());
HPSC005.setPartSpec(HPPZTools.HpPz006.jointSpec(HPSC005.getPartLength(),HPSC005.getPartWidth(),HPSC005.getPartThick()));
DaoUtils.update("HPSC005.update", HPSC005.toMap());
}
} else {
this.updateHPSC002(hpsc002);
this.updateHPSC004(hpsc002, HPSC004);
}
} else {
this.updateHPSC002(hpsc002);
}
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
/**
* 新增操作.
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "新增",operDesc = "新增操作")
@Override
public EiInfo insert(EiInfo inInfo) {
try {
HPSC002 hppz002 = new HPSC002();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz002.fromMap(map);
hppz002.setLeaf("1");
// 计算总重
BigDecimal num = hppz002.getNum();
BigDecimal unitWt = hppz002.getUnitWt();
DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(num.multiply(unitWt).floatValue()/1000));
hppz002.setDelStatus(CommonConstant.YesNo.NO_0.intValue());
hppz002.setTotalWt(totalWt);
// if (StringUtils.isNotEmpty(hppz002.getPrdtCode()) && !hppz002.getParentId().equals("root")) {
// hppz002.setPrdtName(HPPZTools.getPz004ByCode(hppz002.getPrdtCode()).getInventName());
// }
hppz002.setSpec(HPPZTools.HpPz006.jointSpec(hppz002.getLength(),hppz002.getWidth(),hppz002.getThick()));
if(hppz002.getParentId().equals("root")){
hppz002.setLv(new Integer(1));
}else{
hppz002.setPrdtCode(HPPZTools.HpPz004.checkAndSave(hppz002.getPrdtType(),hppz002.getPrdtName()));
Integer lv = (Integer) this.dao.get("HPSC002.queryLv","id",hppz002.getParentId());
hppz002.setLv(lv.intValue()+1);
}
DaoUtils.insert("HPSC002.insert", hppz002.toMap());
if (!hppz002.getParentId().equals("root")) {
this.checkTreeNodeLeaf(hppz002.getParentId());
}
//处理项目管理中物料状态
HPSCTools.updateProjStatus(hppz002.getProjCode());
}
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);
}
/**
* 修改操作.
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "修改",operDesc = "修改操作")
@Override
public EiInfo update(EiInfo inInfo) {
try {
HPSC002 hppz002 = new HPSC002();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz002.fromMap(map);
//处理已经派单的任务不允许修改
//如果是部件修改 LV = 2 ;零件耗材 LV = 3
if (hppz002.getLv() == 2) {
//根据002表的ID找到003表
HPSC003 HPSC003 = HPSCTools.HpSc003.queryByMat(hppz002.getId());
//根据生产计划单号找到对应的生产订单详情
if (HPSC003 != null) {
if (StringUtils.isNotBlank(HPSC003.getPlanInfoNo())) {
List<HPSC004> hpsc004List = HPSCTools.HpSc004.queryByParent(HPSC003.getPlanInfoNo());
if (CollectionUtils.isNotEmpty(hpsc004List)) {
List<Long> matIds = hpsc004List.stream().map(HPSC004 :: getMatId).sorted().collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(matIds)) {
List<HPSC005> hpsc005List = HPSCTools.HpSc005.listByMatId(matIds);
if (CollectionUtils.isNotEmpty(hpsc005List)) {
List<HPSC005> stausList = hpsc005List.stream().filter(
HPSC005 -> HPSC005.getStatus() > 0
).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(stausList)) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!原因参见详细错误描述!");
inInfo.setDetailMsg("部件名称为 " + hppz002.getPrdtName() + "的生产订单已经分派,不允许进行修改!");
logError("修改失败", "部件名称为 " + hppz002.getPrdtName() + "的生产订单已经分派,不允许进行修改!");
return inInfo;
} else {
// 只修改 003 表
this.updateHPSC002(hppz002);
this.updateHPSC003(hppz002, HPSC003);
//修改5表中部件的长宽厚
for (HPSC005 hpsc005 : hpsc005List) {
hpsc005.setPrdtLength(hppz002.getLength());
hpsc005.setPrdtWidth(hppz002.getWidth());
hpsc005.setPrdtThick(hppz002.getThick());
hpsc005.setPrdtSpec(HPPZTools.HpPz006.jointSpec(hpsc005.getPrdtLength(),hpsc005.getPrdtWidth(),hpsc005.getPrdtThick()));
DaoUtils.update("HPSC005.update", hpsc005.toMap());
}
}
} else {
this.updateHPSC002(hppz002);
this.updateHPSC003(hppz002, HPSC003);
}
}
}
}
} else {
this.updateHPSC002(hppz002);
}
} else if (hppz002.getLv() == 3) {
HPSC004 HPSC004 = HPSCTools.HpSc004.queryByMat(hppz002.getId());
HPSC005 HPSC005 = HPSCTools.HpSc005.queryByMat(hppz002.getId());
if (HPSC004 != null) {
if (HPSC005 != null) {
if (HPSC005.getStatus() > 0) {
// 已经分派
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!原因参见详细错误描述!");
inInfo.setDetailMsg("零件(耗材)名称为 " + hppz002.getPrdtName() + "的生产订单已经分派,不允许进行修改!");
logError("修改失败", "零件(耗材)名称为 " + hppz002.getPrdtName() + "的生产订单已经分派,不允许进行修改!");
return inInfo;
} else {
this.updateHPSC002(hppz002);
this.updateHPSC004(hppz002, HPSC004);
HPSC005.setPartLength(hppz002.getLength());
HPSC005.setPartWidth(hppz002.getWidth());
HPSC005.setPartThick(hppz002.getThick());
HPSC005.setNum(hppz002.getNum());
HPSC005.setUnitWt(hppz002.getUnitWt());
HPSC005.setTotalWt(hppz002.getTotalWt());
HPSC005.setPartSpec(HPPZTools.HpPz006.jointSpec(HPSC005.getPartLength(),HPSC005.getPartWidth(),HPSC005.getPartThick()));
DaoUtils.update("HPSC005.update", HPSC005.toMap());
}
} else {
this.updateHPSC002(hppz002);
this.updateHPSC004(hppz002, HPSC004);
}
} else {
this.updateHPSC002(hppz002);
}
}
}
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 void updateHPSC002(HPSC002 hppz002) {
//BigDecimal num = hppz002.getNum();
//BigDecimal unitWt = hppz002.getUnitWt();
//DecimalFormat decimalFormat = new DecimalFormat("#.000");
//BigDecimal totalWt = new BigDecimal(decimalFormat.format(num.multiply(unitWt).floatValue()/1000));
//hppz002.setDelStatus(CommonConstant.YesNo.NO_0.intValue());
//hppz002.setTotalWt(totalWt);
hppz002.setSpec(HPPZTools.HpPz006.jointSpec(hppz002.getLength(),hppz002.getWidth(),hppz002.getThick()));
DaoUtils.update("HPSC002.update", hppz002.toMap());
//更新零件后,更新部件重量
if(hppz002.getPrdtType()==3){
this.updatePrdtWt(hppz002.getParentId());
}
}
public void updateHPSC003(HPSC002 hppz002, HPSC003 HPSC003) {
HPSC003.setLength(hppz002.getLength());
HPSC003.setWidth(hppz002.getWidth());
HPSC003.setThick(hppz002.getThick());
HPSC003.setSpec(HPPZTools.HpPz006.jointSpec(HPSC003.getLength(),HPSC003.getWidth(),HPSC003.getThick()));
HPSC003.setDeliveryDate(hppz002.getDeliveryDate());
HPSC003.setPlanCompletionDate(hppz002.getDeliveryDate());
DaoUtils.update("HPSC003.update", HPSC003.toMap());
}
public void updateHPSC004(HPSC002 hppz002, HPSC004 HPSC004) {
HPSC004.setLength(hppz002.getLength());
HPSC004.setWidth(hppz002.getWidth());
HPSC004.setThick(hppz002.getThick());
HPSC004.setNum(hppz002.getNum());
HPSC004.setUnitWt(hppz002.getUnitWt());
HPSC004.setTotalWt(hppz002.getTotalWt());
HPSC004.setSpec(HPPZTools.HpPz006.jointSpec(HPSC004.getLength(),HPSC004.getWidth(),HPSC004.getThick()));
// HPSC004.setDeliveryDate(hppz002.getDeliveryDate());
DaoUtils.update("HPSC004.update", HPSC004.toMap());
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 删除之前数据校验
for (Map resultRow : resultRows) {
HPSC002 fSc002 = new HPSC002();
fSc002.fromMap(resultRow);
// 存在子节点不能删除
List<HPSC002> dbSc002s = HPSCTools.HpSc002.queryByParent(fSc002.getId().toString());
AssertUtils.isNotEmpty(dbSc002s, String.format("部件[%s]已存在子节点不能删除", fSc002.getPrdtName()));
// 计划生产中不能删除
HPSC004 dbSc004 = HPSCTools.HpSc004.queryByMat(fSc002.getId());
HPSC005 HPSC005 = HPSCTools.HpSc005.queryByMat(fSc002.getId());
if (HPSC005 != null) {
HPSCTools.HpSc005.lock(HPSC005.getProdOrderNo());
AssertUtils.isTrue(HPSC005.getStatus() > 0,
String.format("部件[%s]已派工不能删除", fSc002.getPrdtName()));
}
}
// 删除数据
for (Map resultRow : resultRows) {
HPSC002 fSc002 = new HPSC002();
fSc002.fromMap(resultRow);
// 删除附件文件
delectDoc(fSc002.getId());
DaoUtils.update("HPSC002.delete", fSc002);
// 修改父级节点状态是叶子节点或非叶子节点
this.checkTreeNodeLeaf(fSc002.getParentId());
// 修改节点状态是叶子节点或非叶子节点
this.checkTreeNodeLeaf(fSc002.getId().toString());
// 同步删除生产计划
HPSCTools.HpSc003.deleteByMat(fSc002.getId());
HPSCTools.HpSc004.deleteByMat(fSc002.getId());
// 同步删除生产订单
HPSCTools.HpSc005.deleteByMat(fSc002.getId());
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "物料清单",operType = "删除",operDesc = "删除操作detail")
public EiInfo deleteDetail(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(CommonConstant.Field.DETAIL).getRows();
// 删除之前数据校验
for (Map resultRow : resultRows) {
HPSC002 fSc002 = new HPSC002();
fSc002.fromMap(resultRow);
// 存在子节点不能删除
List<HPSC002> dbSc002s = HPSCTools.HpSc002.queryByParent(fSc002.getId().toString());
AssertUtils.isNotEmpty(dbSc002s, String.format("部件[%s]已存在子节点不能删除", fSc002.getPrdtName()));
// 计划生产中不能删除
HPSC004 dbSc004 = HPSCTools.HpSc004.queryByMat(fSc002.getId());
HPSC005 HPSC005 = HPSCTools.HpSc005.queryByMat(fSc002.getId());
if (HPSC005 != null) {
HPSCTools.HpSc005.lock(HPSC005.getProdOrderNo());
AssertUtils.isTrue(HPSC005.getStatus() > 0,
String.format("部件[%s]已派工不能删除", fSc002.getPrdtName()));
}
}
// 删除数据
for (Map resultRow : resultRows) {
HPSC002 fSc002 = new HPSC002();
fSc002.fromMap(resultRow);
// 删除附件文件
delectDoc(fSc002.getId());
DaoUtils.update(HPSC002.DELETE, fSc002);
// 修改父级节点状态是叶子节点或非叶子节点
this.checkTreeNodeLeaf(fSc002.getParentId());
// 修改节点状态是叶子节点或非叶子节点
this.checkTreeNodeLeaf(fSc002.getId().toString());
// 同步删除生产计划
HPSCTools.HpSc003.deleteByMat(fSc002.getId());
HPSCTools.HpSc004.deleteByMat(fSc002.getId());
// 同步删除生产订单
HPSCTools.HpSc005.deleteByMat(fSc002.getId());
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 前端校验,数据是否派工
*
* @param inInfo
* @return
*/
public EiInfo checkIsPg(EiInfo inInfo) {
List<Map> resultRows = (List<Map>) inInfo.get("result");
Boolean checkSatus = true;
String msg = null;
for (Map resultRow : resultRows) {
HPSC002 fSc002 = new HPSC002();
fSc002.fromMap(resultRow);
HPSC005 HPSC005 = HPSCTools.HpSc005.queryByMat(fSc002.getId());
if (HPSC005 != null) {
checkSatus = false;
msg = HPSC005.getPrdtName()+"已派工不能删除!";
break;
}
}
inInfo.set("checkSatus",checkSatus);
inInfo.set("msg",msg);
return inInfo;
}
/**
* 指定树节点
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "查询",operDesc = "指定树节点")
public EiInfo queryTreeRoot(EiInfo inInfo) {
Long projId = NumberUtils.toLong(inInfo.get("projId"));
Map queryMap = new HashMap();
String root = "";
if (projId != null) {
Map map = new HashMap();
map.put("id", projId);
HPSC001 HPSC001 = (com.baosight.hpjx.hp.sc.domain.HPSC001) dao.get("HPSC001.queryDomainById", "id",projId);
root = HPSC001.getProjCode() + ":" + HPSC001.getProjName();
}
inInfo.set("root",root);
return inInfo;
}
/**
* 查询树
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "物料清单", operType = "查询", operDesc = "树查询服务")
public EiInfo queryTreeNode(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String node = MapUtils.getString(queryRow, "node");
Map map = new HashMap();
map.put("id", queryRow.get(CommonConstant.Field.PROJ_ID));
List<HPSC001> dbSc001s = dao.query("HPSC001.queryDomainById", map);
// 查询节点
Map queryMap = new HashMap();
queryMap.put("projCode", CollectionUtils.isEmpty(dbSc001s) ? "null" : dbSc001s.get(0).getProjCode());
queryMap.put("pEname", "$".equals(node) ? "root" : node);
List rows = dao.query("HPSC002.queryTree", queryMap);
// 增加节点block块
EiInfo outInfo = new EiInfo();
EiBlock outBlock = outInfo.addBlock(node);
outBlock.addRows(rows);
return outInfo;
}
/**
* 修改节点状态,是叶子或非叶子节点
*
* @param id
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "修改",operDesc = "修改节点状态,是叶子或非叶子节点")
public void checkTreeNodeLeaf(String id) {
//1 获取参数
Map queryMap = new HashMap();
queryMap.put("id", id);
List rows = this.dao.query("HPSC002.queryTreeNodeByParentPrtdCode", queryMap);
if (rows.size() > 0) {
queryMap.put("leaf", "0");
} else {
queryMap.put("leaf", "1");
}
DaoUtils.update("HPSC002.updateTreeNodeLeaf", queryMap);
}
/**
* 更新零件后,更新部件重量
*
* @param parentId
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "修改",operDesc = "更新零件后,更新部件重量")
public void updatePrdtWt(String parentId) {
//1 获取参数
Map queryMap = new HashMap();
queryMap.put("parentId", parentId);
DaoUtils.update("HPSC002.updatePrdtWt", queryMap);
}
/**
* 提交 撤回.
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "提交",operDesc = "提交 撤回")
public EiInfo check(EiInfo eiInfo) {
try {
HPSC002 hppz002 = new HPSC002();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz002.fromMap(map);
//限制一下,如果二级已经提交通过,这个时候不允许进行撤回
if("0".equals(map.get("status"))) {
//找到二级是否已经提交
HPSC002 THPSC002 = (HPSC002) dao.get("HPSC002.query","id",hppz002.getId());
if (THPSC002.getStatus() == 1) {
// 二级如果已经提交了则需要去看看计划是否已经更新
}
}
DaoUtils.update("HPSC002.check", hppz002.toMap());
}
// 处理三级提交之后判断是否都提交完成,如果都提交完成则二级直接提交通过
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz002.fromMap(map);
HPSC002 hpsc002 = (HPSC002) dao.get("HPSC002.query","id",hppz002.getId());
Map<String,Object> map1 = new HashMap<>();
map1.put("parentId",hpsc002.getParentId());
List list = dao.query("HPSC002.checkExamineNum", map1);
int num = NumberUtils.toint(list.get(0));
Map<String,Object> map2 = new HashMap<>();
if (num == 0) {
map2.put("status",1);
map2.put("id",hpsc002.getParentId());
// 自动生成生产计划
HPSC003 hpsc003 = this.autoPlanInfo(hpsc002);
// 生成二维码
/*if (StringUtils.isBlank(hpsc003.getQrcodeDocId())) {
try {
HPSCTools.HpSc003.createQrCode(hpsc003.getPlanInfoNo());
} catch (Exception e) {
//e.printStackTrace();
//LogUtils.setDetailMsg(eiInfo,e, "生成二维码失败!");
}
}*/
} else {
map2.put("status",0);
map2.put("id",hpsc002.getParentId());
}
DaoUtils.update("HPSC002.check",map2);
//处理项目管理中物料状态
HPSCTools.updateProjStatus(hpsc002.getProjCode());
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("提交成功!");
} catch (PlatException e) {
LogUtils.setDetailMsg(eiInfo,e, "提交失败!");
}
return eiInfo;
}
/**
* 绑定附件
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "绑定",operDesc = "绑定附件")
public EiInfo bindDocIdById(EiInfo inInfo) {
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HPSC002 fSc002 = new HPSC002();
fSc002.fromMap(resultRow);
Map sqlMap = new HashMap();
sqlMap.put("id", fSc002.getId());
sqlMap.put("filePath1", fSc002.getFilePath1());
sqlMap.put("bizType", "WL");
DaoUtils.update("HPSC002.bindDocIdById", fSc002.toMap());
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "操作失败");
}
return inInfo;
}
/**
* 生成生产计划
*
* @param dbSc002 物料清单
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "新增",operDesc = "生成生产计划")
public HPSC003 autoPlanInfo(HPSC002 dbSc002) {
String planNo;
// 生成生产计划t_hpsc003,如果已存在就不新增
HPSC003 dbSc003 = HPSCTools.HpSc003.queryByMat(dbSc002.getId());
List<String> factoryIds =HPXSTools.XsOrg.getOrgId(OrgTypeEnum.FACTORY.getCode());
AssertUtils.isEmpty(factoryIds,"工厂不存在");
Org org = HPXSTools.XsOrg.queryFactory(factoryIds.get(0));
if (dbSc003 == null) {
planNo = SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPSC003_PROD_NO);
HPSC003 newSc003 = BeanUtils.copy(dbSc002, HPSC003.class);
newSc003.setPlanInfoNo(planNo);
newSc003.setMatId(dbSc002.getId());
newSc003.setFactoryCode(org.getOrgId());
newSc003.setPlanCompletionDate(dbSc002.getDeliveryDate());
newSc003.setStatus(HPConstant.planStatus.S_1);
DaoUtils.insert(HPSC003.INSERT, newSc003);
dbSc003 = newSc003;
} else {
planNo = dbSc003.getPlanInfoNo();
// 更新主计划状态为"计划中"
HPSCTools.HpSc003.updateStatus(dbSc003.getId(), HPConstant.planStatus.S_1);
}
// 生产计划详情
List<HPSC002> dbSc002Children = HPSCTools.HpSc002.queryByParent(dbSc002.getParentId());
for (HPSC002 dbSc002Child : dbSc002Children) {
// 明细已存在就不在新增
HPSC004 dbSc004 = HPSCTools.HpSc004.queryByMat(dbSc002Child.getId());
if (dbSc004 != null) {
continue;
}
// 生成生产订单单号
String prodOrderNo =SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPSC005_PROD_NO);
HPSC004 newSc004 = BeanUtils.copy(dbSc002Child, HPSC004.class);
newSc004.setParentId(planNo);
newSc004.setMatId(dbSc002Child.getId());
newSc004.setFilePath1(dbSc002Child.getId().toString());
newSc004.setPlanCompletionDate(dbSc002Child.getDeliveryDate());
newSc004.setPlanCommentDate(dbSc002Child.getDeliveryDate());
newSc004.setFactoryCode(org.getOrgId());
newSc004.setProdOrderNo(prodOrderNo);
newSc004.setDelStatus(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPSC004.INSERT, newSc004);
// 生成任务订单
HPSCTools.HpSc005.addSc005(dbSc003, newSc004);
}
return dbSc003;
}
@OperationLogAnnotation(operModul = "物料清单",operType = "导入",operDesc = "导入")
public EiInfo importData(EiInfo inInfo) {
try {
List<HPSC002> dataList = (List) inInfo.get("dataList");
HashMap params = (HashMap) inInfo.get("params");
String parentId = (String) params.get("parentId");
String projCode = (String) params.get("projCode");
String projName = (String) params.get("projName");
String deliveryDate = (String) params.get("deliveryDate");
String parentPrdtName = (String) params.get("parentPrdtName");
int lv = Integer.parseInt((String) params.get("lv")) +1;
Boolean checkStatus = false;
StringBuffer sb = new StringBuffer();
// 写入数据
for (int i = 0;i < dataList.size(); i++) {
HPSC002 hpsc002 = new HPSC002();
hpsc002 = dataList.get(i);
hpsc002.setLv(lv);
//产品类型是否为空
if(hpsc002.getPrdtType()==null){
sb.append("导入失败:数据错误第"+(i+1)+"条,产品类型不能为空!!");
checkStatus = true;
}else{
//层级2
if (hpsc002.getLv() == 2 && hpsc002.getPrdtType() != 4) {
sb.append("导入失败:数据错误第"+(i+1)+"条,层级关系错误,当前层级只能导入部件清单!!");
checkStatus = true;
} else if (hpsc002.getLv() == 3) {
if (!(hpsc002.getPrdtType() == 3 || hpsc002.getPrdtType() == 2)) {
sb.append("导入失败:数据错误第"+(i+1)+"条,层级关系错误,当前层级只能导入零件或耗材清单!!");
checkStatus = true;
}
}
}
}
if (checkStatus) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg(sb.toString());
}else{
for (HPSC002 hpsc002: dataList) {
hpsc002.setLv(lv);
hpsc002.setParentId(parentId);
hpsc002.setProjCode(projCode);
hpsc002.setProjName(projName);
hpsc002.setParentPrdtName(parentPrdtName);
hpsc002.setDeliveryDate(deliveryDate);
hpsc002.setStatus(CommonConstant.YesNo.NO_0.intValue());
add(hpsc002);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + dataList.size() + "]条数据保存成功!");
}
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 部件类型下拉框
* @param inInfo 形参
* @return 返回集合
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "查询",operDesc = "部件类型下拉框")
public EiInfo queryPrdtTypeBox(EiInfo inInfo) {
try {
List<DdynamicEnum> list = new ArrayList<>();
Map map = new HashMap();
if (inInfo.getCellStr(EiConstant.queryBlock,0,"itemCode").equals("1")){
map.put("itemCode","ITEM_CODE in ('4')");
}else if (inInfo.getCellStr(EiConstant.queryBlock,0,"itemCode").equals("2")) {
map.put("itemCode","ITEM_CODE in ('2','3')");
}else {
map.put("itemCode","ITEM_CODE in ('2','3','4')");
}
list.add(DdynamicEnum.CODESET_CODE_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, map, false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询部件类型失败");
}
return inInfo;
}
/**
* 删除附件文件
* @param id 文件ID
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "删除",operDesc = "删除附件文件")
public void delectDoc(Long id){
Map<String,Object> map = new HashMap<>();
String companyCode = UserSessionUtils.getCompanyCode();
map.put("bizType","WL");
map.put("docIds","(select DOC_ID from HPJX.T_HPSC002A where MAT_ID in(" +
" select distinct ID from HPJX.T_HPSC002 where COMPANY_CODE = '"+companyCode+"' and (ID = '"+id+"' or PARENT_ID = '"+id+"'))" +
" AND BIZ_TYPE = 'WL')");
List<HPDS002> list = this.dao.query("HPDS002.query",map);
if (list.size() > 0) {
for (HPDS002 hpds002: list) {
String realPath = hpds002.getRealPath();
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
EiInfo queryInfo = new EiInfo();
queryInfo.set(HPSC002A.FIELD_DOC_ID,hpds002.getDocId());
//获取文档信息
queryInfo.set(EiConstant.serviceId,"S_EU_0102");
EiInfo docInfo = XServiceManager.call(queryInfo);
//数据库
Map docInfoMap = docInfo.getMap("docMap");
if (docInfoMap.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("data",docInfoMap.get("url")+"-"+0);
eiInfo.set(EiConstant.serviceId,"S_EU_0105");
//调用接口
EiInfo outInfo = XServiceManager.call(eiInfo);
if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){
LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败");
outInfo.setMsg("失败");
}
}
}else {
FileUtils.deleteFile(realPath);
}
}
this.dao.delete(HPDS002.DELETE,map);
}
}
public EiInfo queryList(EiInfo inInfo){
return super.query(inInfo,"HPSC002.queryList",new HPSC002(),false,new HPSC002().eiMetadata,EiConstant.queryBlock,EiConstant.resultBlock,CommonConstant.Field.DETAIL);
}
}
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.HPConstants;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
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.HPSC005B;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.hp.xs.domain.Org;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.*;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author LiuYang
* @version 1.0 2024/8/9
* @description 生产计划
*/
public class ServiceHPSC103 extends ServiceEPBase {
/**
* 画面初始化.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产计划",operType = "查询",operDesc = "初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID,DdynamicEnum.INVENT_NAME_BLOCK_ID),
new HashMap<String,Object>(){{put("inventType",4);}});
HPSC003 HPSC003 = new HPSC003();
EiInfo outInfo = super.initLoad(inInfo, HPSC003);
outInfo.addBlock(EiConstant.resultBlock).addBlockMeta(HPSC003.eiMetadata);
return inInfo;
}
/**
* 查询操作.
*/
@OperationLogAnnotation(operModul = "生产计划",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC003.FIELD_DELIVERY_DATE,
DateUtils.formatShort(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC003.FIELD_DELIVERY_DATE)));
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC003.FIELD_PLAN_COMPLETION_DATE,
DateUtils.formatShort(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC003.FIELD_PLAN_COMPLETION_DATE)));
inInfo = super.query(inInfo, HPSC003.QUERY, new HPSC003());
inInfo.addBlock(HPConstants.BLOCK_DETAIL).addBlockMeta(new HPSC004().eiMetadata);
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作.
*/
@OperationLogAnnotation(operModul = "生产计划",operType = "新增",operDesc = "新增")
@Override
public EiInfo insert(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
HPSC003 HPSC003 = new HPSC003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPSC003.fromMap(map);
HPSC003.setCreatedBy(UserSession.getUserId());
HPSC003.setCreatedTime(sdf.format(new Date()));
HPSC003.setUpdatedBy(null);
HPSC003.setUpdatedTime(null);
DaoUtils.insert("HPSC003.insert", HPSC003.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);
}
/**
* 修改操作.
*/
@OperationLogAnnotation(operModul = "生产计划",operType = "修改",operDesc = "修改")
@Override
public EiInfo update(EiInfo inInfo) {
try {
HPSC003 hpsc003 = new HPSC003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
if (eiBlock != null) {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpsc003.fromMap(map);
hpsc003.setPlanCompletionDate(DateUtils.formatShort(hpsc003.getPlanCompletionDate()));
DaoUtils.update("HPSC003.update", hpsc003.toMap());
HashMap params = new HashMap();
params.put(HPSC004.FIELD_PARENT_ID,hpsc003.getPlanInfoNo());
List<HPSC004> list = dao.query("HPSC004.queryDetail",params,0,-999999);
for (HPSC004 hpsc004:list) {
hpsc004.setFactoryCode(hpsc003.getFactoryCode());
DaoUtils.update(HPSC004.UPDATE, hpsc004);
}
}
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);
}
/**
* 修改计划明细
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产计划",operType = "修改",operDesc = "修改计划明细")
public EiInfo updatePlanDetail(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(CommonConstant.Field.DETAIL).getRows();
String parentId = null;
for (Map resultRow : resultRows) {
HPSC004 fSc004 = new HPSC004();
fSc004.fromMap(resultRow);
parentId = fSc004.getParentId();
// 更新计划明细完工时间
fSc004.setPlanCommentDate(DateUtils.formatShort(fSc004.getPlanCompletionDate()));
fSc004.setPlanCompletionDate(DateUtils.formatShort(fSc004.getPlanCompletionDate()));
DaoUtils.update(HPSqlConstant.HPSC004.UPDATE_PLAN_DATE, fSc004);
}
// 更新主计划完工时间
List<HPSC004> dbSc004s = HPSCTools.HpSc004.queryByParent(parentId);
String maxPlanCompletionDate = dbSc004s.stream().map(HPSC004::getPlanCompletionDate).max(String::compareTo)
.orElse("");
HPSCTools.HpSc003.updateDate(parentId, maxPlanCompletionDate);
// 刷新明细数据
inInfo.getBlock(CommonConstant.Field.DETAIL).setRows(dbSc004s);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
/**下·
* 根据ID获取详情
* @param eiInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产计划",operType = "查询",operDesc = "根据ID获取详情")
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 inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产计划",operType = "提交",operDesc = "提交生产计划")
public EiInfo submitPlan(EiInfo inInfo) {
try {
Long id = Long.parseLong(inInfo.getString("id"));
HPSC003 dbSc003 = HPSCTools.HpSc003.get(id);
// 查询计划子项
List<HPSC004> dbSc004s = HPSCTools.HpSc004.queryByParent(dbSc003.getPlanInfoNo());
for (HPSC004 dbSc004 : dbSc004s) {
// 已经生成订单的计划不在重复生成
if (StringUtils.isNotBlank(dbSc004.getProdOrderNo())) {
continue;
}
// 生成任务订单
HPSC005 newSc005 = this.addSc005(dbSc003, dbSc004);
// 回填订单号
dbSc004.setProdOrderNo(newSc005.getProdOrderNo());
DaoUtils.update(HPSqlConstant.HPSC004.UPDATE_PROD_ORDER_NO, dbSc004.toMap());
}
// 修改计划状态
HPSCTools.HpSc003.updateStatus(id, HPConstant.planStatus.S_1);
// 生成二维码
if (StringUtils.isBlank(dbSc003.getQrcodeDocId())) {
HPSCTools.HpSc003.createQrCode(dbSc003.getPlanInfoNo());
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("提交成功");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "提交失败");
}
return inInfo;
}
/**
* 生成任务订单
*
* @param dbSc003
* @param dbSc004
*/
private HPSC005 addSc005(HPSC003 dbSc003, HPSC004 dbSc004) {
HPSC005 newSc005 = BeanUtils.copy(dbSc003, HPSC005.class);
newSc005.setProdOrderNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPSC005_PROD_NO));
newSc005.setPrdtLength(dbSc003.getLength());
newSc005.setPrdtWidth(dbSc003.getWidth());
newSc005.setPrdtThick(dbSc003.getThick());
newSc005.setPrdtSpec(dbSc003.getSpec());
newSc005.setInventRecordId(dbSc004.getInventRecordId());
newSc005.setPartType(dbSc004.getPrdtType());
newSc005.setPartCode(dbSc004.getPrdtCode());
newSc005.setPartName(dbSc004.getPrdtName());
newSc005.setPartLength(dbSc004.getLength());
newSc005.setPartWidth(dbSc004.getWidth());
newSc005.setPartThick(dbSc004.getThick());
newSc005.setPartSpec(dbSc004.getSpec());
newSc005.setRemark1(dbSc004.getRemark());
//newSc005.setWorkDate(DateUtils.shortDate());
newSc005.setPlanCompletionDate(dbSc004.getPlanCompletionDate());
newSc005.setNum(dbSc004.getNum());
newSc005.setUnassignedNum(dbSc004.getNum());
newSc005.setUnitWt(dbSc004.getUnitWt());
newSc005.setTotalWt(dbSc004.getTotalWt());
newSc005.setFilePath1(dbSc004.getFilePath1());
newSc005.setMatId(dbSc004.getMatId());
newSc005.setStatus(CommonConstant.YesNo.NO_0);
newSc005.setDeliveryDate(dbSc003.getDeliveryDate());
newSc005.setDepCode(dbSc004.getDepCode());
newSc005.setFactoryCode(dbSc003.getFactoryCode());
DaoUtils.insert(HPSC005.INSERT, newSc005);
return newSc005;
}
/**
* 部件下拉框
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产计划", operType = "查询", operDesc = "部件下拉框")
public EiInfo queryInventComboBox(EiInfo inInfo) {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.INVENT_RECORD_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo));
return inInfo;
}
/**
* 生成二维码
*
* @param inInfo
* @return
*/
public EiInfo generateQrcode(EiInfo inInfo) {
try {
String planInfoNo = inInfo.getString(HPSC003.FIELD_PLAN_INFO_NO);
// 已经生成过,不在重复生产
HPSC003 dbSc003 = HPSCTools.HpSc003.getByNo(planInfoNo);
AssertUtils.isNotEmpty(dbSc003.getQrcodeDocId(), "该计划已存在二维码,请勿重复生成");
// 生成新的二维码
HPSCTools.HpSc003.createQrCode(planInfoNo);
// 刷新页面数据
inInfo = this.query(inInfo);
inInfo.setMsg("生成二维码成功");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "生成二维码失败");
}
return inInfo;
}
/**
* 扫码显示计划明细
*
* @param inInfo
* @return
*/
public EiInfo qrcodePlanDetail(EiInfo inInfo) {
try {
String planInfoNo = inInfo.getString(HPSC003.FIELD_PLAN_INFO_NO);
AssertUtils.isNull(planInfoNo, "计划号不能为空");
// 查询计划主信息
HPSC003 dbSc003 = HPSCTools.HpSc003.getByNo(planInfoNo);
Map dbSc003Map = dbSc003.toMap();
// 设置厂区名称
if (StringUtils.isNotBlank(dbSc003.getFactoryCode())) {
Org org = HPXSTools.XsOrg.get(dbSc003.getFactoryCode());
dbSc003Map.put("factoryName", org.getOrgCname());
} else {
dbSc003Map.put("factoryName", "");
}
// 查询计划明细信息
this.buildPlanDetail(dbSc003Map);
inInfo.set("planInfo", dbSc003Map);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询计划详情失败");
// 小程序端要求,错误码使用500
inInfo.setStatus(500);
}
return inInfo;
}
/**
* 计划明细
*
* @param dbSc003Map
*/
private void buildPlanDetail(Map dbSc003Map) {
String planInfoNo = MapUtils.getString(dbSc003Map, HPSC003.FIELD_PLAN_INFO_NO);
// 查询计划明细信息
List<HPSC004> dbSc004s = HPSCTools.HpSc004.queryByParent(planInfoNo);
if (CollectionUtils.isEmpty(dbSc004s)) {
dbSc003Map.put("planDetail", new ArrayList<>());
return;
}
List<Map> dbSc004Maps = dbSc004s.stream().map(HPSC004::toMap).collect(Collectors.toList());
dbSc003Map.put("planDetail", dbSc004Maps);
// 派工信息
buildProdOrder(dbSc004Maps);
}
/**
* 派工信息
*
* @param dbSc004Maps
*/
private void buildProdOrder(List<Map> dbSc004Maps) {
// 订单号
List<String> prodOrderNos = ObjectUtils.listKey(dbSc004Maps, HPSC004.FIELD_PROD_ORDER_NO);
// 查询派工信息
List<HPSC005B> dbSc005bs = HPSCTools.HpSc005b.listByOrder(prodOrderNos);
// 填充数据
Map<String, List<HPSC005B>> dbSc005bMap = CollectionUtils.isEmpty(dbSc005bs) ? null
: dbSc005bs.stream().collect(Collectors.groupingBy(HPSC005B::getProdOrderNo));
for (Map dbSc004Map : dbSc004Maps) {
String prodOrderNo = MapUtils.getString(dbSc004Map, HPSC004.FIELD_PROD_ORDER_NO);
if (dbSc005bMap == null) {
dbSc004Map.put("prodOrders", new ArrayList<>());
continue;
}
List<HPSC005B> dbSc005Items = dbSc005bMap.get(prodOrderNo);
if (CollectionUtils.isNotEmpty(dbSc005Items)) {
dbSc004Map.put("prodOrders", dbSc005Items.stream().map(HPSC005B::toMap)
.collect(Collectors.toList()));
} else {
dbSc004Map.put("prodOrders", new ArrayList<>());
}
}
}
}
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.hp.sc.domain.HPSC003;
import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
/**
* @author LiuYang
* @version 1.0 2024/8/9
* @description 生产订单
*/
public class ServiceHPSC104 extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产订单",operType = "查询",operDesc = "初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID),
new HashMap<String,Object>(){});
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC005().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
inInfo.setStatus(500);
}
return inInfo;
}
/**
* 查询操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产订单",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC003.FIELD_DELIVERY_DATE,
DateUtils.formatShort(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC003.FIELD_DELIVERY_DATE)));
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC003.FIELD_PLAN_COMPLETION_DATE,
DateUtils.formatShort(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC003.FIELD_PLAN_COMPLETION_DATE)));
inInfo = super.query(inInfo, HPSC005.QUERY, new HPSC005());
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
inInfo.setStatus(500);
}
return inInfo;
}
/**
* 项目下拉框
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产订单",operType = "查询",operDesc = "项目下拉框")
public EiInfo queryProjComboBox(EiInfo inInfo) {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.PROJ_PROD_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo));
return inInfo;
}
/**
* 生产组下拉框
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产订单",operType = "查询",operDesc = "生产组下拉框")
public EiInfo queryOrgComboBox(EiInfo inInfo) {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.ORG_PROD_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo));
return inInfo;
}
}
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
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.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.HPSC005A;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.*;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/8/9
* @description 拆单派工
*/
public class ServiceHPSC104A extends ServiceEPBase {
/**
* 画面初始化.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "拆单派工",operType = "查询",operDesc = "生产订单-拆单派工A-初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String prodOrderNo = MapUtils.getString(queryMap, CommonConstant.Field.PROD_ORDER_NO);
HPSC005 dbSc005 = HPSCTools.HpSc005.get(prodOrderNo);
inInfo.addBlock(CommonConstant.Field.DETAIL).addRow(dbSc005);
queryMap.put("userId", UserSessionUtils.getUserId());
queryMap.put("orgType", "prodGroup");
queryMap.put(HPSC005.FIELD_FACTORY_CODE, dbSc005.getFactoryCode());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_GROUP_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID,DdynamicEnum.GROUP_RECORD_BLOCK_ID),
queryMap, false);
/*new HashMap<String,Object>(){{put(HPSC005.FIELD_FACTORY_CODE,dbSc005.getFactoryCode());}}*/
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC005A().eiMetadata);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "初始化失败");
inInfo.setStatus(500);
}
return inInfo;
}
/**
* 查询操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "拆单派工",operType = "查询",operDesc = "生产订单-拆单派工A-查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPSC005A.QUERY, new HPSC005A());
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
inInfo.setStatus(500);
}
return inInfo;
}
/**
* 新增操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "拆单派工",operType = "新增",operDesc = "生产订单-拆单派工A-新增操作")
public EiInfo save(EiInfo inInfo) {
try {
Map detailMap = EiInfoUtils.getFirstRow(inInfo, CommonConstant.Field.DETAIL);
String prodOrderNo = MapUtils.getString(detailMap, CommonConstant.Field.PROD_ORDER_NO);
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 生产任务号
List<String> prodTaskNos = ObjectUtils.listKey(resultRows, "prodTaskNo");
// 锁主单号
HPSCTools.HpSc005.lock(prodOrderNo);
// 锁子单
HPSCTools.HpSc005a.lock(prodTaskNos);
// 查询订单信息
HPSC005 dbSc005 = HPSCTools.HpSc005.get(prodOrderNo);
// 查询任务信息
Map<String, HPSC005A> mapSc005a = HPSCTools.HpSc005a.map(prodTaskNos);
// 写入数据
for (Map resultRow : resultRows) {
HPSC005A fSc005a = new HPSC005A();
fSc005a.fromMap(resultRow);
fSc005a.setFactoryCode(dbSc005.getFactoryCode());
if (fSc005a.getId() == null || fSc005a.getId() == 0) {
this.add(dbSc005, fSc005a);
} else {
this.modify(dbSc005, fSc005a, mapSc005a);
}
}
inInfo = this.query(inInfo);
// 刷新主订单信息
inInfo = this.refreshOrderInfo(inInfo, prodOrderNo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据操作成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "新增失败");
inInfo.setStatus(500);
}
return inInfo;
}
/**
* 新增
*
* @param dbSc005
* @param fSc005a
*/
private void add(HPSC005 dbSc005, HPSC005A fSc005a) {
String prodOrderNo = dbSc005.getProdOrderNo();
// 数据校验
AssertUtils.isEmpty(fSc005a.getFactoryCode(), "请选择厂区");
AssertUtils.isEmpty(fSc005a.getOrgNo(), "请选择生产组");
// 更新订单主表数量
HPSCTools.checkAssignedWt(prodOrderNo, fSc005a.getTotalWt());
// 写入子表数据
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()).divide(new BigDecimal("1000")));
DaoUtils.insert(HPSC005A.INSERT, fSc005a);
}
/**
* 修改数据
*
* @param hpsc005
* @param hpsc005A
* @param mapSc005a
*/
private void modify(HPSC005 hpsc005, HPSC005A hpsc005A, Map<String, HPSC005A> mapSc005a) {
String prodOrderNo = hpsc005.getProdOrderNo();
// 数据校验
HPSC005A dbSc005a = mapSc005a.get(hpsc005A.getProdTaskNo());
AssertUtils.isGt(dbSc005a.getTotalWt(), hpsc005A.getTotalWt(),
String.format("任务[%s]修改后的重量不能小于已完工的重量", hpsc005A.getId()));
// 计算差异重量
BigDecimal diffWt = hpsc005A.getTotalWt().subtract(dbSc005a.getTotalWt());
// 更新订单主表数量
HPSCTools.checkAssignedWt(prodOrderNo, diffWt);
// 更新子单
//fSc005a.setTotalWt(fSc005a.getNum().multiply(hpsc005.getUnitWt()).divide(new BigDecimal("1000")));
DaoUtils.update(HPSC005A.UPDATE, hpsc005A);
}
/**
* 删除操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "拆单派工",operType = "删除",operDesc = "生产订单-拆单派工A-删除操作")
public EiInfo delete(EiInfo inInfo) {
try {
Map detailMap = EiInfoUtils.getFirstRow(inInfo, CommonConstant.Field.DETAIL);
String prodOrderNo = MapUtils.getString(detailMap, CommonConstant.Field.PROD_ORDER_NO);
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HPSC005A fSc005a = new HPSC005A();
fSc005a.fromMap(resultRow);
HPSC005A dbSc005a = HPSCTools.HpSc005a.getById(fSc005a.getId());
AssertUtils.isGt(dbSc005a.getCompleteNum(), BigDecimal.ZERO,
String.format("任务[%s]已存在完工数量不能删除", fSc005a.getId()));
// 更新订单主表数量
HPSCTools.checkAssignedNum(fSc005a.getProdOrderNo(), fSc005a.getNum().negate());
// 删除子单
DaoUtils.update(HPSC005A.DELETE, fSc005a);
}
inInfo = this.query(inInfo);
// 刷新主订单信息
inInfo = this.refreshOrderInfo(inInfo, prodOrderNo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "删除失败");
inInfo.setStatus(500);
}
return inInfo;
}
/**
* 刷新主订单信息
*
* @param inInfo
* @return
*/
private EiInfo refreshOrderInfo(EiInfo inInfo, String prodOrderNo) {
HPSC005 dbSc005 = HPSCTools.HpSc005.get(prodOrderNo);
inInfo.addBlock(CommonConstant.Field.DETAIL).addRow(dbSc005);
return inInfo;
}
/**
* 分派
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "拆单派工",operType = "新增",operDesc = "生产订单-拆单派工A-分派")
public EiInfo assign(EiInfo inInfo) {
try {
String[] orderIds = inInfo.getString("ids").split(",");
String factoryCode = inInfo.getString("factoryCode");
String factoryName = inInfo.getString("factoryName");
String groupCode = inInfo.getString("groupCode");
String groupName = inInfo.getString("groupName");
for (String orderId : orderIds) {
// 校验主订单是否已分派
HPSC005 dbSc005 = HPSCTools.HpSc005.getById(Long.parseLong(orderId));
// 锁主单号
HPSCTools.HpSc005.lock(dbSc005.getProdOrderNo());
AssertUtils.isTrue(ProdOrderStatusEnum.ALL_ASSIGN.getCode().equals(dbSc005.getStatus()),
String.format("生产订单[%s]已全部分派,不能在进行批量分派,请检查!", dbSc005.getProdOrderNo()));
//获取生产订单已派工总量
List<HPSC005A> list = HPSCTools.HpSc005a.getByProdOrderNo(dbSc005.getProdOrderNo());
BigDecimal totalWt = list.stream().map(HPSC005A::getTotalWt).reduce(BigDecimal.ZERO, BigDecimal::add);
// 更新订单主表数量
if (ProdOrderStatusEnum.NOT_ASSIGN.getCode().equals(dbSc005.getStatus())) {
HPSCTools.checkAssignedWt(dbSc005.getProdOrderNo(), dbSc005.getTotalWt());
} else {
HPSCTools.checkAssignedWt2(dbSc005.getProdOrderNo(), dbSc005.getTotalWt().subtract(totalWt));
}
// 写入子表数据
HPSC005A newSc005a = new HPSC005A();
newSc005a.setProdTaskNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.PROD_TASK_NO,
new String[]{dbSc005.getProdOrderNo()}));
newSc005a.setProdOrderNo(dbSc005.getProdOrderNo());
newSc005a.setNum(new BigDecimal(100));
//区分未派单与部分派单
if (ProdOrderStatusEnum.NOT_ASSIGN.getCode().equals(dbSc005.getStatus())) {
newSc005a.setTotalWt(dbSc005.getTotalWt());
} else {
newSc005a.setTotalWt(dbSc005.getTotalWt().subtract(totalWt));
}
//newSc005a.setTotalWt(newSc005a.getNum().multiply(dbSc005.getUnitWt()));
newSc005a.setOrgNo(groupCode);
newSc005a.setOrgName(groupName);
newSc005a.setFactoryCode(factoryCode);
newSc005a.setFactoryName(factoryName);
DaoUtils.insert(HPSC005A.INSERT, newSc005a);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + orderIds.length + "]条数据分派成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "分派失败");
}
return inInfo;
}
/**
* 设置基础信息
*
* @param fSc005a
*/
private void setBaseInfo(HPSC005A fSc005a) {
// 工厂
fSc005a.setFactoryName(HPXSTools.XsOrg.get(fSc005a.getFactoryCode()).getOrgCname());
// 生产组名称
fSc005a.setOrgName(HPXSTools.XsOrg.get(fSc005a.getOrgNo()).getOrgCname());
}
}
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.hp.sc.domain.HPSC005C;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
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.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/8/9
* @description 生产订单详情
*/
public class ServiceHPSC104B extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "拆单派工",operType = "查询",operDesc = "生产订单-拆单派工C-初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String prodOrderNo = MapUtils.getString(queryMap, "prodOrderNo");
HPSC005C dbSc005 = HPSCTools.HpSc005.getDetails(prodOrderNo);
inInfo.addBlock("detail").addRow(dbSc005);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUB_INVENT_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC005C().eiMetadata);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "初始化失败");
inInfo.setStatus(500);
}
return inInfo;
}
/**
* 查询操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "拆单派工",operType = "查询",operDesc = "生产订单-拆单派工C-查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
inInfo = super.query(inInfo, HPSC005C.QUERY, new HPSC005C());
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
inInfo.setStatus(500);
}
return inInfo;
}
}
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.hp.sc.domain.HPSC005B;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
/**
* @author LiuYang
* @version 1.0 2024/8/9
* @description 生产任务
*/
public class ServiceHPSC105 extends ServiceEPBase {
/**
* 画面初始化.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产任务",operType = "查询",operDesc = "初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC005B().eiMetadata);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "初始化失败");
inInfo.setStatus(500);
}
return inInfo;
}
/**
* 查询操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产任务",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPSC005B.QUERY, new HPSC005B());
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
inInfo.setStatus(500);
}
return inInfo;
}
}
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.hp.sc.domain.HPSC005B;
import com.baosight.hpjx.hp.sc.domain.HPSC005C;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/8/9
* @description 生产任务详情
*/
public class ServiceHPSC105A extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产任务详情",operType = "查询",operDesc = "生产订单-生产任务详情-初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String prodTaskNo = MapUtils.getString(queryMap, "prodTaskNo");
String prodOrderNo =prodTaskNo.substring(0,prodTaskNo.indexOf("-"));
HPSC005C dbSc005 = HPSCTools.HpSc005.getDetails(prodOrderNo);
inInfo.addBlock("detail").addRow(dbSc005);
HPSC005B dbSc005b = HPSCTools.HpSc005b.get(prodTaskNo);
EiBlock resultBlock = inInfo.addBlock(EiConstant.resultBlock);
resultBlock.addRow(dbSc005b);
resultBlock.addBlockMeta(new HPSC005B().eiMetadata);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
}
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.sc.domain.HPSC005B;
import com.baosight.hpjx.hp.sc.domain.HPSC106;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.util.*;
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.ServiceEPBase;
import com.baosight.iplat4j.core.util.DateUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.springframework.beans.BeanUtils;
import java.math.BigDecimal;
import java.util.*;
/**
* @author LiuYang
* @version 1.0 2024/8/10
* @description 报工单添加弹框
*/
public class ServiceHPSC105B extends ServiceEPBase {
@OperationLogAnnotation(operModul = "生产报工", operType = "报工", operDesc = "初始化页面")
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String prodTaskNo = MapUtils.getString(queryMap, HPSC106.FIELD_prod_task_no);
HPSC005B dbSc005b = HPSCTools.HpSc005b.get(prodTaskNo);
HPSC106 hpsc106 = new HPSC106();
BeanUtils.copyProperties(dbSc005b,hpsc106);
List<HPSC106> hpsc106List = HPSCTools.Hpsc106.getByProdTaskNo(prodTaskNo);
hpsc106.setProdTaskNo(dbSc005b.getProdTaskNo());
hpsc106.setProdOrderNo(dbSc005b.getProdOrderNo());
hpsc106.setProjCode(dbSc005b.getProjCode());
hpsc106.setProjName(dbSc005b.getProjName());
hpsc106.setFactoryCode(dbSc005b.getFactoryCode());
hpsc106.setFactoryName(dbSc005b.getFactoryName());
hpsc106.setGroupCode(dbSc005b.getOrgNo());
hpsc106.setGroupName(dbSc005b.getOrgName());
hpsc106.setProductType(dbSc005b.getPartType());
hpsc106.setProductCode(dbSc005b.getPartCode());
hpsc106.setProductName(dbSc005b.getPartName());
hpsc106.setTaskQuantity(dbSc005b.getNum());
hpsc106.setTaskWeight(dbSc005b.getTotalWt());
hpsc106.setRegisteredQuantity(Optional.ofNullable(hpsc106List).orElse(new ArrayList<>()).stream().map(HPSC106::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add));
hpsc106.setRegisteredWeight(Optional.ofNullable(hpsc106List).orElse(new ArrayList<>()).stream().map(HPSC106::getTotalWeight).reduce(BigDecimal.ZERO, BigDecimal::add));
hpsc106.setUnregisterQuantity(dbSc005b.getNum().subtract(hpsc106.getRegisteredQuantity()));
hpsc106.setUnregisterWeight(dbSc005b.getTotalWt().subtract(hpsc106.getRegisteredWeight()));
hpsc106.setRegisterDate(DateUtils.toDateStr(new Date(), DateUtils.DATE10_PATTERN));
hpsc106.setId(null);
inInfo.addBlock(EiConstant.resultBlock).addRow(hpsc106);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "生产报工", operType = "报工", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try{
Map resultMap = EiInfoUtils.getFirstRow(inInfo, EiConstant.resultBlock);
this.add(resultMap);
/*String docId = org.apache.commons.collections.MapUtils.getString(resultMap, HGSB004A.FIELD_DOC_ID);
if (StringUtils.isNotEmpty(docId)) {
String [] docIds = docId.split(",");
for (String docIdStr : docIds){
HGSC099 hgsc099 = new HGSC099();
hgsc099.setBizType("SCBG");
hgsc099.setDocId(docIdStr);
hgsc099.setMatId(hgsc008.getId());
DaoUtils.insert(HGSC099.INSERT, hgsc099);
}
}*/
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
public HPSC106 add(Map<String, Object> resultMap) {
String prodTaskNo = MapUtils.getString(resultMap, HPSC106.FIELD_prod_task_no);
HPSC005B dbSc005b = HPSCTools.HpSc005b.get(prodTaskNo);
HPSC106 hpsc106 = new HPSC106();
hpsc106.fromMap(resultMap);
//BeanUtils.copyProperties(dbSc005b,hpsc106);
cleanBaseInfo(hpsc106);
hpsc106.setProjCode(dbSc005b.getProjCode());
hpsc106.setProjName(dbSc005b.getProjName());
hpsc106.setFactoryCode(dbSc005b.getFactoryCode());
hpsc106.setFactoryName(dbSc005b.getFactoryName());
hpsc106.setProdTaskNo(dbSc005b.getProdTaskNo());
hpsc106.setProdOrderNo(dbSc005b.getProdOrderNo());
hpsc106.setRegisterDate(StringUtil.removeHorizontalLine(resultMap.get(HPSC106.FIELD_register_date).toString()));
//hgsc008.setTotalWeight(hgsc007.getSingleWeight().multiply(new BigDecimal(hpsc106.getQuantity())));
checkAddDate(hpsc106);
hpsc106.setWorkCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HGSC008_WORK_CODE));
DaoUtils.insert(HPSC106.INSERT,hpsc106);
//HGZLTools.THGZL002.add(hpsc106);
return hpsc106;
}
public void cleanBaseInfo(HPSC106 hpsc106){
hpsc106.setCreatedBy(null);
hpsc106.setCreatedName(null);
hpsc106.setCreatedTime(null);
hpsc106.setUpdatedBy(null);
hpsc106.setUpdatedName(null);
hpsc106.setUpdatedTime(null);
hpsc106.setDepCode(null);
hpsc106.setId(null);
}
public void checkAddDate(HPSC106 hpsc106){
// List<String> orgIdList = UserSessionUtils.getOrgId();
// AssertUtils.isEmpty(hgsc008.getGroupCode(),"生产任务班组信息异常,请联系管理员!");
// AssertUtils.isTrue(!orgIdList.contains(hgsc008.getGroupCode()),"非当前任务生产组用户,无法报工此任务!");
AssertUtils.isNull(hpsc106.getQuantity(),"报工数量不能为空!");
}
}
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.sc.domain.HPSC106;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.ObjectUtils;
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.ServiceEPBase;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/8/10
* @description 报工单
*/
public class ServiceHPSC106 extends ServiceEPBase {
@OperationLogAnnotation(operModul = "生产报工单", operType = "查询", operDesc = "初始化页面")
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC106().eiMetadata);
inInfo = super.query(inInfo, HPSC106.QUERY, new HPSC106());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/*
* 查询*/
@OperationLogAnnotation(operModul = "生产报工单", operType = "查询", operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPSC106.QUERY,new HPSC106() );
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@Override
@OperationLogAnnotation(operModul = "生产报工单", operType = "删除", operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 销售单号
List<Long> ids = ObjectUtils.listKey(resultRows, HPSC106.FIELD_ID);
//checkDeleteDate(ids);
DaoUtils.update(HPSC106.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}});
//HGZLTools.THGZL002.deleteByWorkIds(ids);
/*ids.forEach( id -> {
HGSCTools.THGSC099.deleteByMatId(id, HGConstant.FileBizType.SCBG);
})*/;
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.sc.domain.HPSC001;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.contants.ACConstants;
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.ServiceEPBase;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/8/8
* @description 宏建项目档案
*/
public class ServiceHPSC111 extends ServiceEPBase {
@OperationLogAnnotation(operModul = "项目档案",operType = "查询",operDesc = "初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.setCell(EiConstant.queryBlock, 0, "status", 1);
inInfo = super.query(inInfo, "HPSC001.query", new HPSC001());
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);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC001().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@OperationLogAnnotation(operModul = "项目档案",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
/* 调用EI查询方法.*/
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC001.FIELD_DELIVERY_DATE,
DateUtils.formatShort(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC001.FIELD_DELIVERY_DATE)));
inInfo.setCell(EiConstant.queryBlock, 0, "status", 1);
EiInfo outInfo = super.query(inInfo, "HPSC001.query", new HPSC001());
return outInfo;
}
}
<?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-08-10 10:07:01
Version : 1.0
schema : hggp
tableName : T_HPSC108
ID BIGINT NOT NULL primarykey,
company_code VARCHAR NOT NULL,
dep_code VARCHAR NOT NULL,
factory_code VARCHAR,
factory_name VARCHAR,
group_code VARCHAR,
group_name VARCHAR,
proj_code VARCHAR,
proj_name VARCHAR,
prod_order_no VARCHAR,
prod_task_no VARCHAR,
product_type TINYINT,
product_code VARCHAR,
product_name VARCHAR,
register_date VARCHAR,
quantity DECIMAL,
single_weight DECIMAL,
total_weight DECIMAL,
created_by VARCHAR,
created_name VARCHAR,
created_time VARCHAR,
updated_by VARCHAR,
updated_name VARCHAR,
updated_time VARCHAR
-->
<sqlMap namespace="HPSC106">
<typeAlias alias="HPSC106" type="com.baosight.hpjx.hp.sc.domain.HPSC106"/>
<sql id="column">
ID as "id", <!-- ID -->
company_code as "companyCode", <!-- 企业编码 -->
dep_code as "depCode", <!-- 部门编码 -->
factory_code as "factoryCode", <!-- 厂区编号 -->
factory_name as "factoryName", <!-- 厂区名称 -->
group_code as "groupCode", <!-- 生产组编号 -->
group_name as "groupName", <!-- 生产组名称 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
prod_order_no as "prodOrderNo", <!-- 生产订单号 -->
prod_task_no as "prodTaskNo", <!-- 生产任务单号 -->
work_code as "workCode",
product_type as "productType", <!-- 产品类型 -->
product_code as "productCode", <!-- 产品编号 -->
product_name as "productName", <!-- 产品名称 -->
register_date as "registerDate", <!-- 报工日期 -->
quantity as "quantity", <!-- 数量 -->
single_weight as "singleWeight", <!-- 单重 -->
total_weight as "totalWeight", <!-- 总重 -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更改人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime" <!-- 修改时间 -->
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
factory_code = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
factory_name like CONCAT('%',#factoryName#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
group_code = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
group_name like CONCAT('%',#groupName#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodOrderNo">
prod_order_no = #prodOrderNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodTaskNo">
prod_task_no = #prodTaskNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="workCode">
work_code like CONCAT('%',#workCode#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productType">
product_type = #productType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productCode">
product_code = #productCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productName">
product_name = #productName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="registerDate">
register_date = #registerDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="quantity">
quantity = #quantity#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="singleWeight">
single_weight = #singleWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalWeight">
total_weight = #totalWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
created_name = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
updated_name = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="HPSC106">
SELECT
<include refid="column" />
FROM ${hpjxSchema}.T_HPSC106 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
register_date DESC, ID DESC
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPSC106 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="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
factory_code = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
factory_name = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
group_code = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
group_name = #groupName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodOrderNo">
prod_order_no = #prodOrderNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodTaskNo">
prod_task_no = #prodTaskNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productType">
product_type = #productType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productCode">
product_code = #productCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productName">
product_name = #productName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="registerDate">
register_date = #registerDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="quantity">
quantity = #quantity#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="singleWeight">
single_weight = #singleWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalWeight">
total_weight = #totalWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
created_name = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
updated_name = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPSC106 (ID, <!-- ID -->
company_code, <!-- 企业编码 -->
dep_code, <!-- 部门编码 -->
factory_code, <!-- 厂区编号 -->
factory_name, <!-- 厂区名称 -->
group_code, <!-- 生产组编号 -->
group_name, <!-- 生产组名称 -->
proj_code, <!-- 项目编码 -->
proj_name, <!-- 项目名称 -->
prod_order_no, <!-- 生产订单号 -->
prod_task_no, <!-- 生产任务单号 -->
work_code, <!-- 报工单 -->
product_type, <!-- 产品类型 -->
product_code, <!-- 产品编号 -->
product_name, <!-- 产品名称 -->
register_date, <!-- 报工日期 -->
quantity, <!-- 数量 -->
single_weight, <!-- 单重 -->
total_weight, <!-- 总重 -->
created_by, <!-- 创建人 -->
created_name, <!-- 创建人名称 -->
created_time, <!-- 创建时间 -->
updated_by, <!-- 更改人 -->
updated_name, <!-- 修改人名称 -->
updated_time <!-- 修改时间 -->
)
VALUES (#id#, #companyCode#, #depCode#, #factoryCode#, #factoryName#, #groupCode#, #groupName#, #projCode#,
#projName#, #prodOrderNo#, #prodTaskNo#, #workCode#, #productType#, #productCode#, #productName#,
#registerDate#, #quantity#, #singleWeight#, #totalWeight#, #createdBy#, #createdName#, #createdTime#,
#updatedBy#, #updatedName#, #updatedTime#)
<selectKey resultClass="java.lang.Long" keyProperty="id">
SELECT MAX(ID) FROM ${hpjxSchema}.T_HPSC106
</selectKey>
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPSC106 WHERE ID = #id#
</delete>
<delete id="batch_delete">
DELETE FROM ${hpjxSchema}.T_HPSC106 WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPSC106
SET
company_code = #companyCode#, <!-- 企业编码 -->
dep_code = #depCode#, <!-- 部门编码 -->
factory_code = #factoryCode#, <!-- 厂区编号 -->
factory_name = #factoryName#, <!-- 厂区名称 -->
group_code = #groupCode#, <!-- 生产组编号 -->
group_name = #groupName#, <!-- 生产组名称 -->
proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 -->
prod_order_no = #prodOrderNo#, <!-- 生产订单号 -->
prod_task_no = #prodTaskNo#, <!-- 生产任务单号 -->
work_code = #workCode#,
product_type = #productType#, <!-- 产品类型 -->
product_code = #productCode#, <!-- 产品编号 -->
product_name = #productName#, <!-- 产品名称 -->
register_date = #registerDate#, <!-- 报工日期 -->
quantity = #quantity#, <!-- 数量 -->
single_weight = #singleWeight#, <!-- 单重 -->
total_weight = #totalWeight#, <!-- 总重 -->
created_by = #createdBy#, <!-- 创建人 -->
created_name = #createdName#, <!-- 创建人名称 -->
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 更改人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 修改时间 -->
WHERE
ID = #id#
</update>
</sqlMap>
let inventNameGlobalData = [];
let prdtNameGlobalData = [];
$(function () {
IPLATUI.EFTree = {
"materialTree": {
// ROOT: "root:项目列表",
/**
* 树加载完成后的回调函数
* @param options: 树的配置项
*/
query: function (postEiInfo, model) {
postEiInfo.set("inqu_status-0-projId", $("#inqu_status-0-projId").val());
return postEiInfo;
},
loadComplete: function (options) {
// 保持结点展开状态
var expanded = Cookies.get('expanded');
if (expanded) {
Cookies.remove('expanded');
expanded = JSON.parse(expanded);
$("#menu").data("kendoTreeView").expandPath(_.keys(expanded));
}
},
/**
* 选中树结点时触发的事件,注意点击树 折叠/展开 的图标不会触发此事件
*
* @param e
* e.sender kendoTree对象, tree01Tree(EFTree的id + "Tree")
* e.node 点击的节点DOM元素
*/
select: function (e) {
var nodeData = this.dataItem(e.node);
// 选择最后一级时,自动点击上一级
if (nodeData.lv == 3) {
IPLATUI.EFTree.materialTree.selectTreeNode.nodeId = nodeData.pId;
// 刷新树
refreshTree();
} else {
let eiInfo = new EiInfo();
if (nodeData.lv == 1) {
eiInfo.set("inqu_status-0-inventTypes", [4]);
} else if (nodeData.lv == 2) {
eiInfo.set("inqu_status-0-inventTypes", [3]);
}
var dataSource;
EiCommunicator.send("HPPZ006", "queryPrdtComboBox", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("invent_prdt_name_block_id").getMappedRows();
inventNameGlobalData = dataSource;
},
onFail: function (ei) {
}
}, {async: false});
// 设置树节点的值
setTreeNodeValue(nodeData);
}
// 刷新列表数据
query();
// 动态显示列名
dynamicColumnName();
},
selectTreeNode: {}
}
};
IPLATUI.EFGrid = {
result: {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
loadComplete: function (grid) { // 在Grid加载完成后,才能给Grid上的按钮绑定事件
$("#SC02").on("click", function () {
if (grid.getCheckedBlockData().rows.length === 0) {
IPLAT.alert({
message: '<b>请勾选一项</b>',
okFn: function (e) {},
title: '提示'
});
} else {
console.log(grid.getCheckedBlockData().rows[0][10]);
}
});
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save'
|| e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
query: function () {
var ei = new EiInfo();
ei.set("inqu_status-0-prdtType", $("#inqu_status-0-prdtType").val());
ei.set("inqu_status-0-prdtCode", $("#inqu_status-0-prdtCode").val());
ei.set("inqu_status-0-status", $("#inqu_status-0-status").val());
let nodeId = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId;
ei.set("inqu_status-0-parentId", isBlank(nodeId) ? $("#inqu_status-0-projId").val() : nodeId);
return ei;
},
/**
* 点击行首checkbox,勾选行时触发的事件
* @param e kendo的Event对象
* e.sender kendoGrid对象,resultGrid
* e.fake 用于区分是手动点击的事件还是模拟的事件
* e.checked 用于区分是勾选还是取消勾选
* e.model 勾选或取消勾选的行数据,kendo.data.Model
* e.row 当前行的行号
* e.tr 行的tr,包括固定列和数据列 jquery对象
*/
onCheckRow: function (e) {
if (e.checked) {
console.log('选中');
}
},
/**
* EFGrid新增行之前触发的事件,可以根据业务逻辑控制是否进行新增
* @param e 事件对象
* e.sender Grid对象
* e.preventDefault 阻止事件发生
*/
beforeAdd: function (e) {
var lv = IPLATUI.EFTree.materialTree.selectTreeNode.lv;
var logic = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId ? false : true;
if (lv === '3') {
IPLAT.alert({
message: '<b>不能在零件下进行新增</b>',
okFn: function (e) {
},
title: '提示'
});
e.preventDefault();
} else {
if (logic) { // 通过业务逻辑判断, 控制是否进行新增
IPLAT.alert({
message: '<b>请选择项目列表</b>',
okFn: function (e) {
},
title: '提示'
});
e.preventDefault();
}
}
},
/**
* EFGrid新增行时触发的事件,此时数据行tr元素还未渲染
* @param e 事件对象
* e.sender Grid对象
* e.preventDefault 不会触发dataBound,不渲染tr
* e.index 插入的行号
* e.items 将要插入的数据行数组([Model,Model, ...])
*/
onAdd: function (e) {
// 动态设置默认邮箱
let selectTreeNode = IPLATUI.EFTree.materialTree.selectTreeNode;
//e.items[0]['prdtType'] = selectTreeNode.lv = 4;
$.each(e.items, function (index, item) {
item['projCode'] = selectTreeNode.projCode;
item['projName'] = selectTreeNode.projName;
item['parentId'] = selectTreeNode.nodeId;
item['parentPrdtName'] = selectTreeNode.prdtName;
item['deliveryDate'] = selectTreeNode.deliveryDate;
if (selectTreeNode.lv == 1){
item['prdtType'] = 4;
}else if (selectTreeNode.lv == 2){
item['prdtType'] = 3;
}
//item['id'] = null
item['status'] = 0;
});
},
/**
* 点击Grid保存按钮时触发的事件
* @param e 事件对象
* e.sender Grid对象
*/
onSave: function (e) {
e.preventDefault();
saveFunc();
},
/**
* 点击Grid删除按钮时触发的事件
* @param e 事件对象
* e.sender Grid对象
*/
onDelete: function (e) {
e.preventDefault();
deleteFunc();
},
toolbarConfig: {
hidden: false, // true时,不显示功能按钮,但保留setting导出按钮
// add: false, // 不显示新增按钮
// cancel: false, // 不显示取消按钮
// save: false, // 不显示保存按钮
delete: true, // 显示删除按钮
},
columns: [{
field: "operator",
title: "操作",
template: function (item) {
let auditStatus = item.status;
let lv = item.lv
let template = '';
// template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
// + 'onclick="openUploadFile(' + item.id + ',1)" >附件上传</a>';
if (item.id) {
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: "prdtType",
title: "部件类型",
filter: function (options) {
let selectTreeNode = IPLATUI.EFTree.materialTree.selectTreeNode;
if (selectTreeNode.lv == 1) {
// 返回我们过滤后的数据集
/*return options.values[0][province];*/
return _.filter(options.values, function (item) {
return item["valueField"] == 4;
})
} else {
return _.filter(options.values, function (item) {
return item["valueField"] == 2 || item["valueField"] == 3;
})
}
}
}, {
field: "prdtName",
// title: "部件名称",
/*query: function (container, options) {
let eiInfo = new EiInfo();
eiInfo.set("inqu_status-0-inventTypes", [3, 4]);
eiInfo.set("inqu_status-0-inventType", options.model["prdtType"]);
return eiInfo;
}*/
template: function (dataItem) {
for (let i = 0; i < prdtNameGlobalData.length; i++) {
if (prdtNameGlobalData[i]['textField'] === dataItem['prdtName']) {
//dataItem["prdtCode"] = prdtNameGlobalData[i]['valueField']
resultGrid.setCellValue(0, "prdtCode", prdtNameGlobalData[i]['valueField']);
return prdtNameGlobalData[i]['textField'];
}
}
return dataItem["prdtName"];
},
editor: function (container, options) {
var grid = container.closest(".k-grid").data("kendoGrid");
var cellIndex = grid.cellIndex(container);
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
let eiInfo = new EiInfo();
let selectTreeNode = IPLATUI.EFTree.materialTree.selectTreeNode;
if (selectTreeNode.lv == 1) {
eiInfo.set("inventType", 4);
} else if (selectTreeNode.lv == 2) {
eiInfo.set("inventTypes", [2, 3]);
} else {
eiInfo.set("inventTypes", [3, 4]);
}
eiInfo.set("isSplicingSymbol", false);
var dataSource;
EiCommunicator.send("HPPZ004", "queryComboBox", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("invent_name_block_id").getMappedRows();
prdtNameGlobalData = dataSource;
},
onFail: function (ei) {
}
}, {async: false});
input.kendoAutoComplete({
dataSource: dataSource,
minLength: 0,
dataTextField: "textField",
dataValueField: "valueField",
optionLabelTemplate: "#:textField#",
valueTemplate: "#:valueField#",
template: "#:textField#",
filter: "contains"
});
input.data("kendoAutoComplete").search();
//input.trigger("change", {sender: input, open: true});
//enforceMinLength: true,
//suggest: false,
//open: true,
}
}, {
field: "parentPrdtName",
template: function (dataItem) {
if (dataItem.lv > 2) {
return dataItem['parentPrdtName'];
}
return "";
}
}, {
field: "num",
format: "{0:N2}",
template: function (dataItem) {
return kendo.format("{0:N0}%",+dataItem.num);
}
}
]
},
};
// 查询
$("#QUERY").on("click", query);
/**
* 导入
*/
$("#IMPORT").on("click", function (e) {
var lv = IPLATUI.EFTree.materialTree.selectTreeNode.lv;
var logic = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId ? false : true;
if (lv === '3') {
IPLAT.alert({
message: '<b>不能在零件下进行导入</b>',
okFn: function (e) {
},
title: '提示'
});
e.preventDefault();
} else {
if (logic) { // 通过业务逻辑判断, 控制是否进行新增
IPLAT.alert({
message: '<b>请选择项目列表</b>',
okFn: function (e) {
},
title: '提示'
});
e.preventDefault();
} else {
var nodeId = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId;
var parentPrdtName = IPLATUI.EFTree.materialTree.selectTreeNode.prdtName;
var projCode = IPLATUI.EFTree.materialTree.selectTreeNode.projCode;
var projName = IPLATUI.EFTree.materialTree.selectTreeNode.projName;
var deliveryDate = IPLATUI.EFTree.materialTree.selectTreeNode.deliveryDate;
var lv = IPLATUI.EFTree.materialTree.selectTreeNode.lv;
JSColorbox.open({
href: "HPSC097?methodName=initLoad&inqu_status-0-id=route_003&inqu_status-0-parentId="
+ nodeId + "&inqu_status-0-projCode=" + projCode + "&inqu_status-0-projName="
+ projName + "&inqu_status-0-parentPrdtName=" + parentPrdtName
+ "&inqu_status-0-deliveryDate=" + deliveryDate
+ "&inqu_status-0-lv=" + lv,
title: "<div style='text-align: center;'>导入</div>",
width: "60%",
height: "50%",
callbackName: function () {
// 刷新列表
resultGrid.dataSource.page(1);
// 刷新树
refreshTree();
// 关闭弹窗
JSColorbox.close();
}
});
}
}
});
$("#DOWNLOAD").on("click", function (e) {
var href = ctx + "\\HP\\template\\SC\\HPSC102_物料清单-部件.xls";
window.location.href = href;
});
$("#DOWNLOAD2").on("click", function (e) {
var href = ctx + "\\HP\\template\\SC\\HPSC102_物料清单-零件.xls";
window.location.href = href;
});
/**
* 生成模板
*/
$("#GENERATE").on("click", function () {
var projCode = $("#inqu_status-0-projId").val();
var info = new EiInfo()
info.set("id", $("#inqu_status-0-projId").val());
EiCommunicator.send("HPPZ015", "count", info, {
onSuccess: function (ei) {
if (ei["status"] == 1) {
//处理存在产品模板
var generateName= ei["extAttr"]["tempName"];
IPLAT.confirm({
message: '<b>模板名称:<red>*<red></b> <input id="generateName" type="text" name="generateName" ' +
'class="k-textbox" with="30px" required="true" value=" '+generateName+'"/>',
okFn: function (e) {
var generateName = $("#generateName").val();
if (generateName === "") {
message("模板名称不能为空!");
} else {
generateMode(projCode, generateName);
}
},
cancelFn: function (e) {
IPLAT.NotificationUtil('取消该操作');
},
title: '该产品模板已经存在,是否覆盖',
minWidth: 300
});
} else {
IPLAT.confirm({
message: '<b>模板名称:<red>*<red></b> <input id="generateName" name="generateName" ' +
'class="k-textbox" with="30px" required="true" />',
okFn: function (e) {
var generateName = $("#generateName").val();
if (generateName === "") {
message("模板名称不能为空!");
} else {
generateMode(projCode, generateName);
}
},
cancelFn: function (e) {
IPLAT.NotificationUtil('取消该操作');
},
title: '生成物料清单模板确认',
minWidth: 300
});
}
}, onFail: function (ei) {
}
}, {async: false});
});
// 模板选择
$("#ASSIGN").on("click", assign);
/**
* 物料生成
*/
function assign() {
var projCode = $("#inqu_status-0-projId").val();
var info = new EiInfo()
info.set("id", projCode);
EiCommunicator.send("HPSC102", "count", info, {
onSuccess: function (ei) {
if (ei["status"] == 1) {
var projCodeNew=ei["extAttr"]["projCode"];
JSColorbox.open({
href: "HPSC002C?methodName=initLoad&efParentFormEname=HPSC102",
title: "<div style='text-align: center;'>选择产品模板</div>",
width: "70%",
height: "70%",
callbackName: function (row) {
var info = new EiInfo()
info.set("id", row.id);
info.set("projCode", row.projCode);
info.set("projCodeNew", projCodeNew);
EiCommunicator.send("HPPZ015", "assign", info, {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
NotificationUtil({
msg: ei.msg
});
//刷新树
var tree = $("#materialTree").data("kendoTreeView");
tree.reload("root");//更新树
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
}, onFail: function (ei) {
}
}, {async: false});
}
});
}else {
IPLAT.alert({
message: '<b>该项目下已有物料清单!</b>',
okFn: function (e) {
},
title: '提示'
});
}
}, onFail: function (ei) {
}
}, {async: false});
}
function generateMode(projCode,generateName) {
const inEiInfo = new EiInfo();
inEiInfo.set("id", projCode);
inEiInfo.set("templateName", generateName);
EiCommunicator.send('HPPZ015', 'insert', inEiInfo, {
onSuccess(response) {
if(response.status === -1) {
IPLAT.NotificationUtil(response.msg, "error");
}
else {
IPLAT.NotificationUtil(response.msg);
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", e.message);
}
},
{
async: false
}
);
}
// 关闭事件
IPLATUI.EFWindow = {
"uploadFile": {
close: function (e) {
var tree = $("#materialTree").data("kendoTreeView");
let $iframe = uploadFileWindow.element.children("iframe");
let iframejQuery = $iframe[0].contentWindow.$; // 子窗口中的jQuery对象
let uploadFile = iframejQuery("#fileDocId").val();
if (isBlank(uploadFile)) {
return;
}
let inEiInfo = new EiInfo();
// inEiInfo.set("result-0-id", rowId);
inEiInfo.set("result-0-filePath1", uploadFile);
EiCommunicator.send('HPSC102', 'bindDocIdById', inEiInfo, {
onSuccess(response) {
query();
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
},
}
};
//部件类型下拉联动
$('input[name="inqu_status-0-prdtType"]').change(function () {
var inInfo=new EiInfo();
var prdtType=$("#inqu_status-0-prdtType").val();
inInfo.set("inventType",prdtType);
EiCommunicator.send("HPPZ004", "queryComboBox", inInfo, {
onSuccess: function (ei) {
var input=$("#inqu_status-0-prdtCode");
dataEdition=ei.getBlock("invent_name_block_id").getMappedRows();
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
optionLabel:"请选择",
dataSource: dataEdition,
template: "#=textField#"
});
}, onFail: function (ei) {
}
}, {async: false});
});
downKeyUp();
});
$(window).load(function () {
// 存货名称
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [3, 4]);
EiCommunicator.send("HPPZ006", "queryPrdtComboBox", inInfo, {
onSuccess: function (ei) {
inventNameGlobalData = ei.getBlock("invent_prdt_name_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
// 查
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 显示附件清单
*
* @param id
*/
function showUploadFile(id) {
JSColorbox.open({
href: "HPSC002A?methodName=initLoad&inqu_status-0-bizType=WL&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
function check(id, auditStatus) {
const inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-status", auditStatus);
EiCommunicator.send('HPSC102', 'check', inEiInfo, {
onSuccess(response) {
if (response.status === -1){
NotificationUtil(response.msg, "error");
return;
}else {
NotificationUtil(response.msg);
query();
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
}
);
}
/**
* 删除
*/
function deleteFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let pgStatus= item.get("pgStatus");
if(pgStatus==="1"||pgStatus==="2"){
message("选中的第"+(index+1)+"行记录已派工,不能删除!");
flag = false;
return false;
}
});
if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPSC102", "delete",
true, function (res) {
if (res.status > -1) {
refreshTree();
}
}
);
}
});
}
}
function saveFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let prdtType= item.get("prdtType");
let prdtName= item.get("prdtName");
let num= item.get("num");
let totalWt= item.get("totalWt");
if(isBlank(prdtType)){
message("选中的第"+(index+1)+"行\"部件类型\",不能为空!");
flag = false;
return false;
}
if(isBlank(prdtName)){
message("选中的第"+(index+1)+"行\"部件名称\",不能为空!");
flag = false;
return false;
}
if (num == 0 || num > 100) {
message("勾选的第" + (index + 1) + "行\"数量\"只能在0-100之间");
flag = false;
return;
}
if(!isNumber(totalWt) || totalWt == 0){
message("选中的第"+(index+1)+"行\"总重\"不能为0");
flag = false;
return false;
}
let pgStatus= item.get("pgStatus");
if(pgStatus==="1"||pgStatus==="2"){
message("选中的第"+(index+1)+"行记录已派工,不能修改!");
flag = false;
return false;
}
});
if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPSC102", "save",
true, function (res) {
if (res.status > -1) {
refreshTree();
}
}
);
}
});
}
}
/**
* 刷新树
*/
let refreshTree = function () {
setTimeout(() => {
// 刷新树节点
const tree = $("#materialTree").data("kendoTreeView");
// 选中的节点
const treeId = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId;
tree.reload(treeId)
// 展开成功后选中对应的树节点
expandTreeNode(tree, treeId);
// 展开成功后选中对应的树节点
selectTreeNode(tree, treeId);
}, 500);
}
/**
* 展开对应的树节点
*
* @param tree
* @param treeId
*/
let expandTreeNode = function (tree, treeId) {
if (!tree || treeId == null) {
return
}
setTimeout(() => {
let barDataItem = tree.dataSource.get(treeId);
if (barDataItem) {
tree.expandPath([treeId])
} else {
expandTreeNode(tree, treeId)
}
}, 300);
}
/**
* 选中树节点
*
* @param tree
* @param treeId
*/
let selectTreeNode = (tree, treeId) => {
if (!tree || treeId == null) {
return
}
setTimeout(() => {
let barDataItem = tree.dataSource.get(treeId);
if (barDataItem) {
let barElement = tree.findByUid(barDataItem.uid);
// 刷新完成后选中对应的树节点
tree.select(barElement);
// 赋值
setTreeNodeValue(barDataItem);
} else {
selectTreeNode(tree, treeId)
}
}, 300)
}
/**
* 设置树节点的值
*
* @param nodeData
*/
let setTreeNodeValue = function (nodeData) {
IPLATUI.EFTree.materialTree.selectTreeNode.nodeId = nodeData.nodeId;
IPLATUI.EFTree.materialTree.selectTreeNode.pId = nodeData.pId;
IPLATUI.EFTree.materialTree.selectTreeNode.prdtCode = nodeData.prdtCode;
IPLATUI.EFTree.materialTree.selectTreeNode.projCode = nodeData.projCode;
IPLATUI.EFTree.materialTree.selectTreeNode.prdtName = nodeData.prdtName;
IPLATUI.EFTree.materialTree.selectTreeNode.projName = nodeData.projName;
IPLATUI.EFTree.materialTree.selectTreeNode.deliveryDate = nodeData.deliveryDate;
IPLATUI.EFTree.materialTree.selectTreeNode.lv = nodeData.lv;
}
/**
* 动态显示列名
*/
let dynamicColumnName = function () {
// 根据叶子节点动态设置列名
let lv = IPLATUI.EFTree.materialTree.selectTreeNode.lv;
let th = $("th[data-field='prdtName']");
if (lv == 2) {
th.html("<span class=\"i-input-required\">*</span>零件名称");
} else {
th.html("<span class=\"i-input-required\">*</span>部件名称");
}
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/8
Time: 18:03
To change this template use File | Settings | File Templates.
--%>
<!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>
let ctx="${ctx}";
</script>
<EF:EFPage title="物料清单">
<EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput ename="inqu_status-0-projId" type="hidden"/>
<div class="row">
<%--<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 cname="部件名称" ename="inqu_status-0-prdtCode" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="状态" optionLabel="全部" ename="inqu_status-0-status" colWidth="3">
<EF:EFOption label="未提交" value="0"/>
<EF:EFOption label="已提交" value="1"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<div id="splitter" class="i-fit-height" style="display: inline">
<div id="left-pane" class="i-fit-height" style="width: 20%;float:left;">
<EF:EFRegion id="projTree" title="BOM结构图" fitHeight="true">
<EF:EFTree id="materialTree"
valueField="label"
textField="text"
hasChildren="leaf"
serviceName="HPSC002"
methodName="queryTreeNode">
</EF:EFTree>
</EF:EFRegion>
</div>
<div id="right-pane" class="i-fit-height" style="width: 80%;float: right">
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="lv" cname="层级" hidden="true"/>
<EF:EFColumn enable="false" ename="pgStatus" hidden="true" cname="派工状态"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="false" hidden="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" hidden="true"/>
<EF:EFColumn ename="deliveryDate" cname="交货日期" enable="false" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="prdtType" cname="部件类型" align="center" required="true"
filter="contains" width="90" enable="false" hidden="true">
<EF:EFOptions blockId="codeset_code_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="prdtCode" cname="部件编码" hidden='true'/>
<EF:EFColumn ename="prdtName" cname="部件名称" width="140" align="center" maxLength="50"
required="true"/>
<EF:EFColumn ename="length" cname="长/φ(MM)" width="80" format="{0:N0}" maxLength="12" displayType="0"
data-regex="/^-?[0-9]{1,9}$/"
data-errorprompt="请输入数字,该值最大可设置9位整数!"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="80" format="{0:N0}" maxLength="12" displayType="0"
data-regex="/^-?[0-9]{1,9}$/"
data-errorprompt="请输入数字,该值最大可设置9位整数!"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="80" format="{0:N0}" maxLength="12" displayType="0"
data-regex="/^-?[0-9]{1,9}$/"
data-errorprompt="请输入数字,该值最大可设置9位整数!"/>
<EF:EFColumn enable="false" ename="parentId" hidden="true" cname="上级部件名称"/>
<EF:EFColumn enable="false" ename="parentPrdtName" hidden="true" cname="上级部件名称"/>
<EF:EFColumn ename="num" cname="数量" maxLength="15" displayType="0.000"
data-regex="/^-?[0-9]{1,12}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置12位整数和3位小数!"/>
<EF:EFColumn ename="totalWt" cname="总重(T)" enable="true" width="100" align="right" format="{0:N3}" sumType="all"
data-regex="/^-?[0-9]{1,12}([.][0-9])?$/"
data-errorprompt="请输入数字,该值最大可设置12位整数和1位小数!"/>
<EF:EFColumn ename="unitWt" format="{0:N1}" cname="单重(KG)" maxLength="15" displayType="0.0"
data-regex="/^-?[0-9]{1,12}([.][0-9])?$/" defaultValue="0.000" hidden="true"
data-errorprompt="请输入数字,该值最大可设置12位整数和1位小数!"/>
<EF:EFComboColumn enable="false" ename="status" align="center"
columnTemplate="#=textField#" optionLabel=" "
itemTemplate="#=textField#" textField="textField"
valueField="valueField" cname="提交状态">
<EF:EFOption label="未提交" value="0"/>
<EF:EFOption label="已提交" value="1"/>
</EF:EFComboColumn>
<EF:EFColumn ename="remark" cname="备注" />
</EF:EFGrid>
</EF:EFRegion>
</div>
</div>
<%-- EEDM8010页面加载时,不会加载EEDM6000 (lazyload="true") --%>
<%-- <EF:EFWindow id="uploadFile" url="${ctx}/web/HPSC099" lazyload="true" refresh="true">
</EF:EFWindow>
<EF:EFWindow id="openFile">
<EF:EFRegion id="upload" title="文件导入区">
<div id="button"></div>
<EF:EFUpload ename="fileUpload" cname="导入" docTag="HPSC002" path="upload"/>
</EF:EFRegion>
</EF:EFWindow>
<EF:EFWindow id="openFile">
<EF:EFRegion id="upload" title="文件导入区">
<div id="button"></div>
<EF:EFInput cname="上传文件" blockId="inqu_status" ename="file" row="0" type="file" colWidth="3"/>
</EF:EFRegion>
</EF:EFWindow>--%>
<EF:EFWindow id="uploadFile" url="${ctx}/web/HPSC097" lazyload="true" refresh="true"/>
</EF:EFPage>
var pageOffset = 1; //当前主页数
$(function () {
$("#QUERY").on("click", query);
IPLATUI.EFGrid = {
"result": {
pageable: {
pageSize: 5,
pageSizes: [5, 10, 20, 50, 100],
},
columns: [{
field: "operator",
template: function (item) {
//console.log(item)
let auditStatus = item.status;
let template = '';
if (item.matId != null) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.matId + ')" >附件清单</a>';
}
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" '
+ 'onclick="check(' + item.id + ',1, \'' + item.planInfoNo + '\',\''
+ item.factoryCode + '\')" >提交</a>';
}
/*else {
template += '<a hidden="hidden" style="cursor: pointer;display: inline-flex;justify-content: center;" ' +
'onclick="check(' + item.id + ',0)" >撤回</a>';
}*/
return template;
}
}, {
field: "planCompletionDate",
template: function (item) {
let auditStatus = item.status;
let template = '';
if (auditStatus == 1) {
template += 'this.blur();';
}
return template;
}
}, {
field: "qrcodeDocId",
template: function (item) {
let auditStatus = item.status;
if (!isBlank(item.qrcodeDocId)) {
return '<img src="' + downloadHref(item.qrcodeDocId) + '" width="20px" height="20px"'
+ ' onclick="imgClick(\'' + item.qrcodeDocId + '\')" />';
}
if (auditStatus != 0) {
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;" '
+ 'onclick="generateQrcode(\'' + item.planInfoNo + '\')" >生成</a>';
}
return "";
}
}],
/**
* 翻页事件,点翻页按钮,输入页数跳转时触发
* @param e 事件对象
* e.sender Grid对象
* e.page 期望翻到的页数
*/
page: function (e) {
// 禁止翻页
//e.preventDefault();
pageOffset = e.page;
console.log(e.page);
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
saveResult(btnNode);
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'update'
|| e.eiInfo.extAttr.methodName == 'insert') {
query();
}
},
onRowClick: function (e) {
var block = detailGrid.getEiBlock();
if (block != null) {
block.setRows([]);
detailGrid.setEiBlock(block);
}
var info = new EiInfo()
var parentId = e.model['planInfoNo'];
info.set("parentId", parentId);
EiCommunicator.send("HPSC004", "queryDetail", info, {
onSuccess: function (ei) {//返回结果集
detailGrid.setEiInfo(ei);
}, onFail: function (ei) {
}
}, {async: false});
},
},
"detail":{
toolbarConfig: {
// hidden: false, // true时,不显示功能按钮,但保留setting导出按钮
// add: false, // 不显示新增按钮
cancel: true, // 不显示取消按钮
// save: true, // 不显示保存按钮
// delete: true, // 显示删除按钮
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
saveDetail(btnNode);
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'update'
|| e.eiInfo.extAttr.methodName == 'insert') {
query();
}
},
columns: [{
field: "operator",
title: "操作",
template: function (item) {
let filePath1 = item.filePath1;
let template = '';
if (filePath1) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + filePath1 + ')" >附件清单</a>';
}
return template
}
}]
}
}
//部件类型下拉联动
$('input[name="inqu_status-0-prdtType"]').change(function () {
var inInfo=new EiInfo();
var prdtType=$("#inqu_status-0-prdtType").val();
inInfo.set("inventType",prdtType);
EiCommunicator.send("HPPZ004", "queryComboBox", inInfo, {
onSuccess: function (ei) {
var input=$("#inqu_status-0-prdtCode");
dataEdition=ei.getBlock("invent_name_block_id").getMappedRows();
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
optionLabel:"请选择",
dataSource: dataEdition,
template: "#=textField#"
});
}, onFail: function (ei) {
}
}, {async: false});
});
downKeyUp();
});
function showUploadFile(id) {
JSColorbox.open({
href: "HPSC002B?methodName=initLoad&inqu_status-0-bizType=WL&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
function check(id, auditStatus,planInfoNo,factoryCode) {
const inEiInfo = new EiInfo();
inEiInfo.set("id", id);
inEiInfo.set("planInfoNo",planInfoNo);
if (isBlank(factoryCode)) {
message("工厂不能为空,请选择工厂");
return;
}
//先判断本身是否填写
EiCommunicator.send('HPSC103', 'getInfo', inEiInfo, {
onSuccess(ei) {
var model=ei.get("model");
if(!(model.planCompletionDate).trim()) {
NotificationUtil("提交失败!原因:基本信息中计划完成日期未填写", "error");
return;
} else {
//提交
//提交前先判断明细信息中的计划开始和计划结束时间是否都已经填写,只有填写了之后才能进行提交
if (auditStatus == 1) {
EiCommunicator.send('HPSC004', 'inspectDetail', inEiInfo, {
onSuccess(ei) {
var list=ei.get("list");
if(list) {
var count = list[0];
if (count > 0) {
NotificationUtil("提交失败!原因:明细信息中有未填写的计划开始时间或计划结束时间", "error");
} else {
EiCommunicator.send('HPSC004','queryDetail',inEiInfo,{
onSuccess(ei){
var rows = ei.blocks.detail.rows;
var res = check_time(model,rows);
if (!res){
NotificationUtil("计划结束时间应该大于计划开始时间!", "error");
}
else {
// 提交通过,生成
EiCommunicator.send('HPSC103', 'submitPlan', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
console.log(response)
// autoProductionschedulCallback(factoryCode,response.get('planInfoNo'));
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
}
}
})
}
} else {
NotificationUtil("提交失败!未找到明细信息", "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
} else {
// 撤回
}
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
// autoProductionschedul('SCJH24030700006');
}
/**
* 自动排产提示
*/
let autoProductionschedul = function (planInfoNo) {
JSUtils.confirm(" 生产计划提交成功,已生成生产订单!是否自动排产? ", {
ok: function () {
JSColorbox.open({
href: "HPSC003A?methodName=initLoad&inqu_status-0-planInfoNo=" + planInfoNo,
title: "<div style='text-align: center;'>自动排产</div>",
width: "30%",
height: "40%",
callbackName: autoProductionschedulCallback
});
}
});
}
function autoProductionschedulCallback (factoryCode,planInfoNo) {
//JSColorbox.close();
if (factoryCode) {
if (planInfoNo) {
JSColorbox.open({
href: "HPSC003B?methodName=initLoad&inqu_status-0-planInfoNo=" + planInfoNo +
'&inqu_status-0-factoryCode=' + factoryCode,
title: "<div style='text-align: center;'>自动排产</div>",
width: "80%",
height: "80%",
dispaly: "flex",
callbackName: autoProductionschedulCallback1
});
$("#JSColorboxWin").css({"height": "100%"})
} else {
message("生产计划单号不能为空!");
return;
}
} else {
message("请选择工厂生成生产任务!");
return;
}
}
function autoProductionschedulCallback1 () {
JSColorbox.close();
}
let query = function (page) {
let offset = page!=undefined?page:1;
resultGrid.dataSource.page(offset);
}
function check_time(model,rows){
for (var i=0;i<rows.length;i++){
if (model.planInfoNo == rows[i][5]) {
var start_time = rows[i][22];
var end_time = rows[i][23];
if (end_time < start_time) {
return false;
}
}
}
return true;
}
/**
* 保存汇总
*/
function saveResult(btn) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let planCompletionDate= item.get("planCompletionDate");
if(isBlank(planCompletionDate)){
message("选中的第"+(index+1)+"行\"计划结束时间\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPSC103", "update", true);
//释放禁用按钮
btn.attr("disabled", false);
query();
}
});
}
}
/**
* 保存明细
*/
function saveDetail(btn) {
let rows = detailGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let planCommentDate= item.get("planCompletionDate"); //item.get("planCommentDate");
let planCompletionDate= item.get("planCompletionDate");
if(isBlank(planCommentDate)){
message("选中的第"+(index+1)+"行\"计划开始时间\",不能为空!");
flag = false;
return false;
}
if(isBlank(planCompletionDate)){
message("选中的第"+(index+1)+"行\"计划结束时间\",不能为空!");
flag = false;
return false;
}
let startT = new Date(planCommentDate).getTime();
let endT = new Date(planCompletionDate).getTime();
if (startT > endT) {
message("选中的第"+(index+1)+"行\"计划开始时间\"不能大于\"计划结束时间\"!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("detail"));
EiCommunicator.send("HPSC103", "updatePlanDetail", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
console.log("回调查询:"+pageOffset)
query(pageOffset)
IPLAT.fillNode(document.getElementById(eiInfo.extAttr[EiConstant.EF_FORM_ENAME]),
ei
);
} catch (e) {
// TODO: handle exception
}
if (IPLAT.isAvailable("detail")) {
window['detailGrid'].setEiInfo(ei);
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
//let reslu = JSUtils.submitGridsData("detail", "HPSC003", "updatePlanDetail", true);
//释放禁用按钮
btn.attr("disabled", false);
}
});
}
}
/**
* 生成二维码
*
* @param planInfoNo
*/
let generateQrcode = function (planInfoNo) {
let inInfo = __eiInfo;
inInfo.set("planInfoNo", planInfoNo);
JSUtils.submitGridsData("result", "HPSC103", "generateQrcode",
true, function (res) {
message(res.msg);
}, inInfo
);
}
/**
* 图片放大
*/
let imgClick = function (docId) {
// 图片路径
$("#bigImg").attr("src", downloadHref(docId));
$("#bigImg").css({'width': 400});
// 图片淡入
$("#back-curtain").fadeIn("fast");
// 遮罩效果
$("#back-curtain").css({
'position': 'fixed',
'overflow-y': 'auto',
'width': '100%',
'height': '100%',
'z-index': '998'
}).show();
// 点击图片或遮罩,图片淡出
$("#back-curtain").on('click', function () {
$(this).fadeOut("fast");
});
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/9
Time: 10:28
To change this template use File | Settings | File Templates.
--%>
<!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}"/>
<EF:EFPage title="生产计划">
<EF:EFRegion id="inqu" title="查询条件" align-item="center">
<div class="row">
<%--<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"/>
<%-- <EF:EFInput cname="生产计划单号" blockId="inqu_status" ename="planInfoNo" row="0" colWidth="3"/>--%>
<EF:EFDatePicker cname="交货日期" blockId="inqu_status" ename="deliveryDate" row="0" colWidth="3"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFDatePicker cname="计划完成日期" blockId="inqu_status" ename="planCompletionDate" row="0" colWidth="3"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<%-- </div>--%>
<%-- <div class="row">--%>
<EF:EFSelect cname="状态" blockId="inqu_status" ename="status" row="0" colWidth="3" optionLabel="全部">
<EF:EFOption label="未提交" value="0"/>
<EF:EFOption label="已提交" value="1"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="基本信息">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn enable="false" ename="qrcodeDocId" cname="二维码" width="50" align="center"/>
<EF:EFColumn enable="false" ename="projCode" cname="项目号" readonly="true" hidden="true"/>
<EF:EFColumn enable="false" ename="planInfoNo" cname="生产计划单号" readonly="true" hidden="true" width="100"/>
<EF:EFColumn enable="false" ename="projName" cname="项目名称" width="120" readonly="true"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="prdtType" cname="部件类型" hidden = 'true' width="90" align="center" enable="false">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" />
</EF:EFComboColumn>
<EF:EFColumn enable="false" ename="prdtCode" cname="部件编码" readonly="true" hidden = "true" />
<EF:EFColumn enable="false" ename="prdtName" cname="部件名称" readonly="true" width="120"/>
<EF:EFColumn enable="false" ename="spec" cname="规格" readonly="true" align="center" width="100" hidden="true"/>
<EF:EFColumn enable="false" ename="remark" cname="备注" readonly="true" width="100"/>
<EF:EFColumn ename="deliveryDate" cname="交货日期" width="100" align="center" enable="false"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" hidden="true"/>
<EF:EFColumn ename="planCompletionDate" cname="计划完成日期" width="100" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required='true'/>
<EF:EFColumn enable="false" ename="schedule" cname="生产完工进度" format="{0:N2}" width="80" readonly="true" align="center"/>
<EF:EFComboColumn enable="false" ename="status" cname="状态" width="60" align="center">
<EF:EFOption label="未提交" value="0"/>
<EF:EFOption label="已提交" value="1"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
<EF:EFRegion id="detail" title="明细信息">
<EF:EFGrid blockId="detail" autoDraw="no" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目编码" hidden="true"/>
<EF:EFColumn ename="parentId" cname="父ID" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" align="center"/>
<EF:EFComboColumn ename="prdtType" cname="零件类型" width="90" align="center" readonly="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFComboColumn>
<EF:EFColumn enable="false" ename="prdtCode" cname="零件编码" hidden = "true"/>
<EF:EFColumn enable="false" ename="prdtName" readonly="true" cname="零件名称"/>
<EF:EFColumn enable="false" ename="spec" cname="规格" align="center" readonly="true"/>
<EF:EFColumn enable="false" ename="remark" cname="备注" readonly="true"/>
<EF:EFColumn enable="false" ename="num" readonly="true" width="80" align="right" cname="数量" format="{0:N0}%"/>
<EF:EFColumn enable="false" ename="unitWt" readonly="true" width="80" align="right" cname="单重(KG)" hidden="true"/>
<EF:EFColumn ename="totalWt" cname="总重(T)" width="80" align="right" enable="false"/>
<%--<EF:EFColumn ename="planCommentDate" required='true' cname="计划开始时间" width="100" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>--%>
<EF:EFColumn ename="planCompletionDate" required='true' cname="计划完成日期" width="100" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="actualCompletionDate" cname="完成时间" editType="date" dateFormat="yyyy/MM/dd" width="100"
enable="false"/>
<EF:EFColumn enable="false" ename="actualCompletionNum" width="80" align="right" cname="完成数量" format="{0:N0}%" readonly="true"/>
<EF:EFColumn enable="false" ename="actualCompletionUnitWt" width="80" align="right" cname="完成总重(T)" readonly="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<div id="back-curtain" style="position:fixed; top:0; left:0; background:rgba(0,0,0,0.5); z-index:998; width:100%;
display:none;display: flex; justify-content: center; align-items: center;">
<img id="bigImg" src=""/>
</div>
let ids = [];
$(function () {
// 查询
$("#QUERY").on("click", query);
// 拆单派工
// $("#TEAR_ASSIGN").on("click", tearAssign);
// 批量分派
$("#ASSIGN").on("click", assign);
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [{
field: "operator",
template: function (item) {
let status = item.status;
let prodOrderNo = item.prodOrderNo;
let filePath1 = item.filePath1;
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) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + filePath1 + ')" >附件</a>';
}
return template
}
},
{
field: "prodOrderNo",
template: function (item) {
let prodOrderNo = item.prodOrderNo;
let template = '';
template += '<a style="cursor: pointer;display: inline-flex" '
+' onclick="tearDetails(\'' + prodOrderNo + '\')" >' + prodOrderNo + '</a>';
return template
}
}
]
}
});
/**
* 查询
*/
function query() {
resultGrid.dataSource.page(1);
}
/**
* 拆单派工
*
* @param prodOrderNo
*/
function tearAssign(prodOrderNo) {
JSColorbox.open({
href: "HPSC104A?methodName=initLoad&inqu_status-0-prodOrderNo=" + prodOrderNo,
title: "<div style='text-align: center;'>拆单派工</div>",
width: "80%",
height: "90%",
callbackName: tearAssignCallback
});
}
/**
* 生产订单详情
*
* @param prodOrderNo
*/
function tearDetails(prodOrderNo) {
JSColorbox.open({
href: "HPSC104B?methodName=initLoad&inqu_status-0-prodOrderNo=" + prodOrderNo,
title: "<div style='text-align: center;'>生产订单详情</div>",
width: "80%",
height: "90%",
callbackName: tearAssignCallback
});
}
/**
* 拆单分派回调
*/
function tearAssignCallback() {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
/**
* 批量分派
*/
function assign() {
//重置全局变量
ids = [];
let rows = resultGrid.getCheckedRows()
if (rows.length < 1) {
message("请至少选择一条需要分派的数据");
return;
}
let factoryCodes = null;
rows.forEach(function (element) {
ids.push(element.id);
factoryCodes = element.factoryCode;
});
let flag = true;
$.each(rows, function(index, item) {
let factoryCode= item.get("factoryCode");
if(factoryCode != factoryCodes){
IPLAT.alert({
message : "选中的生产订单不上同一个工厂,无法分派!",
okFn : function(e) {
},
title : '错误'
});
flag = false;
return false;
}
});
if(flag) {
// groupType=1:仅查询生产组
JSColorbox.open({
href: "HPSC098?methodName=initLoad&inqu_status-0-orgType=prodGroup&inqu_status-0-factoryCode="+factoryCodes,
title: "<div style='text-align: center;'>选择组织</div>",
width: "70%",
height: "70%",
callbackName: function (row) {
var info = new EiInfo()
info.set("ids",ids.join(','));
info.set("factoryCode",row.factoryCode);
info.set("factoryName",row.factoryName);
info.set("groupCode",row.groupCode);
info.set("groupName",row.groupName);
EiCommunicator.send("HPSC104A", "assign", info, {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
NotificationUtil({
msg: ei.msg
});
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
}, onFail: function (ei) {
}
}, {async: false});
}
});
}
}
/**
* 附件清单
*
* @param id
*/
function showUploadFile(id) {
JSColorbox.open({
href: "HPSC002B?methodName=initLoad&inqu_status-0-bizType=WL&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
/**
* 生产组详情
*
* @param let
*/
function showGroupDetail(prodOrderNo) {
window.open("HPSC105?methodName=initLoad&inqu_status-0-prodOrderNo=" + prodOrderNo)
}
$(window).load(function () {
// 查询
query();
});
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/9
Time: 16:08
To change this template use File | Settings | File Templates.
--%>
<!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}"/>
<EF:EFPage title="生产订单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="生产订单号" blockId="inqu_status" ename="prodOrderNo" 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"/>
<EF:EFInput cname="零件名称" blockId="inqu_status" ename="partName" row="0" colWidth="3"/>
</div>
<div class="row">
<EF:EFDatePicker cname="交货日期" blockId="inqu_status" ename="deliveryDate" row="0" colWidth="3"
format="yyyy-MM-dd"/>
<EF:EFDatePicker cname="计划完成日期" blockId="inqu_status" ename="planCompletionDate" row="0" colWidth="3"
format="yyyy-MM-dd"/>
<EF:EFSelect cname="状态" optionLabel="全部" blockId="inqu_status" ename="status" row="0" colWidth="3">
<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:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="170" locked="true" align="center"/>
<EF:EFColumn ename="prodOrderNo" 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="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<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="partName" cname="零件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partSpec" cname="零件规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="deliveryDate" cname="交货日期" width="100" align="center" enable="false"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="workDate" cname="派工时间" enable="false" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="planCompletionDate" cname="计划完成日期" enable="false" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="assignedNum" cname="派工数量" enable="false" width="80" align="right" format="{0:N0}%"/>
<EF:EFColumn ename="unassignedNum" cname="剩余数量" enable="false" width="80" align="right" format="{0:N0}%"/>
<EF:EFColumn ename="num" cname="数量" enable="false" width="80" align="right" format="{0:N0}%"/>
<EF:EFColumn ename="totalWt" cname="总重(T)" enable="false" width="80" 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="100" align="center" hidden="true"/>
<EF:EFColumn ename="prdtCode" cname="部件编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="partCode" cname="零件编码" enable="false" width="100" align="center" hidden="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
let factoryGroupGlobalData = [];
$(function () {
IPLATUI.EFGrid = {
"result" : {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [{
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-parentOrgId", options.model["factoryCode"]);
// 1:生产组
inInfo.set("inqu_status-0-orgType", 'prodGroup');
inInfo.set("serviceName", "HPXSOrg");
inInfo.set("methodName", "queryGroupComboBox");
inInfo.set("blockId", "group_record_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
},{
field: "workDate",
attributes: {
class: "i-input-readonly"
},
defaultValue: function () {
return currShortDate();
}
}],
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
}
}
}
$("#QUERY").on("click", query);
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 生产组名称
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-orgType", 'prodGroup');
EiCommunicator.send("HPXSOrg", "queryGroupComboBox", inInfo, {
onSuccess: function (ei) {
factoryGroupGlobalData = ei.getBlock("group_record_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
// 查询
query();
});
/**
* 查询
*/
function query() {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
for (let i = 0; i < rows.length; i++) {
/*if (isBlank(rows[i]['factoryCode'])) {
message("勾选的第" + (i + 1) + "行\"厂区\",不能为空");
return;
}*/
if (isBlank(rows[i]['orgNo'])) {
message("勾选的第" + (i + 1) + "行\"生产组\",不能为空");
return;
}
if (isBlank(rows[i]['totalWt'])) {
message("勾选的第" + (i + 1) + "行\"分派重量\",不能为空");
return;
}
if (Number(rows[i]['totalWt']) <= 0) {
message("勾选的第" + (i + 1) + "行\"分派重量\"必须是大于0");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPSC104A", "save", true);
}
});
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPSC104A", "delete", true);
}
});
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/9
Time: 16:13
To change this template use File | Settings | File Templates.
--%>
<!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}"/>
<EF:EFPage title="拆单派工">
<EF:EFRegion id="inqu" title="订单详情">
<EF:EFInput ename="inqu_status-0-prodOrderNo" cname="项目号" 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"/>
<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"/>
<EF:EFInput ename="detail-0-partName" cname="零件名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-deliveryDate" cname="交货日期" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-planCompletionDate" cname="计划完成日期" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-num" cname="计划数量" colWidth="4" readonly="true" format="{0:N0}%"/>
<EF:EFInput ename="detail-0-totalWt" cname="计划重量(T)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-assignedNum" cname="已派工数量" colWidth="4" readonly="true" format="{0:N0}%"/>
<EF:EFInput ename="detail-0-unassignedNum" cname="待派工数量" colWidth="4" readonly="true" format="{0:N0}%"/>
<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="2"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect ename="detail-0-factoryCode" cname="厂区" colWidth="4" readonly="true">
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="任务ID" enable="false" width="80" align="center"/>
<EF:EFColumn ename="prodTaskNo" cname="任务单号" enable="false" hidden="true"/>
<%--<EF:EFComboColumn ename="factoryCode" cname="厂区" width="110" align="center" defaultValue="" 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:EFComboColumn ename="orgNo" cname="生产组" width="110" align="center" defaultValue="" required="true"
filter="contains" readonly="true">
<EF:EFOptions blockId="group_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" align="center" hidden="true"/>
<EF:EFColumn ename="workDate" cname="派工时间" enable="false" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="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="factoryCode" cname="厂区编码" enable="false" hidden="true"/>
<EF:EFColumn ename="factoryName" cname="厂区" enable="false" align="center"/>--%>
<EF:EFColumn ename="num" cname="分派数量" format="{0:N0}%" defaultValue="100" required="true" enable="false"/>
<EF:EFColumn ename="totalWt" cname="分派重量(T)" enable="true" format="{0:N3}"/>
<EF:EFColumn ename="completeNum" cname="已完工数量" enable="false" format="{0:N0}%" defaultValue="0"/>
</EF:EFGrid>
<br/>
<span style='color: red;font-size: 13px;'>说明:厂区和生产组仅新增的时候可以编辑</span>
</EF:EFRegion>
</EF:EFPage>
let factoryGroupGlobalData = [];
$(function () {
IPLATUI.EFGrid = {
"result" : {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [{
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) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
}
}
});
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/9
Time: 16:18
To change this template use File | Settings | File Templates.
--%>
<!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}"/>
<EF:EFPage title="生产订单">
<EF:EFRegion id="inqu" title="订单详情">
<EF:EFInput ename="inqu_status-0-prodOrderNo" cname="项目号" type="hidden"/>
<div class="row">
<EF:EFInput ename="detail-0-productionOrderNo" cname="生产订单号" colWidth="4" readonly="true"/>
<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-prdtLength" cname="部件长(MM)" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-prdtWidth" cname="部件宽(MM)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-prdtThick" cname="部件厚(MM)" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-num" cname="部件数量" colWidth="4" readonly="true" format="{0:N0}%"/>
<EF:EFInput ename="detail-0-totalWt" cname="部件重量(T)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-remark" cname="部件备注" colWidth="4" readonly="true"/>
<EF:EFSelect ename="detail-0-partType" cname="零件类型" colWidth="4" readonly="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFSelect>
<EF:EFInput ename="detail-0-partName" cname="零件名称" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-partLength" cname="零件长(MM)" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-partWidth" cname="零件宽(MM)" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-partThick" cname="零件厚(MM)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-remark1" cname="零件备注" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-num" cname="零件数量" colWidth="4" readonly="true" format="{0:N0}%"/>
<EF:EFInput ename="detail-0-totalWt" cname="零件重量(T)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFDatePicker ename="detail-0-workDate" cname="派工时间" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="4" readonly="true" />
<EF:EFInput ename="detail-0-assignedNum" cname="派工数量" colWidth="4" readonly="true" format="{0:N0}%"/>
<EF:EFInput ename="detail-0-totalWt" cname="派工重量(T)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-unassignedNum" cname="剩余数量" colWidth="4" readonly="true" format="{0:N0}%"/>
<EF:EFInput ename="detail-0-unTotalWt" cname="剩余重量(T)" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-completeNum" cname="完成数量" colWidth="4" readonly="true" format="{0:N0}%"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-actualCompletionTotalWt" cname="完成重量(T)" colWidth="4" readonly="true"/>
<EF:EFDatePicker ename="detail-0-deliveryDate" cname="交货日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="4" readonly="true" />
<EF:EFDatePicker ename="detail-0-planCompletionDate" cname="计划完成日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="4" readonly="true" />
<EF:EFDatePicker ename="detail-0-actualCompletionDate" cname="实际完成时间" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="4" readonly="true" />
</div>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid = {
"result" : {
pageable: {
pageSize: 15,
pageSizes: [15, 50, 70, 100],
},
columns: [{
field: "operator",
template: function (item) {
let filePath1 = item.filePath1;
let zlprodTaskNo = item.zlprodTaskNo;
let prodTaskNo = item.prodTaskNo;
let template = '';
if (filePath1) {
template+='<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="registerWork(\'' + prodTaskNo + '\')" >报工</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + filePath1 + ')" >附件</a>';
}
if (zlprodTaskNo) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showZlDetail(\'' + prodTaskNo + '\')" >质检单</a>';
}
return template
}
}, {
field: "prodTaskNo",
template: function (item) {
let prodTaskNo = item.prodTaskNo;
return '<a style="cursor: pointer;display: inline-flex" '
+ ' onclick="tearDetails(\'' + prodTaskNo + '\')" >' + prodTaskNo + '</a>';
}
}]
}
}
// 查询
$("#QUERY").on("click", query);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
function query() {
resultGrid.dataSource.page(1);
}
/**
* 附件清单
*
* @param id
*/
function showUploadFile(id) {
JSColorbox.open({
href: "HPSC002B?methodName=initLoad&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
/**
* 生产任务详情
*
* @param prodOrderNo
*/
function tearDetails(prodTaskNo) {
JSColorbox.open({
href: "HPSC105A?methodName=initLoad&inqu_status-0-prodTaskNo=" + prodTaskNo,
title: "<div style='text-align: center;'>生产任务详情</div>",
width: "80%",
height: "90%"
});
}
function registerWork(prodTaskNo) {
JSColorbox.open({
href: "HPSC105B?methodName=initLoad&inqu_status-0-prodTaskNo=" + prodTaskNo,
title: "<div style='text-align: center;'>报工</div>",
width: "70%",
height: "60%",
callbackName: registerWorkCallback
});
}
function registerWorkCallback(ei) {
if (ei.getStatus() >= 0) {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
}
function showZlDetail(prodTaskNo) {
window.open("HPZL001?methodName=initLoad&inqu_status-0-prodTaskNo=" + prodTaskNo)
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/9
Time: 16:15
To change this template use File | Settings | File Templates.
--%>
<!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}"/>
<EF:EFPage title="生产任务">
<EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput cname="生产订单号" ename="prodOrderNo" blockId="inqu_status" row="0" colWidth="3" type="hidden"/>
<div class="row">
<EF:EFInput cname="生产任务号" ename="prodTaskNo" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="部件名称" ename="prdtName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="零件名称" ename="partName" blockId="inqu_status" row="0" colWidth="3"/>
</div>
<div class="row">
<EF:EFSelect cname="工厂" ename="factoryCode" blockId="inqu_status" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="生产组名称" ename="orgNo" blockId="inqu_status" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="childId" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="110" align="center"/>
<EF:EFColumn ename="prodTaskNo" cname="生产任务号" enable="false" width="150" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="partName" cname="零件名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="partSpec" cname="零件规格" enable="false" width="100" align="center"/>
<%--<EF:EFColumn ename="remark1" cname="零件备注"/>--%>
<EF:EFColumn ename="deliveryDate" cname="交货日期" enable="false" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="workDate" cname="派工时间" enable="false" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="planCompletionDate" cname="计划完成日期" enable="false" width="120" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="completeNum" cname="完成数量" enable="false" width="100" align="right" format="{0:N0}%"/>
<EF:EFColumn ename="unCompleteNum" cname="剩余数量" enable="false" width="100" align="right" format="{0:N0}%"/>
<EF:EFColumn ename="num" cname="数量" enable="false" width="100" align="right" format="{0:N0}%"/>
<EF:EFColumn ename="totalWt" cname="总重(T)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="factoryName" cname="工厂" enable="false" width="140" align="center"/>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prodOrderNo" cname="生产订单号" enable="false" width="140" align="center" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目号" enable="false" width="140" align="center" hidden="true"/>
<EF:EFColumn ename="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>
</EF:EFRegion>
</EF:EFPage>
let factoryGroupGlobalData = [];
$(function () {
IPLATUI.EFGrid = {
"result" : {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [{
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) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
}
}
});
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/9
Time: 16:21
To change this template use File | Settings | File Templates.
--%>
<!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}"/>
<EF:EFPage title="生产任务详情">
<EF:EFRegion id="inqu" title="订单详情">
<EF:EFInput ename="inqu_status-0-prodOrderNo" cname="项目号" type="hidden"/>
<div class="row">
<EF:EFInput ename="detail-0-productionOrderNo" cname="生产订单号" colWidth="4" readonly="true"/>
<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-prdtLength" cname="部件长(MM)" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-prdtWidth" cname="部件宽(MM)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-prdtThick" cname="部件厚(MM)" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-num" cname="部件数量" colWidth="4" readonly="true" format="{0:N0}%"/>
<EF:EFInput ename="detail-0-unitWt" cname="部件重量(T)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-remark" cname="部件备注" colWidth="4" readonly="true"/>
<EF:EFSelect ename="detail-0-partType" cname="零件类型" colWidth="4" readonly="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFSelect>
<EF:EFInput ename="detail-0-partName" cname="零件名称" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-partLength" cname="零件长(MM)" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-partWidth" cname="零件宽(MM)" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-partThick" cname="零件厚(MM)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-remark1" cname="零件备注" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-num" cname="零件数量" colWidth="4" readonly="true" format="{0:N0}%"/>
<EF:EFInput ename="detail-0-unitWt" cname="零件重量(T)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-assignedNum" cname="派工数量" colWidth="4" readonly="true" format="{0:N0}%"/>
<EF:EFInput ename="detail-0-totalWt" cname="派工重量(T)" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-unassignedNum" cname="剩余数量" colWidth="4" readonly="true" format="{0:N0}%"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-unTotalWt" cname="剩余重量(T)" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-completeNum" cname="完成数量" colWidth="4" readonly="true" format="{0:N0}%"/>
<EF:EFInput ename="detail-0-actualCompletionTotalWt" cname="完成重量(T)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFDatePicker ename="detail-0-deliveryDate" cname="交货日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="4" readonly="true" />
<EF:EFDatePicker ename="detail-0-planCompletionDate" cname="计划完成日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="4" readonly="true" />
<EF:EFDatePicker ename="detail-0-actualCompletionDate" cname="实际完成时间" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="4" readonly="true" />
</div>
</EF:EFRegion>
<EF:EFRegion id="inqu" title="任务详情">
<div class="row">
<EF:EFInput cname="生产任务号" blockId="result" ename="prodTaskNo" row="0" colWidth="4" readonly="true"/>
<%-- <EF:EFInput cname="生产订单号" blockId="result" ename="prodOrderNo" row="0" colWidth="4" readonly="true"/>--%>
</div>
<%--<div class="row">
<EF:EFInput cname="项目号" blockId="result" ename="projCode" row="0" colWidth="4" readonly="true"/>
<EF:EFInput cname="项目名称" blockId="result" ename="projName" row="0" colWidth="4" readonly="true"/>
<EF:EFInput cname="部件名称" blockId="result" ename="prdtName" row="0" colWidth="4" readonly="true"/>
</div>--%>
<div class="row">
<EF:EFInput cname="部件名称" blockId="result" ename="prdtName" row="0" colWidth="4" readonly="true"/>
<EF:EFInput cname="零件名称" blockId="result" ename="partName" row="0" colWidth="4" readonly="true"/>
<EF:EFInput cname="零件规格(MM)" blockId="result" ename="partSpec" row="0" colWidth="4" readonly="true"/>
</div>
<%--<div class="row">
<EF:EFInput cname="零件长" blockId="result" ename="partLength" row="0" colWidth="4" readonly="true"/>
<EF:EFInput cname="零件宽" blockId="result" ename="partWidth" row="0" colWidth="4" readonly="true"/>
<EF:EFInput cname="零件厚" blockId="result" ename="partThick" row="0" colWidth="4" readonly="true"/>
</div>--%>
<div class="row">
<EF:EFInput cname="任务数量" blockId="result" ename="num" row="0" colWidth="4" readonly="true" format="{0:N0}%"/>
<EF:EFInput cname="任务重量(T)" blockId="result" ename="totalWt" row="0" colWidth="4" readonly="true"/>
<EF:EFInput cname="完成数量" blockId="result" ename="completeNum" row="0" colWidth="4" readonly="true" format="{0:N0}%"/>
</div>
<div class="row">
<EF:EFInput cname="剩余数量" blockId="result" ename="unCompleteNum" row="0" colWidth="4" readonly="true" format="{0:N0}%"/>
<EF:EFDatePicker cname="计划完成日期" blockId="result" ename="planCompletionDate" row="0" colWidth="4"
format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="工厂" blockId="result" ename="factoryName" row="0" colWidth="4" readonly="true"/>
<EF:EFInput cname="生产组名称" blockId="result" ename="orgName" row="0" colWidth="4" readonly="true"/>
</div>
</EF:EFRegion>
</EF:EFPage>
$(function () {
$("#result-0-quantity_textField").on('change',function () {
var quantity = $("#result-0-quantity_textField").val();
if(!isPositiveInteger(quantity)){
message("报工数量必须是大于0的正整数")
}
var taskWeight = $("#result-0-taskWeight_textField").val();
if(isPositiveNumber(taskWeight)) {
$("#result-0-totalWeight_textField").val((parseInt(taskWeight*(quantity/100))).toFixed(2));
$("#result-0-totalWeight").val((parseInt(taskWeight*(quantity/100))).toFixed(2))
}
})
/**
* 取消
*/
$('#cancel').on('click', function () {
// 关闭弹窗
parent.JSColorbox.close();
})
/**
* 保存*
*/
$("#btn_save").on("click",function(){
let quantity = $("#result-0-quantity_textField").val().split("%")[0];
let unregisterQuantity = $("#result-0-unregisterQuantity").val();
if(!isPositiveInteger(quantity)){
message("报工数量必须是大于0的正整数");
return ;
}
if (unregisterQuantity<quantity){
message("报工数量不能大于剩余数量");
return ;
}
if (quantity>100){
message("报工数量不能大于100%");
return ;
}
var registerDate = $("#result-0-registerDate").val();
if(!registerDate){
message("报工日期不能为空!");
return ;
}
$("#result-0-quantity_textField").val(quantity);
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGrid("", "HPSC105B", "save", {isAlldata:true,onSuccessCallback:parent.registerWorkCallback});
}
});
});
});
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/9
Time: 23:03
To change this template use File | Settings | File Templates.
--%>
<!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}"/>
<EF:EFPage title="报工">
<EF:EFRegion id="inqu" title="报工">
<div class="row">
<EF:EFInput ename="result-0-prodTaskNo" cname="生产任务ID" type="hidden"/>
<EF:EFInput ename="result-0-productType" cname="产品类型" colWidth="4" type="hidden" readonly="true"/>
<EF:EFInput ename="result-0-productCode" cname="产品编码" colWidth="6" readonly="true"/>
<EF:EFInput ename="result-0-productName" cname="产品名称" colWidth="6" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-groupCode" cname="生产班组编码" type="hidden"/>
<EF:EFInput ename="result-0-groupName" cname="班组" colWidth="6" required="true" readonly="true"/>
<EF:EFDatePicker cname="报工日期" ename="result-0-registerDate" colWidth="6"
format="yyyy-MM-dd" required="true" readonly="false"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-taskQuantity" cname="任务数量" format="{0:0}%" editType="text" colWidth="6" readonly="true"/>
<EF:EFInput ename="result-0-taskWeight" cname="任务重量" format="{0:n2}" editType="text" colWidth="6" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-registeredQuantity" cname="已报工数量" format="{0:0}%" editType="text" colWidth="6" readonly="true"/>
<EF:EFInput ename="result-0-registeredWeight" cname="已报工重量" format="{0:n2}" editType="text" colWidth="6" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-unregisterQuantity" cname="剩余数量" format="{0:0}%" editType="text" colWidth="6" readonly="true"/>
<EF:EFInput ename="result-0-unregisterWeight" cname="剩余重量" format="{0:n2}" editType="text" colWidth="6" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-quantity" cname="报工数量" format="{0:0}%" editType="text" colWidth="6" required="true" />
<EF:EFInput ename="result-0-totalWeight" cname="报工重量" format="{0:n2}" editType="text" colWidth="6" readonly="true"/>
</div>
</EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;">
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-center"/>
<EF:EFButton ename="btn_save" cname="保存" type="button" class="btn-center"/>
</div>
</EF:EFPage>
$(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 template = '';
template+='<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ')" >附件清单</a>';
return template;
}
}],
loadComplete: function(grid) {
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
}
}
});
/**
* 查询
*/
function query() {
resultGrid.dataSource.page(1);
}
$(window).load(function () {
// 查
query();
});
/**
* 显示附件清单
*
* @param id
*/
function showUploadFile(id) {
JSColorbox.open({
href: "HPSC099?methodName=initLoad&inqu_status-0-bizType=SCBG&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件详情</div>",
width: "80%",
height: "80%",
});
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/9
Time: 23:01
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<EF:EFPage title="生产报工单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput blockId="inqu_status" row="0" ename="factoryName" cname="工厂区" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="workCode" cname="报工单号" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="groupName" cname="生产组" placeholder="模糊查询" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="账套" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="factoryName" cname="工厂区" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="workCode" cname="报工单号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="productCode" cname="产品编码" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="productName" cname="产品名称" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="groupName" cname="生产组" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="quantity" cname="数量" width="100" enable="false" format="{0:0}%" readonly="true" align="center"/>
<EF:EFColumn ename="totalWeight" cname="任务总重(KG)" width="100" enable="false" format="{0:n2}" readonly="true" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(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 template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="jump(' + item.id + ')" >物料清单</a>';
return template;
}
}
],
}
});
function jump(id) {
var herf = ctx + "\\web\\" + "HPSC102?inqu_status-0-projId=" + id + "&efParentFormEname=HPSC111";
window.open(herf);
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/8
Time: 17:41
To change this template use File | Settings | File Templates.
--%>
<!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 ename="inqu_status-0-projCode" cname="项目编码" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-projName" cname="项目名称" colWidth="3"/>
<EF:EFSelect ename="inqu_status-0-projType" cname="项目类型" colWidth="3" filter="contains"
template="#=textField#" valueTemplate="#=textField#">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpsc.projType"/>
</EF:EFSelect>
<EF:EFSelect cname="物料提交状态" optionLabel="全部" ename="inqu_status-0-materialStatus" colWidth="3">
<EF:EFOption label="未提交" value="0"/>
<EF:EFOption label="部分提交" value="1"/>
<EF:EFOption label="全部提交" value="2"/>
</EF:EFSelect>
<EF:EFSelect cname="项目负责人" ename="inqu_status-0-princ1" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="客户负责人" ename="inqu_status-0-princ2" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="customer_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDatePicker ename="inqu_status-0-deliveryDate" cname="交货日期" role="date" enable="false" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
</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" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="projType" cname="项目类型" width="100" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#">
<EF:EFCodeOption codeName="hpjx.hpsc.projType"/>
</EF:EFComboColumn>
<EF:EFColumn enable="false" ename="projName" cname="项目名称"/>
<EF:EFComboColumn ename="princ1" cname="项目负责人" width="120" align="center" required="true"
blockName="user_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="true"
filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="princ2" cname="客户负责人" width="120" align="center" required="true"
blockName="customer_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="true"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="deliveryDate" cname="交货日期" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn ename="materialStatus" cname="物料提交状态" enable="false" width="100" align="center">
<EF:EFOption label="未提交" value="0"/>
<EF:EFOption label="部分提交" value="1"/>
<EF:EFOption label="全部提交" value="2"/>
</EF:EFComboColumn>
<EF:EFColumn ename="remark" cname="备注" enable="false"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
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