Commit 09e9280c by liuyang

2024-05-16 存货档案添加导入和流程关联

parent 6e56a112
package com.baosight.hggp.hg.pz.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* Project: <br>
* Title:Hgpz005a.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-05-15 18:59:20 create
*/
public class HGPZ005A extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 帐套编码*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 更新人*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除0.否1.是*/
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 公司编码*/
public static final String FIELD_COMPANY_NAME = "companyName"; /* 公司名称*/
public static final String FIELD_PROCESS_CODE = "processCode"; /* 工序编码*/
public static final String FIELD_PROCESS_NAME = "processName"; /* 工序名称*/
public static final String FIELD_COMPOSING_COEFF = "composingCoeff"; /* 排产系数*/
public static final String FIELD_UNIT_COEFF = "unitCoeff"; /* 单价系数*/
public static final String FIELD_PROCESS_CLASS = "processClass"; /* 工序类别*/
public static final String FIELD_PARENT_ID = "parentId"; /* 上级ID*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 帐套编码*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除0.否1.是*/
public static final String COL_PROCESS_CODE = "PROCESS_CODE"; /* 工序编码*/
public static final String COL_PROCESS_NAME = "PROCESS_NAME"; /* 工序名称*/
public static final String COL_COMPOSING_COEFF = "COMPOSING_COEFF"; /* 排产系数*/
public static final String COL_UNIT_COEFF = "UNIT_COEFF"; /* 单价系数*/
public static final String COL_PROCESS_CLASS = "PROCESS_CLASS"; /* 工序分类*/
public static final String COL_PARENT_ID = "PARENT_ID"; /* 上级ID*/
public static final String QUERY = "HGPZ005A.query";
public static final String COUNT = "HGPZ005A.count";
public static final String INSERT = "HGPZ005A.insert";
public static final String UPDATE = "HGPZ005A.update";
public static final String DELETE = "HGPZ005A.delete";
public static final String DELETE_PARENT_ID = "HGPZ005A.deleteByParentId";
private Long id = new Long(0);
private String accountCode = " "; /* 帐套编码*/
private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag = 0; /* 是否删除0.否1.是*/
private String companyCode = " "; /* 公司编码*/
private String companyName = " "; /* 公司名称*/
private String processCode = " "; /* 工序编码*/
private String processName = " "; /* 工序名称*/
private BigDecimal composingCoeff = new BigDecimal(0); /* 排产系数*/
private BigDecimal unitCoeff = new BigDecimal(0); /* 单价系数*/
private String processClass = " "; /* 工序分类*/
private Long parentId = new Long(0); /* 上级ID*/
/**
* 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_ACCOUNT_CODE);
eiColumn.setDescName("帐套编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("更新人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("是否删除0.否1.是");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("公司编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_NAME);
eiColumn.setDescName("公司名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROCESS_CODE);
eiColumn.setDescName("工序编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROCESS_NAME);
eiColumn.setDescName("工序名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPOSING_COEFF);
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("排产系数");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UNIT_COEFF);
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("单价系数");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROCESS_CLASS);
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("工序分类");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PARENT_ID);
eiColumn.setDescName("上级ID");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGPZ005A() {
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 accountCode - 帐套编码.
* @return the accountCode
*/
public String getAccountCode() {
return this.accountCode;
}
/**
* set the accountCode - 帐套编码.
*
* @param accountCode - 帐套编码
*/
public void setAccountCode(String accountCode) {
this.accountCode = accountCode;
}
/**
* get the depCode - 部门编码.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
* @param depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称.
*
* @param createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人.
*
* @param updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 更新人名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 更新人名称.
*
* @param updatedName - 更新人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 更新时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间.
*
* @param updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 是否删除0.否1.是.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 是否删除0.否1.是.
*
* @param deleteFlag - 是否删除0.否1.是
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
public String getCompanyCode() {
return companyCode;
}
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
/**
* get the processCode - 工序编码.
* @return the processCode
*/
public String getProcessCode() {
return this.processCode;
}
/**
* set the processCode - 工序编码.
*
* @param processCode - 工序编码
*/
public void setProcessCode(String processCode) {
this.processCode = processCode;
}
/**
* get the processName - 工序名称.
* @return the processName
*/
public String getProcessName() {
return this.processName;
}
/**
* set the processName - 工序名称.
*
* @param processName - 工序名称
*/
public void setProcessName(String processName) {
this.processName = processName;
}
/**
* get the composingCoeff - 排产系数.
* @return the composingCoeff
*/
public BigDecimal getComposingCoeff() {
return this.composingCoeff;
}
/**
* set the composingCoeff - 排产系数.
*
* @param composingCoeff - 排产系数
*/
public void setComposingCoeff(BigDecimal composingCoeff) {
this.composingCoeff = composingCoeff;
}
/**
* get the unitCoeff - 单价系数.
* @return the unitCoeff
*/
public BigDecimal getUnitCoeff() {
return this.unitCoeff;
}
/**
* set the unitCoeff - 单价系数.
*
* @param unitCoeff - 单价系数
*/
public void setUnitCoeff(BigDecimal unitCoeff) {
this.unitCoeff = unitCoeff;
}
/**
* get the processClass - 工序类别.
* @return the processClass
*/
public String getProcessClass() {
return this.processClass;
}
/**
* set the processClass - 工序类别.
*
* @param processClass - 工序类别
*/
public void setProcessClass(String processClass) {
this.processClass = processClass;
}
/**
* get the parentId - 上级ID.
* @return the parentId
*/
public Long getParentId() {
return this.parentId;
}
/**
* set the parentId - 上级ID.
*
* @param parentId - 上级ID
*/
public void setParentId(Long parentId) {
this.parentId = parentId;
}
/**
* 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));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_NAME)), companyName));
setProcessCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROCESS_CODE)), processCode));
setProcessName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROCESS_NAME)), processName));
setComposingCoeff(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_COMPOSING_COEFF)), composingCoeff));
setUnitCoeff(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UNIT_COEFF)), unitCoeff));
setProcessClass(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROCESS_CLASS)), processClass));
setParentId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PARENT_ID)), parentId));
}
/**
* 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_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_COMPANY_NAME, StringUtils.toString(companyName, eiMetadata.getMeta(FIELD_COMPANY_NAME)));
map.put(FIELD_PROCESS_CODE, StringUtils.toString(processCode, eiMetadata.getMeta(FIELD_PROCESS_CODE)));
map.put(FIELD_PROCESS_NAME, StringUtils.toString(processName, eiMetadata.getMeta(FIELD_PROCESS_NAME)));
map.put(FIELD_COMPOSING_COEFF, StringUtils.toString(composingCoeff, eiMetadata.getMeta(FIELD_COMPOSING_COEFF)));
map.put(FIELD_UNIT_COEFF, StringUtils.toString(unitCoeff, eiMetadata.getMeta(FIELD_UNIT_COEFF)));
map.put(FIELD_PROCESS_CLASS, StringUtils.toString(processClass, eiMetadata.getMeta(FIELD_PROCESS_CLASS)));
map.put(FIELD_PARENT_ID, StringUtils.toString(parentId, eiMetadata.getMeta(FIELD_PARENT_ID)));
return map;
}
}
package com.baosight.hggp.hg.pz.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ005A;
import com.baosight.hggp.hg.sj.domain.HGSJ003;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.springframework.security.core.parameters.P;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author LiuYang
* @version 1.0 2024/5/15
*/
public class ServiceHGPZ005A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGPZ005A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGPZ005A.QUERY, new HGPZ005A());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.PROCESS_CODE_BLOCK_ID,DdynamicEnum.ITEM_CODE_BOX_BLOCK_ID),
new HashMap<String,Object>(){{put("codesetCode","hggp.hgsj.processClass");}}
);
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGPZ005A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
return super.query(inInfo, HGPZ005A.QUERY);
}
@OperationLogAnnotation(operModul = "工序设置",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HGPZ005A hgpz005A = new HGPZ005A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgpz005A.fromMap(map);
hgpz005A.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGPZ005A.DELETE, hgpz005A.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("删除失败", e.getMessage());
return inInfo;
}
return inInfo;
}
/**
* 保存操作
*/
@OperationLogAnnotation(operModul = "工序设置",operType = "保存",operDesc = "保存操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (Map resultRow : resultRows) {
HGPZ005A hgpz005a = new HGPZ005A();
hgpz005a.fromMap(resultRow);
if (hgpz005a.getId() == null || hgpz005a.getId() == 0) {
Long parentId = Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGPZ005A.FIELD_PARENT_ID));
hgpz005a.setParentId(parentId);
this.add(hgpz005a);
} else {
this.modify(hgpz005a);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HGPZ005A hgpz005A) {
DaoUtils.insert(HGPZ005A.INSERT, hgpz005A);
}
/**
* 修改操作
*/
public void modify(HGPZ005A hgpz005A) {
DaoUtils.update(HGPZ005A.UPDATE, hgpz005A);
}
public EiInfo queryEdcm01(EiInfo inInfo){
inInfo = super.query(inInfo, HGSJ003.QUERY,new HGSJ003());
List<Object> integerList = new ArrayList<>();
List<Map> hgsj003s = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map map:hgsj003s) {
integerList.add(map.get(HGSJ003.FIELD_PROCESS_CLASS));
}
CommonMethod.initBlock(inInfo,Arrays.asList(DdynamicEnum.ITEM_CODE_BOX_BLOCK_ID),
new HashMap<String,Object>(){{
put("codesetCode","hggp.hgsj.processClass");
put("itemCodes",integerList);
}}
);
return inInfo;
}
}
package com.baosight.hggp.hg.pz.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.hg.sj.domain.HGSJ002;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.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.Arrays;
/**
* @author LiuYang
* @version 1.0 2024/5/15
*/
public class ServiceHGPZ005B extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ002.FIELD_STATUS, CommonConstant.YesNo.YES_1);
inInfo = super.query(inInfo, HGSJ002.QUERY, new HGSJ002());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),null);
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ002.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ002.FIELD_STATUS, CommonConstant.YesNo.YES_1);
return super.query(inInfo, HGSJ002.QUERY, new HGSJ002());
}
}
<?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-05-15 18:59:20
Version : 1.0
schema : hggp
tableName : HGPZ005A
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
PROCESS_CODE VARCHAR NOT NULL,
PROCESS_NAME VARCHAR NOT NULL,
COMPOSING_COEFF VARCHAR,
UNIT_COEFF VARCHAR,
PARENT_ID BIGINT
-->
<sqlMap namespace="HGPZ005A">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processCode">
PROCESS_CODE = #processCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processName">
PROCESS_NAME LIKE CONCAT('%', #processName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="composingCoeff">
COMPOSING_COEFF = #composingCoeff#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unitCoeff">
UNIT_COEFF = #unitCoeff#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processClass">
PROCESS_CLASS = #processClass#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.pz.domain.HGPZ005A">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 帐套编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
PROCESS_CODE as "processCode", <!-- 工序编码 -->
PROCESS_NAME as "processName", <!-- 工序名称 -->
COMPOSING_COEFF as "composingCoeff", <!-- 排产系数 -->
UNIT_COEFF as "unitCoeff", <!-- 单价系数 -->
PROCESS_CLASS as "processClass", <!-- 工序类别 -->
PARENT_ID as "parentId" <!-- 上级ID -->
FROM ${hggpSchema}.HGPZ005A WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME asc, ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ005A WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processCode">
PROCESS_CODE = #processCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processName">
PROCESS_NAME = #processName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="composingCoeff">
COMPOSING_COEFF = #composingCoeff#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unitCoeff">
UNIT_COEFF = #unitCoeff#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processClass">
PROCESS_CLASS = #processClass#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGPZ005A (ID,
ACCOUNT_CODE, <!-- 帐套编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_NAME, <!-- 更新人名称 -->
UPDATED_TIME, <!-- 更新时间 -->
DELETE_FLAG, <!-- 是否删除0.否1.是 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
PROCESS_CODE, <!-- 工序编码 -->
PROCESS_NAME, <!-- 工序名称 -->
COMPOSING_COEFF, <!-- 排产系数 -->
UNIT_COEFF, <!-- 单价系数 -->
PROCESS_CLASS, <!-- 工序类别 -->
PARENT_ID <!-- 上级ID -->
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #processCode#, #processName#, #composingCoeff#, #unitCoeff#, #processClass#, #parentId#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGPZ005A WHERE
ID = #id#
</delete>
<delete id="deleteByParentId">
DELETE FROM ${hggpSchema}.HGPZ005A WHERE PARENT_ID = #parentId#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGPZ005A
SET
ACCOUNT_CODE = #accountCode#, <!-- 帐套编码 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0.否1.是 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
PROCESS_CODE = #processCode#, <!-- 工序编码 -->
PROCESS_NAME = #processName#, <!-- 工序名称 -->
COMPOSING_COEFF = #composingCoeff#, <!-- 排产系数 -->
UNIT_COEFF = #unitCoeff#, <!-- 单价系数 -->
PROCESS_CLASS = #processClass#, <!-- 工序类别 -->
PARENT_ID = #parentId# <!-- 上级ID -->
WHERE
ID = #id#
</update>
<select id="queryEdcm01" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
ITEM_CODE as "itemCode",
ITEM_CNAME as "itemCname"
from ${platSchema}.TEDCM01
where CODESET_CODE = #codesetCode#
<isNotEmpty prepend=" AND " property="itemCode">
ITEM_CODE = #itemCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemCodes">
ITEM_CODE in <iterate property="itemCodes" open="(" close=")" conjunction=","> #itemCodes[]# </iterate>
</isNotEmpty>
</select>
</sqlMap>
$(function (){
var processCodes = __eiInfo.getBlock("processCode_block_id").getMappedRows();
var itemCodeBox = __eiInfo.getBlock("item_code_box_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
/* 页面查询框的尺寸设置 */
$.extend(true, IPLATUI.Config, {
EFGrid: {
height: $(document).height() - $("#inqu").height() - $("#ef_form_head").height() - 100,
}
});
IPLATUI.EFGrid = {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
{
field: "processCode",
template: function (dataItem) {
for (let i = 0; i < processCodes.length; i++) {
if (processCodes[i]['valueField'] === dataItem['processCode']) {
dataItem['processName'] = processCodes[i]['textField'].split("]")[1];
return processCodes[i]['textField'].split("]")[1];
}
}
return dataItem['processCode'];
},
},{
field: "processClass",
template: function (dataItem) {
for (let i = 0; i < itemCodeBox.length; i++) {
if (itemCodeBox[i]['valueField'] === dataItem['processClass']) {
return itemCodeBox[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let eiInfo = new EiInfo();
eiInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
eiInfo.set("inqu_status-0-processCode", options.model["processCode"]);
eiInfo.set("serviceName", "HGPZ005A");
eiInfo.set("methodName", "queryEdcm01");
eiInfo.set("blockId", "item_code_box_block_id");
eiInfo.set("field", options.field);
refreshSelect(container,eiInfo);
}
}
],
loadComplete: function(grid) {},
afterEdit:function (e) {},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {},
exportGrid : {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "工艺流程详情_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls",
exportBlockId: "result",
}
}
}
downKeyUp();
})
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let processCode= item.get("processCode");
let composingCoeff= item.get("composingCoeff");
let unitCoeff= item.get("unitCoeff");
let processClass= item.get("processClass");
if(isBlank(processCode)){
message("选中的第"+(index+1)+"行\"工序名称\",不能为空!");
flag = false;
return false;
}
if(isBlank(composingCoeff)){
message("选中的第"+(index+1)+"行\"排产系数\",不能为空!");
flag = false;
return false;
}
if(isBlank(unitCoeff)){
message("选中的第"+(index+1)+"行\"单价系数\",不能为空!");
flag = false;
return false;
}
if(isBlank(processClass)){
message("选中的第"+(index+1)+"行\"工序类别\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGPZ005A", "save", true,
function (e) {
query();
});
btnNode.attr("disabled", false);
}
});
}
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/5/15
Time: 19:21
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="工艺流程详情">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<%--<EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="公司名称" colWidth="3" filter="contains" readonly="true">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="flowCode" cname="流程编码" colWidth="3" readonly="true"/>
<EF:EFInput blockId="inqu_status" row="0" ename="flowName" cname="流程名称" colWidth="3" readonly="true"/>--%>
<EF:EFInput blockId="inqu_status" row="0" ename="processName" cname="工序名称" colWidth="3" placeholder="模糊查询"/>
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" type="hidden" 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:EFComboColumn ename="processCode" cname="工序名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true" readonly="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="processCode_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="processName" cname="工序名称" hidden="true"/>
<EF:EFColumn ename="composingCoeff" cname="排产系数" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="unitCoeff" cname="单价系数" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="processClass" cname="工序分类" width="120" enable="true" align="center" required="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function (){
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
/* 页面查询框的尺寸设置 */
$.extend(true, IPLATUI.Config, {
EFGrid: {
height: $(document).height() - $("#inqu").height() - $("#ef_form_head").height() - 100,
}
});
IPLATUI.EFGrid = {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
],
loadComplete: function(grid) {
},
afterEdit:function (e) {
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {},
exportGrid : {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "工艺流程_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls",
exportBlockId: "result",
}
}
}
$("#result").on("click", function () {
let id = $("#inqu_status-0-parentId").val();
let rows = resultGrid.getCheckedRows();
parent.JSColorbox.setValueCallback({"id":id,"rows":rows[0]});
parent.JSColorbox.close();
});
})
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/5/15
Time: 22:39
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="工艺流程">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="flowName" cname="流程名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="上级ID" colWidth="3" type="hidden"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="single" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true" checkMode ="single"/>
<EF:EFComboColumn ename="factoryCode" cname="公司名称" enable="false"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="flowCode" cname="流程编码" enable="false" width="100" align="center"/>
<EF:EFColumn ename="flowName" cname="流程名称" enable="false" width="120" readonly="false" align="center" required="true"/>
</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