Commit e7be94f6 by wancheng

配置管理更新

parent f625adf0
......@@ -55,6 +55,13 @@ public enum DdynamicEnum {
INVENT_TYPE_BLOCK_ID("invent_type_block_id","inventType","inventTypeName","HGPZ004.queryComboBox"),
/**
* 模块:存货类型
* 用途:父级存货类型下拉框
* 编写:
*/
PAR_INVENT_TYPE_BLOCK_ID("par_invent_type_block_id","parInventType","parInventTypeName","HGPZ004.queryParComboBox"),
/**
* 模块:存货档案
* 用途:存货档案下拉框
* 编写:
......@@ -66,7 +73,7 @@ public enum DdynamicEnum {
* 用途:仓库类型下拉框
* 编写:
*/
WH_TYPE_BLOCK_ID("WH_type_block_id","whType","whTypeName","HGPZ006.queryComboBox"),
WH_TYPE_BLOCK_ID("wh_type_block_id","whType","whTypeName","HGPZ006.queryComboBox"),
/**
* 模块:仓库档案
......
......@@ -30,7 +30,7 @@ public class HGPZ005 extends DaoEPBase {
public static final String FIELD_INVENT_NAME = "inventName"; /* 存货名称*/
public static final String FIELD_SPEC = "spec"; /* 规格*/
public static final String FIELD_LENGTH = "length"; /* 长*/
public static final String FIELD_width = "width"; /* 宽*/
public static final String FIELD_WIDTH = "width"; /* 宽*/
public static final String FIELD_THICK = "thick"; /* 厚*/
public static final String FIELD_MATERIAL = "material"; /* 材质*/
public static final String FIELD_COEFFICIENT = "coefficient"; /* 系数*/
......@@ -52,7 +52,7 @@ public class HGPZ005 extends DaoEPBase {
public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 存货名称*/
public static final String COL_SPEC = "SPEC"; /* 规格*/
public static final String COL_LENGTH = "LENGTH"; /* 长*/
public static final String COL_width = "width"; /* 宽*/
public static final String COL_WIDTH = "width"; /* 宽*/
public static final String COL_THICK = "THICK"; /* 厚*/
public static final String COL_MATERIAL = "MATERIAL"; /* 材质*/
public static final String COL_COEFFICIENT = "COEFFICIENT"; /* 系数*/
......@@ -75,7 +75,7 @@ public class HGPZ005 extends DaoEPBase {
private Long id = new Long(0);
private String accountCode = " "; /* 帐套编码*/
private String depCode = " "; /* 部门编码*/
private Integer inventType; /* 存货类型*/
private String inventType = " ";; /* 存货类型*/
private String inventCode = " "; /* 存货编码*/
private String inventName = " "; /* 存货名称*/
private String spec = " "; /* 规格*/
......@@ -136,7 +136,7 @@ public class HGPZ005 extends DaoEPBase {
eiColumn.setDescName("长");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_width);
eiColumn = new EiColumn(FIELD_WIDTH);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12);
......@@ -259,7 +259,7 @@ public class HGPZ005 extends DaoEPBase {
* get the inventType - 存货类型.
* @return the inventType
*/
public Integer getInventType() {
public String getInventType() {
return this.inventType;
}
......@@ -268,7 +268,7 @@ public class HGPZ005 extends DaoEPBase {
*
* @param inventType - 存货类型
*/
public void setInventType(Integer inventType) {
public void setInventType(String inventType) {
this.inventType = inventType;
}
/**
......@@ -554,12 +554,12 @@ public class HGPZ005 extends DaoEPBase {
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));
setInventType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_INVENT_TYPE)), inventType));
setInventType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_TYPE)), inventType));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode));
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SPEC)), spec));
setLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_LENGTH)), length));
setWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_width)), width));
setWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WIDTH)), width));
setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_THICK)), thick));
setMaterial(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MATERIAL)), material));
setCoefficient(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_COEFFICIENT)), coefficient));
......@@ -589,7 +589,7 @@ public class HGPZ005 extends DaoEPBase {
map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME)));
map.put(FIELD_SPEC, StringUtils.toString(spec, eiMetadata.getMeta(FIELD_SPEC)));
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_WIDTH, StringUtils.toString(width, eiMetadata.getMeta(FIELD_WIDTH)));
map.put(FIELD_THICK, StringUtils.toString(thick, eiMetadata.getMeta(FIELD_THICK)));
map.put(FIELD_MATERIAL, StringUtils.toString(material, eiMetadata.getMeta(FIELD_MATERIAL)));
map.put(FIELD_COEFFICIENT, StringUtils.toString(coefficient, eiMetadata.getMeta(FIELD_COEFFICIENT)));
......
......@@ -63,7 +63,6 @@ public class ServiceHGPZ001 extends ServiceBase {
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGPZ001.QUERY, new HGPZ001());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
......
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.HGPZ002;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 客户档案
*
* @author:
* @date:2024/1/15,11:20
*/
public class ServiceHGPZ002 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "客户档案", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_TYPE_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGPZ002().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "客户档案", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGPZ002.QUERY, new HGPZ002());
} 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();
// 数据校验
this.checkSaveData(resultRows);
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGPZ002 hgpz002 = new HGPZ002();
hgpz002.fromMap(resultRows.get(i));
if (hgpz002.getId() == null || hgpz002.getId() == 0) {
this.add(hgpz002);
} else {
this.modify(hgpz002);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param resultRows
*/
private void checkSaveData(List<Map> resultRows) {
// 数据校验
for (int i = 0; i < resultRows.size(); i++) {
HGPZ002 hgpz002 = new HGPZ002();
hgpz002.fromMap(resultRows.get(i));
AssertUtils.isNull(hgpz002.getStatus(), "是否启用不能为空");
}
}
/**
* 新增
*
* @param hgpz002
* @throws Exception
*/
private void add(HGPZ002 hgpz002) throws Exception {
hgpz002.setCustCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CUST_CODE));
DaoUtils.insert(HGPZ002.INSERT, hgpz002);
}
/**
* 修改数据
*
* @param hgpz002
*/
private void modify(HGPZ002 hgpz002) {
DaoUtils.update(HGPZ002.UPDATE, hgpz002);
}
/**
* 新增操作.
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "客户档案", operType = "新增", operDesc = "新增")
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 数据写入
for (int i = 0; i < resultRows.size(); i++) {
HGPZ002 hgpz002 = new HGPZ002();
hgpz002.fromMap(resultRows.get(i));
this.add(hgpz002);
}
inInfo = this.query(inInfo);
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 = "修改操作")
public EiInfo update(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
for (int i = 0; i < resultRows.size(); i++) {
HGPZ002 hppz009 = new HGPZ002();
hppz009.fromMap(resultRows.get(i));
DaoUtils.update(HGPZ002.UPDATE, hppz009);
}
inInfo = this.query(inInfo);
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 = "删除操作")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGPZ002 hgpz002 = new HGPZ002();
hgpz002.fromMap(resultRows.get(i));
// 校验企业下是否存在用户
int count = HGXSTools.XsUser.countByAccount(hgpz002.getAccountCode());
if (count > 0) {
// throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", hgpz002.getAccountName()));
}
DaoUtils.update(HGPZ002.DELETE, hgpz002);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.pz.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
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.HGPZ003;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 供应商档案
*
* @author:songx
* @date:2024/1/15,11:20
*/
public class ServiceHGPZ003 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "供应商档案", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGPZ003().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "供应商档案", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGPZ003.QUERY, new HGPZ003());
} 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();
// 数据校验
this.checkSaveData(resultRows);
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGPZ003 hgpz003 = new HGPZ003();
hgpz003.fromMap(resultRows.get(i));
if (hgpz003.getId() == null || hgpz003.getId() == 0) {
this.add(hgpz003);
} else {
this.modify(hgpz003);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param resultRows
*/
private void checkSaveData(List<Map> resultRows) {
// 数据校验
for (int i = 0; i < resultRows.size(); i++) {
HGPZ003 hgpz003 = new HGPZ003();
hgpz003.fromMap(resultRows.get(i));
AssertUtils.isNull(hgpz003.getStatus(), "是否启用不能为空");
}
}
/**
* 新增
*
* @param hgpz003
* @throws Exception
*/
private void add(HGPZ003 hgpz003) throws Exception {
hgpz003.setSupCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.SUP_CODE));
DaoUtils.insert(HGPZ003.INSERT, hgpz003);
}
/**
* 修改数据
*
* @param hgpz003
*/
private void modify(HGPZ003 hgpz003) {
DaoUtils.update(HGPZ003.UPDATE, hgpz003);
}
/**
* 新增操作.
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "供应商档案", operType = "新增", operDesc = "新增")
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 数据写入
for (int i = 0; i < resultRows.size(); i++) {
HGPZ003 hgpz003 = new HGPZ003();
hgpz003.fromMap(resultRows.get(i));
this.add(hgpz003);
}
inInfo = this.query(inInfo);
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 = "修改操作")
public EiInfo update(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
for (int i = 0; i < resultRows.size(); i++) {
HGPZ003 hppz009 = new HGPZ003();
hppz009.fromMap(resultRows.get(i));
DaoUtils.update(HGPZ003.UPDATE, hppz009);
}
inInfo = this.query(inInfo);
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 = "删除操作")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGPZ003 hgpz003 = new HGPZ003();
hgpz003.fromMap(resultRows.get(i));
// 校验企业下是否存在用户
int count = HGXSTools.XsUser.countByAccount(hgpz003.getAccountCode());
if (count > 0) {
// throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", hgpz003.getAccountName()));
}
DaoUtils.update(HGPZ003.DELETE, hgpz003);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
}
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.HGPZ004;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 存货类型
*
* @author:songx
* @date:2024/1/15,11:20
*/
public class ServiceHGPZ004 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "存货类型", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGPZ004().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "存货类型", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGPZ004.QUERY, new HGPZ004());
} 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();
// 数据校验
this.checkSaveData(resultRows);
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGPZ004 hgpz004 = new HGPZ004();
hgpz004.fromMap(resultRows.get(i));
if (hgpz004.getId() == null || hgpz004.getId() == 0) {
this.add(hgpz004);
} else {
this.modify(hgpz004);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param resultRows
*/
private void checkSaveData(List<Map> resultRows) {
// 数据校验
for (int i = 0; i < resultRows.size(); i++) {
HGPZ004 hgpz004 = new HGPZ004();
hgpz004.fromMap(resultRows.get(i));
AssertUtils.isNull(hgpz004.getStatus(), "是否启用不能为空");
}
}
/**
* 新增企业信息
*
* @param hgpz004
* @throws Exception
*/
private void add(HGPZ004 hgpz004) throws Exception {
hgpz004.setInventType(SequenceGenerator.getNextSequence(HGConstant.SequenceId.INVENT_TYPE));
DaoUtils.insert(HGPZ004.INSERT, hgpz004);
}
/**
* 修改数据
*
* @param hgpz004
*/
private void modify(HGPZ004 hgpz004) {
DaoUtils.update(HGPZ004.UPDATE, hgpz004);
}
/**
* 新增操作.
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "存货类型", operType = "新增", operDesc = "新增")
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 数据写入
for (int i = 0; i < resultRows.size(); i++) {
HGPZ004 hgpz004 = new HGPZ004();
hgpz004.fromMap(resultRows.get(i));
this.add(hgpz004);
}
inInfo = this.query(inInfo);
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 = "修改操作")
public EiInfo update(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
for (int i = 0; i < resultRows.size(); i++) {
HGPZ004 hppz009 = new HGPZ004();
hppz009.fromMap(resultRows.get(i));
DaoUtils.update(HGPZ004.UPDATE, hppz009);
}
inInfo = this.query(inInfo);
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 = "删除操作")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGPZ004 hgpz004 = new HGPZ004();
hgpz004.fromMap(resultRows.get(i));
// 校验企业下是否存在用户
int count = HGXSTools.XsUser.countByAccount(hgpz004.getAccountCode());
if (count > 0) {
// throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", hgpz004.getAccountName()));
}
DaoUtils.update(HGPZ004.DELETE, hgpz004);
}
inInfo = this.query(inInfo);
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 = "下拉框")
public EiInfo queryParComboBox(EiInfo inInfo) {
try {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.PAR_INVENT_TYPE_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询规格失败");
}
return inInfo;
}
}
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.HGPZ005;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 存货档案
*
* @author:songx
* @date:2024/1/15,11:20
*/
public class ServiceHGPZ005 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "存货档案", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_TYPE_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGPZ005().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "存货档案", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGPZ005.QUERY, new HGPZ005());
} 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();
// 数据校验
this.checkSaveData(resultRows);
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGPZ005 hgpz005 = new HGPZ005();
hgpz005.fromMap(resultRows.get(i));
// 设置规格
if (StringUtils.isBlank(hgpz005.getSpec())) {
hgpz005.setSpec(HGPZTools.HgPz005.jointSpec(hgpz005.getLength(), hgpz005.getWidth(), hgpz005.getThick()));
}
// 去除空格
hgpz005.setSpec(StringUtils.trimToEmpty(hgpz005.getSpec()));
if (hgpz005.getId() == null || hgpz005.getId() == 0) {
this.add(hgpz005);
} else {
this.modify(hgpz005);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param resultRows
*/
private void checkSaveData(List<Map> resultRows) {
// 数据校验
for (int i = 0; i < resultRows.size(); i++) {
HGPZ005 hgpz005 = new HGPZ005();
hgpz005.fromMap(resultRows.get(i));
AssertUtils.isNull(hgpz005.getStatus(), "是否启用不能为空");
}
}
/**
* 新增企业信息
*
* @param hgpz005
* @throws Exception
*/
private void add(HGPZ005 hgpz005) throws Exception {
hgpz005.setInventCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.INVENT_CODE));
DaoUtils.insert(HGPZ005.INSERT, hgpz005);
}
/**
* 修改数据
*
* @param hgpz005
*/
private void modify(HGPZ005 hgpz005) {
DaoUtils.update(HGPZ005.UPDATE, hgpz005);
}
/**
* 新增操作.
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "存货档案", operType = "新增", operDesc = "新增")
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 数据写入
for (int i = 0; i < resultRows.size(); i++) {
HGPZ005 hgpz005 = new HGPZ005();
hgpz005.fromMap(resultRows.get(i));
this.add(hgpz005);
}
inInfo = this.query(inInfo);
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 = "修改操作")
public EiInfo update(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
for (int i = 0; i < resultRows.size(); i++) {
HGPZ005 hppz009 = new HGPZ005();
hppz009.fromMap(resultRows.get(i));
DaoUtils.update(HGPZ005.UPDATE, hppz009);
}
inInfo = this.query(inInfo);
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 = "删除操作")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGPZ005 hgpz005 = new HGPZ005();
hgpz005.fromMap(resultRows.get(i));
// 校验企业下是否存在用户
int count = HGXSTools.XsUser.countByAccount(hgpz005.getAccountCode());
if (count > 0) {
// throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", hgpz005.getAccountName()));
}
DaoUtils.update(HGPZ005.DELETE, hgpz005);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.pz.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
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.HGPZ006;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 仓库类型
*
* @author:songx
* @date:2024/1/15,11:20
*/
public class ServiceHGPZ006 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "仓库类型", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGPZ006().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "仓库类型", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGPZ006.QUERY, new HGPZ006());
} 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();
// 数据校验
this.checkSaveData(resultRows);
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGPZ006 hgpz006 = new HGPZ006();
hgpz006.fromMap(resultRows.get(i));
if (hgpz006.getId() == null || hgpz006.getId() == 0) {
this.add(hgpz006);
} else {
this.modify(hgpz006);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param resultRows
*/
private void checkSaveData(List<Map> resultRows) {
// 数据校验
for (int i = 0; i < resultRows.size(); i++) {
HGPZ006 hgpz006 = new HGPZ006();
hgpz006.fromMap(resultRows.get(i));
AssertUtils.isNull(hgpz006.getStatus(), "是否启用不能为空");
}
}
/**
* 新增企业信息
*
* @param hgpz006
* @throws Exception
*/
private void add(HGPZ006 hgpz006) throws Exception {
hgpz006.setWhType(SequenceGenerator.getNextSequence(HGConstant.SequenceId.WH_TYPE));
DaoUtils.insert(HGPZ006.INSERT, hgpz006);
}
/**
* 修改数据
*
* @param hgpz006
*/
private void modify(HGPZ006 hgpz006) {
DaoUtils.update(HGPZ006.UPDATE, hgpz006);
}
/**
* 新增操作.
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "仓库类型", operType = "新增", operDesc = "新增")
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 数据写入
for (int i = 0; i < resultRows.size(); i++) {
HGPZ006 hgpz006 = new HGPZ006();
hgpz006.fromMap(resultRows.get(i));
this.add(hgpz006);
}
inInfo = this.query(inInfo);
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 = "修改操作")
public EiInfo update(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
for (int i = 0; i < resultRows.size(); i++) {
HGPZ006 hppz009 = new HGPZ006();
hppz009.fromMap(resultRows.get(i));
DaoUtils.update(HGPZ006.UPDATE, hppz009);
}
inInfo = this.query(inInfo);
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 = "删除操作")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGPZ006 hgpz006 = new HGPZ006();
hgpz006.fromMap(resultRows.get(i));
// 校验企业下是否存在用户
int count = HGXSTools.XsUser.countByAccount(hgpz006.getAccountCode());
if (count > 0) {
// throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", hgpz006.getAccountName()));
}
DaoUtils.update(HGPZ006.DELETE, hgpz006);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
}
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.HGPZ007;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 仓库档案
*
* @author:
* @date:2024/1/15,11:20
*/
public class ServiceHGPZ007 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "仓库档案", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_TYPE_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGPZ007().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "仓库档案", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGPZ007.QUERY, new HGPZ007());
} 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();
// 数据校验
this.checkSaveData(resultRows);
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGPZ007 hgpz007 = new HGPZ007();
hgpz007.fromMap(resultRows.get(i));
if (hgpz007.getId() == null || hgpz007.getId() == 0) {
this.add(hgpz007);
} else {
this.modify(hgpz007);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param resultRows
*/
private void checkSaveData(List<Map> resultRows) {
// 数据校验
for (int i = 0; i < resultRows.size(); i++) {
HGPZ007 hgpz007 = new HGPZ007();
hgpz007.fromMap(resultRows.get(i));
AssertUtils.isNull(hgpz007.getStatus(), "是否启用不能为空");
}
}
/**
* 新增企业信息
*
* @param hgpz007
* @throws Exception
*/
private void add(HGPZ007 hgpz007) throws Exception {
hgpz007.setWhCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.WH_CODE));
DaoUtils.insert(HGPZ007.INSERT, hgpz007);
}
/**
* 修改数据
*
* @param hgpz007
*/
private void modify(HGPZ007 hgpz007) {
DaoUtils.update(HGPZ007.UPDATE, hgpz007);
}
/**
* 新增操作.
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "仓库档案", operType = "新增", operDesc = "新增")
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 数据写入
for (int i = 0; i < resultRows.size(); i++) {
HGPZ007 hgpz007 = new HGPZ007();
hgpz007.fromMap(resultRows.get(i));
this.add(hgpz007);
}
inInfo = this.query(inInfo);
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 = "修改操作")
public EiInfo update(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
for (int i = 0; i < resultRows.size(); i++) {
HGPZ007 hppz009 = new HGPZ007();
hppz009.fromMap(resultRows.get(i));
DaoUtils.update(HGPZ007.UPDATE, hppz009);
}
inInfo = this.query(inInfo);
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 = "删除操作")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGPZ007 hgpz007 = new HGPZ007();
hgpz007.fromMap(resultRows.get(i));
// 校验企业下是否存在用户
int count = HGXSTools.XsUser.countByAccount(hgpz007.getAccountCode());
if (count > 0) {
//throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", hgpz007.getAccountName()));
}
DaoUtils.update(HGPZ007.DELETE, hgpz007);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
}
......@@ -63,8 +63,6 @@ public class ServiceHGPZ008 extends ServiceBase {
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGPZ008.QUERY, new HGPZ008());
String projectEnv = ProjectInfo.getProjectEnv();
inInfo.setCell(EiConstant.resultBlock, ACConstants.ROW_CODE_0, "projectEnv", projectEnv);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
......
package com.baosight.hggp.hg.pz.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
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.HGPZ010;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 库存预警
*
* @author:songx
* @date:2024/1/15,11:20
*/
public class ServiceHGPZ010 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "库存预警", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGPZ010().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "库存预警", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGPZ010.QUERY, new HGPZ010());
} 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();
// 数据校验
this.checkSaveData(resultRows);
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGPZ010 hgpz010 = new HGPZ010();
hgpz010.fromMap(resultRows.get(i));
if (hgpz010.getId() == null || hgpz010.getId() == 0) {
this.add(hgpz010);
} else {
this.modify(hgpz010);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param resultRows
*/
private void checkSaveData(List<Map> resultRows) {
// 数据校验
for (int i = 0; i < resultRows.size(); i++) {
HGPZ010 hgpz010 = new HGPZ010();
hgpz010.fromMap(resultRows.get(i));
}
}
/**
* 新增企业信息
*
* @param hgpz010
* @throws Exception
*/
private void add(HGPZ010 hgpz010) throws Exception {
DaoUtils.insert(HGPZ010.INSERT, hgpz010);
}
/**
* 修改数据
*
* @param hgpz010
*/
private void modify(HGPZ010 hgpz010) {
DaoUtils.update(HGPZ010.UPDATE, hgpz010);
}
/**
* 新增操作.
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "库存预警", operType = "新增", operDesc = "新增")
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 数据写入
for (int i = 0; i < resultRows.size(); i++) {
HGPZ010 hgpz010 = new HGPZ010();
hgpz010.fromMap(resultRows.get(i));
this.add(hgpz010);
}
inInfo = this.query(inInfo);
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 = "修改操作")
public EiInfo update(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
for (int i = 0; i < resultRows.size(); i++) {
HGPZ010 hgpz010 = new HGPZ010();
hgpz010.fromMap(resultRows.get(i));
DaoUtils.update(HGPZ010.UPDATE, hgpz010);
}
inInfo = this.query(inInfo);
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 = "删除操作")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGPZ010 hgpz010 = new HGPZ010();
hgpz010.fromMap(resultRows.get(i));
// 校验企业下是否存在用户
int count = HGXSTools.XsUser.countByAccount(hgpz010.getAccountCode());
if (count > 0) {
// throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", hgpz010.getAccountName()));
}
DaoUtils.update(HGPZ010.DELETE, hgpz010);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
}
......@@ -98,7 +98,7 @@
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag" <!-- 是否删除0.否1.是 -->
FROM ${hggpSchema}.HGPZ001 WHERE 1=1
FROM ${hggpSchema}.HGPZ001 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<include refid="authCondition" />
<dynamic prepend="ORDER BY">
......@@ -113,7 +113,7 @@
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ001 WHERE 1=1
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ001 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<include refid="authCondition" />
</select>
......
......@@ -153,7 +153,7 @@
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag" <!-- 是否删除0.否1.是 -->
FROM ${hggpSchema}.HGPZ002 WHERE 1=1
FROM ${hggpSchema}.HGPZ002 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<include refid="authCondition" />
<dynamic prepend="ORDER BY">
......@@ -168,7 +168,7 @@
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ002 WHERE 1=1
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ002 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<include refid="authCondition" />
</select>
......
......@@ -153,7 +153,7 @@
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag" <!-- 是否删除0:否1.是 -->
FROM ${hggpSchema}.HGPZ003 WHERE 1=1
FROM ${hggpSchema}.HGPZ003 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<include refid="authCondition" />
<dynamic prepend="ORDER BY">
......@@ -168,7 +168,7 @@
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ003 WHERE 1=1
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ003 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<include refid="authCondition" />
</select>
......
......@@ -36,7 +36,7 @@
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypeName">
INVENT_TYPE_NAME = #inventTypeName#
INVENT_TYPE_NAME LIKE CONCAT('%', #inventTypeName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parInventType">
PAR_INVENT_TYPE = #parInventType#
......@@ -108,7 +108,7 @@
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag" <!-- 是否删除0.否1.是 -->
FROM ${hggpSchema}.HGPZ004 WHERE 1=1
FROM ${hggpSchema}.HGPZ004 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<include refid="authCondition" />
<dynamic prepend="ORDER BY">
......@@ -123,7 +123,7 @@
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ004 WHERE 1=1
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ004 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<include refid="authCondition" />
</select>
......@@ -238,4 +238,25 @@
ORDER BY INVENT_TYPE
</select>
<select id="queryParComboBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT 'root' as "parInventType",'根目录' as "parInventTypeName"
FROM DUAL
UNION ALL
(SELECT DISTINCT
INVENT_TYPE as "parInventType",
INVENT_TYPE_NAME as "parInventTypeName"
FROM ${hggpSchema}.HGPZ004
WHERE DELETE_FLAG = 0
AND STATUS=1
AND PAR_INVENT_TYPE = 'root'
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE <![CDATA[ <> ]]> #inventType#
</isNotEmpty>
ORDER BY INVENT_TYPE)
</select>
</sqlMap>
......@@ -12,7 +12,7 @@
INVENT_NAME VARCHAR NOT NULL,
SPEC VARCHAR,
LENGTH DECIMAL,
width DECIMAL,
WIDTH DECIMAL,
THICK DECIMAL,
MATERIAL VARCHAR,
COEFFICIENT DECIMAL,
......@@ -45,7 +45,7 @@
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
INVENT_NAME LIKE CONCAT('%', #inventName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
SPEC = #spec#
......@@ -54,7 +54,7 @@
LENGTH = #length#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="width">
width = #width#
WIDTH = #width#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thick">
THICK = #thick#
......@@ -125,7 +125,7 @@
INVENT_NAME as "inventName", <!-- 存货名称 -->
SPEC as "spec", <!-- 规格 -->
LENGTH as "length", <!-- 长 -->
width as "width", <!-- 宽 -->
WIDTH as "width", <!-- 宽 -->
THICK as "thick", <!-- 厚 -->
MATERIAL as "material", <!-- 材质 -->
COEFFICIENT as "coefficient", <!-- 系数 -->
......@@ -138,7 +138,7 @@
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag" <!-- 是否删除0.否1.是 -->
FROM ${hggpSchema}.HGPZ005 WHERE 1=1
FROM ${hggpSchema}.HGPZ005 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<include refid="authCondition" />
<dynamic prepend="ORDER BY">
......@@ -153,7 +153,7 @@
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ005 WHERE 1=1
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ005 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<include refid="authCondition" />
</select>
......@@ -184,7 +184,7 @@
LENGTH = #length#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="width">
width = #width#
WIDTH = #width#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thick">
THICK = #thick#
......@@ -233,7 +233,7 @@
INVENT_NAME, <!-- 存货名称 -->
SPEC, <!-- 规格 -->
LENGTH, <!-- 长 -->
width, <!-- 宽 -->
WIDTH, <!-- 宽 -->
THICK, <!-- 厚 -->
MATERIAL, <!-- 材质 -->
COEFFICIENT, <!-- 系数 -->
......@@ -264,7 +264,7 @@
INVENT_NAME = #inventName#, <!-- 存货名称 -->
SPEC = #spec#, <!-- 规格 -->
LENGTH = #length#, <!-- 长 -->
width = #width#, <!-- 宽 -->
WIDTH = #width#, <!-- 宽 -->
THICK = #thick#, <!-- 厚 -->
MATERIAL = #material#, <!-- 材质 -->
COEFFICIENT = #coefficient#, <!-- 系数 -->
......
......@@ -34,7 +34,7 @@
WH_TYPE = #whType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whTypeName">
WH_TYPE_NAME = #whTypeName#
WH_TYPE_NAME LIKE CONCAT('%', #whTypeName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
......@@ -98,7 +98,7 @@
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag" <!-- 是否删除0.否1.是 -->
FROM ${hggpSchema}.HGPZ006 WHERE 1=1
FROM ${hggpSchema}.HGPZ006 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<include refid="authCondition" />
<dynamic prepend="ORDER BY">
......@@ -113,7 +113,7 @@
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ006 WHERE 1=1
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ006 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<include refid="authCondition" />
</select>
......
......@@ -39,7 +39,7 @@
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
WH_NAME LIKE CONCAT('%', #whName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="princ">
PRINC = #princ#
......@@ -108,7 +108,7 @@
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag" <!-- 是否删除0.否1.是 -->
FROM ${hggpSchema}.HGPZ007 WHERE 1=1
FROM ${hggpSchema}.HGPZ007 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<include refid="authCondition" />
<dynamic prepend="ORDER BY">
......@@ -123,7 +123,7 @@
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ007 WHERE 1=1
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ007 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<include refid="authCondition" />
</select>
......
......@@ -98,7 +98,7 @@
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag" <!-- 是否删除0.否1.是 -->
FROM ${hggpSchema}.HGPZ008 WHERE 1=1
FROM ${hggpSchema}.HGPZ008 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<include refid="authCondition" />
<dynamic prepend="ORDER BY">
......@@ -113,7 +113,7 @@
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ008 WHERE 1=1
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ008 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<include refid="authCondition" />
</select>
......
......@@ -128,7 +128,7 @@
INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID -->
WARN_NUM as "warnNum", <!-- 预警数量 -->
REMARK as "remark" <!-- 备注 -->
FROM ${hggpSchema}.HGPZ010 WHERE 1=1
FROM ${hggpSchema}.HGPZ010 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<include refid="authCondition" />
<dynamic prepend="ORDER BY">
......@@ -143,7 +143,7 @@
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ010 WHERE 1=1
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ010 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<include refid="authCondition" />
</select>
......
......@@ -2,14 +2,26 @@ package com.baosight.hggp.hg.pz.tools;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.ValidFlagEnum;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
......@@ -57,5 +69,272 @@ public class HGPZTools {
}
}
/**
* HGPZ005 公共DAO定义
*
* @author:songx
* @date:2024/2/6,13:37
*/
public static class HgPz005 {
/**
* 查询
*
* @param id
* @return
*/
public static HGPZ005 get(Long id) {
AssertUtils.isNull(id, "规格ID不能为空");
Map queryMap = new HashMap();
queryMap.put("id", id);
List<HGPZ005> results = DaoBase.getInstance().query(HGPZ005.QUERY, queryMap);
AssertUtils.isEmpty(results, String.format("规格[%s]不存在", id));
return results.get(0);
}
/**
* 查询
*
* @param inventCode
* @param spec
* @return
*/
public static HGPZ005 getBySpec(String inventCode, String spec) {
AssertUtils.isEmpty(inventCode, "存货编码不能为空");
Map queryMap = new HashMap();
queryMap.put("inventCode", inventCode);
if (StringUtils.isBlank(spec)) {
queryMap.put("notSpec", CommonConstant.YesNo.YES);
} else {
queryMap.put("spec", spec);
}
List<HGPZ005> results = DaoBase.getInstance().query(HGPZ005.QUERY, queryMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param ids
* @return
*/
public static List<HGPZ005> list(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("ids", ids);
return DaoBase.getInstance().query(HGPZ005.QUERY, queryMap);
}
/**
* 查询
*
* @param ids
* @return
*/
public static Map<Long, HGPZ005> map(List<Long> ids) {
List<HGPZ005> results = list(ids);
if (CollectionUtils.isEmpty(results)) {
return null;
}
return results.stream().collect(Collectors.toMap(HGPZ005::getId, item -> item));
}
/**
* 计算单重
*
* @param id
* @return
*/
public static BigDecimal calcUnitWeight(Long id) {
HGPZ005 hgpz005 = get(id);
return calcUnitWeight(hgpz005);
}
/**
* 计算单重
*
* @param hgpz005
* @return
*/
public static BigDecimal calcUnitWeight(HGPZ005 hgpz005) {
if ((hgpz005.getLength() == null && hgpz005.getWidth() == null && hgpz005.getThick() == null)
|| hgpz005.getCoefficient() == null) {
return BigDecimal.ZERO;
}
BigDecimal unitWeight = BigDecimal.ONE;
// 长
if (hgpz005.getLength() != null) {
unitWeight = unitWeight.multiply(hgpz005.getLength());
}
// 宽
if (hgpz005.getWidth() != null) {
unitWeight = unitWeight.multiply(hgpz005.getWidth());
}
// 厚
if (hgpz005.getThick() != null) {
unitWeight = unitWeight.multiply(hgpz005.getThick());
}
// 乘以系数,除以1000000=重量(千克KG)
return unitWeight.multiply(hgpz005.getCoefficient()).divide(new BigDecimal("1000000"))
.setScale(3, RoundingMode.HALF_UP);
}
/**
* 拼接规格
*
* @param hgpz005
*/
public static void jointSpec(HGPZ005 hgpz005) {
if (StringUtils.isNotBlank(hgpz005.getSpec())) {
return;
}
hgpz005.setSpec(jointSpec(hgpz005.getLength(), hgpz005.getWidth(), hgpz005.getThick()));
}
/**
* 拼接规格
*
* @param length
* @param width
* @param thick
* @return
*/
public static String jointSpec(BigDecimal length, BigDecimal width, BigDecimal thick) {
StringBuffer sb = new StringBuffer();
if (length != null && length.compareTo(BigDecimal.ZERO) != 0) {
sb.append(length.stripTrailingZeros().toPlainString());
}
if (width != null && width.compareTo(BigDecimal.ZERO) != 0) {
if (StringUtils.isNotBlank(sb)) {
sb.append("*");
}
sb.append(width.stripTrailingZeros().toPlainString());
}
if (thick != null && thick.compareTo(BigDecimal.ZERO) != 0) {
if (StringUtils.isNotBlank(sb)) {
sb.append("*");
}
sb.append(thick.stripTrailingZeros().toPlainString());
}
return sb.toString();
}
/**
* 检查不存在就新增
*
* @param newPz006
* @return
*/
public static HGPZ005 checkAndSave(HGPZ005 newPz006) {
// 检查存货名称是否存在
jointSpec(newPz006);
HGPZ005 specPz006 = getBySpec(newPz006.getInventCode(), newPz006.getSpec());
if (specPz006 != null) {
return specPz006;
} else {
// 生成编码
newPz006.setStatus(CommonConstant.YesNo.YES_1.intValue());
DaoUtils.insert(HGPZ005.INSERT, newPz006);
return newPz006;
}
}
/**
* 判断存货档案是否存在,如果存在返回存货档案,否则新增并返回存货档案
*
* @param inventType 存货类型
* @param inventName 存货名称
* @param length 长
* @param width 宽
* @param thick 厚
* @param coefficient 系数
* @param material 材质
* @param unit 单位
*/
public static HGPZ005 checkAndSave(Integer inventType, String inventName, BigDecimal length,
BigDecimal width, BigDecimal thick, BigDecimal coefficient, String material, String unit) {
// 检查存货名称是否存在
//String inventCode = HGPZTools.HpPz004.checkAndSave(inventType, inventName);
Map queryMap = new HashMap();
queryMap.put("inventType", inventType);
//queryMap.put("inventCode", inventCode);
queryMap.put("inventName", inventName);
queryMap.put("length", length);
queryMap.put("width", width);
queryMap.put("thick", thick);
queryMap.put("material", material);
queryMap.put("coefficient", coefficient);
queryMap.put("unit", unit);
List<HGPZ005> dbPz006s = DaoBase.getInstance().query(HGPZ005.QUERY, queryMap);
if (CollectionUtils.isNotEmpty(dbPz006s)) {
return dbPz006s.get(0);
} else {
// 生成编码
HGPZ005 newPz006 = new HGPZ005();
newPz006.fromMap(queryMap);
newPz006.setStatus(CommonConstant.YesNo.YES_1.intValue());
newPz006.setSpec(jointSpec(newPz006.getLength(), newPz006.getWidth(), newPz006.getThick()));
DaoUtils.insert(HGPZ005.INSERT, newPz006);
return newPz006;
}
}
/**
* 设置用户信息
*
* @param inInfo
* @param idName
*/
public static void setSpecInfo(EiInfo inInfo, String idName) {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<Long> ids = ObjectUtils.listKey(resultRows, idName);
Map<Long, HGPZ005> resultMap = map(ids);
if (MapUtils.isEmpty(resultMap)) {
return;
}
for (Map resultRow : resultRows) {
Long id = MapUtils.getLong(resultRow, idName);
HGPZ005 dbPz006 = resultMap.get(id);
if (dbPz006 == null) {
resultRow.put(HGPZ005.FIELD_SPEC, "");
} else {
resultRow.put(HGPZ005.FIELD_SPEC, "".equals(StringUtils.trim(dbPz006.getSpec()))
? "无规格" : dbPz006.getSpec());
}
resultRow.put(HGPZ005.FIELD_LENGTH, dbPz006 == null ? "" : dbPz006.getLength());
resultRow.put(HGPZ005.FIELD_WIDTH, dbPz006 == null ? "" : dbPz006.getWidth());
resultRow.put(HGPZ005.FIELD_THICK, dbPz006 == null ? "" : dbPz006.getThick());
resultRow.put(HGPZ005.FIELD_COEFFICIENT, dbPz006 == null ? "" : dbPz006.getCoefficient());
resultRow.put(HGPZ005.FIELD_MATERIAL, dbPz006 == null ? "" : dbPz006.getMaterial());
resultRow.put(HGPZ005.FIELD_UNIT, dbPz006 == null ? "" : dbPz006.getUnit());
}
}
/**
* 设置规格
*
* @param bean
* @param keyName
*/
public static void setSpecInfo(DaoEPBase bean, String keyName) {
try {
String inventRecordId = BeanUtils.getProperty(bean, keyName);
if (StringUtils.isBlank(inventRecordId)) {
return;
}
HGPZ005 dbPz06 = get(Long.parseLong(inventRecordId));
BeanUtils.setProperty(bean, HGPZ005.FIELD_SPEC, dbPz06.getSpec());
BeanUtils.setProperty(bean, HGPZ005.FIELD_LENGTH, dbPz06.getLength());
BeanUtils.setProperty(bean, HGPZ005.FIELD_WIDTH, dbPz06.getWidth());
BeanUtils.setProperty(bean, HGPZ005.FIELD_THICK, dbPz06.getThick());
} catch (Throwable e) {
log.warn("设置规格失败:{}", e.getMessage(), e);
}
}
}
}
......@@ -13,7 +13,7 @@ $(function() {
// add: false, // 不显示新增按钮
//add: false, // 不显示取消按钮
// save: true, // 不显示保存按钮
delete: false, // 显示删除按钮
//delete: false, // 显示删除按钮
},
columns: [{
field: "createdName",
......
$(function() {
// 查询
$("#QUERY").on("click", query);
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [{
field: "operator",
template: function (item) {
let filePath = item.filePath;
let template = '';
// 资质详情
if (filePath) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + filePath + ')" >附件</a>';
}
return template
}
},{
field: "createdName",
template: function (options) {
return showUserName(options.createdBy, options.createdName);
}
}, {
field: "updatedName",
template: function (options) {
return showUserName(options.updatedBy, options.updatedName);
}
}],
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
},
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
}
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 附件清单
*
* @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%",
});
}
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let supType= item.get("supType");
let supClass= item.get("supClass");
let supName= item.get("supName");
let headName= item.get("headName");
let phoneName= item.get("phoneName");
let address= item.get("address");
let openBankName= item.get("openBankName");
let accountNum= item.get("accountNum");
let openBankCode= item.get("openBankCode");
let assLevel= item.get("assLevel");
let score= item.get("score");
let status= item.get("status");
if(isBlank(supType)){
message("选中的第"+(index+1)+"行\"供应商类型\",不能为空!");
flag = false;
return false;
}
if(isBlank(supClass)){
message("选中的第"+(index+1)+"行\"供应商类别\",不能为空!");
flag = false;
return false;
}
if(isBlank(supName)){
message("选中的第"+(index+1)+"行\"供应商名称\",不能为空!");
flag = false;
return false;
}
if(isBlank(headName)){
message("选中的第"+(index+1)+"行\"负责人\",不能为空!");
flag = false;
return false;
}
if(isBlank(phoneName)){
message("选中的第"+(index+1)+"行\"负责人联系方式\",不能为空!");
flag = false;
return false;
}
if(isBlank(address)){
message("选中的第"+(index+1)+"行\"地址\",不能为空!");
flag = false;
return false;
}
if(isBlank(status)){
message("选中的第"+(index+1)+"行\"状态\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGPZ002", "save", true);
}
});
}
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGPZ002", "delete", true);
}
});
}
<!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="客户名称" ename="custName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect cname="客户类型" ename="inqu_status-0-custType" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="customer_type_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput cname="联系人" ename="accountName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="custClass" cname="客户类别" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgpz.custClass"/>
</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="operator" cname="操作" enable="false" width="170" locked="true" align="center"/>
<EF:EFColumn cname="客户编码" ename="custCode" enable="false" width="120" align="center"/>
<EF:EFColumn cname="客户名称" ename="custName" width="140" align="center" required="true"/>
<EF:EFComboColumn ename="custType" cname="客户类型" width="100" align="center" defaultValue="" required="true"
filter="contains">
<EF:EFOptions blockId="customer_type_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFComboColumn cname="客户类别" ename="custClass" width="100" align="center" required="true" defaultValue="1">
<EF:EFCodeOption codeName="hggp.hgpz.custClass"/>
</EF:EFComboColumn>
<EF:EFColumn cname="统一社会信用代码" ename="taxRegisterCode" align="center" width="200" readonly="true" enable="false"/>
<EF:EFColumn cname="开户银行" ename="openBankName" align="center" width="200" readonly="true" enable="false"/>
<EF:EFColumn cname="银行账号" ename="accountNum" align="center" width="200" readonly="true" enable="false"/>
<EF:EFColumn cname="地址" ename="docIdPc" align="center" width="200" readonly="true" enable="false"/>
<EF:EFColumn cname="联系人" ename="headName" align="center" width="200" readonly="true" enable="false"/>
<EF:EFColumn cname="电话" ename="phoneName" align="center" width="200" readonly="true" enable="false"
data-regex="/^1[345678]\d{9}$/"
data-errorprompt="请输入正确的手机号!"/>
<EF:EFComboColumn cname="状态" ename="status" width="90" align="center" required="true" defaultValue="1">
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFComboColumn>
<EF:EFColumn cname="创建人" ename="createdName" enable="false" align="center"/>
<EF:EFColumn cname="创建时间" ename="createdTime" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
<EF:EFColumn cname="修改人" ename="updatedName" enable="false" align="center"/>
<EF:EFColumn cname="修改时间" ename="updatedTime" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function() {
// 查询
$("#QUERY").on("click", query);
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [{
field: "createdName",
template: function (options) {
return showUserName(options.createdBy, options.createdName);
}
}, {
field: "updatedName",
template: function (options) {
return showUserName(options.updatedBy, options.updatedName);
}
}],
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
},
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
}
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let custType= item.get("custType");
let custName= item.get("custName");
let companyName= item.get("companyName");
let headName= item.get("headName");
let phoneName= item.get("phoneName");
let address= item.get("address");
let status= item.get("status");
if(isBlank(custType)){
message("选中的第"+(index+1)+"行\"供应商类型\",不能为空!");
flag = false;
return false;
}
if(isBlank(custName)){
message("选中的第"+(index+1)+"行\"供应商名称\",不能为空!");
flag = false;
return false;
}
if(isBlank(companyName)){
message("选中的第"+(index+1)+"行\"公司\",不能为空!");
flag = false;
return false;
}
if(isBlank(headName)){
message("选中的第"+(index+1)+"行\"负责人\",不能为空!");
flag = false;
return false;
}
if(isBlank(phoneName)){
message("选中的第"+(index+1)+"行\"负责人联系方式\",不能为空!");
flag = false;
return false;
}
if(isBlank(address)){
message("选中的第"+(index+1)+"行\"地址\",不能为空!");
flag = false;
return false;
}
if(isBlank(status)){
message("选中的第"+(index+1)+"行\"状态\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGPZ003", "save", true);
}
});
}
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGPZ003", "delete", true);
}
});
}
<!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="供应商名称:" ename="supName" blockId="inqu_status" row="0"/>
<EF:EFSelect cname="供应商类型" ename="inqu_status-0-supType" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="cust_type_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</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 cname="供应商类型" ename="supType" enable="false" width="120" align="center"/>
<EF:EFColumn cname="供应商分类" ename="supClass" width="140" align="center" required="true"/>
<EF:EFColumn cname="供应商编码" ename="supCode" width="80" align="center" readonly="true"/>
<EF:EFColumn cname="供应商名称" ename="supName" align="center" width="200" readonly="true" enable="false"/>
<EF:EFColumn cname="联系人" ename="headName" align="center" width="200" readonly="true"
enable="false"/>
<EF:EFColumn cname="联系人电话" ename="phoneName" align="center" width="200" readonly="true"
enable="false"/>
<EF:EFColumn cname="地址" ename="address" align="center" width="200" readonly="true"
enable="false"/>
<EF:EFColumn cname="开户行全称" ename="openBankName" align="center" width="200" readonly="true"
enable="false"/>
<EF:EFColumn cname="开户行账号" ename="accountNum" align="center" width="200" readonly="true"
enable="false"/>
<EF:EFColumn cname="银行行号" ename="openBankCode" align="center" width="200" readonly="true"
enable="false"/>
<EF:EFColumn cname="评定等级" ename="assLevel" align="center" width="200" readonly="true"
enable="false"/>
<EF:EFColumn cname="综合得分" ename="score" align="center" width="200" readonly="true"
enable="false"/>
<EF:EFComboColumn cname="状态" ename="status" width="90" align="center" required="true" defaultValue="1">
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFComboColumn>
<EF:EFColumn cname="备注" ename="remark" width="150" editType="textarea"/>
<EF:EFColumn cname="创建人" ename="createdName" enable="false" align="center"/>
<EF:EFColumn cname="创建时间" ename="createdTime" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
<EF:EFColumn cname="修改人" ename="updatedName" enable="false" align="center"/>
<EF:EFColumn cname="修改时间" ename="updatedTime" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<EF:EFWindow id="insertGroup" title="企业管理" top="100px" left="280px" width="40%" height="70%">
<form>
<div class="row">
<label for="accountName" class="col-sm-2 col-form-label col-form-label-sm">企业名称</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="accountName" placeholder="企业名称" aria-label="企业名称"
required="required">
</div>
</div>
<div class="form-group row">
<label for="loginPrefix" class="col-sm-2 col-form-label col-form-label-sm">登录前缀</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="loginPrefix" placeholder="登录前缀" aria-label="登录前缀">
</div>
</div>
<div class="form-group row">
<label for="validFlag" class="col-sm-2 col-form-label col-form-label-sm">是否启用</label>
<div class="col-sm-6">
<select class="form-control" id="validFlag">
<option value="1"></option>
<option value="0"></option>
</select>
</div>
</div>
<div class="form-group row">
<label for="docIdPc" class="col-sm-2 col-form-label">PC端log</label>
<div class="col-sm-6">
<EF:EFUpload ename="docIdPc" cname="PC上传" docTag="hk_filePc" path="A"/>
<div class="side-header" id="pc-img" style="background-color: whitesmoke">
<img src="${ctx}/hpjx-logo.png" style="width:200px;height:55px;background-image: none;" alt="pc端log"/>
</div>
</div>
<input type="hidden" id="PCfileDocId" value="">
</div>
<div class="form-group row">
<label for="docIdApp" class="col-sm-2 col-form-label">APP端log</label>
<div class="col-sm-6">
<EF:EFUpload ename="docIdApp" cname="APP上传" docTag="hk_fileApp" path="A"/>
<div class="side-header" id="app-img" style="background-color: whitesmoke">
<img src="${ctx}/hpjx-logo.png" style="width:200px;height:55px;background-image: none;" alt="app端log"/>
</div>
</div>
<input type="hidden" id="APPfileDocId" value="">
</div>
<div class="form-group row">
<label for="remark" class="col-sm-2 col-form-label col-form-label-sm">备注</label>
<div class="col-sm-6">
<textarea id="remark" class="form-control" placeholder="备注" aria-label="备注"></textarea>
</div>
</div>
<input type="hidden" id="type" value="insert">
<input type="hidden" id="id" value="">
<input type="hidden" id="accountCode" value="">
<div class="form-group col-md-6 col-sm-6 col-sm-offset-9">
<button type="button" onclick="save()" class="btn btn-primary">确认</button>
</div>
</form>
</EF:EFWindow>
<EF:EFWindow id="updateGroup" top="100px" left="280px" width="58%" height="80%">
<EF:EFRegion id="updateResult">
<EF:EFInput ename="accountName" colWidth="6" cname="企业名称"/>
<EF:EFInput ename="loginPrefix" colWidth="6" cname="登录前缀"/>
<EF:EFSelect ename="validFlag" cname="是否启动"
template="#=valueField#-#=textField#" valueTemplate="#=valueField#-#=textField#"
required="true" defaultValue="China"> <%--enable="false":不可下拉--%>
<EF:EFOptions blockId="made_country_block_id" textField="country_ch_name" valueField="country"/>
</EF:EFSelect>
<EF:EFUpload ename="uploadFilePc" cname="PC上传" docTag="hk_filePc" path="A"/>
<EF:EFUpload ename="uploadFileApp" cname="APP上传" docTag="hk_fileApp" path="A"/>
<EF:EFInput ename="remark" colWidth="6" cname="备注"/>
<EF:EFInput ename="PCfileDocId" cname="" hidden="true"/>
<EF:EFInput ename="APPfileDocId" cname="" hidden="true"/>
<EF:EFButton ename="update" cname="确认" layout="1" class="k-button"/>
</EF:EFRegion>
</EF:EFWindow>
let ParInventNameGlobalData = [];
$(function() {
// 查询
$("#QUERY").on("click", query);
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [{
field: "parInventType",
template: function (dataItem) {
for (let i = 0; i < ParInventNameGlobalData.length; i++) {
if (ParInventNameGlobalData[i]['valueField'] === dataItem['parInventType']) {
dataItem['parInventTypeName'] = ParInventNameGlobalData[i]['textField']
return ParInventNameGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventType", options.model["inventType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HGPZ004");
inInfo.set("methodName", "queryParComboBox");
inInfo.set("blockId", "par_invent_type_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
},{
field: "createdName",
template: function (options) {
return showUserName(options.createdBy, options.createdName);
}
}, {
field: "updatedName",
template: function (options) {
return showUserName(options.updatedBy, options.updatedName);
}
}],
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
},
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
}
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
initParInvent();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 初始化存货
*/
let initParInvent = function () {
let inInfo = new EiInfo();
EiCommunicator.send("HGPZ004", "queryParComboBox", inInfo, {
onSuccess: function (ei) {
ParInventNameGlobalData = ei.getBlock("par_invent_type_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let parInventType= item.get("parInventType");
let inventTypeName= item.get("inventTypeName");
let status= item.get("status");
if(isBlank(parInventType)){
message("选中的第"+(index+1)+"行\"上级名称\",不能为空!");
flag = false;
return false;
}
if(isBlank(inventTypeName)){
message("选中的第"+(index+1)+"行\"存货类型\",不能为空!");
flag = false;
return false;
}
if(isBlank(status)){
message("选中的第"+(index+1)+"行\"状态\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGPZ004", "save", true);
}
});
}
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGPZ004", "delete", true);
}
});
}
<!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="存货类型" ename="inventTypeName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</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 cname="类型编码" ename="inventType" enable="false" width="120" align="center"/>
<EF:EFColumn cname="存货类型" ename="inventTypeName" width="140" align="center" required="true"/>
<EF:EFColumn cname="上级名称" ename="parInventType" width="80" align="center" required="true"/>
<EF:EFColumn cname="上级名称" ename="parInventTypeName" width="80" align="center" hidden="true" />
<EF:EFComboColumn cname="状态" ename="status" width="90" align="center" required="true" defaultValue="1">
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFComboColumn>
<EF:EFColumn cname="创建人" ename="createdName" enable="false" align="center"/>
<EF:EFColumn cname="创建时间" ename="createdTime" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
<EF:EFColumn cname="修改人" ename="updatedName" enable="false" align="center"/>
<EF:EFColumn cname="修改时间" ename="updatedTime" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function() {
// 查询
$("#QUERY").on("click", query);
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [{
field: "spec",
template: function (options) {
return $.trim(options.spec) == "" ? "无规格" : options.spec;
}
}, {
field: "length",
template: function (options) {
return options.length == 0 ? "-" : options.length;
}
}, {
field: "width",
template: function (options) {
return options.width == 0 ? "-" : options.width;
}
}, {
field: "thick",
template: function (options) {
return options.thick == 0 ? "-" : options.thick;
}
}, {
field: "createdName",
template: function (options) {
return showUserName(options.createdBy, options.createdName);
}
}, {
field: "updatedName",
template: function (options) {
return showUserName(options.updatedBy, options.updatedName);
}
}],
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
},
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
}
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let inventType= item.get("inventType");
let inventName= item.get("inventName");
let length= item.get("length");
let width= item.get("width");
let thick= item.get("thick");
let status= item.get("status");
if(isBlank(inventType)){
message("选中的第"+(index+1)+"行\"存货类型\",不能为空!");
flag = false;
return false;
}
if(isBlank(inventName)){
message("选中的第"+(index+1)+"行\"存货名称\",不能为空!");
flag = false;
return false;
}
if(isBlank(status)){
message("选中的第"+(index+1)+"行\"状态\",不能为空!");
flag = false;
return false;
}
if(!isBlank(length) && !isNumber(length)){
message("选中的第" + (i + 1) + "行\"\",必须是数值!");
flag = false;
return false;
}
if(!isBlank(width) && !isNumber(width)){
message("选中的第" + (i + 1) + "行\"\",必须是数值!");
flag = false;
return false;
}
if(!isBlank(thick) && !isNumber(thick)){
message("选中的第" + (i + 1) + "行\"\",必须是数值!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGPZ005", "save", true);
}
});
}
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGPZ005", "delete", true);
}
});
}
<!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:EFSelect cname="存货类型" ename="inqu_status-0-inventType" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_type_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput cname="存货名称" ename="inventName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</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 cname="存货编码" ename="inventCode" width="140" align="center" enable="false"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true"
blockName="invent_type_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="inventName" cname="存货名称" width="80" align="center" required="true"/>
<EF:EFColumn ename="spec" cname="规格" width="140" align="center" maxLength="50"/>
<EF:EFColumn ename="length" cname="长(MM)" width="100" align="right" format="{0:N2}" maxLength="10"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="100" align="right" format="{0:N2}" maxLength="10"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="100" align="right" format="{0:N2}" maxLength="10"/>
<EF:EFColumn ename="material" cname="材质" width="100" align="center"/>
<EF:EFColumn ename="coefficient" cname="系数" width="80" align="right" format="{0:N2}" maxLength="10"
defaultValue="1"/>
<EF:EFColumn ename="unit" cname="单位" width="80" align="center"/>
<EF:EFComboColumn ename="status" cname="状态" align="center" width="80" required="true" defaultValue="1">
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFComboColumn>
<EF:EFColumn cname="创建人" ename="createdName" enable="false" align="center"/>
<EF:EFColumn cname="创建时间" ename="createdTime" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
<EF:EFColumn cname="修改人" ename="updatedName" enable="false" align="center"/>
<EF:EFColumn cname="修改时间" ename="updatedTime" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function() {
// 查询
$("#QUERY").on("click", query);
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [{
field: "createdName",
template: function (options) {
return showUserName(options.createdBy, options.createdName);
}
}, {
field: "updatedName",
template: function (options) {
return showUserName(options.updatedBy, options.updatedName);
}
}],
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
},
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
}
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let whTypeName= item.get("whTypeName");
let status= item.get("status");
if(isBlank(whTypeName)){
message("选中的第"+(index+1)+"行\"仓库类型\",不能为空!");
flag = false;
return false;
}
if(isBlank(status)){
message("选中的第"+(index+1)+"行\"状态\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGPZ006", "save", true);
}
});
}
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGPZ006", "delete", true);
}
});
}
<!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="仓库类型:" ename="whTypeName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</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 cname="类型编码" ename="whType" enable="false" width="120" align="center"/>
<EF:EFColumn cname="仓库类型" ename="whTypeName" width="140" align="center" required="true"/>
<EF:EFComboColumn ename="status" cname="状态" align="center" width="80" required="true" defaultValue="1">
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFComboColumn>
<EF:EFColumn cname="创建人" ename="createdName" enable="false" align="center"/>
<EF:EFColumn cname="创建时间" ename="createdTime" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
<EF:EFColumn cname="修改人" ename="updatedName" enable="false" align="center"/>
<EF:EFColumn cname="修改时间" ename="updatedTime" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function() {
// 查询
$("#QUERY").on("click", query);
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [{
field: "createdName",
template: function (options) {
return showUserName(options.createdBy, options.createdName);
}
}, {
field: "updatedName",
template: function (options) {
return showUserName(options.updatedBy, options.updatedName);
}
}],
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
},
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
}
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let whType= item.get("whType");
let whName= item.get("whName");
let princ= item.get("princ");
let status= item.get("status");
if(isBlank(whType)){
message("选中的第"+(index+1)+"行\"仓库类型\",不能为空!");
flag = false;
return false;
}
if(isBlank(whName)){
message("选中的第"+(index+1)+"行\"仓库名称\",不能为空!");
flag = false;
return false;
}
if(isBlank(princ)){
message("选中的第"+(index+1)+"行\"负责人\",不能为空!");
flag = false;
return false;
}
if(isBlank(status)){
message("选中的第"+(index+1)+"行\"状态\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGPZ007", "save", true);
}
});
}
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGPZ007", "delete", true);
}
});
}
<!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:EFSelect cname="仓库类型" ename="inqu_status-0-whType" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_type_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput cname="仓库名称:" ename="whName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</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 cname="仓库编码" ename="whCode" width="140" align="center" enable="false"/>
<EF:EFComboColumn ename="whType" cname="仓库类型" width="120" align="center" required="true"
blockName="wh_type_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn cname="仓库名称" ename="whName" width="120" align="center" readonly="true" required="true"/>
<EF:EFColumn cname="负责人" ename="princ" align="center" width="120" readonly="true" required="true" />
<EF:EFComboColumn cname="状态" ename="status" width="90" align="center" required="true" defaultValue="1">
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFComboColumn>
<EF:EFColumn cname="创建人" ename="createdName" enable="false" align="center"/>
<EF:EFColumn cname="创建时间" ename="createdTime" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
<EF:EFColumn cname="修改人" ename="updatedName" enable="false" align="center"/>
<EF:EFColumn cname="修改时间" ename="updatedTime" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -13,7 +13,7 @@ $(function() {
// add: false, // 不显示新增按钮
//add: false, // 不显示取消按钮
// save: true, // 不显示保存按钮
delete: false, // 显示删除按钮
//delete: false, // 显示删除按钮
},
columns: [{
field: "createdName",
......
$(function() {
// 查询
$("#QUERY").on("click", query);
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [{
field: "createdName",
template: function (options) {
return showUserName(options.createdBy, options.createdName);
}
}, {
field: "updatedName",
template: function (options) {
return showUserName(options.updatedBy, options.updatedName);
}
}],
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
},
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
}
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let custType= item.get("custType");
let custName= item.get("custName");
let companyName= item.get("companyName");
let headName= item.get("headName");
let phoneName= item.get("phoneName");
let address= item.get("address");
let status= item.get("status");
if(isBlank(custType)){
message("选中的第"+(index+1)+"行\"供应商类型\",不能为空!");
flag = false;
return false;
}
if(isBlank(custName)){
message("选中的第"+(index+1)+"行\"供应商名称\",不能为空!");
flag = false;
return false;
}
if(isBlank(companyName)){
message("选中的第"+(index+1)+"行\"公司\",不能为空!");
flag = false;
return false;
}
if(isBlank(headName)){
message("选中的第"+(index+1)+"行\"负责人\",不能为空!");
flag = false;
return false;
}
if(isBlank(phoneName)){
message("选中的第"+(index+1)+"行\"负责人联系方式\",不能为空!");
flag = false;
return false;
}
if(isBlank(address)){
message("选中的第"+(index+1)+"行\"地址\",不能为空!");
flag = false;
return false;
}
if(isBlank(status)){
message("选中的第"+(index+1)+"行\"状态\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGPZ010", "save", true);
}
});
}
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGPZ010", "delete", true);
}
});
}
<!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:EFSelect cname="仓库名称" blockId="inqu_status" ename="whCode" row="0" colWidth="3" filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="仓库类型" blockId="inqu_status" ename="whType" row="0" colWidth="3" filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_type_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:EFComboColumn ename="inventType" cname="存货类型" width="100" align="center" required="true"
readonly="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2')"/>
</EF:EFComboColumn>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventRecordId" cname="规格" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="material" cname="材质" width="120" align="center" enable="false"/>
<EF:EFColumn ename="unit" cname="单位" width="120" align="center" enable="false"/>
<EF:EFColumn ename="warnNum" cname="预警值" width="100" align="right" format="{0:N3}" maxLength="20"
required="true"/>
<EF:EFColumn ename="remark" cname="备注" width="150"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
<EF:EFColumn ename="updatedName" cname="修改人" enable="false" align="center"/>
<EF:EFColumn ename="updatedTime" cname="修改时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
</EF:EFGrid>
<br/>
</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