Commit cbb8fdc6 by yukang

Merge branch 'dev' of https://gitlab.baocloud.cn/bggf/smart/hp-smart into dev

parents 1ef31f04 25ffb498
......@@ -112,14 +112,14 @@ public enum DdynamicEnum {
* 用途:厂区管理下拉框
* 编写:songx
*/
FACTORY_RECORD_BLOCK_ID("factory_record_block_id","factoryCode","factoryName","HPPZ011.queryComboBox"),
FACTORY_RECORD_BLOCK_ID("factory_record_block_id","orgId","orgCname","HPXSOrg.queryFactoryComboBox"),
/**
* 模块:组管理
* 用途:组管理下拉框
* 编写:songx
*/
GROUP_RECORD_BLOCK_ID("group_record_block_id","groupCode","groupName","HPPZ011.queryGroupComboBox"),
GROUP_RECORD_BLOCK_ID("group_record_block_id","orgId","orgCname","HPXSOrg.queryGroupComboBox"),
/**
* 分厂与组一起查出,用于生产任务分派
*/
......@@ -152,6 +152,7 @@ public enum DdynamicEnum {
* 用途:项目档案下拉框
* 编写:wwl
*/
@Deprecated
ORG_PROD_BLOCK_ID("org_prod_block_id","orgNo","orgName","HPSC005.queryOrgComboBox"),
......
package com.baosight.hpjx.core.constant;
/**
* @author:songx
* @date:2024/3/1,17:36
*/
public class CodesetConstant {
/**
* 组织机构
*
* @author:songx
* @date:2024/3/1,17:36
*/
public static class XsOg {
// 组织机构类型
public static final String ORG_TYPE = "xs.og.orgType";
}
}
......@@ -54,6 +54,8 @@ public class CommonConstant {
public static final String PROD_ORDER_NO = "prodOrderNo";
// 生产订单号2
public static final String PRODUCTTION_ORDER_NO = "productionOrderNo";
// ROOT
public static final String ROOT = "root";
}
}
package com.baosight.hpjx.core.enums;
/**
* @author:songx
* @date:2024/3/1,17:29
*/
public enum OrgTypeEnum {
FACTORY("factory", "厂区"),
DEPT("dept", "部门"),
PROD_GROUP("prodGroup", "生产组"),
CUT_GROUP("cutGroup", "下料组"),
;
private String code;
private String value;
OrgTypeEnum(String code, String value) {
this.code = code;
this.value = value;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
package com.baosight.hpjx.core.tools;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import java.util.List;
/**
* @author:songx
* @date:2023/4/13,14:38
*/
public class CodeValueTools {
/**
* getCodeValueList.
*
* @param codesetCode
* @return
*/
public static List getCodeValues(String codesetCode) {
return getCodeValues(codesetCode, null);
}
/**
* getCodeValueList.
*
* @param codesetCode
* @param condition
* @return
*/
public static List getCodeValues(String codesetCode, String condition) {
EiInfo callInfo = new EiInfo();
callInfo.set(EiConstant.serviceId, "S_ED_02");
callInfo.set("codeset", codesetCode);
if (StringUtils.isNotBlank(condition)) {
callInfo.set("condition", condition);
}
return (List) XServiceManager.call(callInfo).get("list");
}
}
......@@ -14,6 +14,8 @@ public class HPConstant {
*/
public class SequenceId {
// 组织机构编码
public static final String ORG_CODE = "ORG_CODE";
// 组编码
public static final String GROUP_CODE = "GROUP_CODE";
// 厂区编码
......
......@@ -2,6 +2,7 @@ package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
......@@ -10,6 +11,7 @@ import com.baosight.hpjx.hp.kc.domain.HPKC005;
import com.baosight.hpjx.hp.kc.domain.HPKC006;
import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.BeanUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
......@@ -25,6 +27,7 @@ import org.apache.commons.collections.MapUtils;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -36,6 +39,10 @@ import java.util.Map;
*/
public class ServiceHPKC005 extends ServiceBase {
// 指定存货类型
private static final Integer[] DEFAULT_INVENT_CODE = {InventTypeEnum.RAW.getCode(),
InventTypeEnum.CONSUMABLE.getCode(), InventTypeEnum.WASTE.getCode()};
/**
* 画面初始化
*
......@@ -46,10 +53,12 @@ public class ServiceHPKC005 extends ServiceBase {
@OperationLogAnnotation(operModul = "库存盘点单", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), null, false);
Map queryMap = new HashMap();
queryMap.put("inventTypes", DEFAULT_INVENT_CODE);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), queryMap, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC006().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
......@@ -81,38 +90,80 @@ public class ServiceHPKC005 extends ServiceBase {
}
/**
* 新增操作
* 保存操作.
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "库存盘点单", operType = "新增", operDesc = "新增")
public EiInfo insert(EiInfo inInfo) {
@OperationLogAnnotation(operModul = "其他入库单", operType = "插入", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HPKC005 fKc005 = new HPKC005();
fKc005.fromMap(resultRows.get(i));
// 设置基础信息
this.setBaseInfo(fKc005);
// 生成单据号
fKc005.setCheckNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.CHECK_NO));
DaoUtils.insert(HPKC005.INSERT, fKc005);
// 修改库存
HPKCTools.updateStock(fKc005.getWhCode(), fKc005.getInventRecordId(),
fKc005.getDiffAmount(), fKc005.getDiffWeight());
}
// 数据校验
this.checkSaveData(resultRows);
// 写入数据
this.saveData(resultRows);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 保存数据
*
* @param resultRows
*/
private void saveData(List<Map> resultRows) {
for (Map resultRow : resultRows) {
HPKC005 fKc005 = new HPKC005();
fKc005.fromMap(resultRow);
if (fKc005.getId() == null || fKc005.getId() == 0) {
this.addData(fKc005);
} else {
// TODO 盘点不支持修改
}
}
}
/**
* 新增数据
*
* @param fKc005
*/
private void addData(HPKC005 fKc005) {
// 设置基础信息
this.setBaseInfo(fKc005);
// 生成单据号
fKc005.setCheckNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.CHECK_NO));
DaoUtils.insert(HPKC005.INSERT, fKc005);
// 修改库存
HPKCTools.updateStock(fKc005.getWhCode(), fKc005.getInventRecordId(),
fKc005.getDiffAmount(), fKc005.getDiffWeight());
}
/**
* 校验保存的数据
*
* @param resultRows
*/
private void checkSaveData(List<Map> resultRows) {
for (int i = 0; i < resultRows.size(); i++) {
HPKC005 fKc005 = new HPKC005();
fKc005.fromMap(resultRows.get(i));
AssertUtils.isEmpty(fKc005.getInventCode(), "存货类型不能为空");
AssertUtils.isEmpty(fKc005.getWhCode(), "仓库名称不能为空");
AssertUtils.isEmpty(fKc005.getInventCode(), "存货名称不能为空");
AssertUtils.isNull(fKc005.getInventRecordId(), "规格不能为空");
AssertUtils.isGt(BigDecimal.ZERO, fKc005.getBookAmount(), "账面数量必须大于0");
AssertUtils.isGt(BigDecimal.ZERO, fKc005.getEntityAmount(), "实物重量必须大于0");
}
}
/**
* 设置基础信息
*
* @param fKc005
......
package com.baosight.hpjx.hp.mt.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.servlet.multipart.UploadFile;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.mt.untils.uploadUntil;
import com.baosight.hpjx.hp.zl.domain.HPZL001;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.iplat4j.config.AdminFactoryConfig;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.MapUtils;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 鸿鹏机械APP移动端接口调用处
*/
public class ServiceHPMT002 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
/**
* 生产管理-项⽬跟踪
*
* @param inInfo
* @return
*/
public EiInfo pmProject(EiInfo inInfo) {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
List<Map> rows = this.dao.query("HPMT002.pmProject", sqlMap);
EiInfo outInfo = new EiInfo();
EiBlock eiBlock = new EiBlock(EiConstant.resultBlock);
eiBlock.setRows(rows);
outInfo.setBlock(eiBlock);
return outInfo;
}
/**
* 生产管理-质量分析报表
*
* @param inInfo
* @return
*/
public EiInfo pmQuality(EiInfo inInfo) {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
List<Map> rows = this.dao.query("HPMT002.pmQuality", sqlMap);
EiInfo outInfo = new EiInfo();
EiBlock eiBlock = new EiBlock(EiConstant.resultBlock);
eiBlock.setRows(rows);
outInfo.setBlock(eiBlock);
return outInfo;
}
/**
* 生产管理-质量巡检列表-项目列表
*
* @param inInfo
* @return
*/
public EiInfo pmQualityList(EiInfo inInfo) {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String status = MapUtils.getString(queryMap, "status");
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
sqlMap.put("status", status);
List<Map> rows = this.dao.query("HPMT002.pmQualityList", sqlMap);
EiInfo outInfo = new EiInfo();
EiBlock eiBlock = new EiBlock(EiConstant.resultBlock);
eiBlock.setRows(rows);
outInfo.setBlock(eiBlock);
return outInfo;
}
/**
* 生产管理-质量巡检列表-项目详情
*
* @param inInfo
* @return
*/
public EiInfo pmQualityDetail(EiInfo inInfo) {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String status = MapUtils.getString(queryMap, "status");
String checkNo = MapUtils.getString(queryMap, "checkNo");
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
sqlMap.put("status", status);
sqlMap.put("checkNo", checkNo);
List<Map> rows = this.dao.query("HPMT002.pmQualityDetail", sqlMap);
EiInfo outInfo = new EiInfo();
EiBlock eiBlock = new EiBlock(EiConstant.resultBlock);
eiBlock.setRows(rows);
outInfo.setBlock(eiBlock);
return outInfo;
}
/**
* 生产管理-质量巡检新增
*
* @param inInfo
* @return
*/
public EiInfo pmInsertQuality(EiInfo inInfo) {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
try {
HPZL001 fZl001 = new HPZL001();
fZl001.fromMap(queryMap);
//处理文件
CommonsMultipartFile[] multipartFile = (CommonsMultipartFile[]) queryMap.get("multipartFile");
int num=0;
while (num<=multipartFile.length){
try {
uploadUntil.upload(multipartFile[num]);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo, e, "上传失败");
}
num++;
}
// 去除日期字符串中的-
fZl001.setReceiptDate(StringUtil.removeHorizontalLine(fZl001.getReceiptDate()));
// 生成单据号
fZl001.setCheckNo(SequenceGenerator.getNextSequence(
HPConstant.SequenceId.HPZL001_NUMBER));
fZl001.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPZL001.INSERT, fZl001);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 生产管理-质量巡检处理
*
* @param inInfo
* @return
*/
public EiInfo pmModifyQuality(EiInfo inInfo) {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
try {
HPZL001 fZl001 = new HPZL001();
fZl001.fromMap(queryMap);
//处理文件
// 去除日期字符串中的-
fZl001.setReceiptDate(StringUtil.removeHorizontalLine(fZl001.getReceiptDate()));
fZl001.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPSqlConstant.HPZL001.DO_PROCESS, fZl001);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPMT002">
<select id="pmProject" resultClass="java.util.HashMap">
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
PROJ_TYPE as "projType", <!-- 项目类型 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PLAN_INFO_NO as "planInfoNo", <!-- 生产计划单号 -->
PLAN_COMPLETION_DATE as "planCompletionDate", <!-- 计划完成日期 -->
STATUS as "status", <!-- 状态 0-计划中,1-生产中 -->
CONCAT((
SELECT
format((ifnull( SUM( ACTUAL_COMPLETION_NUM ), 0 ) / ifnull( SUM( NUM ), 0 ) * 100),2)
FROM
hpjx.T_HPSC004
WHERE
PARENT_ID = hpjx.T_HPSC003.PLAN_INFO_NO
),'%') AS "schedule", <!-- 进度 -->
(
SELECT
IFNULL( SUM( ACTUAL_COMPLETION_NUM ), 0 )
FROM
hpjx.T_HPSC004
WHERE
PARENT_ID = hpjx.T_HPSC003.PLAN_INFO_NO
) AS "actualCompletionNum" <!-- 完成数量 -->
,
(
SELECT
IFNULL( SUM( NUM ),2)
FROM
hpjx.T_HPSC004
WHERE
PARENT_ID = hpjx.T_HPSC003.PLAN_INFO_NO
) AS "num" <!-- 计划数量 -->
FROM hpjx.T_HPSC003 WHERE COMPANY_CODE= #companyCode#
</select>
<select id="pmQuality" resultClass="java.util.HashMap">
SELECT
POOR_TYPE,<!-- 不良品类 -->
COUNT(POOR_TYPE) AS POOR_TYPE_NUM,<!-- 单种不良品类数量 -->
CONCAT( FORMAT(COUNT(POOR_TYPE)/ (
SELECT COUNT(*) FROM hpjx.t_hpzl001 WHERE
COMPANY_CODE=#companyCode# )* 100,2),'%') AS NUM
FROM hpjx.t_hpzl001 WHERE COMPANY_CODE= #companyCode# AND DELETE_FLAG =0
GROUP BY POOR_TYPE
</select>
<select id="pmQualityList" resultClass="java.util.HashMap">
SELECT
ID as "id",
CHECK_NO as "checkNo", <!-- 检查单号 -->
PROD_ORDER_NO as "prodOrderNo", <!-- 生产订单号 -->
PROD_TASK_NO as "prodTaskNo", <!-- 生产任务号 -->
PROJ_CODE as "projCode", <!-- 项目号 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
INVENT_CODE as "inventCode", <!-- 部件编码 -->
INVENT_NAME as "inventName", <!-- 部件名称 -->
SUB_INVENT_CODE as "subInventCode", <!-- 零件编码 -->
SUB_INVENT_NAME as "subInventName", <!-- 零件名称 -->
ORG_NO as "orgNo", <!-- 生产组编码 -->
ORG_NAME as "orgName", <!-- 生产组名称 -->
POOR_TYPE as "poorType", <!-- 不良品类 -->
STATUS as "status" <!-- 单据状态 0未处理 1已处理 -->
FROM hpjx.t_hpzl001 WHERE COMPANY_CODE= #companyCode# AND STATUS=#status# AND DELETE_FLAG =0
</select>
<select id="pmQualityDetail" resultClass="java.util.HashMap">
SELECT
ID as "id",
CHECK_NO as "checkNo", <!-- 检查单号 -->
PROD_ORDER_NO as "prodOrderNo", <!-- 生产订单号 -->
PROD_TASK_NO as "prodTaskNo", <!-- 生产任务号 -->
PROJ_CODE as "projCode", <!-- 项目号 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
INVENT_CODE as "inventCode", <!-- 部件编码 -->
INVENT_NAME as "inventName", <!-- 部件名称 -->
SUB_INVENT_CODE as "subInventCode", <!-- 零件编码 -->
SUB_INVENT_NAME as "subInventName", <!-- 零件名称 -->
ORG_NO as "orgNo", <!-- 生产组编码 -->
ORG_NAME as "orgName", <!-- 生产组名称 -->
POOR_TYPE as "poorType", <!-- 不良品类 -->
PROBLEM_DESC as "problemDesc", <!-- 质量问题描述 -->
CHECK_USER as "checkUser", <!-- 检查人 -->
CHECK_USER_NAME as "checkUserName", <!-- 检查人名称 -->
STATUS as "status" <!-- 单据状态 0未处理 1已处理 -->
FROM hpjx.t_hpzl001 WHERE COMPANY_CODE= #companyCode# AND STATUS=#status#
AND DELETE_FLAG = 0 AND CHECK_NO = #checkNo#
</select>
<insert id="insert">
INSERT INTO hpjx.t_hpzl001 (
COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 -->
RECEIPT_DATE, <!-- 单据日期 -->
CHECK_NO, <!-- 检查单号 -->
PROD_ORDER_NO, <!-- 生产订单号 -->
PROD_TASK_NO, <!-- 生产任务号 -->
PROJ_CODE, <!-- 项目号 -->
PROJ_NAME, <!-- 项目名称 -->
INVENT_CODE, <!-- 部件编码 -->
INVENT_NAME, <!-- 部件名称 -->
SUB_INVENT_CODE, <!-- 零件编码 -->
SUB_INVENT_NAME, <!-- 零件名称 -->
ORG_NO, <!-- 生产组编码 -->
ORG_NAME, <!-- 生产组名称 -->
POOR_TYPE, <!-- 不良品类 -->
PROBLEM_DESC, <!-- 质量问题描述 -->
CHECK_USER , <!-- 检查人 -->
CHECK_USER_NAME, <!-- 检查人名称 -->
STATUS, <!-- 单据状态 0未处理 1已处理 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG <!-- 是否删除 -->
) VALUES (
#companyCode#, #depCode#, #receiptDate#, #checkNo#, #prodOrderNo#, #prodTaskNo#,
#projCode#, #projName#, #inventCode#, #inventName#, #subInventCode#, #subInventName#,
#orgNo#, #orgName#, #poorType#, #problemDesc#,#checkUser#,#checkUserName#, #status#,
#createdBy#, #createdName#, #createdTime#, #deleteFlag#)
</insert>
</sqlMap>
package com.baosight.hpjx.hp.mt.untils;
import com.baosight.iplat4j.core.data.id.UUIDHexIdGenerator;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext;
import com.baosight.iplat4j.core.util.DateUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import com.baosight.iplat4j.eu.dm.util.IFileUploader;
import net.sf.json.JSONObject;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
public class uploadUntil {
public static IFileUploader fileUploader;
public static String upload(CommonsMultipartFile multipartFile ) throws IOException {
JSONObject documentJSON = new JSONObject();
String filePath;
String msg;
String category;
String docPath;
filePath = multipartFile.getOriginalFilename();
Long docSize = multipartFile.getSize();
String chgName = fileUploader.transformFileName(filePath);
String attachmentName;
Map<String, String> pathMap = fileUploader.getRealPath("A");
msg = (String)pathMap.get("dirId");
category = (String)pathMap.get("path");
checkInvalidPath(category);
File dir = new File(category);
if (!dir.exists()) {
dir.mkdirs();
}
docPath = UUIDHexIdGenerator.generate().toString();
Map map = new HashMap();
map.put("docId", docPath);
map.put("dirId", msg);
map.put("docTag", "");
map.put("docName", filePath);
map.put("chgName", chgName);
map.put("docSize", docSize);
map.put("recCreator", "");
map.put("recCreateTime", DateUtils.curDateTimeStr14());
fileUploader.uploadDoc(map);
attachmentName = category + "/" + chgName;
multipartFile.transferTo(new File(attachmentName));
documentJSON.put("docId", docPath);
documentJSON.put("docTag", "");
documentJSON.put("author", "");
documentJSON.put("authorCName", "");
documentJSON.put("uploadTime", DateUtils.toDateTimeStr14(new Date()));
documentJSON.put("docUrl", attachmentName);
documentJSON.put("docSize", docSize);
documentJSON.put("docName", filePath);
return "";
}
public static void checkInvalidPath(String realPath) {
String pathErrorMsg = "Upload params contain invalid characters!";
if (realPath.contains("../")) {
throw new PlatException(pathErrorMsg);
} else {
String invalidPathConfig = PlatApplicationContext.getProperty("iplat.upload.invalidPath");
if (StringUtils.isNotEmpty(invalidPathConfig)) {
String[] invalidPaths = invalidPathConfig.split(",");
String[] var5 = invalidPaths;
int var6 = invalidPaths.length;
for(int var7 = 0; var7 < var6; ++var7) {
String invalidPath = var5[var7];
if (realPath.contains(invalidPath)) {
throw new PlatException(pathErrorMsg);
}
}
}
}
}
}
......@@ -65,6 +65,57 @@ public class ServiceHPPZ002 extends ServiceBase {
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "供应商档案",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HPPZ002 fPz002 = new HPPZ002();
fPz002.fromMap(resultRows.get(i));
if (fPz002.getId() == null || fPz002.getId() == 0) {
this.add(fPz002);
} else {
this.modify(fPz002);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param fPz002
* @return
*/
public void add(HPPZ002 fPz002) {
// 生成供应商编码
fPz002.setCustCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPPZ002_CUST_CODE));
DaoUtils.insert("HPPZ002.insert", fPz002);
}
/**
* 修改操作
*
* @param fPz002
* @return
*/
public void modify(HPPZ002 fPz002) {
DaoUtils.update("HPPZ002.update", fPz002);
}
/**
* 新增操作
......
......@@ -62,6 +62,57 @@ public class ServiceHPPZ003 extends ServiceBase {
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户档案",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HPPZ003 fPz003 = new HPPZ003();
fPz003.fromMap(resultRows.get(i));
if (fPz003.getId() == null || fPz003.getId() == 0) {
this.add(fPz003);
} else {
this.modify(fPz003);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param fPz003
* @return
*/
public void add(HPPZ003 fPz003) {
// 生成客户编码
fPz003.setCustCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPPZ003_CUST_CODE));
DaoUtils.insert("HPPZ003.insert", fPz003);
}
/**
* 修改操作
*
* @param fPz003
* @return
*/
public void modify(HPPZ003 fPz003) {
DaoUtils.update("HPPZ003.update", fPz003);
}
/**
* 新增操作
......
......@@ -5,6 +5,7 @@ import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InitiateModeEnum;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ003;
import com.baosight.hpjx.hp.pz.domain.HPPZ004;
import com.baosight.hpjx.hp.pz.domain.HPPZ006;
import com.baosight.hpjx.util.AssertUtils;
......@@ -62,6 +63,58 @@ public class ServiceHPPZ004 extends ServiceBase {
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "存货类型",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HPPZ004 fPz004 = new HPPZ004();
fPz004.fromMap(resultRows.get(i));
if (fPz004.getId() == null || fPz004.getId() == 0) {
this.add(fPz004);
} else {
this.modify(fPz004);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param fPz004
* @return
*/
public void add(HPPZ004 fPz004) {
// 生成编码
fPz004.setInventCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.INVENT_CODE));
DaoUtils.insert(HPPZ004.INSERT, fPz004);
}
/**
* 修改操作
*
* @param fPz004
* @return
*/
@OperationLogAnnotation(operModul = "存货类型",operType = "修改",operDesc = "修改")
public void modify(HPPZ004 fPz004) {
DaoUtils.update(HPPZ004.UPDATE, fPz004);
}
/**
* 新增操作
......
......@@ -7,6 +7,7 @@ import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.kc.domain.HPKC010;
import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.hp.pz.domain.HPPZ004;
import com.baosight.hpjx.hp.pz.domain.HPPZ006;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.util.AssertUtils;
......@@ -72,6 +73,78 @@ public class ServiceHPPZ006 extends ServiceBase {
* @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++) {
HPPZ006 fPz006 = new HPPZ006();
fPz006.fromMap(resultRows.get(i));
if (fPz006.getId() == null || fPz006.getId() == 0) {
this.add(fPz006);
} else {
this.modify(fPz006);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param fPz006
* @return
*/
public void add(HPPZ006 fPz006) {
AssertUtils.isNull(fPz006.getInventType(), "存货类型不能为空");
AssertUtils.isEmpty(fPz006.getInventCode(), "存货名称不能为空");
// 去除空格
fPz006.setSpec(StringUtils.trimToEmpty(fPz006.getSpec()));
// 重复校验
Map queryParam = new HashMap();
queryParam.put("inventCode", fPz006.getInventCode());
queryParam.put("spec", fPz006.getSpec());
List<HPPZ006> dbPz006 = dao.query(HPPZ006.QUERY, queryParam);
AssertUtils.isNotEmpty(dbPz006, String.format("存货编码[%s]已存在规格[%s],请勿重复添加!", fPz006.getInventCode(),
fPz006.getSpec()));
// 存货名称
fPz006.setInventName(HPPZTools.HpPz004.getByCode(fPz006.getInventCode()).getInventName());
fPz006.setSpec(HPPZTools.HpPz006.jointSpec(fPz006.getLength(),fPz006.getWidth(),fPz006.getThick()));
DaoUtils.insert(HPPZ006.INSERT, fPz006);
}
/**
* 修改操作
*
* @param fPz006
* @return
*/
@OperationLogAnnotation(operModul = "存货档案",operType = "修改",operDesc = "修改")
public void modify(HPPZ006 fPz006) {
// 校验是否存在库存
List<HPKC010> dbKc010s = HPKCTools.HpKc010.listBySpec(fPz006.getId());
AssertUtils.isEmpty(dbKc010s, String.format("档案[%s]已存在库存数量,不能进行修改", fPz006.getId()));
// 存货名称
fPz006.setInventName(HPPZTools.HpPz004.getByCode(fPz006.getInventCode()).getInventName());
fPz006.setSpec(HPPZTools.HpPz006.jointSpec(fPz006.getLength(), fPz006.getWidth(), fPz006.getThick()));
DaoUtils.update(HPPZ006.UPDATE, fPz006);
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "存货档案",operType = "新增",operDesc = "新增")
@Override
public EiInfo insert(EiInfo inInfo) {
......
......@@ -4,6 +4,7 @@ import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ004;
import com.baosight.hpjx.hp.pz.domain.HPPZ007;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
......@@ -62,6 +63,54 @@ public class ServiceHPPZ007 extends ServiceBase {
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "仓库档案",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HPPZ007 fPz007 = new HPPZ007();
fPz007.fromMap(resultRows.get(i));
if (fPz007.getId() == null || fPz007.getId() == 0) {
this.add(fPz007);
} else {
this.modify(fPz007);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作.
*/
public void add(HPPZ007 fPz007) {
// 仓库编码
fPz007.setWhCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.WH_CODE));
DaoUtils.insert(HPPZ007.INSERT, fPz007);
}
/**
* 修改操作
*
* @param fPz007
*
*/
public void modify(HPPZ007 fPz007) {
DaoUtils.update(HPPZ007.UPDATE, fPz007);
}
/**
* 新增操作.
*/
@OperationLogAnnotation(operModul = "仓库档案",operType = "新增",operDesc = "新增")
......
package com.baosight.hpjx.hp.xs.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.ObjectUtils;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/1/15,15:08
*/
public class ServiceHPXSOrg extends ServiceBase {
/**
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "组织管理", operType = "查询", operDesc = "厂区下拉框")
public EiInfo queryFactoryComboBox(EiInfo inInfo) {
try {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.FACTORY_RECORD_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询厂区失败");
}
return inInfo;
}
/**
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "组织管理", operType = "查询", operDesc = "组下拉框")
public EiInfo queryGroupComboBox(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
if (ObjectUtils.isEmpty(queryRow.get("parentOrgId"))) {
queryRow.put("parentOrgId", CommonConstant.Field.ROOT);
}
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.GROUP_RECORD_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, queryRow, false);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询组失败");
}
return inInfo;
}
}
......@@ -3,6 +3,7 @@
<sqlMap namespace="HPXSOrg">
<sql id="condition">
AND IS_DELETED = '0'
<isNotEmpty prepend=" AND " property="orgEname">
ORG_ENAME = #orgEname#
</isNotEmpty>
......@@ -12,9 +13,6 @@
<isNotEmpty prepend=" AND " property="orgId">
ORG_ID = #orgId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgIds">
ORG_ID IN <iterate close=")" open="(" conjunction="," property="orgIds">#orgIds[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgType">
ORG_TYPE = #orgType#
</isNotEmpty>
......@@ -26,6 +24,12 @@
</isNotEmpty>
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="orgIds">
ORG_ID IN <iterate close=")" open="(" conjunction="," property="orgIds">#orgIds[]#</iterate>
</isNotEmpty>
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="order">
......@@ -48,6 +52,7 @@
FROM ${platSchema}.TXSOG01
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
......@@ -57,6 +62,7 @@
FROM ${platSchema}.TXSOG01
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
</select>
<!-- 查询组织信息 -->
......@@ -66,9 +72,51 @@
ORG_CNAME as "orgCname"
FROM ${platSchema}.TXSOG01
WHERE 1=1
AND ORG_TYPE IN ('company', 'dept')
AND ORG_TYPE != 'org'
<include refid="condition"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
<!-- 查询厂区信息 -->
<select id="queryFactoryComboBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
ORG_ID as "orgId",
ORG_CNAME as "orgCname"
FROM ${platSchema}.TXSOG01
WHERE 1=1
AND ORG_TYPE = 'factory'
<include refid="condition"/>
<include refid="order"/>
</select>
<!-- 查询组信息(递归) -->
<select id="queryGroupComboBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
T2.LEVEL AS "level", T3.ORG_ID AS "orgId", T3.ORG_CNAME AS "orgCname"
FROM (
SELECT
@CODES AS CODES,
(SELECT @CODES := GROUP_CONCAT(ORG_ID)
FROM ${platSchema}.TXSOG01
WHERE FIND_IN_SET(PARENT_ORG_ID, @CODES)
) AS T1,
@LEVEL:= @LEVEL+1 AS LEVEL
FROM ${platSchema}.TXSOG01,
(SELECT @CODES:=#parentOrgId#, @LEVEL:= 0) T4
WHERE @CODES IS NOT NULL
) T2,
${platSchema}.TXSOG01 T3
WHERE 1=1
AND FIND_IN_SET(T3.ORG_ID, T2.CODES)
AND ORG_TYPE IN ('prodGroup', 'cutGroup')
<isNotEmpty prepend=" AND " property="orgType">
ORG_TYPE = #orgType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
ORDER BY T2.LEVEL, T3.ORG_ID
</select>
</sqlMap>
package com.baosight.xservices.xs.og.service;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ009;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.iplat4j.common.ed.domain.TEDCM01;
......@@ -16,6 +17,7 @@ import com.baosight.iplat4j.core.service.soa.XServiceManager;
import com.baosight.iplat4j.core.util.DateUtils;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.AdminUtil;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import com.baosight.xservices.xs.domain.XS01;
import com.baosight.xservices.xs.domain.XS02;
import com.baosight.xservices.xs.og.domain.XSOG01;
......@@ -260,14 +262,15 @@ public class ServiceXSOG0801 extends ServiceBase {
}
// 非管理员组织机构编码前缀增加企业编码 added by songx at 2024-01-15
String companyCode = UserSessionUtils.getCompanyCode();
HPPZ009 dbPz009 = StringUtils.isBlank(companyCode) ? null : HPPZTools.HpPz009.getByCode(companyCode);
final String companyPrefix = dbPz009 == null ? "" : "[" + dbPz009.getLoginPrefix() + "]";
// HPPZ009 dbPz009 = StringUtils.isBlank(companyCode) ? null : HPPZTools.HpPz009.getByCode(companyCode);
// final String companyPrefix = dbPz009 == null ? "" : "[" + dbPz009.getLoginPrefix() + "]";
String orgCode = SequenceGenerator.getNextSequence(HPConstant.SequenceId.ORG_CODE);
resultBlock = inInfo.getBlock(EiConstant.resultBlock);
List rows = resultBlock.getRows();
rows.forEach((m) -> {
Map row = (Map) m;
row.put("orgId", companyPrefix + inInfo.get("result2-0-orgEname"));
row.put("orgEname", companyPrefix + row.get("orgEname"));
row.put("orgId", orgCode);
row.put("orgEname", orgCode);
row.put("companyCode", companyCode);
row.put("parentOrgId", inInfo.get("inqu_status2-0-parentOrgId"));
row.put("recCreator", UserSession.getLoginName());
......
package com.baosight.xservices.xs.og.service;
import com.baosight.hpjx.core.constant.CodesetConstant;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.enums.OrgTypeEnum;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.core.tools.CodeValueTools;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC010;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import com.baosight.xservices.xs.og.domain.XSOG01;
import com.baosight.xservices.xs.util.LoginUserDetails;
import java.util.List;
import java.util.Map;
/**
* 新增组织机构
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceXSOG0801A extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String parentOrgId = MapUtils.getString(queryMap, "parentOrgId");
String condition;
if (CommonConstant.Field.ROOT.equals(parentOrgId)) {
condition = String.format(" ITEM_CODE = '%s'", OrgTypeEnum.FACTORY.getCode());
} else {
condition = String.format(" ITEM_CODE IN ('%s', '%s', '%s')", OrgTypeEnum.DEPT.getCode(),
OrgTypeEnum.PROD_GROUP.getCode(), OrgTypeEnum.CUT_GROUP.getCode());
}
List<Map> orgTypes = CodeValueTools.getCodeValues(CodesetConstant.XsOg.ORG_TYPE, condition);
inInfo.addBlock("orgTypeBlock").addRows(orgTypes);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC010().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String parentOrgId = MapUtils.getString(queryRow, "parentOrgId");
if ("".equals(parentOrgId)) {
return inInfo;
}
// 非管理员仅查询所属企业用户 added by songx at 2024-01-16
if (!LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())) {
queryRow.put("companyCode", UserSessionUtils.getCompanyCode());
}
inInfo = super.query(inInfo, "XSOG01.query", new XSOG01());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 保存
*
* @param inInfo
* @return
*/
public EiInfo save(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 非管理员组织机构编码前缀增加企业编码 added by songx at 2024-01-15
String companyCode = UserSessionUtils.getCompanyCode();
resultRows.forEach((row) -> {
String orgCode = SequenceGenerator.getNextSequence(HPConstant.SequenceId.ORG_CODE);
row.put("orgId", orgCode);
row.put("orgEname", orgCode);
row.put("companyCode", companyCode);
row.put("establishDate", DateUtils.formatShort(MapUtils.getString(row, "establishDate")));
row.put("parentOrgId", queryRow.get("parentOrgId"));
row.put("recCreator", UserSession.getLoginName());
});
EiInfo call = new EiInfo();
call.set("list", resultRows);
call.set(EiConstant.serviceId, "S_XS_87");
XServiceManager.call(call);
inInfo = this.query(inInfo);
inInfo.setMsg("新增成功");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增组织机构失败");
}
return inInfo;
}
}
......@@ -50,7 +50,7 @@
<EF:EFColumn ename="partName" cname="零件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partSpec" cname="零件规格" enable="false" width="150" align="center"/>
<EF:EFColumn ename="amount" cname="数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="weight" cname="重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="重量(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
<EF:EFColumn ename="prdtCode" cname="部件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="partCode" cname="零件编码" enable="false" width="120" align="center" hidden="true"/>
......
......@@ -40,7 +40,7 @@
hidden="true"/>
<EF:EFColumn ename="unCompleteNum" cname="待入库数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="num" cname="任务数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="totalWt" cname="任务重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="totalWt" cname="任务重量(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="factoryName" cname="厂区名称" enable="false" width="150" align="center"/>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" width="150" align="center"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
......
let whNameGlobalData = [];
let inventNameGlobalData = [];
let specGlobalData = [];
$(function() {
IPLATUI.EFGrid = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
pageSizes: [20, 50, 70, 100],
},
"result": {
columns: [{
field: "receiptDate",
attributes: {
class: "i-input-readonly"
},
defaultValue: function () {
return currShortDate();
}
......@@ -81,6 +85,11 @@ $(function() {
}],
loadComplete: function (grid) {
},
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'update'
||e.eiInfo.extAttr.methodName == 'insert'
......@@ -102,9 +111,25 @@ $(function() {
* 页面加载时执行
*/
$(window).load(function () {
// 仓库名称
initWh()
// 存货名称
initInvent()
// 规格
initSpec()
// 查询
query();
});
/**
* 初始化仓库
*/
let initWh = function () {
let inInfo = new EiInfo();
// 1.原料,2.耗材,5.废料
inInfo.set("inqu_status-0-inventTypes", [1, 2, 5]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
// 仓库名称
EiCommunicator.send("HPPZ007", "queryComboBox", inInfo, {
onSuccess: function (ei) {
whNameGlobalData = ei.getBlock("wh_record_block_id").getMappedRows();
......@@ -112,7 +137,16 @@ $(window).load(function () {
onFail: function (ei) {
}
}, {async: false});
// 存货名称
}
/**
* 初始化存货
*/
let initInvent = function () {
let inInfo = new EiInfo();
// 1.原料,2.耗材,5.废料
inInfo.set("inqu_status-0-inventTypes", [1, 2, 5]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HPPZ004", "queryComboBox", inInfo, {
onSuccess: function (ei) {
inventNameGlobalData = ei.getBlock("invent_name_block_id").getMappedRows();
......@@ -120,17 +154,24 @@ $(window).load(function () {
onFail: function (ei) {
}
}, {async: false});
// 规格
EiCommunicator.send("HPPZ006", "queryComboBoxSpec", inInfo, {
}
/**
* 初始化规格
*/
let initSpec = function () {
let inInfo = new EiInfo();
// 1.原料,2.耗材,5.废料
inInfo.set("inqu_status-0-inventTypes", [1, 2, 5]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HPPZ006", "queryComboBoxAll", inInfo, {
onSuccess: function (ei) {
specGlobalData = ei.getBlock("invent_spec_block_id").getMappedRows();
specGlobalData = ei.getBlock("invent_all_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
// 查询
query();
});
}
/**
* 查询
......@@ -171,6 +212,32 @@ let save = function () {
message("请选择数据");
return;
}
for (let i = 0; i < rows.length; i++) {
if (isBlank(rows[i]['inventType'])) {
message("勾选的第" + (i + 1) + "行存货类型不能为空");
return;
}
if (isBlank(rows[i]['whCode'])) {
message("勾选的第" + (i + 1) + "行仓库名称不能为空");
return;
}
if (isBlank(rows[i]['inventCode'])) {
message("勾选的第" + (i + 1) + "行存货名称不能为空");
return;
}
if (isBlank(rows[i]['inventRecordId'])) {
message("勾选的第" + (i + 1) + "行规格不能为空");
return;
}
if (!isPositiveInteger(rows[i]['bookAmount'])) {
message("勾选的第" + (i + 1) + "行账面数量必须是大于0的整数");
return;
}
if (!isPositiveInteger(rows[i]['entityAmount'])) {
message("勾选的第" + (i + 1) + "行实物数量必须是大于0的整数");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPKC005", "save", true);
......
......@@ -56,15 +56,15 @@
<EF:EFColumn ename="inventRecordId" cname="规格" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="bookAmount" cname="账面数量" format="{0:N0}" maxLength="20" width="90" align="right"
sumType="all" required="true" readonly="true"/>
<EF:EFColumn ename="bookWeight" cname="账面重量" enable="false" format="{0:N3}" maxLength="20" width="90"
<EF:EFColumn ename="bookWeight" cname="账面重量(KG)" enable="false" format="{0:N3}" maxLength="20" width="90"
align="right" sumType="all"/>
<EF:EFColumn ename="entityAmount" cname="实物数量" format="{0:N0}" maxLength="20" width="100" align="right"
sumType="all" required="true" readonly="true"/>
<EF:EFColumn ename="entityWeight" cname="实物重量" enable="false" format="{0:N3}" maxLength="20" width="100"
<EF:EFColumn ename="entityWeight" cname="实物重量(KG)" enable="false" format="{0:N3}" maxLength="20" width="120"
align="right" sumType="all"/>
<EF:EFColumn ename="diffAmount" cname="差异数量" enable="false" format="{0:N0}" maxLength="20" width="100"
align="right" sumType="all" readonly="true"/>
<EF:EFColumn ename="diffWeight" cname="差异重量" enable="false" format="{0:N3}" maxLength="20" width="100"
<EF:EFColumn ename="diffWeight" cname="差异重量(KG)" enable="false" format="{0:N3}" maxLength="20" width="120"
align="right" sumType="all" readonly="true"/>
<EF:EFColumn ename="remark" cname="备注" width="150" readonly="true"/>
<EF:EFColumn ename="oldCheckNo" cname="原盘点单号" enable="false" width="140" align="center"/>
......
......@@ -49,7 +49,7 @@
<EF:EFColumn ename="entityRemark" cname="盘点说明" width="150" editType="textarea" copy="true"/>
<EF:EFColumn ename="amount" cname="库存数量" enable="false" width="120" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="weight" cname="库存重量" enable="false" width="120" align="right" format="{0:N3}"
<EF:EFColumn ename="weight" cname="库存重量(KG)" enable="false" width="120" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
</EF:EFGrid>
......
......@@ -155,7 +155,6 @@ $(window).load(function () {
query();
});
/**
* 初始化仓库
*/
......
......@@ -65,8 +65,8 @@
</EF:EFComboColumn>
<EF:EFColumn ename="amount" cname="数量" enable="false" format="{0:N0}" width="100" align="right"
sumType="all"/>
<EF:EFColumn ename="unitWeight" cname="单重" enable="false" format="{0:N3}" width="100" align="right"/>
<EF:EFColumn ename="weight" cname="重量" enable="false" format="{0:N3}" width="100" align="right"
<EF:EFColumn ename="unitWeight" cname="单重(KG)" enable="false" format="{0:N3}" width="100" align="right"/>
<EF:EFColumn ename="weight" cname="重量(KG)" enable="false" format="{0:N3}" width="100" align="right"
sumType="all"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
<EF:EFColumn ename="oldOuterNo" cname="原出库单号" enable="false" width="140" align="center"/>
......
......@@ -48,8 +48,8 @@
<EF:EFColumn ename="applyAmount" cname="申请数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFColumn ename="applyRemark" cname="申请说明" width="150" editType="textarea" copy="true"/>
<EF:EFColumn ename="amount" cname="库存数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="unitWeight" cname="单重" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="库存重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="unitWeight" cname="单重(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="库存重量(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
</EF:EFGrid>
</EF:EFRegion>
......
......@@ -52,39 +52,39 @@
</EF:EFComboColumn>
<EF:EFColumn ename="initAmount" cname="期初数量" enable="false" width="100" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="initWeight" cname="期初重量" enable="false" width="100" align="right" format="{0:N3}"
<EF:EFColumn ename="initWeight" cname="期初重量(KG)" enable="false" width="100" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="cgEnterAmount" cname="采购入库数量" enable="false" width="100" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="cgEnterWeight" cname="采购入库重量" enable="false" width="100" align="right" format="{0:N3}"
<EF:EFColumn ename="cgEnterWeight" cname="采购入库重量(KG)" enable="false" width="100" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="qtEnterAmount" cname="其它入库数量" enable="false" width="90" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="qtEnterWeight" cname="其它入库重量" enable="false" width="90" align="right" format="{0:N3}"
<EF:EFColumn ename="qtEnterWeight" cname="其它入库重量(KG)" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="enterAmount" cname="入库数量" enable="false" width="90" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="enterWeight" cname="入库重量" enable="false" width="90" align="right" format="{0:N3}"
<EF:EFColumn ename="enterWeight" cname="入库重量(KG)" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="scOuterAmount" cname="生产领料数量" enable="false" width="90" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="scOuterWeight" cname="生产领料重量" enable="false" width="90" align="right" format="{0:N3}"
<EF:EFColumn ename="scOuterWeight" cname="生产领料重量(KG)" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="qtOuterAmount" cname="其它出库数量" enable="false" width="90" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="qtOuterWeight" cname="其它出库重量" enable="false" width="90" align="right" format="{0:N3}"
<EF:EFColumn ename="qtOuterWeight" cname="其它出库重量(KG)" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="outerAmount" cname="出库数量" enable="false" width="90" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="outerWeight" cname="出库重量" enable="false" width="90" align="right" format="{0:N3}"
<EF:EFColumn ename="outerWeight" cname="出库重量(KG)" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="pdDiffAmount" cname="盘点差异数量" enable="false" width="90" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="pdDiffWeight" cname="盘点差异重量" enable="false" width="90" align="right" format="{0:N3}"
<EF:EFColumn ename="pdDiffWeight" cname="盘点差异重量(KG)" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="endAmount" cname="期末数量" enable="false" width="90" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="endWeight" cname="期末重量" enable="false" width="90" align="right" format="{0:N3}"
<EF:EFColumn ename="endWeight" cname="期末重量(KG)" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
</EF:EFGrid>
</EF:EFRegion>
......
......@@ -45,8 +45,8 @@
<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="amount" cname="数量" enable="false" width="100" align="right" format="{0:N0}"/>
<EF:EFColumn ename="unitWeight" cname="单重" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="重量" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="unitWeight" cname="单重(KG)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="重量(KG)" enable="false" width="100" align="right" format="{0:N3}"/>
<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']"/>
......
......@@ -41,12 +41,12 @@
<EF:EFColumn ename="projName" cname="项目名称" width="120" align="center" required="true" enable="false"/>
<EF:EFColumn ename="inventCode" cname="部件名称" width="120" align="center" required="true" enable="false"/>
<EF:EFColumn ename="subInventCode" cname="零件名称" width="120" align="center" required="true" enable="false"/>
<EF:EFColumn ename="length" cname="长" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/>
<EF:EFColumn ename="width" cname="宽" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/>
<EF:EFColumn ename="thick" cname="厚" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/>
<EF:EFColumn ename="length" cname="长(MM)" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/>
<EF:EFColumn ename="width" cname="宽(MM)" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/>
<EF:EFColumn ename="thick" cname="厚(MM)" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/>
<EF:EFColumn ename="amount" cname="数量" format="{0:N0}" maxLength="20" width="90" align="right" required="true" enable="false"/>
<EF:EFColumn ename="unitWeight" cname="单重" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/>
<EF:EFColumn ename="weight" cname="重量" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/>
<EF:EFColumn ename="unitWeight" cname="单重(KG)" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/>
<EF:EFColumn ename="weight" cname="重量(KG)" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/>
<EF:EFColumn ename="remark" cname="备注" width="120" align="center" enable="false"/>
<EF:EFColumn ename="createdBy" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时刻" enable="false" width="140" align="center"
......
......@@ -57,7 +57,7 @@
<EF:EFColumn ename="unit" cname="单位" enable="false" width="120" align="center"/>
<EF:EFColumn ename="amount" cname="库存数量" enable="false" width="90" align="right" format="{0:N0}"/>
<EF:EFColumn ename="warnNum" cname="预警值" enable="false" width="90" align="right" format="{0:N0}"/>
<EF:EFColumn ename="weight" cname="库存重量" enable="false" width="90" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="库存重量(KG)" enable="false" width="90" align="right" format="{0:N3}"/>
<EF:EFComboColumn ename="princ" cname="仓库负责人" width="120" align="center" enable="false"
blockName="user_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#"
......
......@@ -20,11 +20,20 @@ $(function() {
}
}],
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'update'
||e.eiInfo.extAttr.methodName == 'insert'
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
},
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
}
......@@ -44,3 +53,82 @@ $(window).load(function () {
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(custType===""){
message("选中的第"+(index+1)+"行\"供应商类型\",不能为空!");
flag = false;
return false;
}
if(custName===""){
message("选中的第"+(index+1)+"行\"供应商名称\",不能为空!");
flag = false;
return false;
}
if(companyName===""){
message("选中的第"+(index+1)+"行\"公司\",不能为空!");
flag = false;
return false;
}
if(headName===""){
message("选中的第"+(index+1)+"行\"负责人\",不能为空!");
flag = false;
return false;
}
if(phoneName===""){
message("选中的第"+(index+1)+"行\"负责人联系方式\",不能为空!");
flag = false;
return false;
}
if(address===""){
message("选中的第"+(index+1)+"行\"地址\",不能为空!");
flag = false;
return false;
}
if(status===""){
message("选中的第"+(index+1)+"行\"状态\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ002", "save", true);
}
});
}
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ002", "delete", true);
}
});
}
......@@ -20,11 +20,20 @@ $(function() {
}
}],
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'update'
||e.eiInfo.extAttr.methodName == 'insert'
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
},
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
}
......@@ -44,3 +53,83 @@ $(window).load(function () {
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(custType===""){
message("选中的第"+(index+1)+"行\"客户类型\",不能为空!");
flag = false;
return false;
}
if(custName===""){
message("选中的第"+(index+1)+"行\"公司简称\",不能为空!");
flag = false;
return false;
}
if(companyName===""){
message("选中的第"+(index+1)+"行\"公司全称\",不能为空!");
flag = false;
return false;
}
if(headName===""){
message("选中的第"+(index+1)+"行\"负责人\",不能为空!");
flag = false;
return false;
}
if(phoneName===""){
message("选中的第"+(index+1)+"行\"负责人联系方式\",不能为空!");
flag = false;
return false;
}
if(address===""){
message("选中的第"+(index+1)+"行\"地址\",不能为空!");
flag = false;
return false;
}
if(status===""){
message("选中的第"+(index+1)+"行\"状态\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ003", "save", true);
}
});
}
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ003", "delete", true);
}
});
}
......@@ -20,11 +20,20 @@ $(function() {
}
}],
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'update'
||e.eiInfo.extAttr.methodName == 'insert'
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
},
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
}
......@@ -44,3 +53,59 @@ $(window).load(function () {
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 status= item.get("status");
if(inventType===""){
message("选中的第"+(index+1)+"行\"存货类型\",不能为空!");
flag = false;
return false;
}
if(inventName===""){
message("选中的第"+(index+1)+"行\"存货名称\",不能为空!");
flag = false;
return false;
}
if(status===""){
message("选中的第"+(index+1)+"行\"状态\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ004", "save", true);
}
});
}
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ004", "delete", true);
}
});
}
......@@ -71,11 +71,20 @@ $(function() {
}
}],
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'update'
||e.eiInfo.extAttr.methodName == 'insert'
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
},
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
}
......@@ -104,3 +113,71 @@ $(window).load(function () {
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 inventCode= item.get("inventCode");
let material= item.get("material");
let unit= item.get("unit");
let status= item.get("status");
if(inventType===""){
message("选中的第"+(index+1)+"行\"存货类型\",不能为空!");
flag = false;
return false;
}
if(inventCode===""){
message("选中的第"+(index+1)+"行\"存货名称\",不能为空!");
flag = false;
return false;
}
if(material===""){
message("选中的第"+(index+1)+"行\"材质\",不能为空!");
flag = false;
return false;
}
if(unit===""){
message("选中的第"+(index+1)+"行\"单位\",不能为空!");
flag = false;
return false;
}
if(status===""){
message("选中的第"+(index+1)+"行\"状态\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ006", "save", true);
}
});
}
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ006", "delete", true);
}
});
}
......@@ -20,11 +20,20 @@ $(function() {
}
}],
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'update'
||e.eiInfo.extAttr.methodName == 'insert'
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
},
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
}
......@@ -44,3 +53,65 @@ $(window).load(function () {
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 whName= item.get("whName");
let whType= item.get("whType");
let princ= item.get("princ");
let status= item.get("status");
if(whName===""){
message("选中的第"+(index+1)+"行\"仓库名称\",不能为空!");
flag = false;
return false;
}
if(whType===""){
message("选中的第"+(index+1)+"行\"仓库类型\",不能为空!");
flag = false;
return false;
}
if(princ===""){
message("选中的第"+(index+1)+"行\"负责人\",不能为空!");
flag = false;
return false;
}
if(status===""){
message("选中的第"+(index+1)+"行\"状态\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ007", "save", true);
}
});
}
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ007", "delete", true);
}
});
}
......@@ -36,8 +36,7 @@ $(function () {
deleteFunc();
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'update'
||e.eiInfo.extAttr.methodName == 'insert'
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
......@@ -82,11 +81,34 @@ let save = function () {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ011", "save", true);
let flag = true;
$.each(rows, function(index, item) {
let factoryName= item.get("factoryName");
let groupCode= item.get("groupCode");
let groupType= item.get("groupType");
if(factoryName===""){
message("选中的第"+(index+1)+"行\"厂区名称\",不能为空!");
flag = false;
return false;
}
if(groupCode===""){
message("选中的第"+(index+1)+"行\"生产组名称\",不能为空!");
flag = false;
return false;
}
if(groupType===""){
message("选中的第"+(index+1)+"行\"组类型\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ011", "save", true);
}
});
}
}
/**
......
......@@ -118,8 +118,7 @@ $(function () {
deleteFunc();
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'update'
||e.eiInfo.extAttr.methodName == 'insert'
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
......@@ -208,11 +207,46 @@ let save = function () {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ012", "save", true);
let flag = true;
$.each(rows, function(index, item) {
let whCode= item.get("whCode");
let inventCode= item.get("inventCode");
let inventRecordId= item.get("inventRecordId");
let inventType= item.get("inventType");
let warnNum= item.get("warnNum");
if(inventType===""){
message("选中的第"+(index+1)+"行\"存货类型\",不能为空!");
flag = false;
return false;
}
if(whCode===""){
message("选中的第"+(index+1)+"行\"仓库名称\",不能为空!");
flag = false;
return false;
}
if(inventCode===""){
message("选中的第"+(index+1)+"行\"存货名称\",不能为空!");
flag = false;
return false;
}
if(inventRecordId===""){
message("选中的第"+(index+1)+"行\"规格\",不能为空!");
flag = false;
return false;
}
if(warnNum===""){
message("选中的第"+(index+1)+"行\"预警值\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ012", "save", true);
}
});
}
}
/**
......
......@@ -24,10 +24,10 @@ $(function () {
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-factoryCode", options.model["factoryCode"]);
inInfo.set("inqu_status-0-parentOrgId", options.model["factoryCode"]);
// 1:生产组
inInfo.set("inqu_status-0-groupType", 1);
inInfo.set("serviceName", "HPPZ011");
inInfo.set("inqu_status-0-orgType", 'prodGroup');
inInfo.set("serviceName", "HPXSOrg");
inInfo.set("methodName", "queryGroupComboBox");
inInfo.set("blockId", "group_record_block_id");
inInfo.set("field", options.field);
......@@ -64,8 +64,8 @@ $(function () {
$(window).load(function () {
// 生产组名称
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-groupType", 1);
EiCommunicator.send("HPPZ011", "queryGroupComboBox", inInfo, {
inInfo.set("inqu_status-0-orgType", 'prodGroup');
EiCommunicator.send("HPXSOrg", "queryGroupComboBox", inInfo, {
onSuccess: function (ei) {
factoryGroupGlobalData = ei.getBlock("group_record_block_id").getMappedRows();
},
......
......@@ -26,7 +26,7 @@
<EF:EFRegion id="result" title="生产任务集">
<EF:EFGrid blockId="result" autoDraw="no" checkMode="row,single" >
<EF:EFGrid blockId="result" autoDraw="no" height="30vh" checkMode="row,single" >
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn enable="false" ename="projCode" cname="项目号" />
<EF:EFColumn enable="false" ename="projName" cname="项目名称"/>
......
......@@ -478,18 +478,27 @@ $(function () {
* 组织机构树节点新增(新增组织机构)
*/
$("#add").on("click", () => {
const parentId = $("#inqu_status-0-parentOrgId").val()
if (null == parentId || "" === parentId) {
IPLAT.alert("请在组织机构树选择任意节点后新增组织机构")
return
}
$("#inqu_status2-0-parentOrgId").val(parentId)
// $("#inqu_status2-0-parentOrgEname").val(parentId)
$("#inqu_status2-0-orgEname").val("")
$("#inqu_status2-0-orgCname").val("")
IPLAT.EFSelect.value($("#inqu_status2-0-orgType"), "")
result2Grid.dataSource.page(1)
$("#insertOrgWindow").data("kendoWindow").open();
const parentId = $("#inqu_status-0-parentOrgId").val()
if (null == parentId || "" === parentId) {
IPLAT.alert("请在组织机构树选择任意节点后新增组织机构")
return
}
// $("#inqu_status2-0-parentOrgId").val(parentId)
// $("#inqu_status2-0-parentOrgEname").val(parentId)
// $("#inqu_status2-0-orgEname").val("")
// $("#inqu_status2-0-orgCname").val("")
// IPLAT.EFSelect.value($("#inqu_status2-0-orgType"), "")
// result2Grid.dataSource.page(1)
// $("#insertOrgWindow").data("kendoWindow").open();
let params = "&inqu_status-0-parentOrgId=" + parentId
+ "&inqu_status-0-parentOrgEname=" + parentId;
JSColorbox.open({
href: "XSOG0801A?methodName=initLoad" + params,
title: "<div style='text-align: center;'>新增子组织机构</div>",
width: "70%",
height: "70%",
callbackName: addCallback
});
})
/**
......@@ -767,53 +776,35 @@ $(function () {
}
},
"result2": {
onSuccess: (e) => {
if (e.type === "create") {
setTimeout(() => {
const selectTreeNode = (tree, treeOrgId) => {
if (!tree || treeOrgId == null) {
return
}
setTimeout(() => {
let barDataItem = tree.dataSource.get(treeOrgId);
if (barDataItem) {
let barElement = tree.findByUid(barDataItem.uid);
// 刷新完成后选中对应的树节点
tree.select(barElement);
} else {
selectTreeNode(tree, treeOrgId)
}
}, 100)
}
// 刷新树节点
const tree = $("#categoryTree").data("kendoTreeView");
const treeOrgId = $("#inqu_status2-0-parentOrgId").val()
tree.reload(treeOrgId)
expandTreeNode(tree, treeOrgId)
// tree.expandPath(treeOrgId)
// 展开成功后选中对应的树节点
selectTreeNode(tree, treeOrgId);
}, 500)
}
},
columns: [{
field: "establishDate",
attributes: {
class: "i-input-readonly"
}
}],
onSuccess: (e) => {
if (e.type === "create") {
refreshTree();
}
},
},
"result3": {
onSuccess: (e) => {
if (e.type === "update") {
setTimeout(() => {
// 刷新树节点
const tree = $("#categoryTree").data("kendoTreeView");
const orgParentId = $("#inqu_status3-0-orgParentId").val()
const treeOrgId = $("#inqu_status3-0-orgId").val()
tree.reload(orgParentId)
// 选中树节点
columns: [{
field: "establishDate",
attributes: {
class: "i-input-readonly"
}
}],
onSuccess: (e) => {
if (e.type === "update") {
setTimeout(() => {
// 刷新树节点
const tree = $("#categoryTree").data("kendoTreeView");
const orgParentId = $("#inqu_status3-0-orgParentId").val()
const treeOrgId = $("#inqu_status3-0-orgId").val()
tree.reload(orgParentId)
// 选中树节点
selectTreeNode(tree, treeOrgId);
}, 500)
......@@ -902,8 +893,8 @@ $(function () {
IPLAT.alert(response.getMsg());
}
}, onFail: function (errorMsg, status, e) { /* errorMsg 是平台格式化后的异常消息, status, e的含义和$.ajax的含义相同,请参考jQuery文档 */
console.log(errorMsg);
}
console.log(errorMsg);
}
});
})
}
......@@ -912,17 +903,56 @@ $(function () {
});
let movedUser;
/**
* 新增组织机构回调
*/
let addCallback = function (parentOrgId) {
// 回填父级ID
$("#inqu_status2-0-parentOrgId").val(parentOrgId);
refreshTree();
}
let splitter;
/**
* 刷新树
*/
let refreshTree = function () {
setTimeout(() => {
const selectTreeNode = (tree, treeOrgId) => {
if (!tree || treeOrgId == null) {
return
}
setTimeout(() => {
let barDataItem = tree.dataSource.get(treeOrgId);
if (barDataItem) {
let barElement = tree.findByUid(barDataItem.uid);
// 刷新完成后选中对应的树节点
tree.select(barElement);
} else {
selectTreeNode(tree, treeOrgId)
}
}, 100)
}
// 刷新树节点
const tree = $("#categoryTree").data("kendoTreeView");
const treeOrgId = $("#inqu_status2-0-parentOrgId").val()
tree.reload(treeOrgId)
expandTreeNode(tree, treeOrgId)
// tree.expandPath(treeOrgId)
// 展开成功后选中对应的树节点
selectTreeNode(tree, treeOrgId);
}, 500);
}
let movedUser;
let splitter;
/**
* 扩展信息查看
* @param e
*/
const user_ex_btn_func = (e) => {
const model = resultGrid.dataItem(e.closest("tr"));
const model = resultGrid.dataItem(e.closest("tr"));
const userId = model.id;
splitter.collapse(".k-pane:first")
......
......@@ -134,7 +134,6 @@
</div>
<div id="menu" style="margin-top: 12px; margin-bottom: 8px">
<EF:EFTree bindId="categoryTree" ename="tree_name" textField="text" valueField="label"
hasChildren="leaf" pid="parent_id"
serviceName="XSOG0800" methodName="query">
......@@ -146,8 +145,7 @@
<span style="font-size: 16px; width: 16px; vertical-align: middle;" class="fa fa-plus"></span>新增
</li>
<li data-type="delete" id="isDel">
<span style="font-size: 16px; width: 16px; vertical-align: middle;"
class="fa fa-minus-circle"></span>删除
<span style="font-size: 16px; width: 16px; vertical-align: middle;" class="fa fa-minus-circle"></span>删除
</li>
<li data-type="edit" id="isEdit">
<span style="font-size: 16px; width: 16px; vertical-align: middle;" class="fa fa-pencil"></span>编辑
......@@ -264,9 +262,9 @@
<EF:EFRegion id="inqu2" title="查询条件">
<div class="row">
<EF:EFInput ename="inqu_status2-0-parentOrgId" cname="上级组织Id" type="hidden"/>
<EF:EFInput ename="inqu_status2-0-parentOrgEname" cname="上级组织编码" type="hidden"/>
<EF:EFInput ename="inqu_status2-0-orgEname" cname="组织编码"/>
<EF:EFInput ename="inqu_status2-0-orgCname" cname="组织名称"/>
<EF:EFInput ename="inqu_status2-0-parentOrgEname" cname="上级组织编码" type="hidden"/>
<EF:EFInput ename="inqu_status2-0-orgEname" cname="组织编码" type="hidden"/>
<EF:EFInput ename="inqu_status2-0-orgCname" cname="组织名称"/>
<%--这里注册成小代码,下拉查询--%>
<EF:EFSelect cname="组织类型" optionLabel="全部" blockId="inqu_status2" ename="orgType" row="0">
<EF:EFCodeOption codeName="xs.og.orgType" textField="label" valueField="value"/>
......@@ -279,9 +277,9 @@
insertMethod="insertOrgByParentId"
>
<EF:EFColumn ename="orgId" cname="组织ID" hidden="true"/> <%--隐藏--%>
<EF:EFColumn ename="orgEname" cname="组织编码" required="true" readonly="true" locked="true"/>
<EF:EFColumn ename="orgEname" cname="组织编码" readonly="true" hidden="true"/>
<EF:EFColumn ename="orgCname" cname="组织名称" required="true" locked="true"/>
<EF:EFColumn ename="orgBriefName" cname="组织别名"/>
<EF:EFColumn ename="orgBriefName" cname="组织别名" hidden="true"/>
<EF:EFComboColumn ename="orgType" cname="组织类型" required="true" textField="label" valueField="value">
<EF:EFCodeOption codeName="xs.og.orgType" textField="label" valueField="value"/>
</EF:EFComboColumn>
......@@ -290,7 +288,7 @@
<EF:EFColumn ename="establishDate" cname="成立时间" required="true" width="170" parseFormats="['yyyyMMdd']"
editType="date"
dateFormat="yyyy-MM-dd" align="center"/>
<EF:EFColumn ename="orgLevel" cname="组织级别" align="center"/>
<EF:EFColumn ename="orgLevel" cname="组织级别" align="center" hidden="true"/>
<EF:EFColumn ename="sortIndex" cname="排序" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
......@@ -305,23 +303,20 @@
</div>
<EF:EFRegion id="result3Region" title="子组织机构">
<EF:EFGrid blockId="result3" autoBind="false" autoDraw="false" checkMode="multiple, row"
queryMethod="queryOrgById"
updateMethod="updateOrgById"
>
queryMethod="queryOrgById" updateMethod="updateOrgById">
<EF:EFColumn ename="orgId" cname="组织ID" hidden="true"/> <%--隐藏--%>
<EF:EFColumn ename="orgEname" cname="组织编码" required="true" readonly="true" locked="true"/>
<EF:EFColumn ename="orgCname" cname="组织名称" required="true" locked="true"/>
<EF:EFColumn ename="orgBriefName" cname="组织别名"/>
<EF:EFComboColumn ename="orgType" cname="组织类型" required="true" textField="label" valueField="value">
<EF:EFCodeOption codeName="xs.og.orgType" textField="label" valueField="value"/>
</EF:EFComboColumn>
<EF:EFColumn ename="orgNodeType" cname="节点类型" hidden="true" defaultValue="2"/> <%--隐藏 默认值为2--%>
<EF:EFColumn ename="parentOrgId" cname="上级组织编码" readonly="true" hidden="true"/> <%--隐藏--%>
<EF:EFColumn ename="establishDate" cname="成立时间" required="true" width="170" parseFormats="['yyyyMMdd']"
editType="date"
dateFormat="yyyy-MM-dd" align="center"/>
<EF:EFColumn ename="orgLevel" cname="组织级别" align="center"/>
<EF:EFColumn ename="sortIndex" cname="排序" align="center"/>
<EF:EFColumn ename="orgEname" cname="组织编码" readonly="true" locked="true" hidden="true"/>
<EF:EFColumn ename="orgCname" cname="组织名称" locked="true" required="true" />
<EF:EFColumn ename="orgBriefName" cname="组织别名" hidden="true"/>
<EF:EFComboColumn ename="orgType" cname="组织类型" align="center" readonly="true">
<EF:EFCodeOption codeName="xs.og.orgType" textField="label" valueField="value"/>
</EF:EFComboColumn>
<EF:EFColumn ename="orgNodeType" cname="节点类型" hidden="true" defaultValue="2"/> <%--隐藏 默认值为2--%>
<EF:EFColumn ename="parentOrgId" cname="上级组织编码" readonly="true" hidden="true"/> <%--隐藏--%>
<EF:EFColumn ename="establishDate" cname="成立时间" required="true" width="170" parseFormats="['yyyyMMdd']"
editType="date" dateFormat="yyyy-MM-dd" align="center"/>
<EF:EFColumn ename="orgLevel" cname="组织级别" align="center" hidden="true"/>
<EF:EFColumn ename="sortIndex" cname="排序" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFWindow>
......
$(function () {
IPLATUI.EFGrid = {
"result": {
columns: [],
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
}
}
};
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
});
/**
* 查询
*/
var query = function (e) {
resultGrid.dataSource.page(1);
};
/**
* 选择库存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let orgCname = rows[i]['orgCname'];
if (isBlank(orgCname)) {
message("组织机构名称不能为空");
return;
}
let orgType = rows[i]['orgType'];
if (isBlank(orgType)) {
message("组织类型不能为空");
return;
}
let establishDate = rows[i]['establishDate'];
if (isBlank(establishDate)) {
message("成立时间不能为空");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "XSOG0801A", "save", true, function (e) {
var status = e.getStatus();
if (status !== -1) {
let parentOrgId = $("#inqu_status-0-parentOrgId").val();
parent.JSColorbox.setValueCallback(parentOrgId);
}
});
}
});
}
<!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="上级组织Id" blockId="inqu_status" ename="parentOrgId" row="0" type="hidden"/>
<EF:EFInput cname="上级组织编码" blockId="inqu_status" ename="parentOrgEname" row="0" type="hidden"/>
<EF:EFInput cname="组织编码" blockId="inqu_status" ename="orgEname" row="0" type="hidden"/>
<EF:EFInput cname="组织名称" blockId="inqu_status" ename="orgCname" row="0"/>
<EF:EFSelect cname="组织类型" blockId="inqu_status" ename="orgType" row="0" optionLabel="全部">
<EF:EFOptions blockId="orgTypeBlock" textField="label" valueField="value"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="子组织机构">
<EF:EFGrid blockId="result" autoBind="false" autoDraw="false" checkMode="multiple,row" readonly="true">
<EF:EFColumn ename="orgId" cname="组织ID" hidden="true"/>
<EF:EFColumn ename="orgEname" cname="组织编码" readonly="true" hidden="true"/>
<EF:EFColumn ename="orgCname" cname="组织名称" required="true" locked="true"/>
<EF:EFColumn ename="orgBriefName" cname="组织别名" hidden="true"/>
<EF:EFComboColumn ename="orgType" cname="组织类型" required="true" textField="label" valueField="value">
<EF:EFOptions blockId="orgTypeBlock" textField="label" valueField="value"/>
</EF:EFComboColumn>
<EF:EFColumn ename="orgNodeType" cname="节点类型" hidden="true" defaultValue="2"/> <%--隐藏 默认值为2--%>
<EF:EFColumn ename="parentOrgId" cname="上级组织编码" readonly="true" hidden="true"/> <%--隐藏--%>
<EF:EFColumn ename="establishDate" cname="成立时间" required="true" width="170" parseFormats="['yyyyMMdd']"
editType="date" dateFormat="yyyy-MM-dd" align="center"/>
<EF:EFColumn ename="orgLevel" cname="组织级别" align="center" hidden="true"/>
<EF:EFColumn ename="sortIndex" cname="排序" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment