Commit a568a105 by liuyang

Merge branch 'dev' of http://git.pseer.com:8800/platform/hg-smart into dev-ly

parents 09e9280c 5f6cc8b7
...@@ -5,7 +5,7 @@ package com.baosight.hggp.hg.constant; ...@@ -5,7 +5,7 @@ package com.baosight.hggp.hg.constant;
* @date:2024/1/18,17:16 * @date:2024/1/18,17:16
*/ */
public class HGConstant { public class HGConstant {
/** /**
* 序列号 * 序列号
* *
...@@ -13,7 +13,7 @@ public class HGConstant { ...@@ -13,7 +13,7 @@ public class HGConstant {
* @date:2021/8/17,15:22 * @date:2021/8/17,15:22
*/ */
public static class SequenceId { public static class SequenceId {
// 用户ID // 用户ID
public static final String USER_ID = "USER_ID"; public static final String USER_ID = "USER_ID";
// 组织机构编码 // 组织机构编码
...@@ -40,7 +40,7 @@ public class HGConstant { ...@@ -40,7 +40,7 @@ public class HGConstant {
public static final String WH_CODE = "HGPZ007_WH_CODE"; public static final String WH_CODE = "HGPZ007_WH_CODE";
// 项目性质编码 // 项目性质编码
public static final String NAT_CODE = "HGPZ008_NAT_CODE"; public static final String NAT_CODE = "HGPZ008_NAT_CODE";
//项目档案编号 //项目档案编号
public static final String PROJ_NUMBER = "PROJ_NUMBER"; public static final String PROJ_NUMBER = "PROJ_NUMBER";
// 盘点单号 // 盘点单号
...@@ -101,8 +101,10 @@ public class HGConstant { ...@@ -101,8 +101,10 @@ public class HGConstant {
public static final String INSPEC_CODE = "INSPEC_CODE"; public static final String INSPEC_CODE = "INSPEC_CODE";
// 保养单号 // 保养单号
public static final String UPKEEP_CODE = "UPKEEP_CODE"; public static final String UPKEEP_CODE = "UPKEEP_CODE";
// 蓝图编号
public static final String BLUEPRINT_CODE = "BLUEPRINT_CODE";
} }
/** /**
* 采购计划状态 * 采购计划状态
* *
...@@ -110,7 +112,7 @@ public class HGConstant { ...@@ -110,7 +112,7 @@ public class HGConstant {
* @date:2024/2/22,13:57 * @date:2024/2/22,13:57
*/ */
public static class CgPlanStatus { public static class CgPlanStatus {
// 待审核 // 待审核
public static final Integer S_0 = 0; public static final Integer S_0 = 0;
// 审核中 // 审核中
...@@ -122,7 +124,7 @@ public class HGConstant { ...@@ -122,7 +124,7 @@ public class HGConstant {
// 生成合同 // 生成合同
public static final Integer S_4 = 4; public static final Integer S_4 = 4;
} }
/** /**
* 采购合同状态 * 采购合同状态
* *
...@@ -130,7 +132,7 @@ public class HGConstant { ...@@ -130,7 +132,7 @@ public class HGConstant {
* @date:2024/2/22,13:57 * @date:2024/2/22,13:57
*/ */
public static class CgContractStatus { public static class CgContractStatus {
// 待审核 // 待审核
public static final Integer S_0 = 0; public static final Integer S_0 = 0;
// 审核中 // 审核中
...@@ -164,7 +166,7 @@ public class HGConstant { ...@@ -164,7 +166,7 @@ public class HGConstant {
// 已入库 // 已入库
public static final Integer S_5 = 5; public static final Integer S_5 = 5;
} }
/** /**
* 库存类型 * 库存类型
* *
...@@ -172,7 +174,7 @@ public class HGConstant { ...@@ -172,7 +174,7 @@ public class HGConstant {
* @date:2024/1/20,15:18 * @date:2024/1/20,15:18
*/ */
public static class KcType { public static class KcType {
// 采购 // 采购
public static final String CG = "CG"; public static final String CG = "CG";
// 生产 // 生产
...@@ -180,5 +182,33 @@ public class HGConstant { ...@@ -180,5 +182,33 @@ public class HGConstant {
// 其他 // 其他
public static final String QT = "QT"; public static final String QT = "QT";
} }
/**
* 停用状态
*
* @author:songx
* @date:2024/1/20,15:18
*/
public static class EnablingStatus {
// 停用
public static final Integer TY = 0;
// 启用
public static final Integer QY = 1;
}
/**
* 审批状态
*
* @author:songx
* @date:2024/5/15,15:18
*/
public static class ApprovalStatus {
// 待审
public static final Integer DS = 0;
// 审批中
public static final Integer SPZ = 1;
// 已审
public static final Integer YS = 2;
}
} }
package com.baosight.hggp.hg.sc.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* Project: <br>
* Title:HGSC003.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-05-14 20:23:03 create
*/
public class HGSC003 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_id = "id"; /* 主键*/
public static final String FIELD_company_code = "companyCode"; /* 公司编码*/
public static final String FIELD_company_name = "companyName"; /* 公司名称*/
public static final String FIELD_dep_code = "depCode"; /* 公司编码*/
public static final String FIELD_dep_name = "depName"; /* 公司名称*/
public static final String FIELD_blueprint_code = "blueprintCode"; /* 蓝图编号*/
public static final String FIELD_blueprint_name = "blueprintName"; /* 蓝图名称*/
public static final String FIELD_proj_code = "projCode"; /* 项目编码*/
public static final String FIELD_proj_name = "projName"; /* 项目名称*/
public static final String FIELD_blueprint_status = "blueprintStatus"; /* 蓝图状态 0:停用,1:启用*/
public static final String FIELD_approval_status = "approvalStatus"; /* 审批状态\t0:待审;1:审核中;2:已审*/
public static final String FIELD_account_code = "accountCode"; /* 帐套*/
public static final String FIELD_created_by = "createdBy"; /* 创建人*/
public static final String FIELD_created_name = "createdName"; /* 创建人名称*/
public static final String FIELD_created_time = "createdTime"; /* 创建时间*/
public static final String FIELD_updated_by = "updatedBy"; /* 更新人*/
public static final String FIELD_updated_name = "updatedName"; /* 修改人名称*/
public static final String FIELD_updated_time = "updatedTime"; /* 更新时间*/
public static final String COL_id = "id"; /* 主键*/
public static final String COL_company_code = "company_code"; /* 公司编码*/
public static final String COL_company_name = "company_name"; /* 公司名称*/
public static final String COL_dep_code = "dep_code"; /* 公司编码*/
public static final String COL_dep_name = "dep_name"; /* 公司名称*/
public static final String COL_blueprint_code = "blueprint_code"; /* 蓝图编号*/
public static final String COL_blueprint_name = "blueprint_name"; /* 蓝图名称*/
public static final String COL_proj_code = "proj_code"; /* 项目编码*/
public static final String COL_proj_name = "proj_name"; /* 项目名称*/
public static final String COL_blueprint_status = "blueprint_status"; /* 蓝图状态 0:停用,1:启用*/
public static final String COL_approval_status = "approval_status"; /* 审批状态\t0:待审;1:审核中;2:已审*/
public static final String COL_account_code = "account_code"; /* 帐套*/
public static final String COL_created_by = "created_by"; /* 创建人*/
public static final String COL_created_name = "created_name"; /* 创建人名称*/
public static final String COL_created_time = "created_time"; /* 创建时间*/
public static final String COL_updated_by = "updated_by"; /* 更新人*/
public static final String COL_updated_name = "updated_name"; /* 修改人名称*/
public static final String COL_updated_time = "updated_time"; /* 更新时间*/
public static final String QUERY = "HGSC003.query";
public static final String COUNT = "HGSC003.count";
public static final String INSERT = "HGSC003.insert";
public static final String UPDATE = "HGSC003.update";
public static final String DELETE = "HGSC003.delete";
public static final String BATCH_DELETE = "HGSC003.batchDelete";
public static final String BATCH_DEACTIVATE = "HGSC003.batchDeactivate";
public static final String UPDATE_BLUEPRINT_STATUS = "HGSC003.updateBlueprintStatus";
private Long id = new Long(0); /* 主键*/
private String companyCode = " "; /* 公司编码*/
private String companyName = " "; /* 公司名称*/
private String depCode = " "; /* 部门编码*/
private String depName = " "; /* 部门名称*/
private String blueprintCode = " "; /* 蓝图编号*/
private String blueprintName = " "; /* 蓝图名称*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private Integer blueprintStatus = new Integer(0); /* 蓝图状态 0:停用,1:启用*/
private Integer approvalStatus = new Integer(0); /* 审批状态\t0:待审;1:审核中;2:已审*/
private String accountCode = " "; /* 帐套*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 更新时间*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_id);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_company_code);
eiColumn.setFieldLength(32);
eiColumn.setDescName("公司编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_company_name);
eiColumn.setFieldLength(32);
eiColumn.setDescName("公司名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_dep_code);
eiColumn.setFieldLength(20);
eiColumn.setDescName("公司编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_dep_name);
eiColumn.setFieldLength(32);
eiColumn.setDescName("公司名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_blueprint_code);
eiColumn.setFieldLength(32);
eiColumn.setDescName("蓝图编号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_blueprint_name);
eiColumn.setFieldLength(50);
eiColumn.setDescName("蓝图名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_code);
eiColumn.setFieldLength(20);
eiColumn.setDescName("项目编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_name);
eiColumn.setFieldLength(50);
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_blueprint_status);
eiColumn.setType("N");
eiColumn.setDescName("蓝图状态 0:停用,1:启用");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_approval_status);
eiColumn.setType("N");
eiColumn.setDescName("审批状态\t0:待审;1:审核中;2:已审");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_account_code);
eiColumn.setFieldLength(32);
eiColumn.setDescName("帐套");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_created_by);
eiColumn.setFieldLength(32);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_created_name);
eiColumn.setFieldLength(32);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_created_time);
eiColumn.setFieldLength(14);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_updated_by);
eiColumn.setFieldLength(32);
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_updated_name);
eiColumn.setFieldLength(32);
eiColumn.setDescName("修改人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_updated_time);
eiColumn.setFieldLength(14);
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGSC003() {
initMetaData();
}
/**
* get the id - 主键.
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id - 主键.
*
* @param id - 主键
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the companyCode - 公司编码.
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 公司编码.
*
* @param companyCode - 公司编码
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the companyName - 公司名称.
* @return the companyName
*/
public String getCompanyName() {
return this.companyName;
}
/**
* set the companyName - 公司名称.
*
* @param companyName - 公司名称
*/
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
/**
* get the blueprintCode - 蓝图编号.
* @return the blueprintCode
*/
public String getBlueprintCode() {
return this.blueprintCode;
}
/**
* set the blueprintCode - 蓝图编号.
*
* @param blueprintCode - 蓝图编号
*/
public void setBlueprintCode(String blueprintCode) {
this.blueprintCode = blueprintCode;
}
/**
* get the blueprintName - 蓝图名称.
* @return the blueprintName
*/
public String getBlueprintName() {
return this.blueprintName;
}
/**
* set the blueprintName - 蓝图名称.
*
* @param blueprintName - 蓝图名称
*/
public void setBlueprintName(String blueprintName) {
this.blueprintName = blueprintName;
}
/**
* get the projCode - 项目编码.
* @return the projCode
*/
public String getProjCode() {
return this.projCode;
}
/**
* set the projCode - 项目编码.
*
* @param projCode - 项目编码
*/
public void setProjCode(String projCode) {
this.projCode = projCode;
}
/**
* get the projName - 项目名称.
* @return the projName
*/
public String getProjName() {
return this.projName;
}
/**
* set the projName - 项目名称.
*
* @param projName - 项目名称
*/
public void setProjName(String projName) {
this.projName = projName;
}
/**
* get the blueprintStatus - 蓝图状态 0:停用,1:启用.
* @return the blueprintStatus
*/
public Integer getBlueprintStatus() {
return this.blueprintStatus;
}
/**
* set the blueprintStatus - 蓝图状态 0:停用,1:启用.
*
* @param blueprintStatus - 蓝图状态 0:停用,1:启用
*/
public void setBlueprintStatus(Integer blueprintStatus) {
this.blueprintStatus = blueprintStatus;
}
/**
* get the approvalStatus - 审批状态\t0:待审;1:审核中;2:已审.
* @return the approvalStatus
*/
public Integer getApprovalStatus() {
return this.approvalStatus;
}
/**
* set the approvalStatus - 审批状态\t0:待审;1:审核中;2:已审.
*
* @param approvalStatus - 审批状态\t0:待审;1:审核中;2:已审
*/
public void setApprovalStatus(Integer approvalStatus) {
this.approvalStatus = approvalStatus;
}
/**
* get the accountCode - 帐套.
* @return the accountCode
*/
public String getAccountCode() {
return this.accountCode;
}
/**
* set the accountCode - 帐套.
*
* @param accountCode - 帐套
*/
public void setAccountCode(String accountCode) {
this.accountCode = accountCode;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称.
*
* @param createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人.
*
* @param updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 修改人名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 修改人名称.
*
* @param updatedName - 修改人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 更新时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间.
*
* @param updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
public String getDepCode() {
return depCode;
}
public void setDepCode(String depCode) {
this.depCode = depCode;
}
public String getDepName() {
return depName;
}
public void setDepName(String depName) {
this.depName = depName;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_id)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_company_code)), companyCode));
setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_company_name)), companyName));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_dep_code)), depCode));
setDepName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_dep_name)), depName));
setBlueprintCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_blueprint_code)), blueprintCode));
setBlueprintName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_blueprint_name)), blueprintName));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_code)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_name)), projName));
setBlueprintStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_blueprint_status)), blueprintStatus));
setApprovalStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_approval_status)), approvalStatus));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_account_code)), accountCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_created_by)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_created_name)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_created_time)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_by)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_name)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_time)), updatedTime));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_id, StringUtils.toString(id, eiMetadata.getMeta(FIELD_id)));
map.put(FIELD_company_code, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_company_code)));
map.put(FIELD_company_name, StringUtils.toString(companyName, eiMetadata.getMeta(FIELD_company_name)));
map.put(FIELD_dep_code, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_dep_code)));
map.put(FIELD_dep_name, StringUtils.toString(depName, eiMetadata.getMeta(FIELD_dep_name)));
map.put(FIELD_blueprint_code, StringUtils.toString(blueprintCode, eiMetadata.getMeta(FIELD_blueprint_code)));
map.put(FIELD_blueprint_name, StringUtils.toString(blueprintName, eiMetadata.getMeta(FIELD_blueprint_name)));
map.put(FIELD_proj_code, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_proj_code)));
map.put(FIELD_proj_name, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_proj_name)));
map.put(FIELD_blueprint_status, StringUtils.toString(blueprintStatus, eiMetadata.getMeta(FIELD_blueprint_status)));
map.put(FIELD_approval_status, StringUtils.toString(approvalStatus, eiMetadata.getMeta(FIELD_approval_status)));
map.put(FIELD_account_code, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_account_code)));
map.put(FIELD_created_by, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_created_by)));
map.put(FIELD_created_name, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_created_name)));
map.put(FIELD_created_time, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_created_time)));
map.put(FIELD_updated_by, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_updated_by)));
map.put(FIELD_updated_name, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_updated_name)));
map.put(FIELD_updated_time, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_updated_time)));
return map;
}
}
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.domain.HGSC003;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.*;
/**
* @Author jhs
* @Date 2024/5/14 14:46
*/
public class ServiceHGSC003 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC003.QUERY, new HGSC003());
Map map = new HashMap();
map.put(HGSC003.FIELD_account_code, UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID),map,false
);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC003.QUERY, new HGSC003());
Map map = new HashMap();
map.put(HGSC003.FIELD_account_code, UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID),map,false
);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 蓝图ids
List<Long> ids = ObjectUtils.listKey(resultRows, HGSC003.FIELD_id);
DaoUtils.update(HGSC003.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}});
// HGSCTools.THGSC003A.deleteByProIds(ids);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
public EiInfo deactivate(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 蓝图ids
List<Long> ids = ObjectUtils.listKey(resultRows, "id");
DaoUtils.update(HGSC003.BATCH_DEACTIVATE, new HashMap<String,Object>(){{put("ids",ids);}});
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据停用成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "操作失败");
}
return inInfo;
}
public EiInfo save(EiInfo inInfo){
try {
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
HGSC003 hgsc003 = new HGSC003();
hgsc003.fromMap(resultMap);
this.checkSaveData(hgsc003);
if(Objects.nonNull(hgsc003.getId())&&hgsc003.getId()!=0){
DaoUtils.update(HGSC003.UPDATE, hgsc003);
}else {
//生成蓝图编号
hgsc003.setBlueprintCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.BLUEPRINT_CODE));
hgsc003.setBlueprintStatus(HGConstant.EnablingStatus.QY);
DaoUtils.insert(HGSC003.INSERT, hgsc003);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param hgsc003
*/
private void checkSaveData(HGSC003 hgsc003) {
if(Objects.nonNull(hgsc003.getId())&&hgsc003.getId()>0){
HGSC003 oldHgsc003 = (HGSC003) super.dao.get(HGSC003.QUERY,HGSC003.FIELD_id,hgsc003.getId());
AssertUtils.isTrue(oldHgsc003.getBlueprintStatus().compareTo(HGConstant.EnablingStatus.QY) == 0,"蓝图启用中不可修改!");
}
Map<String,Object> map = new HashMap<>();
map.put("projCode",hgsc003.getProjCode());
List<HGSC003> oldHgsc003List = this.dao.query(HGSC003.QUERY,map);
for(HGSC003 o : oldHgsc003List){
AssertUtils.isTrue(!(o.getId().intValue() == hgsc003.getId().intValue()),"已存在此项目号的蓝图!");
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(hgsc003.getCompanyCode(), "请选择公司!");
AssertUtils.isEmpty(hgsc003.getProjCode(), "请填写项目编号!");
AssertUtils.isEmpty(hgsc003.getProjName(), "请填写项目名称!");
AssertUtils.isEmpty(hgsc003.getBlueprintName(), "请填写蓝图名称!");
}
/**
* 修改启用状态
* @param inInfo
* @return
*/
public EiInfo updateBlueprintStatus(EiInfo inInfo){
int i = 0;
try {
HGSC003 hgsc003 = new HGSC003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgsc003.fromMap(map);
DaoUtils.update(HGSC003.UPDATE_BLUEPRINT_STATUS, hgsc003);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleUpdateException(inInfo,i,e);
logError("修改失败", e.getMessage());
return inInfo;
}
return inInfo;
}
/**
* 项目档案下拉框
* @param inInfo
* @return
*/
public EiInfo projComboBox(EiInfo inInfo){
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String companyCode = MapUtils.getString(queryMap, HGSC001.FIELD_company_code);
String approvalStatus = MapUtils.getString(queryMap, HGSC001.FIELD_approval_status);
Map map = new HashMap();
map.put(HGSC001.FIELD_account_code, UserSessionUtils.getAccountCode());
map.put(HGSC001.FIELD_company_code, companyCode);
map.put(HGSC001.FIELD_approval_status, approvalStatus);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), map,false);
return inInfo;
}
}
...@@ -4,33 +4,33 @@ ...@@ -4,33 +4,33 @@
Version : 1.0 Version : 1.0
schema : hggp schema : hggp
tableName : HGSC001 tableName : HGSC001
id BIGINT NOT NULL primarykey, id BIGINT NOT NULL primarykey,
company_code VARCHAR NOT NULL, company_code VARCHAR NOT NULL,
company_name VARCHAR NOT NULL, company_name VARCHAR NOT NULL,
dep_code VARCHAR, dep_code VARCHAR,
dep_name VARCHAR, dep_name VARCHAR,
subcontract_code VARCHAR NOT NULL, subcontract_code VARCHAR NOT NULL,
subcontract_name VARCHAR NOT NULL, subcontract_name VARCHAR NOT NULL,
genral_contract_code VARCHAR NOT NULL, genral_contract_code VARCHAR NOT NULL,
genral_contract_name VARCHAR NOT NULL, genral_contract_name VARCHAR NOT NULL,
party_pm_name VARCHAR, party_pm_name VARCHAR,
party_pm_hpone VARCHAR, party_pm_hpone VARCHAR,
contract_name VARCHAR, contract_name VARCHAR,
contract_work_txt VARCHAR, contract_work_txt VARCHAR,
proj_code VARCHAR, proj_code VARCHAR,
proj_name VARCHAR, proj_name VARCHAR,
proj_type VARCHAR, proj_type VARCHAR,
proj_status TINYINT, proj_status TINYINT,
approval_status TINYINT, approval_status TINYINT,
permiss_start_date VARCHAR, permiss_start_date VARCHAR,
start_date VARCHAR, start_date VARCHAR,
end_date VARCHAR, end_date VARCHAR,
account_code VARCHAR NOT NULL, account_code VARCHAR NOT NULL,
created_by VARCHAR, created_by VARCHAR,
created_name VARCHAR, created_name VARCHAR,
created_time VARCHAR, created_time VARCHAR,
updated_by VARCHAR, updated_by VARCHAR,
updated_name VARCHAR, updated_name VARCHAR,
updated_time VARCHAR updated_time VARCHAR
--> -->
<sqlMap namespace="HGSC001"> <sqlMap namespace="HGSC001">
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC001"> resultClass="com.baosight.hggp.hg.sc.domain.HGSC001">
SELECT SELECT
id as "id", id as "id",
company_code as "companyCode", <!-- 公司编码 --> company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 --> company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编码 --> dep_code as "depCode", <!-- 部门编码 -->
...@@ -376,6 +376,9 @@ ...@@ -376,6 +376,9 @@
<isNotEmpty prepend=" AND " property="companyCodes"> <isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate> COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="approvalStatus">
approval_status = #approvalStatus#
</isNotEmpty>
ORDER BY PROJ_CODE ORDER BY PROJ_CODE
</select> </select>
</sqlMap> </sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HGSC003">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name like ('%$companyName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintCode">
blueprint_code = #blueprintCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintName">
blueprint_name like ('%$blueprintName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name like ('%$projName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintStatus">
blueprint_status = #blueprintStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="approvalStatus">
approval_status = #approvalStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
created_name = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
updated_name = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC003">
SELECT
id as "id", <!-- 主键 -->
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编码 -->
dep_name as "depName", <!-- 部门名称 -->
blueprint_code as "blueprintCode", <!-- 蓝图编号 -->
blueprint_name as "blueprintName", <!-- 蓝图名称 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
blueprint_status as "blueprintStatus", <!-- 蓝图状态 0:停用,1:启用 -->
approval_status as "approvalStatus", <!-- 审批状态 0:待审;1:审核中;2:已审 -->
account_code as "accountCode", <!-- 帐套 -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更新人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime" <!-- 更新时间 -->
FROM ${hggpSchema}.HGSC003 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC003 WHERE 1=1
<include refid="condition" />
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSC003 (id, <!-- 主键 -->
company_code, <!-- 公司编码 -->
company_name, <!-- 公司名称 -->
dep_code, <!-- 部门编码 -->
dep_name, <!-- 部门名称 -->
blueprint_code, <!-- 蓝图编号 -->
blueprint_name, <!-- 蓝图名称 -->
proj_code, <!-- 项目编码 -->
proj_name, <!-- 项目名称 -->
blueprint_status, <!-- 蓝图状态 0:停用,1:启用 -->
approval_status, <!-- 审批状态 0:待审;1:审核中;2:已审 -->
account_code, <!-- 帐套 -->
created_by, <!-- 创建人 -->
created_name, <!-- 创建人名称 -->
created_time, <!-- 创建时间 -->
updated_by, <!-- 更新人 -->
updated_name, <!-- 修改人名称 -->
updated_time <!-- 更新时间 -->
)
VALUES (#id#, #companyCode#, #companyName#, #depCode#, #depName#, #blueprintCode#, #blueprintName#, #projCode#, #projName#, #blueprintStatus#, #approvalStatus#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSC003 WHERE
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGSC003
SET
id = #id#, <!-- 主键 -->
company_code = #companyCode#, <!-- 公司编码 -->
company_name = #companyName#, <!-- 公司名称 -->
dep_code = #depCode#, <!-- 部门编码 -->
dep_name = #depName#, <!-- 部门名称 -->
blueprint_code = #blueprintCode#, <!-- 蓝图编号 -->
blueprint_name = #blueprintName#, <!-- 蓝图名称 -->
proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 -->
blueprint_status = #blueprintStatus#, <!-- 蓝图状态 0:停用,1:启用 -->
approval_status = #approvalStatus#, <!-- 审批状态 0:待审;1:审核中;2:已审 -->
account_code = #accountCode#, <!-- 帐套 -->
created_by = #createdBy#, <!-- 创建人 -->
created_name = #createdName#, <!-- 创建人名称 -->
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 -->
WHERE
</update>
<delete id="batchDelete">
DELETE FROM ${hggpSchema}.HGSC003 WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete>
<update id="batchDeactivate">
UPDATE ${hggpSchema}.HGSC003
SET
blueprint_status = 0, <!-- 蓝图状态 0:停用,1:启用 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 -->
WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</update>
<update id="updateBlueprintStatus">
UPDATE ${hggpSchema}.HGSC003
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
BLUEPRINT_STATUS = #blueprintStatus# <!-- 状态0.启用1.停止 -->
WHERE
ID = #id#
</update>
</sqlMap>
package com.baosight.hggp.hg.zl.domain; package com.baosight.hggp.hg.zl.domain;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils; import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/** /**
* Project: <br> * Project: <br>
...@@ -17,7 +16,7 @@ import java.util.Map; ...@@ -17,7 +16,7 @@ import java.util.Map;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br> * Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
* *
* @version 1.0 * @version 1.0
* @history 2024-05-15 16:04:54 create * @history 2024-05-16 11:17:34 create
*/ */
public class HGZL001 extends DaoEPBase { public class HGZL001 extends DaoEPBase {
...@@ -49,8 +48,8 @@ public class HGZL001 extends DaoEPBase { ...@@ -49,8 +48,8 @@ public class HGZL001 extends DaoEPBase {
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_THICK = "thick"; /* 厚度*/
public static final String FIELD_RECEIVE_QTY = "receiveQty"; /* 收货数量*/ public static final String FIELD_RECEIVE_QTY = "receiveQty"; /* 收货数量*/
public static final String FIELD_DELIVER_QTY = "deliverQty"; /* 退货数量*/ public static final String FIELD_QUALIFY_QTY = "qualifyQty"; /* 合格数量*/
public static final String FIELD_DEPOSIT_QTY = "depositQty"; /* 入库数量*/ public static final String FIELD_UNQUALIFY_QTY = "unqualifyQty"; /* 不合格数量*/
public static final String FIELD_RECEIVE_UNIT_WEIGHT = "receiveUnitWeight"; /* 收货单重*/ public static final String FIELD_RECEIVE_UNIT_WEIGHT = "receiveUnitWeight"; /* 收货单重*/
public static final String FIELD_RECEIVE_WEIGHT = "receiveWeight"; /* 收货重量*/ public static final String FIELD_RECEIVE_WEIGHT = "receiveWeight"; /* 收货重量*/
public static final String FIELD_STATUS = "status"; /* 状态:0-质检中,1-质检完成*/ public static final String FIELD_STATUS = "status"; /* 状态:0-质检中,1-质检完成*/
...@@ -81,8 +80,8 @@ public class HGZL001 extends DaoEPBase { ...@@ -81,8 +80,8 @@ public class HGZL001 extends DaoEPBase {
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_THICK = "THICK"; /* 厚度*/
public static final String COL_RECEIVE_QTY = "RECEIVE_QTY"; /* 收货数量*/ public static final String COL_RECEIVE_QTY = "RECEIVE_QTY"; /* 收货数量*/
public static final String COL_DELIVER_QTY = "DELIVER_QTY"; /* 退货数量*/ public static final String COL_QUALIFY_QTY = "QUALIFY_QTY"; /* 合格数量*/
public static final String COL_DEPOSIT_QTY = "DEPOSIT_QTY"; /* 入库数量*/ public static final String COL_UNQUALIFY_QTY = "UNQUALIFY_QTY"; /* 不合格数量*/
public static final String COL_RECEIVE_UNIT_WEIGHT = "RECEIVE_UNIT_WEIGHT"; /* 收货单重*/ public static final String COL_RECEIVE_UNIT_WEIGHT = "RECEIVE_UNIT_WEIGHT"; /* 收货单重*/
public static final String COL_RECEIVE_WEIGHT = "RECEIVE_WEIGHT"; /* 收货重量*/ public static final String COL_RECEIVE_WEIGHT = "RECEIVE_WEIGHT"; /* 收货重量*/
public static final String COL_STATUS = "STATUS"; /* 状态:0-质检中,1-质检完成*/ public static final String COL_STATUS = "STATUS"; /* 状态:0-质检中,1-质检完成*/
...@@ -119,8 +118,8 @@ public class HGZL001 extends DaoEPBase { ...@@ -119,8 +118,8 @@ public class HGZL001 extends DaoEPBase {
private BigDecimal width = new BigDecimal(0.000); /* 宽度*/ private BigDecimal width = new BigDecimal(0.000); /* 宽度*/
private BigDecimal thick = new BigDecimal(0.000); /* 厚度*/ private BigDecimal thick = new BigDecimal(0.000); /* 厚度*/
private BigDecimal receiveQty = new BigDecimal(0.000); /* 收货数量*/ private BigDecimal receiveQty = new BigDecimal(0.000); /* 收货数量*/
private BigDecimal deliverQty = new BigDecimal(0.000); /* 退货数量*/ private BigDecimal qualifyQty = new BigDecimal(0.000); /* 合格数量*/
private BigDecimal depositQty = new BigDecimal(0.000); /* 入库数量*/ private BigDecimal unqualifyQty = new BigDecimal(0.000); /* 不合格数量*/
private BigDecimal receiveUnitWeight = new BigDecimal(0.000); /* 收货单重*/ private BigDecimal receiveUnitWeight = new BigDecimal(0.000); /* 收货单重*/
private BigDecimal receiveWeight = new BigDecimal(0.000); /* 收货重量*/ private BigDecimal receiveWeight = new BigDecimal(0.000); /* 收货重量*/
private Integer status; /* 状态:0-质检中,1-质检完成*/ private Integer status; /* 状态:0-质检中,1-质检完成*/
...@@ -248,18 +247,18 @@ public class HGZL001 extends DaoEPBase { ...@@ -248,18 +247,18 @@ public class HGZL001 extends DaoEPBase {
eiColumn.setDescName("收货数量"); eiColumn.setDescName("收货数量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELIVER_QTY); eiColumn = new EiColumn(FIELD_QUALIFY_QTY);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20); eiColumn.setFieldLength(20);
eiColumn.setDescName("退货数量"); eiColumn.setDescName("合格数量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEPOSIT_QTY); eiColumn = new EiColumn(FIELD_UNQUALIFY_QTY);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20); eiColumn.setFieldLength(20);
eiColumn.setDescName("入库数量"); eiColumn.setDescName("不合格数量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_RECEIVE_UNIT_WEIGHT); eiColumn = new EiColumn(FIELD_RECEIVE_UNIT_WEIGHT);
...@@ -707,36 +706,36 @@ public class HGZL001 extends DaoEPBase { ...@@ -707,36 +706,36 @@ public class HGZL001 extends DaoEPBase {
this.receiveQty = receiveQty; this.receiveQty = receiveQty;
} }
/** /**
* get the deliverQty - 退货数量. * get the qualifyQty - 合格数量.
* @return the deliverQty * @return the qualifyQty
*/ */
public BigDecimal getDeliverQty() { public BigDecimal getQualifyQty() {
return this.deliverQty; return this.qualifyQty;
} }
/** /**
* set the deliverQty - 退货数量. * set the qualifyQty - 合格数量.
* *
* @param deliverQty - 退货数量 * @param qualifyQty - 合格数量
*/ */
public void setDeliverQty(BigDecimal deliverQty) { public void setQualifyQty(BigDecimal qualifyQty) {
this.deliverQty = deliverQty; this.qualifyQty = qualifyQty;
} }
/** /**
* get the depositQty - 入库数量. * get the unqualifyQty - 不合格数量.
* @return the depositQty * @return the unqualifyQty
*/ */
public BigDecimal getDepositQty() { public BigDecimal getUnqualifyQty() {
return this.depositQty; return this.unqualifyQty;
} }
/** /**
* set the depositQty - 入库数量. * set the unqualifyQty - 不合格数量.
* *
* @param depositQty - 入库数量 * @param unqualifyQty - 不合格数量
*/ */
public void setDepositQty(BigDecimal depositQty) { public void setUnqualifyQty(BigDecimal unqualifyQty) {
this.depositQty = depositQty; this.unqualifyQty = unqualifyQty;
} }
/** /**
* get the receiveUnitWeight - 收货单重. * get the receiveUnitWeight - 收货单重.
...@@ -820,8 +819,8 @@ public class HGZL001 extends DaoEPBase { ...@@ -820,8 +819,8 @@ public class HGZL001 extends DaoEPBase {
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)); setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_THICK)), thick));
setReceiveQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_RECEIVE_QTY)), receiveQty)); setReceiveQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_RECEIVE_QTY)), receiveQty));
setDeliverQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_DELIVER_QTY)), deliverQty)); setQualifyQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_QUALIFY_QTY)), qualifyQty));
setDepositQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_DEPOSIT_QTY)), depositQty)); setUnqualifyQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UNQUALIFY_QTY)), unqualifyQty));
setReceiveUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_RECEIVE_UNIT_WEIGHT)), receiveUnitWeight)); setReceiveUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_RECEIVE_UNIT_WEIGHT)), receiveUnitWeight));
setReceiveWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_RECEIVE_WEIGHT)), receiveWeight)); setReceiveWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_RECEIVE_WEIGHT)), receiveWeight));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status)); setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
...@@ -860,8 +859,8 @@ public class HGZL001 extends DaoEPBase { ...@@ -860,8 +859,8 @@ public class HGZL001 extends DaoEPBase {
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_THICK, StringUtils.toString(thick, eiMetadata.getMeta(FIELD_THICK)));
map.put(FIELD_RECEIVE_QTY, StringUtils.toString(receiveQty, eiMetadata.getMeta(FIELD_RECEIVE_QTY))); map.put(FIELD_RECEIVE_QTY, StringUtils.toString(receiveQty, eiMetadata.getMeta(FIELD_RECEIVE_QTY)));
map.put(FIELD_DELIVER_QTY, StringUtils.toString(deliverQty, eiMetadata.getMeta(FIELD_DELIVER_QTY))); map.put(FIELD_QUALIFY_QTY, StringUtils.toString(qualifyQty, eiMetadata.getMeta(FIELD_QUALIFY_QTY)));
map.put(FIELD_DEPOSIT_QTY, StringUtils.toString(depositQty, eiMetadata.getMeta(FIELD_DEPOSIT_QTY))); map.put(FIELD_UNQUALIFY_QTY, StringUtils.toString(unqualifyQty, eiMetadata.getMeta(FIELD_UNQUALIFY_QTY)));
map.put(FIELD_RECEIVE_UNIT_WEIGHT, StringUtils.toString(receiveUnitWeight, eiMetadata.getMeta(FIELD_RECEIVE_UNIT_WEIGHT))); map.put(FIELD_RECEIVE_UNIT_WEIGHT, StringUtils.toString(receiveUnitWeight, eiMetadata.getMeta(FIELD_RECEIVE_UNIT_WEIGHT)));
map.put(FIELD_RECEIVE_WEIGHT, StringUtils.toString(receiveWeight, eiMetadata.getMeta(FIELD_RECEIVE_WEIGHT))); map.put(FIELD_RECEIVE_WEIGHT, StringUtils.toString(receiveWeight, eiMetadata.getMeta(FIELD_RECEIVE_WEIGHT)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS))); map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
......
...@@ -2,21 +2,14 @@ package com.baosight.hggp.hg.zl.service; ...@@ -2,21 +2,14 @@ package com.baosight.hggp.hg.zl.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; 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.constant.HGSqlConstant;
import com.baosight.hggp.hg.zl.domain.HGZL001; import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.hg.zl.utils.HGZLUtils;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtil;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.MapUtils;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
...@@ -34,7 +27,8 @@ public class ServiceHGZL001 extends ServiceBase { ...@@ -34,7 +27,8 @@ public class ServiceHGZL001 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "质量巡检单",operType = "查询",operDesc = "初始化") @Override
@OperationLogAnnotation(operModul = "入库质检单", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), null); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), null);
...@@ -53,14 +47,12 @@ public class ServiceHGZL001 extends ServiceBase { ...@@ -53,14 +47,12 @@ public class ServiceHGZL001 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "质量巡检单",operType = "查询",operDesc = "查询")
@Override @Override
@OperationLogAnnotation(operModul = "质量巡检单", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo); Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String receiptDate = MapUtils.getString(queryMap, "receiptDate"); HGZLUtils.HgZl001.setCondition(queryMap);
queryMap.put("receiptDate", StringUtil.removeSpecifiedCharacter(receiptDate,
StringUtil.DEFAULT_CHARACTER_TO_BE_REMOVED));
inInfo = super.query(inInfo, HGZL001.QUERY, new HGZL001()); inInfo = super.query(inInfo, HGZL001.QUERY, new HGZL001());
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
...@@ -75,7 +67,6 @@ public class ServiceHGZL001 extends ServiceBase { ...@@ -75,7 +67,6 @@ public class ServiceHGZL001 extends ServiceBase {
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "质量巡检单",operType = "新增",operDesc = "新增") @OperationLogAnnotation(operModul = "质量巡检单",operType = "新增",operDesc = "新增")
@Override
public EiInfo insert(EiInfo inInfo) { public EiInfo insert(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
......
...@@ -29,15 +29,17 @@ ...@@ -29,15 +29,17 @@
WIDTH as "width", <!-- 宽度 --> WIDTH as "width", <!-- 宽度 -->
THICK as "thick", <!-- 厚度 --> THICK as "thick", <!-- 厚度 -->
RECEIVE_QTY as "receiveQty", <!-- 收货数量 --> RECEIVE_QTY as "receiveQty", <!-- 收货数量 -->
DELIVER_QTY as "deliverQty", <!-- 退货数量 --> QUALIFY_QTY as "qualifyQty", <!-- 合格数量 -->
DEPOSIT_QTY as "depositQty", <!-- 入库数量 --> UNQUALIFY_QTY as "unqualifyQty", <!-- 不合格数量 -->
RECEIVE_UNIT_WEIGHT as "receiveUnitWeight", <!-- 收货单重 --> RECEIVE_UNIT_WEIGHT as "receiveUnitWeight", <!-- 收货单重 -->
RECEIVE_WEIGHT as "receiveWeight", <!-- 收货重量 --> RECEIVE_WEIGHT as "receiveWeight", <!-- 收货重量 -->
STATUS as "status" <!-- 状态:0-质检中,1-质检完成 --> STATUS as "status" <!-- 状态:0-质检中,1-质检完成 -->
</sql> </sql>
<sql id="condition"> <sql id="condition">
AND DELETE_FLAG = 0 <include refid="HGXSDataAuth.authCondition"/>
<include refid="idCondition"/>
<include refid="customCondition"/>
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode# ACCOUNT_CODE = #accountCode#
</isNotEmpty> </isNotEmpty>
...@@ -88,199 +90,98 @@ ...@@ -88,199 +90,98 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reqNo">
REQ_NO = #reqNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reqNos">
REQ_NO IN <iterate open="(" close=")" conjunction="," property="reqNos">#reqNos[]#</iterate>
</isNotEmpty>
</sql>
<sql id="customCondition">
<include refid="BaseCondition.specCondition"/>
<include refid="BaseCondition.createdTimeCondition"/>
</sql>
<!-- 公共修改字段 -->
<sql id="updateRevise">
UPDATED_BY = #updatedBy#,
UPDATED_NAME = #updatedName#,
UPDATED_TIME = #updatedTime#
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.zl.domain.HGZL001"> <select id="query" resultClass="com.baosight.hggp.hg.zl.domain.HGZL001">
SELECT SELECT
<include refid="column"/> <include refid="column"/>
FROM ${hggpSchema}.HGZL001 WHERE 1=1 FROM ${hggpSchema}.HGZL001 WHERE 1=1
<include refid="condition"/> <include refid="condition"/>
<dynamic prepend="ORDER BY"> <include refid="orderBy"/>
<isNotEmpty property="orderBy"> </select>
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGZL001 WHERE 1=1 SELECT COUNT(*) FROM ${hggpSchema}.HGZL001 WHERE 1=1
<include refid="condition" /> <include refid="condition"/>
</select> </select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkNo">
CHECK_NO = #checkNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveNo">
RECEIVE_NO = #receiveNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="specId">
SPEC_ID = #specId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="material">
MATERIAL = #material#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unit">
UNIT = #unit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="length">
LENGTH = #length#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="width">
WIDTH = #width#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thick">
THICK = #thick#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveQty">
RECEIVE_QTY = #receiveQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deliverQty">
DELIVER_QTY = #deliverQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositQty">
DEPOSIT_QTY = #depositQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveUnitWeight">
RECEIVE_UNIT_WEIGHT = #receiveUnitWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveWeight">
RECEIVE_WEIGHT = #receiveWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
-->
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGZL001 (ID, INSERT INTO ${hggpSchema}.HGZL001 (
ACCOUNT_CODE, <!-- 企业编码 --> ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 --> DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 --> CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 --> CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 --> CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 --> DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
UPDATED_NAME, <!-- 记录修改名称 --> COMPANY_CODE, <!-- 公司编码 -->
UPDATED_TIME, <!-- 记录修改时间 --> COMPANY_NAME, <!-- 公司名称 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 --> RECEIPT_DATE, <!-- 单据日期 -->
COMPANY_CODE, <!-- 公司编码 --> CHECK_NO, <!-- 检查单号 -->
COMPANY_NAME, <!-- 公司名称 --> RECEIVE_NO, <!-- 收货单号 -->
RECEIPT_DATE, <!-- 单据日期 --> INVENT_TYPE, <!-- 存货类型 -->
CHECK_NO, <!-- 检查单号 --> INVENT_CODE, <!-- 存货编码 -->
RECEIVE_NO, <!-- 收货单号 --> INVENT_NAME, <!-- 存货名称 -->
INVENT_TYPE, <!-- 存货类型 --> SPEC_ID, <!-- 规格ID -->
INVENT_CODE, <!-- 存货编码 --> SPEC, <!-- 规格 -->
INVENT_NAME, <!-- 存货名称 --> MATERIAL, <!-- 材质 -->
SPEC_ID, <!-- 规格ID --> UNIT, <!-- 单位 -->
SPEC, <!-- 规格 --> LENGTH, <!-- 长度 -->
MATERIAL, <!-- 材质 --> WIDTH, <!-- 宽度 -->
UNIT, <!-- 单位 --> THICK, <!-- 厚度 -->
LENGTH, <!-- 长度 --> RECEIVE_QTY, <!-- 收货数量 -->
WIDTH, <!-- 宽度 --> QUALIFY_QTY, <!-- 合格数量 -->
THICK, <!-- 厚度 --> UNQUALIFY_QTY, <!-- 不合格数量 -->
RECEIVE_QTY, <!-- 收货数量 --> RECEIVE_UNIT_WEIGHT, <!-- 收货单重 -->
DELIVER_QTY, <!-- 退货数量 --> RECEIVE_WEIGHT, <!-- 收货重量 -->
DEPOSIT_QTY, <!-- 入库数量 --> STATUS <!-- 状态:0-质检中,1-质检完成 -->
RECEIVE_UNIT_WEIGHT, <!-- 收货单重 --> ) VALUES (
RECEIVE_WEIGHT, <!-- 收货重量 --> #id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
STATUS <!-- 状态:0-质检中,1-质检完成 --> #deleteFlag#, #companyCode#, #companyName#, #receiptDate#, #checkNo#, #receiveNo#, #inventType#,
) #inventCode#, #inventName#, #specId#, #spec#, #material#, #unit#, #length#, #width#, #thick#, #receiveQty#,
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #receiptDate#, #checkNo#, #receiveNo#, #inventType#, #inventCode#, #inventName#, #specId#, #spec#, #material#, #unit#, #length#, #width#, #thick#, #receiveQty#, #deliverQty#, #depositQty#, #receiveUnitWeight#, #receiveWeight#, #status#) #qualifyQty#, #unqualifyQty#, #receiveUnitWeight#, #receiveWeight#, #status#
</insert> )
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGZL001 WHERE
ID = #id#
</delete>
<update id="update"> <delete id="delete">
UPDATE ${hggpSchema}.HGZL001 UPDATE ${hggpSchema}.HGZL001
SET SET
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 --> DELETE_FLAG = #deleteFlag#,
DEP_CODE = #depCode#, <!-- 部门编码 --> <include refid="updateRevise"/>
CREATED_BY = #createdBy#, <!-- 记录创建者 --> WHERE CHECK_NO = #checkNo#
CREATED_NAME = #createdName#, <!-- 记录创建名称 --> </delete>
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 0-未删除,1-已删除 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
RECEIPT_DATE = #receiptDate#, <!-- 单据日期 -->
CHECK_NO = #checkNo#, <!-- 检查单号 -->
RECEIVE_NO = #receiveNo#, <!-- 收货单号 -->
INVENT_TYPE = #inventType#, <!-- 存货类型 -->
INVENT_CODE = #inventCode#, <!-- 存货编码 -->
INVENT_NAME = #inventName#, <!-- 存货名称 -->
SPEC_ID = #specId#, <!-- 规格ID -->
SPEC = #spec#, <!-- 规格 -->
MATERIAL = #material#, <!-- 材质 -->
UNIT = #unit#, <!-- 单位 -->
LENGTH = #length#, <!-- 长度 -->
WIDTH = #width#, <!-- 宽度 -->
THICK = #thick#, <!-- 厚度 -->
RECEIVE_QTY = #receiveQty#, <!-- 收货数量 -->
DELIVER_QTY = #deliverQty#, <!-- 退货数量 -->
DEPOSIT_QTY = #depositQty#, <!-- 入库数量 -->
RECEIVE_UNIT_WEIGHT = #receiveUnitWeight#, <!-- 收货单重 -->
RECEIVE_WEIGHT = #receiveWeight#, <!-- 收货重量 -->
STATUS = #status# <!-- 状态:0-质检中,1-质检完成 -->
WHERE
ID = #id#
</update>
</sqlMap> </sqlMap>
package com.baosight.hggp.hg.zl.utils;
import com.baosight.hggp.hg.utils.HGUtils;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.StringUtils;
import java.util.Map;
/**
* @author:songx
* @date:2024/5/16,11:26
*/
public class HGZLUtils {
/**
* HGZL001 工具类
*
* @author:songx
* @date:2024/5/9,16:58
*/
public static class HgZl001 {
/**
* 设置查询条件
*
* @param queryRow 集合
* @return
*/
public static void setCondition(Map queryRow) {
HGUtils.setCondition(queryRow);
// 单据日期
String receiptDate = MapUtils.getString(queryRow, HGZL001.FIELD_RECEIPT_DATE);
if (StringUtils.isNotBlank(receiptDate)) {
queryRow.put(HGZL001.FIELD_RECEIPT_DATE, DateUtils.formatShort(receiptDate));
}
}
}
}
$(function (){
var companyCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var projCodes = __eiInfo.getBlock("proj_record_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
/* 页面查询框的尺寸设置 */
$.extend(true, IPLATUI.Config, {
EFGrid: {
height: $(document).height() - $("#inqu").height() - $("#ef_form_head").height() - 100,
}
});
IPLATUI.EFGrid = {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
{
field: "operator",
title: "操作",
template: function (item) {
let status = item.blueprintStatus;
let template = '';
if (item.id){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id +'\')" >蓝图详情</a>';
if (status == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="updateBlueprintStatus(' + item.id + ',1)" >启用</a>';
} else if (status == 1) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateBlueprintStatus(' + item.id + ',0)" >停用</a>';
}
// template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
// 'onclick="showUploadFile(' + item.id + ')" >附件详情</a>';
}
return template;
}
},{
field: "companyCode",
template: function (dataItem) {
for (let i = 0; i < companyCodes.length; i++) {
if (companyCodes[i]['valueField'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodes[i]['textField']
return companyCodes[i]['textField'];
}
}
return dataItem["companyCode"];
}
}, {
field: "projCode",
template: function (item) {
let template = "";
if(item.projCode){
for(let i=0;i<projCodes.length;i++){
if(item.projCode === projCodes[i]['valueField']){
item['projName'] = projCodes[i]['textField'];
template = projCodes[i]['valueField'];
}
}
}
return template;
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
inInfo.set("inqu_status-0-approvalStatus", 2);
inInfo.set("field", options.field);
let dataSource;
EiCommunicator.send("HGSC003", "projComboBox", inInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("proj_record_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: dataSource,
minLength: 0,
dataTextField: "textField",
dataValueField: "valueField",
optionLabelTemplate: "[#:valueField#]#:textField#",
valueTemplate: "[#:valueField#]#:textField#",
template: "[#:valueField#]#:textField#",
filter: "contains"
});
}
}
],
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field == "projCode") {
loadChange(grid,e,"projName");
}
if (e.field == "companyCode") {
e.items[0].projCode = "";
e.items[0].projName = "";
loadChange(grid,e,"projCode");
}
});
//批量停用
$("#DEACTIVATE").on("click", deactivate);
},
afterEdit:function (e) {
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {
},
exportGrid : {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "工艺流程_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls",
exportBlockId: "result",
}
}
}
downKeyUp();
})
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC003", "save", true,
function (e) {
query();
});
btnNode.attr("disabled", false);
}
});
}
}
function updateBlueprintStatus(id,status) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-blueprintStatus", status);
EiCommunicator.send('HGSC003', 'updateBlueprintStatus', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
query();
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
}
);
}
function deactivate() {
let rows = resultGrid.getCheckedRows()
if (rows.length < 1) {
message2("停用","没有选中的行");
return;
}
IPLAT.confirm({
title:'停用',
message:'确认停用此数据么?',
okFn:function () {
var post = new EiInfo();
post.addBlock(resultGrid.getCheckedBlockData());
post.set("recursion", true);
EiCommunicator.send("HGSC003","deactivate",post,{
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
NotificationUtil(ei);
resultGrid.dataSource.query();
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
})
}
/**
* 显示详情
*/
function showDetail(id,factoryCode,flowCode,flowName) {
JSColorbox.open({
href: "HGSC003A?methodName=initLoad&inqu_status-0-parendId=" + id+
"&inqu_status-0-flowCode="+flowCode+"&inqu_status-0-flowName="+flowName+"&inqu_status-0-factoryCode="+factoryCode,
title: "<div style='text-align: center;'>蓝图清单详情</div>",
width: "80%",
height: "80%",
});
}
/**
* 显示附件清单
*
* @param id
*/
function showUploadFile(id) {
JSColorbox.open({
href: "HGSC099?methodName=initLoad&inqu_status-0-bizType=LTQD&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件详情</div>",
width: "80%",
height: "80%",
});
}
function loadChange(grid,e,field) {
var cell_label = field,that = grid;
// locked 表示是否为固定列
var locked = that.isCellLocked(cell_label);
// tr 表示 locked 和非 locked 的行,index 表示此行的第几列
var tr,index;
// 获取此 model 元素信息
var item = e.items[0];
var _uid = item.uid;
if (locked) {
tr = $(".k-grid-content-locked tr[data-uid="+ _uid +"]");
index = $("th[data-field='"+cell_label+"']").data("index");
} else {
tr = $(".k-grid-content tr[data-uid="+ _uid +"]");
index = parseInt($("th[data-field='"+cell_label+"']").data("index")) - that.lockedHeader.find("th").length;
}
// 获取子 cell(td)
var td = tr.children("td:eq("+index+")");
// 触发 td.click 事件,
td.trigger("click");
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script>
var ctx = "${ctx}";
</script>
<head>
</head>
<EF:EFPage title="蓝图清单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput ename="inqu_status-0-companyName" cname="公司名称" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-blueprintName" cname="蓝图名称" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-projName" cname="项目名称" colWidth="3"/>
<EF:EFSelect cname="状态" ename="inqu_status-0-blueprintStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgsc.enablingStatus" />
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="blueprintCode" cname="蓝图编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="blueprintName" cname="蓝图名称" enable="true" width="120" align="center" required="true"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="true" width="120" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" align="center" enable="false"/>
<EF:EFComboColumn ename="blueprintStatus" cname="状态" width="80" align="center" enable="false" required="false" readonly="true">
<EF:EFCodeOption codeName="hggp.hgsc.enablingStatus" />
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid = {
"result": {
pageable: {
input: true,
numeric: false,
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [{
field: "receiptDate",
attributes: {
class: "i-input-readonly"
}
}, {
field: "operator",
template: function (item) {
let status = item.status;
if (status === "0") {
return '<a style="cursor: pointer;display: flex;justify-content: center;" ' +
'onclick="doProcess(' + item.id + ', \'' + item.checkNo + '\')" >处理</a>';
} else {
return "";
}
}
}, {
field: "problemPhoto",
template: function (item) {
if (!isBlank(item.checkNo)) {
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ', 1)" >附件清单</a>';
} else {
return "";
}
}
}, {
field: "processPhoto",
template: function (item) {
if (!isBlank(item.checkNo)) {
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ', 2)" >附件清单</a>';
} else {
return "";
}
}
}, {
field: "createdName",
template: function (options) {
return showUserName(options.createdBy, options.createdName);
}
}],
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
onSuccess: function (e) {
}
}
}
// 查询
$("#QUERY").on("click", query);
// 选择生产任务
$("#SELECT_PROD").on("click", selectProd);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 显示附件清单
*
* @param id
* @param docType
*/
let showUploadFile = function (id, docType) {
JSColorbox.open({
href: "HPZL001A?methodName=initLoad&inqu_status-0-checkId=" + id + "&inqu_status-0-docType=" + docType,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
/**
* 提交操作
*
* @param id
* @param checkNo
*/
let doProcess = function (id, checkNo) {
let message = "确认将单号[" + checkNo + "]的状态修改为已处理吗? ";
JSUtils.confirm(message, {
ok: function () {
JSUtils.submitGridsData("result", "HPZL001", "doProcess", true);
}
});
}
/**
* 挑选生产任务
*/
let selectProd = function () {
JSColorbox.open({
href: "HPZL001B?methodName=initLoad",
title: "<div style='text-align: center;'>生产任务查询</div>",
width: "90%",
height: "80%",
callbackName: selectStockCallback
});
}
/**
* 挑选生产任务回调
*/
let selectStockCallback = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
/**
* 删除
*/
function deleteFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let status= item.get("status");
if(status==="1"){
message("选中的第"+(index+1)+"行记录已处理,不能删除!");
flag = false;
return false;
}
});
if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPZL001", "delete", true);
}
});
}
}
...@@ -41,17 +41,24 @@ ...@@ -41,17 +41,24 @@
required="true"/> required="true"/>
<EF:EFColumn ename="processPhoto" cname="处理照片" locked="true" enable="false" width="100" align="center" <EF:EFColumn ename="processPhoto" cname="处理照片" locked="true" enable="false" width="100" align="center"
required="true"/> required="true"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" enable="false" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="checkNo" cname="检查单号" enable="false" width="130" align="center"/> <EF:EFColumn ename="checkNo" cname="检查单号" enable="false" width="130" align="center"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="100" align="center"> <EF:EFComboColumn ename="status" cname="状态" enable="false" width="100" align="center">
<EF:EFOption label="已处理" value="1"></EF:EFOption> <EF:EFOption label="已处理" value="1"></EF:EFOption>
<EF:EFOption label="未处理" value="0"></EF:EFOption> <EF:EFOption label="未处理" value="0"></EF:EFOption>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="receiptDate" cname="单据日期" enable="false" width="120" align="center" editType="date" <EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/> <EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="130" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="130" align="center"/> <EF:EFColumn ename="receiveNo" cname="收货单号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="inventName" cname="部件名称" enable="false" width="130" align="center"/> <EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="subInventName" cname="零件名称" enable="false" width="130" align="center"/> <EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" width="130" align="center"/> <EF:EFColumn ename="specId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="receiveQty" cname="收货数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="receiveWeight" cname="收货重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="qualifyQty" cname="合格数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFColumn ename="unqualifyQty" cname="不合格数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFComboColumn ename="poorType" cname="不良品类" enable="false" width="100" align="center"> <EF:EFComboColumn ename="poorType" cname="不良品类" enable="false" width="100" align="center">
<EF:EFCodeOption codeName="hpjx.hpjx.poorType"/> <EF:EFCodeOption codeName="hpjx.hpjx.poorType"/>
</EF:EFComboColumn> </EF:EFComboColumn>
...@@ -60,12 +67,11 @@ ...@@ -60,12 +67,11 @@
blockName="user_block_id" textField="textField" valueField="valueField" blockName="user_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#"> columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="prodOrderNo" cname="生产订单号" enable="false" width="140" align="center"/> <EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="prodTaskNo" cname="生产任务号" enable="false" width="150" align="center"/> <EF:EFColumn ename="unit" cname="单位" enable="false" width="80" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="false" width="130" align="center"/> <EF:EFColumn ename="length" cname="长(M)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="inventCode" cname="部件编码" enable="false" width="130" align="center"/> <EF:EFColumn ename="width" cname="宽(M)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="subInventCode" cname="零件编码" enable="false" width="130" align="center"/> <EF:EFColumn ename="thick" cname="厚(M)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="orgNo" cname="生产组编码" enable="false" width="130" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="150" align="center"/> <EF:EFColumn ename="createdName" cname="创建人" enable="false" width="150" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="150" align="center" <EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="150" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']" dateFormat="yyyy-MM-dd HH:mm:ss"/> editType="datetime" parseFormats="['yyyyMMddHHmmss']" dateFormat="yyyy-MM-dd HH:mm:ss"/>
......
let projNameGlobalData = [];
let inventNameGlobalData = [];
let subInventNameGlobalData = [];
let orgNameGlobalData = [];
$(function () {
IPLATUI.EFGrid = {
"result": {
pageable: {
input: true,
numeric: false,
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [{
field: "receiptDate",
attributes: {
class: "i-input-readonly"
}
}, {
field: "operator",
template: function (item) {
let status = item.status;
if (status === "0") {
return '<a style="cursor: pointer;display: flex;justify-content: center;" ' +
'onclick="doProcess(' + item.id + ', \'' + item.checkNo + '\')" >处理</a>';
} else {
return "";
}
}
}, {
field: "problemPhoto",
template: function (item) {
if (!isBlank(item.checkNo)) {
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ', 1)" >附件清单</a>';
} else {
return "";
}
}
}, {
field: "processPhoto",
template: function (item) {
if (!isBlank(item.checkNo)) {
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ', 2)" >附件清单</a>';
} else {
return "";
}
}
},
// {
// field: "projCode",
// template: function (dataItem) {
// for (let i = 0; i < projNameGlobalData.length; i++) {
// if (projNameGlobalData[i]['valueField'] === dataItem['projCode']) {
// return projNameGlobalData[i]['textField'];
// }
// }
// return "";
// },
// editor: function (container, options) {
// let inInfo = new EiInfo();
// // 1.部分分派,2.全部分派
// inInfo.set("inqu_status-0-statuses", [1, 2]);
// inInfo.set("serviceName", "HPSC005");
// inInfo.set("methodName", "queryProjComboBox");
// inInfo.set("blockId", "proj_prod_block_id");
// inInfo.set("field", options.field);
// refreshSelect(container, inInfo);
// }
// }, {
// field: "inventCode",
// template: function (dataItem) {
// for (let i = 0; i < inventNameGlobalData.length; i++) {
// if (inventNameGlobalData[i]['valueField'] === dataItem['inventCode']) {
// return inventNameGlobalData[i]['textField'];
// }
// }
// return "";
// },
// editor: function (container, options) {
// let projCode = options.model["projCode"];
// let inInfo = new EiInfo();
// inInfo.set("inqu_status-0-projCode", isBlank(projCode) ? " " : projCode);
// inInfo.set("serviceName", "HPSC003");
// inInfo.set("methodName", "queryInventComboBox");
// inInfo.set("blockId", "invent_record_block_id");
// inInfo.set("field", options.field);
// refreshSelect(container, inInfo);
// }
// }, {
// field: "subInventCode",
// template: function (dataItem) {
// for (let i = 0; i < subInventNameGlobalData.length; i++) {
// if (subInventNameGlobalData[i]['valueField'] === dataItem['subInventCode']) {
// return subInventNameGlobalData[i]['textField'];
// }
// }
// return "";
// },
// editor: function (container, options) {
// let inventCode = options.model["inventCode"];
// let inInfo = new EiInfo();
// inInfo.set("inqu_status-0-parentPrdtCode", isBlank(inventCode) ? " " : inventCode);
// inInfo.set("serviceName", "HPSC004");
// inInfo.set("methodName", "queryInventComboBox");
// inInfo.set("blockId", "sub_invent_record_block_id");
// inInfo.set("field", options.field);
// refreshSelect(container, inInfo);
// }
// }, {
// field: "orgNo",
// template: function (dataItem) {
// for (let i = 0; i < orgNameGlobalData.length; i++) {
// if (orgNameGlobalData[i]['valueField'] === dataItem['orgNo']) {
// return orgNameGlobalData[i]['textField'];
// }
// }
// return "";
// },
// editor: function (container, options) {
// let subInventCode = options.model["subInventCode"];
// let inInfo = new EiInfo();
// inInfo.set("inqu_status-0-prdtCode", isBlank(subInventCode) ? " " : subInventCode);
// inInfo.set("serviceName", "HPSC005");
// inInfo.set("methodName", "queryOrgComboBox");
// inInfo.set("blockId", "org_prod_block_id");
// inInfo.set("field", options.field);
// refreshSelect(container, inInfo);
// }
// },
{
field: "createdName",
template: function (options) {
return showUserName(options.createdBy, options.createdName);
}
}],
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
}
}
}
// 查询
$("#QUERY").on("click", query);
// 选择生产任务
$("#SELECT_PROD").on("click", selectProd);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 项目名称
// let inInfo = new EiInfo();
// EiCommunicator.send("HPSC001", "queryComboBox", inInfo, {
// onSuccess: function (ei) {
// projNameGlobalData = ei.getBlock("proj_record_block_id").getMappedRows();
// },
// onFail: function (ei) {
// }
// }, {async: false});
// // 部件名称
// EiCommunicator.send("HPSC003", "queryInventComboBox", inInfo, {
// onSuccess: function (ei) {
// inventNameGlobalData = ei.getBlock("invent_record_block_id").getMappedRows();
// },
// onFail: function (ei) {
// }
// }, {async: false});
// // 零件名称
// EiCommunicator.send("HPSC004", "queryInventComboBox", inInfo, {
// onSuccess: function (ei) {
// subInventNameGlobalData = ei.getBlock("sub_invent_record_block_id").getMappedRows();
// },
// onFail: function (ei) {
// }
// }, {async: false});
// // 生产组名称
// EiCommunicator.send("HPSC005", "queryOrgComboBox", inInfo, {
// onSuccess: function (ei) {
// orgNameGlobalData = ei.getBlock("org_prod_block_id").getMappedRows();
// },
// onFail: function (ei) {
// }
// }, {async: false});
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 显示附件清单
*
* @param id
* @param docType
*/
let showUploadFile = function (id, docType) {
JSColorbox.open({
href: "HPZL001A?methodName=initLoad&inqu_status-0-checkId=" + id + "&inqu_status-0-docType=" + docType,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
/**
* 提交操作
*
* @param id
* @param checkNo
*/
let doProcess = function (id, checkNo) {
let message = "确认将单号[" + checkNo + "]的状态修改为已处理吗? ";
JSUtils.confirm(message, {
ok: function () {
JSUtils.submitGridsData("result", "HPZL001", "doProcess", true);
}
});
}
/**
* 挑选生产任务
*/
let selectProd = function () {
JSColorbox.open({
href: "HPZL001B?methodName=initLoad",
title: "<div style='text-align: center;'>生产任务查询</div>",
width: "90%",
height: "80%",
callbackName: selectStockCallback
});
}
/**
* 挑选生产任务回调
*/
let selectStockCallback = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
/**
* 删除
*/
function deleteFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let status= item.get("status");
if(status==="1"){
message("选中的第"+(index+1)+"行记录已处理,不能删除!");
flag = false;
return false;
}
});
if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPZL001", "delete", true);
}
});
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment