Commit 1d319492 by yukang

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/main/webapp/HP/KC/HPKC004.js
parents 14a1f6b1 60682ab7
package com.baosight.hpjx.common;
import com.baosight.iplat4j.core.ei.EiBlock;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author jhs
* @Date 2024/1/22 18:23
*/
public enum ApprovalStatusEnum {
SAVED(1,"保存"),
SUBMIT(2,"已提交"),
APPROVED(3,"审批通过"),
REJECTION(4,"审批拒绝");
private Integer code;
private String value;
ApprovalStatusEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static EiBlock generatorEiBlock(){
EiBlock block = new EiBlock("approval_status_block_id");
List<Map<String,Object>> rows = new ArrayList<Map<String,Object>>(){{
add(new HashMap<String,Object>(){{
put(HPConstants.TEXT_FIELD,SAVED.code);
put(HPConstants.VALUE_FIELD,SAVED.value);
}});
add(new HashMap<String,Object>(){{
put(HPConstants.TEXT_FIELD,SUBMIT.code);
put(HPConstants.VALUE_FIELD,SUBMIT.value);
}});
add(new HashMap<String,Object>(){{
put(HPConstants.TEXT_FIELD,APPROVED.code);
put(HPConstants.VALUE_FIELD,APPROVED.value);
}});
add(new HashMap<String,Object>(){{
put(HPConstants.TEXT_FIELD,REJECTION.code);
put(HPConstants.VALUE_FIELD,REJECTION.value);
}});
}};
block.setRows(rows);
return block;
}
}
...@@ -42,7 +42,14 @@ public enum DdynamicEnum { ...@@ -42,7 +42,14 @@ public enum DdynamicEnum {
* 编写:wwl * 编写:wwl
*/ */
INVENT_RECORD_BLOCK_ID("invent_record_block_id","id","inventName","HPPZ006.queryComboBox"), INVENT_RECORD_BLOCK_ID("invent_record_block_id","id","inventName","HPPZ006.queryComboBox"),
/**
* 模块:存货档案
* 用途:存货档案下拉框
* 编写:jhs
*/
MATERIAL_RECORD_BLOCK_ID("material_record_block_id","inventCode","inventName","HPPZ006.queryMaterialComboBox"),
/** /**
* 模块:存货档案 * 模块:存货档案
* 用途:存货档案下拉框 * 用途:存货档案下拉框
...@@ -50,7 +57,7 @@ public enum DdynamicEnum { ...@@ -50,7 +57,7 @@ public enum DdynamicEnum {
*/ */
INVENT_SPEC_BLOCK_ID("invent_spec_block_id","spec","spec","HPPZ006.queryComboBoxSpec"), INVENT_SPEC_BLOCK_ID("invent_spec_block_id","spec","spec","HPPZ006.queryComboBoxSpec"),
/** /**
* 模块:仓库档案 * 模块:仓库档案
* 用途:仓库档案下拉框 * 用途:仓库档案下拉框
......
...@@ -26,6 +26,27 @@ public enum InventTypeEnun { ...@@ -26,6 +26,27 @@ public enum InventTypeEnun {
this.value = value; this.value = value;
} }
public static String getNameByCode(String code){
String returnName = "";
switch (code){
case "1":
returnName = MATERIAL.value;
break;
case "2":
returnName = CONSUMABLE.value;
break;
case "3":
returnName = SEMI_FINISHED_PRODUCT.value;
break;
case "4":
returnName = FINISHED_PRODUCT.value;
break;
default:
break;
}
return returnName;
};
public Integer getCode() { public Integer getCode() {
return code; return code;
} }
...@@ -46,20 +67,20 @@ public enum InventTypeEnun { ...@@ -46,20 +67,20 @@ public enum InventTypeEnun {
EiBlock block = new EiBlock("customer_type_block_id"); EiBlock block = new EiBlock("customer_type_block_id");
List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>() {{ List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>() {{
add(new HashMap<String, Object>() {{ add(new HashMap<String, Object>() {{
put(HPConstants.TEXT_FIELD, MATERIAL.code); put(HPConstants.TEXT_FIELD, MATERIAL.code + HPConstants.SPLICING_SYMBOL + MATERIAL.value);
put(HPConstants.VALUE_FIELD, MATERIAL.value); put(HPConstants.VALUE_FIELD, MATERIAL.code);
}}); }});
add(new HashMap<String, Object>() {{ add(new HashMap<String, Object>() {{
put(HPConstants.TEXT_FIELD, CONSUMABLE.code); put(HPConstants.TEXT_FIELD, CONSUMABLE.code + HPConstants.SPLICING_SYMBOL + CONSUMABLE.value);
put(HPConstants.VALUE_FIELD, CONSUMABLE.value); put(HPConstants.VALUE_FIELD, CONSUMABLE.code);
}}); }});
add(new HashMap<String, Object>() {{ add(new HashMap<String, Object>() {{
put(HPConstants.TEXT_FIELD, SEMI_FINISHED_PRODUCT.code); put(HPConstants.TEXT_FIELD, SEMI_FINISHED_PRODUCT.code + HPConstants.SPLICING_SYMBOL + SEMI_FINISHED_PRODUCT.value);
put(HPConstants.VALUE_FIELD, SEMI_FINISHED_PRODUCT.value); put(HPConstants.VALUE_FIELD, SEMI_FINISHED_PRODUCT.code);
}}); }});
add(new HashMap<String, Object>() {{ add(new HashMap<String, Object>() {{
put(HPConstants.TEXT_FIELD, FINISHED_PRODUCT.code); put(HPConstants.TEXT_FIELD, FINISHED_PRODUCT.code + HPConstants.SPLICING_SYMBOL + FINISHED_PRODUCT.value);
put(HPConstants.VALUE_FIELD, FINISHED_PRODUCT.value); put(HPConstants.VALUE_FIELD, FINISHED_PRODUCT.code);
}}); }});
}}; }};
block.setRows(rows); block.setRows(rows);
......
package com.baosight.hpjx.core.dao; package com.baosight.hpjx.core.dao;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.xs.tools.HPXSUserTools;
import com.baosight.hpjx.util.AssertUtils; import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.DateUtils; import com.baosight.hpjx.util.DateUtils;
import com.baosight.iplat4j.core.data.DaoEPBase; import com.baosight.iplat4j.core.data.DaoEPBase;
...@@ -103,6 +105,24 @@ public class DaoUtils { ...@@ -103,6 +105,24 @@ public class DaoUtils {
} catch (Exception e) { } catch (Exception e) {
log.warn("写入创建人姓名失败", e); log.warn("写入创建人姓名失败", e);
} }
// 创建人企业编码
try {
String companyCode;
try {
companyCode = UserSessionUtils.getCompanyCode();
} catch (Exception e) {
companyCode = "";
}
BeanUtils.setProperty(bean, "companyCode", companyCode);
} catch (Exception e) {
log.warn("写入创建人企业编码失败", e);
}
// 创建人部门编码
try {
BeanUtils.setProperty(bean, "depCode", HPXSUserTools.getOrgId());
} catch (Exception e) {
log.warn("写入创建人企业编码失败", e);
}
// 创建时刻 // 创建时刻
try { try {
BeanUtils.setProperty(bean, "createdTime", DateUtils.shortDateTime()); BeanUtils.setProperty(bean, "createdTime", DateUtils.shortDateTime());
...@@ -141,6 +161,24 @@ public class DaoUtils { ...@@ -141,6 +161,24 @@ public class DaoUtils {
} }
map.put("createdName", userName); map.put("createdName", userName);
map.put("updatedName", ""); map.put("updatedName", "");
// 创建人企业编码
try {
String companyCode;
try {
companyCode = UserSessionUtils.getCompanyCode();
} catch (Exception e) {
companyCode = "";
}
map.put("companyCode", companyCode);
} catch (Exception e) {
log.warn("写入创建人企业编码失败", e);
}
// 创建人部门编码
try {
map.put("depCode", HPXSUserTools.getOrgId());
} catch (Exception e) {
log.warn("写入创建人企业编码失败", e);
}
// 创建时刻 // 创建时刻
try { try {
map.put("createdTime", DateUtils.shortDateTime()); map.put("createdTime", DateUtils.shortDateTime());
......
...@@ -5,7 +5,7 @@ package com.baosight.hpjx.hp.constant; ...@@ -5,7 +5,7 @@ package com.baosight.hpjx.hp.constant;
* @date:2024/1/18,17:16 * @date:2024/1/18,17:16
*/ */
public class HPConstant { public class HPConstant {
/** /**
* 序列号 * 序列号
* *
...@@ -13,15 +13,31 @@ public class HPConstant { ...@@ -13,15 +13,31 @@ public class HPConstant {
* @date:2021/8/17,15:22 * @date:2021/8/17,15:22
*/ */
public class SequenceId { public class SequenceId {
// 盘点单号 // 盘点单号
public static final String STATISTICAL_NUMBER = "STATISTICAL_NUMBER"; public static final String STATISTICAL_NUMBER = "STATISTICAL_NUMBER";
// 统计单号 // 统计单号
public static final String HPKC008_NUMBER = "HPKC008_NUMBER"; public static final String HPKC008_NUMBER = "HPKC008_NUMBER";
// 巡检单号 // 巡检单号
public static final String HPZL001_NUMBER = "HPZL001_NUMBER"; public static final String HPZL001_NUMBER = "HPZL001_NUMBER";
//采购入库单号
public static final String HPKC001_NUMBER = "HPKC001_NUMBER";
//生产领料单号
public static final String HPKC002_NUMBER = "HPKC002_NUMBER";
// 生产入库单号
public static final String HPKC003_PROD_NO = "HPKC003_PROD_NO";
// 生产销售单号
public static final String HPKC004_SALE_NO = "HPKC004_SALE_NO";
// 供应商编码
public static final String HPPZ002_CUST_CODE = "HPPZ002_CUST_CODE";
// 客户编码
public static final String HPPZ003_CUST_CODE = "HPPZ003_CUST_CODE";
// 存货编码
public static final String INVENT_CODE = "INVENT_CODE";
// 仓库编码
public static final String WH_CODE = "WH_CODE";
} }
/** /**
* 库存类型 * 库存类型
* *
...@@ -29,7 +45,7 @@ public class HPConstant { ...@@ -29,7 +45,7 @@ public class HPConstant {
* @date:2024/1/20,15:18 * @date:2024/1/20,15:18
*/ */
public class KcType { public class KcType {
// 采购 // 采购
public static final String CG = "CG"; public static final String CG = "CG";
// 生产 // 生产
...@@ -37,5 +53,5 @@ public class HPConstant { ...@@ -37,5 +53,5 @@ public class HPConstant {
// 其他 // 其他
public static final String QT = "QT"; public static final String QT = "QT";
} }
} }
...@@ -42,7 +42,7 @@ public class HPKC001 extends DaoEPBase { ...@@ -42,7 +42,7 @@ public class HPKC001 extends DaoEPBase {
private Long quantity = 0L; /* 数量*/ private Long quantity = 0L; /* 数量*/
private BigDecimal weight = new BigDecimal("0"); /* 重量*/ private BigDecimal weight = new BigDecimal("0"); /* 重量*/
private String remarks = " "; /* 备注*/ private String remarks = " "; /* 备注*/
private int approvalStatus; /* 审批状态:0-未审核,1-已审核*/ private int approvalStatus; /* 审批状态:1-保存,2-已提交,3-审批通过,4-审批拒绝*/
private String custCode = " "; /* 供应商编码*/ private String custCode = " "; /* 供应商编码*/
private String custName = " "; /* 供应商名称*/ private String custName = " "; /* 供应商名称*/
...@@ -151,7 +151,7 @@ EiColumn eiColumn; ...@@ -151,7 +151,7 @@ EiColumn eiColumn;
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("approvalStatus"); eiColumn = new EiColumn("approvalStatus");
eiColumn.setDescName("审批状态:0-未审核,1-已审核"); eiColumn.setDescName("审批状态:1-保存,2-已提交,3-审批通过,4-审批拒绝");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("custCode"); eiColumn = new EiColumn("custCode");
......
...@@ -42,7 +42,7 @@ public class HPKC002 extends DaoEPBase { ...@@ -42,7 +42,7 @@ public class HPKC002 extends DaoEPBase {
private Long quantity = 0L; /* 数量*/ private Long quantity = 0L; /* 数量*/
private BigDecimal weight = new BigDecimal("0"); /* 重量*/ private BigDecimal weight = new BigDecimal("0"); /* 重量*/
private String remarks = " "; /* 备注*/ private String remarks = " "; /* 备注*/
private int approvalStatus; /* 审批状态:0-未审核,1-已审核*/ private int approvalStatus; /* 审批状态:1-保存,2-已提交,3-审批通过,4-审批拒绝*/
private String custCode = " "; /* 供应商编码*/ private String custCode = " "; /* 供应商编码*/
private String custName = " "; /* 供应商名称*/ private String custName = " "; /* 供应商名称*/
...@@ -151,7 +151,7 @@ public class HPKC002 extends DaoEPBase { ...@@ -151,7 +151,7 @@ public class HPKC002 extends DaoEPBase {
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("approvalStatus"); eiColumn = new EiColumn("approvalStatus");
eiColumn.setDescName("审批状态:0-未审核,1-已审核"); eiColumn.setDescName("审批状态:1-保存,2-已提交,3-审批通过,4-审批拒绝");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("custCode"); eiColumn = new EiColumn("custCode");
......
...@@ -70,11 +70,11 @@ public class HPKC005 extends DaoEPBase { ...@@ -70,11 +70,11 @@ public class HPKC005 extends DaoEPBase {
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/ public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/ public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String QUERY = "t_hpkc005.query"; public static final String QUERY = "HPKC005.query";
public static final String COUNT = "t_hpkc005.count"; public static final String COUNT = "HPKC005.count";
public static final String INSERT = "t_hpkc005.insert"; public static final String INSERT = "HPKC005.insert";
public static final String UPDATE = "t_hpkc005.update"; public static final String UPDATE = "HPKC005.update";
public static final String DELETE = "t_hpkc005.delete"; public static final String DELETE = "HPKC005.delete";
private Long id = new Long(0); private Long id = new Long(0);
private String companyCode = " "; /* 企业编码 预留*/ private String companyCode = " "; /* 企业编码 预留*/
......
...@@ -84,7 +84,7 @@ public class HPKC009 extends DaoEPBase { ...@@ -84,7 +84,7 @@ public class HPKC009 extends DaoEPBase {
private String dateProc = " "; /* 日期*/ private String dateProc = " "; /* 日期*/
private String whCode = " "; /* 仓库编码*/ private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/ private String whName = " "; /* 仓库名称*/
private String inventType = " "; /* 存货类型*/ private Integer inventType; /* 存货类型*/
private String inventCode = " "; /* 存货编码*/ private String inventCode = " "; /* 存货编码*/
private String inventName = " "; /* 存货名称*/ private String inventName = " "; /* 存货名称*/
private String spec = " "; /* 规格*/ private String spec = " "; /* 规格*/
...@@ -380,7 +380,7 @@ public class HPKC009 extends DaoEPBase { ...@@ -380,7 +380,7 @@ public class HPKC009 extends DaoEPBase {
* get the inventType - 存货类型. * get the inventType - 存货类型.
* @return the inventType * @return the inventType
*/ */
public String getInventType() { public Integer getInventType() {
return this.inventType; return this.inventType;
} }
...@@ -389,7 +389,7 @@ public class HPKC009 extends DaoEPBase { ...@@ -389,7 +389,7 @@ public class HPKC009 extends DaoEPBase {
* *
* @param inventType - 存货类型 * @param inventType - 存货类型
*/ */
public void setInventType(String inventType) { public void setInventType(Integer inventType) {
this.inventType = inventType; this.inventType = inventType;
} }
/** /**
...@@ -680,7 +680,7 @@ public class HPKC009 extends DaoEPBase { ...@@ -680,7 +680,7 @@ public class HPKC009 extends DaoEPBase {
setDateProc(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DATE_PROC)), dateProc)); setDateProc(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DATE_PROC)), dateProc));
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode)); setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode));
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName)); setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName));
setInventType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_TYPE)), inventType)); setInventType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_INVENT_TYPE)), inventType));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode)); setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode));
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName)); setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SPEC)), spec)); setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SPEC)), spec));
......
...@@ -2,19 +2,22 @@ package com.baosight.hpjx.hp.kc.service; ...@@ -2,19 +2,22 @@ package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.common.DdynamicEnum; import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InventTypeEnun; import com.baosight.hpjx.common.InventTypeEnun;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC002; import com.baosight.hpjx.hp.kc.domain.HPKC002;
import com.baosight.hpjx.hp.pz.domain.HPPZ007;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil; import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
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.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
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.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import java.util.Arrays; import java.util.*;
import java.util.Map;
/** /**
* @author YK * @author YK
...@@ -27,17 +30,17 @@ public class ServiceHPKC002 extends ServiceBase { ...@@ -27,17 +30,17 @@ public class ServiceHPKC002 extends ServiceBase {
*/ */
@Override @Override
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
HPKC002 HPKC002 = new HPKC002(); try {
EiInfo outInfo = super.initLoad(inInfo, HPKC002); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
outInfo.getBlock(EiConstant.resultBlock).getRows().clear(); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_QUERY_BLOCK_ID), null);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.WH_RECORD_QUERY_BLOCK_ID), null); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), null);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC002().eiMetadata);
EiBlock block = outInfo.addBlock(EiConstant.queryBlock); inInfo.setBlock(InventTypeEnun.generatorEiBlock());
block.setCell(ACConstants.ROW_CODE_0, ACConstants.PARAM_WH_CODE, outInfo.getBlock(ACConstants.WH_CODE_BLOCK_ID).getRow(ACConstants.ROW_CODE_0).get(ACConstants.FIELD_VALUE)); } catch (PlatException e) {
block.setCell(ACConstants.ROW_CODE_0, ACConstants.PARAM_WH_CODE, outInfo.getBlock(ACConstants.WH_CODE_QUERY_BLOCK_ID).getRow(ACConstants.ROW_CODE_0).get(ACConstants.FIELD_VALUE)); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
outInfo.setBlock(InventTypeEnun.generatorEiBlock()); }
return outInfo; return inInfo;
} }
/** /**
...@@ -61,15 +64,29 @@ public class ServiceHPKC002 extends ServiceBase { ...@@ -61,15 +64,29 @@ public class ServiceHPKC002 extends ServiceBase {
public EiInfo insert(EiInfo inInfo) { public EiInfo insert(EiInfo inInfo) {
try { try {
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock); CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
for (int i = 0; i < inInfo.getBlock(EiConstant.resultBlock).getRowCount(); i++) { List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
String documentTime = inInfo.getCellStr(EiConstant.resultBlock,i,"documentTime"); this.checkSaveData(resultRows);
if(StringUtils.isNotBlank(documentTime)){ // 写入数据
inInfo.setCell(EiConstant.resultBlock,i,"documentTime", StringUtil.removeHorizontalLine(documentTime)); for (int i = 0; i < resultRows.size(); i++) {
} HPKC002 insertEntity = new HPKC002();
inInfo.setCell(EiConstant.resultBlock,i,"status", 1); insertEntity.fromMap(resultRows.get(i));
inInfo.setCell(EiConstant.resultBlock,i,"approvalStatus", 0); // 仓库名称
super.insert(inInfo,"HPKC002.insert"); Map params = new HashMap<>();
params.put("whCode", insertEntity.getWhCode());
List query = dao.query("HPPZ007.queryByWhCode", params);
insertEntity.setWhName(((HPPZ007) query.get(0)).getWhName());
//物料类型
insertEntity.setMaterialTypeName(InventTypeEnun.getNameByCode(insertEntity.getMaterialType()));
// 生成单据号
insertEntity.setDocumentCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC002_NUMBER));
insertEntity.setStatus(1);
insertEntity.setApprovalStatus(0);
dao.insert("HPKC002.insert", insertEntity);
} }
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (PlatException e) { } catch (PlatException e) {
inInfo.setStatus(EiConstant.STATUS_FAILURE); inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!原因参见详细错误描述!"); inInfo.setMsg("操作失败!原因参见详细错误描述!");
...@@ -78,30 +95,53 @@ public class ServiceHPKC002 extends ServiceBase { ...@@ -78,30 +95,53 @@ public class ServiceHPKC002 extends ServiceBase {
return inInfo; return inInfo;
} }
return query(inInfo); return inInfo;
}
/**
* 校验保存的数据
*
* @param resultRows
*/
private void checkSaveData(List<Map> resultRows) {
for (int i = 0; i < resultRows.size(); i++) {
HPKC002 entity = new HPKC002();
entity.fromMap(resultRows.get(i));
AssertUtils.isEmpty(entity.getMaterialType(), "物料类型不能为空");
AssertUtils.isEmpty(entity.getMaterialCode(), "物料不能为空");
AssertUtils.isEmpty(entity.getWhCode(), "仓库不能为空");
}
} }
/** /**
* 修改操作. * 修改操作.
*/ */
@Override @Override
public EiInfo update(EiInfo inInfo) { public EiInfo update(EiInfo inInfo) {
try { try {
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock); CommonMethod.udpateInfo(inInfo,EiConstant.resultBlock);
HPKC002 hpkc002 = new HPKC002(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); this.checkSaveData(resultRows);
for (int i = 0; i < eiBlock.getRowCount(); i++) { // 写入数据
Map<?, ?> map = eiBlock.getRow(i); for (int i = 0; i < resultRows.size(); i++) {
hpkc002.fromMap(map); HPKC002 updateEntity = new HPKC002();
String documentTime = inInfo.getCellStr(EiConstant.resultBlock,i,"documentTime"); updateEntity.fromMap(resultRows.get(i));
if(StringUtils.isNotBlank(documentTime)){ // 仓库名称
inInfo.setCell(EiConstant.resultBlock,i,"documentTime", StringUtil.removeHorizontalLine(documentTime)); Map params = new HashMap<>();
} params.put("whCode", updateEntity.getWhCode());
this.dao.update("HPKC002.update", hpkc002.toMap()); List query = dao.query("HPPZ007.queryByWhCode", params);
updateEntity.setWhName(((HPPZ007) query.get(0)).getWhName());
//物料类型
updateEntity.setMaterialTypeName(InventTypeEnun.getNameByCode(updateEntity.getMaterialType()));
dao.insert("HPKC002.update", updateEntity);
} }
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!"); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (PlatException e) { } catch (PlatException e) {
inInfo.setStatus(EiConstant.STATUS_FAILURE); inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!原因参见详细错误描述!"); inInfo.setMsg("操作失败!原因参见详细错误描述!");
...@@ -109,7 +149,7 @@ public class ServiceHPKC002 extends ServiceBase { ...@@ -109,7 +149,7 @@ public class ServiceHPKC002 extends ServiceBase {
logError("修改失败", e.getMessage()); logError("修改失败", e.getMessage());
return inInfo; return inInfo;
} }
return query(inInfo); return inInfo;
} }
/** /**
...@@ -137,15 +177,4 @@ public class ServiceHPKC002 extends ServiceBase { ...@@ -137,15 +177,4 @@ public class ServiceHPKC002 extends ServiceBase {
eiInfo.setMsg("删除成功!"); eiInfo.setMsg("删除成功!");
return eiInfo; return eiInfo;
} }
public EiInfo queryMaterialTypeSetName(EiInfo eiInfo) {
eiInfo.setBlock(InventTypeEnun.generatorEiBlock());
return eiInfo;
}
public EiInfo queryWhCodeSetName(EiInfo eiInfo) {
CommonMethod.initBlock(eiInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
return eiInfo;
}
} }
package com.baosight.hpjx.hp.kc.service; package com.baosight.hpjx.hp.kc.service;
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.kc.domain.HPKC003; import com.baosight.hpjx.hp.kc.domain.HPKC003;
import com.baosight.hpjx.hp.pz.domain.HPPZ009;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil; import com.baosight.hpjx.util.StringUtil;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
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.exception.PlatException;
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.List;
import java.util.Map; import java.util.Map;
/** /**
* @author xuao * @author:songx
* @date 2024年01月12日 14:22 * @date:2024/1/22,10:48
*/ */
public class ServiceHPKC003 extends ServiceBase { public class ServiceHPKC003 extends ServiceBase {
/**
/** * 画面初始化
* 画面初始化. *
*/ * @param inInfo
public EiInfo initLoad(EiInfo inInfo) { * @return
HPKC003 hpkc003 = new HPKC003(); */
EiInfo outInfo = new EiInfo(); public EiInfo initLoad(EiInfo inInfo) {
outInfo.addBlock(EiConstant.resultBlock); try {
outInfo.getBlock(EiConstant.resultBlock).addBlockMeta(hpkc003.eiMetadata); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_QUERY_BLOCK_ID), null);
return outInfo; CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null);
} inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC003().eiMetadata);
} catch (Exception e) {
/** LogUtils.setDetailMsg(inInfo, e, "初始化失败");
* 查询操作. }
*/ return inInfo;
@Override }
public EiInfo query(EiInfo inInfo) {
/* 调用EI查询方法.*/ /**
EiInfo outInfo = super.query(inInfo, "HPKC003.query", new HPKC003()); * 查询操作
return outInfo; *
* @param inInfo
} * @return
*/
/** @Override
* 新增操作. public EiInfo query(EiInfo inInfo) {
*/ try {
@Override Map queryRow = EiInfoUtils.getFirstRow(inInfo);
public EiInfo insert(EiInfo inInfo) { String receiptDate = MapUtils.getString(queryRow, "documentDate");
try { queryRow.put("documentDate", StringUtil.removeSpecifiedCharacter(receiptDate,
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock); StringUtil.DEFAULT_CHARACTER_TO_BE_REMOVED));
inInfo = super.query(inInfo, "HPKC003.query", new HPPZ009());
for (int i = 0; i < inInfo.getBlock(EiConstant.resultBlock).getRowCount(); i++) { } catch (Exception e) {
// String inventName =inInfo.getCellStr(EiConstant.resultBlock,i,"inventName"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
// String[] str = inventName.split("-"); }
// inInfo.setCell(EiConstant.resultBlock,i,"inventCode", str[0]); return inInfo;
// inInfo.setCell(EiConstant.resultBlock,i,"inventName", str[1]); }
String documentDate = inInfo.getCellStr(EiConstant.resultBlock,i,"documentDate");
inInfo.setCell(EiConstant.resultBlock,i,"documentDate", StringUtil.removeHorizontalLine(documentDate)); /**
* 新增操作
} *
inInfo.setStatus(EiConstant.STATUS_SUCCESS); * @param inInfo
inInfo.setMsg("新增成功!"); * @return
*/
} catch (PlatException e) { @Override
e.printStackTrace(); public EiInfo insert(EiInfo inInfo) {
inInfo.setStatus(EiConstant.STATUS_FAILURE); CommonMethod.creatorInfo(inInfo, EiConstant.resultBlock);
inInfo.setMsg("新增失败!原因参见详细错误描述!"); try {
inInfo.setDetailMsg(e.getMessage()); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
logError("新增失败", e.getMessage()); // 数据写入
return inInfo; for (int i = 0; i < resultRows.size(); i++) {
} HPKC003 fKc003 = new HPKC003();
return super.insert(inInfo,"HPKC003.insert"); fKc003.fromMap(resultRows.get(i));
} fKc003.setDocumentDate(StringUtil.removeHorizontalLine(fKc003.getDocumentDate()));
// 仓库名称
fKc003.setWhName(HPPZTools.getPz007ByCode(fKc003.getWhCode()).getWhName());
/** // 物料名称
* 修改操作. fKc003.setInventName(HPPZTools.getPz004ByCode(fKc003.getInventCode()).getInventName());
*/ // 生成入库单号
public EiInfo update(EiInfo inInfo) { fKc003.setProdNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC003_PROD_NO));
try { DaoUtils.insert("HPKC003.insert", fKc003);
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock); }
HPKC003 hpkc003 = new HPKC003(); inInfo = this.query(inInfo);
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
for (int i = 0; i < eiBlock.getRowCount(); i++) { inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
Map<?, ?> map = eiBlock.getRow(i); } catch (Exception e) {
hpkc003.fromMap(map); LogUtils.setDetailMsg(inInfo, e, "新增失败");
String documentDate = inInfo.getCellStr(EiConstant.resultBlock,i,"documentDate"); }
inInfo.setCell(EiConstant.resultBlock,i,"documentDate", StringUtil.removeHorizontalLine(documentDate)); return inInfo;
this.dao.update("HPKC003.update", hpkc003.toMap()); }
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS); /**
inInfo.setMsg("修改成功!"); * 修改操作
} catch (PlatException e) { *
inInfo.setStatus(EiConstant.STATUS_FAILURE); * @param inInfo
inInfo.setMsg("操作失败!原因参见详细错误描述!"); * @return
inInfo.setDetailMsg(e.getMessage()); */
logError("修改失败", e.getMessage()); public EiInfo update(EiInfo inInfo) {
return inInfo; try {
} CommonMethod.creatorInfo(inInfo, EiConstant.resultBlock);
return query(inInfo); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
} for (int i = 0; i < resultRows.size(); i++) {
HPKC003 fKc003 = new HPKC003();
/** fKc003.fromMap(resultRows.get(i));
* 删除操作. fKc003.setDocumentDate(StringUtil.removeHorizontalLine(fKc003.getDocumentDate()));
*/ // 仓库名称
public EiInfo delete(EiInfo eiInfo) { fKc003.setWhName(HPPZTools.getPz007ByCode(fKc003.getWhCode()).getWhName());
HPKC003 hpkc003 = new HPKC003(); // 物料名称
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock); fKc003.setInventName(HPPZTools.getPz004ByCode(fKc003.getInventCode()).getInventName());
try { DaoUtils.update("HPKC003.update", fKc003);
for (int i = 0; i < eiBlock.getRowCount(); i++) { }
Map<?, ?> map = eiBlock.getRow(i); inInfo = this.query(inInfo);
hpkc003.fromMap(map); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
this.dao.delete("HPKC003.delete", hpkc003.toMap()); } catch (Exception e) {
} LogUtils.setDetailMsg(inInfo, e, "修改失败");
} catch (PlatException e) { }
eiInfo.setStatus(EiConstant.STATUS_FAILURE); return inInfo;
eiInfo.setMsg("删除失败,原因参见详细错误描述!"); }
eiInfo.setDetailMsg(e.getMessage());
logError("删除失败!", e.getMessage()); /**
return eiInfo; * 删除操作
} *
* @param eiInfo
eiInfo.setStatus(EiConstant.STATUS_SUCCESS); * @return
eiInfo.setMsg("删除成功!"); */
return eiInfo; public EiInfo delete(EiInfo eiInfo) {
} HPKC003 hpkc003 = new HPKC003();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpkc003.fromMap(map);
this.dao.delete("HPKC003.delete", hpkc003.toMap());
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(eiInfo, e, "删除失败");
}
return eiInfo;
}
} }
package com.baosight.hpjx.hp.kc.service; package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.common.DdynamicEnum; 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.kc.domain.HPKC004; import com.baosight.hpjx.hp.kc.domain.HPKC004;
import com.baosight.hpjx.hp.pz.domain.HPPZ007; import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.pz.domain.THppz004;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil; import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
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.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
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.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* @author YK * @author YK
* @date 2024年01月09日 10:18 * @date 2024年01月09日 10:18
*/ */
public class ServiceHPKC004 extends ServiceBase { public class ServiceHPKC004 extends ServiceBase {
/** /**
* 画面初始化. * 画面初始化
*/ *
public EiInfo initLoad(EiInfo inInfo) { * @param inInfo
HPKC004 HPKC004 = new HPKC004(); * @return
EiInfo outInfo = super.initLoad(inInfo, HPKC004); */
outInfo.addBlock(EiConstant.queryBlock).setCell(0,"receiptDate",CommonMethod.getCurrentSameYearMonth()); public EiInfo initLoad(EiInfo inInfo) {
outInfo.getBlock(EiConstant.resultBlock).getRows().clear(); try {
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_QUERY_BLOCK_ID), null);
EiBlock block = outInfo.addBlock(EiConstant.queryBlock); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null);
block.setCell(ACConstants.ROW_CODE_0, ACConstants.PARAM_WH_CODE, outInfo.getBlock(ACConstants.WH_CODE_BLOCK_ID).getRow(ACConstants.ROW_CODE_0).get(ACConstants.FIELD_VALUE)); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC004().eiMetadata);
} catch (Exception e) {
return outInfo; LogUtils.setDetailMsg(inInfo, e, "初始化失败");
} }
return inInfo;
/** }
* 查询操作.
*/ /**
@Override * 查询操作
public EiInfo query(EiInfo inInfo) { *
String receiptDate = inInfo.getCellStr(EiConstant.queryBlock,0,"receiptDate"); * @param inInfo
inInfo.setCell(EiConstant.queryBlock,0,"receiptDate", StringUtil.removeHorizontalLine(receiptDate)); * @return
/* 调用EI查询方法.*/ */
return super.query(inInfo, "HPKC004.query", new HPKC004()); @Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String receiptDate = MapUtils.getString(queryRow, "receiptDate");
queryRow.put("receiptDate", StringUtil.removeSpecifiedCharacter(receiptDate,
StringUtil.DEFAULT_CHARACTER_TO_BE_REMOVED));
inInfo = super.query(inInfo, "HPKC004.query", new HPKC004());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
} }
/** /**
* 新增操作. * 新增操作
*/ *
@Override * @param inInfo
public EiInfo insert(EiInfo inInfo) { * @return
*/
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock); @Override
for (int i = 0; i < inInfo.getBlock(EiConstant.resultBlock).getRowCount(); i++) { public EiInfo insert(EiInfo inInfo) {
String receiptDate = inInfo.getCellStr(EiConstant.resultBlock,i,"receiptDate"); CommonMethod.creatorInfo(inInfo, EiConstant.resultBlock);
inInfo.setCell(EiConstant.resultBlock,i,"receiptDate", StringUtil.removeHorizontalLine(receiptDate)); try {
String whCode = inInfo.getCellStr(EiConstant.resultBlock,i,"whCode"); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
String matCode = inInfo.getCellStr(EiConstant.resultBlock,i,"matCode"); // 数据写入
Map params=new HashMap<>(); for (int i = 0; i < resultRows.size(); i++) {
params.put("whCode", whCode); HPKC004 fKc004 = new HPKC004();
List query = dao.query("HPPZ007.queryByWhCode",params); fKc004.fromMap(resultRows.get(i));
String whName = ((HPPZ007)query.get(0)).getWhName(); fKc004.setReceiptDate(StringUtil.removeHorizontalLine(fKc004.getReceiptDate()));
inInfo.setCell(EiConstant.resultBlock,i,"whName", whName); // 仓库名称
Map params1=new HashMap<>(); fKc004.setWhName(HPPZTools.getPz007ByCode(fKc004.getWhCode()).getWhName());
params1.put("inventCode", matCode); // 物料名称
List query1 = dao.query("HPPZ004.queryMatNameByCode",params1); fKc004.setInventName(HPPZTools.getPz004ByCode(fKc004.getInventCode()).getInventName());
String matName = ((THppz004)query1.get(0)).getInventName(); // 生成销售单号
inInfo.setCell(EiConstant.resultBlock,i,"matName", matName); fKc004.setSaleNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC004_SALE_NO));
} DaoUtils.insert("HPKC004.insert", fKc004);
return super.insert(inInfo,"HPKC004.insert"); }
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
} }
/**
/** * 修改操作
* 修改操作. *
*/ * @param inInfo
public EiInfo update(EiInfo inInfo) { * @return
try { */
HPKC004 HPKC004 = new HPKC004(); public EiInfo update(EiInfo inInfo) {
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); CommonMethod.creatorInfo(inInfo, EiConstant.resultBlock);
List<String> list = new ArrayList<>(); try {
for (int i = 0; i < eiBlock.getRowCount(); i++) { List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
Map<?, ?> map = eiBlock.getRow(i); for (int i = 0; i < resultRows.size(); i++) {
HPKC004.fromMap(map); HPKC004 fKc004 = new HPKC004();
if (HPKC004.getStatus() == 1) { fKc004.fromMap(resultRows.get(i));
list.add(HPKC004.getSaleNumber()); fKc004.setReceiptDate(StringUtil.removeHorizontalLine(fKc004.getReceiptDate()));
continue; // 仓库名称
} fKc004.setWhName(HPPZTools.getPz007ByCode(fKc004.getWhCode()).getWhName());
Map params=new HashMap<>(); // 物料名称
params.put("whCode", HPKC004.getWhCode()); fKc004.setInventName(HPPZTools.getPz004ByCode(fKc004.getInventCode()).getInventName());
List query = dao.query("HPPZ007.queryByWhCode",params); DaoUtils.update("HPKC004.update", fKc004);
String whName = ((HPPZ007)query.get(0)).getWhName(); }
HPKC004.setWhName(whName); inInfo = this.query(inInfo);
Map params1=new HashMap<>(); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
params1.put("inventCode", HPKC004.getMatCode()); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
List query1 = dao.query("HPPZ004.queryMatNameByCode",params1); } catch (Exception e) {
String matName = ((THppz004)query1.get(0)).getInventName(); LogUtils.setDetailMsg(inInfo, e, "修改失败");
HPKC004.setMatName(matName); }
this.dao.update("HPKC004.update", HPKC004.toMap()); return inInfo;
}
if (list.size() > 0) {
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("部分数据修改成功!销售出库单号为:" + list.stream()
.collect(Collectors.joining(",")) + "状态为已审核不能进行修改!");
} else {
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
}
} catch (PlatException e) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("修改失败", e.getMessage());
return inInfo;
}
return query(inInfo);
} }
/** /**
......
package com.baosight.hpjx.hp.kc.service; package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.common.DdynamicEnum; import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant; import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC005; import com.baosight.hpjx.hp.kc.domain.HPKC005;
import com.baosight.hpjx.hp.pz.domain.HPPZ007; import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.pz.domain.HPPZ009;
import com.baosight.hpjx.hp.pz.domain.THppz004;
import com.baosight.hpjx.util.AssertUtils; import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils; import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils; import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil; import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
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;
...@@ -22,32 +18,33 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase; ...@@ -22,32 +18,33 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* @author YK *
* @date 2024年01月09日 10:18 * @author:songx
* @date:2024/1/22,10:51
*/ */
public class ServiceHPKC005 extends ServiceBase { public class ServiceHPKC005 extends ServiceBase {
/** /**
* 画面初始化. * 画面初始化
*/ *
public EiInfo initLoad(EiInfo inInfo) { * @param inInfo
HPKC005 HPKC005 = new HPKC005(); * @return
EiInfo outInfo = super.initLoad(inInfo, HPKC005); */
outInfo.addBlock(EiConstant.queryBlock).setCell(0, "receiptDate", CommonMethod.getCurrentSameYearMonth()); public EiInfo initLoad(EiInfo inInfo) {
outInfo.getBlock(EiConstant.resultBlock).getRows().clear(); HPKC005 HPKC005 = new HPKC005();
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null); EiInfo outInfo = super.initLoad(inInfo, HPKC005);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.WH_RECORD_QUERY_BLOCK_ID), null); outInfo.addBlock(EiConstant.queryBlock).setCell(0, "receiptDate", CommonMethod.getCurrentSameYearMonth());
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), null); outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
return outInfo; CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
} CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.WH_RECORD_QUERY_BLOCK_ID), null);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), null);
return outInfo;
}
/** /**
* 查询操作. * 查询操作.
...@@ -83,18 +80,8 @@ public class ServiceHPKC005 extends ServiceBase { ...@@ -83,18 +80,8 @@ public class ServiceHPKC005 extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
HPKC005 fKc005 = new HPKC005(); HPKC005 fKc005 = new HPKC005();
fKc005.fromMap(resultRows.get(i)); fKc005.fromMap(resultRows.get(i));
// 去除日期字符串中的- // 设置基础信息
fKc005.setReceiptDate(StringUtil.removeHorizontalLine(fKc005.getReceiptDate())); this.setBaseInfo(fKc005);
// 仓库名称
Map params = new HashMap<>();
params.put("whCode", fKc005.getWhCode());
List query = dao.query("HPPZ007.queryByWhCode", params);
fKc005.setWhName(((HPPZ007) query.get(0)).getWhName());
// 物料名称
Map params1 = new HashMap<>();
params1.put("inventCode", fKc005.getInventCode());
List query1 = dao.query("HPPZ004.queryMatNameByCode", params1);
fKc005.setInventName(((THppz004) query1.get(0)).getInventName());
if (fKc005.getId() == null || fKc005.getId() == 0) { if (fKc005.getId() == null || fKc005.getId() == 0) {
this.add(fKc005); this.add(fKc005);
} else { } else {
...@@ -154,28 +141,14 @@ public class ServiceHPKC005 extends ServiceBase { ...@@ -154,28 +141,14 @@ public class ServiceHPKC005 extends ServiceBase {
CommonMethod.creatorInfo(inInfo, EiConstant.resultBlock); CommonMethod.creatorInfo(inInfo, EiConstant.resultBlock);
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
Map resultRow = resultRows.get(i); HPKC005 fKc005 = new HPKC005();
// 去除日期字符串中的- fKc005.fromMap(resultRows.get(i));
String receiptDate = MapUtils.getString(resultRow, "receiptDate"); // 设置基础信息
resultRow.put("receiptDate", StringUtil.removeHorizontalLine(receiptDate)); this.setBaseInfo(fKc005);
String whCode = MapUtils.getString(resultRow, "whCode");
String inventCode = MapUtils.getString(resultRow, "inventCode");
// 仓库名称
Map params = new HashMap<>();
params.put("whCode", whCode);
List query = dao.query("HPPZ007.queryByWhCode", params);
String whName = ((HPPZ007) query.get(0)).getWhName();
resultRow.put("whName", whName);
// 物料名称
Map params1 = new HashMap<>();
params1.put("inventCode", inventCode);
List query1 = dao.query("HPPZ004.queryMatNameByCode", params1);
String inventName = ((THppz004) query1.get(0)).getInventName();
resultRow.put("inventName", inventName);
// 生成单据号 // 生成单据号
resultRow.put("statisticalNumber", SequenceGenerator.getNextSequence( fKc005.setStatisticalNumber(SequenceGenerator.getNextSequence(
HPConstant.SequenceId.STATISTICAL_NUMBER)); HPConstant.SequenceId.STATISTICAL_NUMBER));
DaoUtils.insert("HPKC005.insert", resultRow); DaoUtils.insert(HPKC005.INSERT, fKc005);
} }
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!"); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) { } catch (Exception e) {
...@@ -185,30 +158,20 @@ public class ServiceHPKC005 extends ServiceBase { ...@@ -185,30 +158,20 @@ public class ServiceHPKC005 extends ServiceBase {
} }
/** /**
* 修改操作. * 修改操作
*
* @param inInfo
* @return
*/ */
public EiInfo update(EiInfo inInfo) { public EiInfo update(EiInfo inInfo) {
try { try {
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
List<String> list = new ArrayList<>();
for (int i = 0; i < eiBlock.getRowCount(); i++) { for (int i = 0; i < eiBlock.getRowCount(); i++) {
HPKC005 HPKC005 = new HPKC005(); HPKC005 fKc005 = new HPKC005();
HPKC005.fromMap(eiBlock.getRow(i)); fKc005.fromMap(eiBlock.getRow(i));
if (HPKC005.getStatus() == 1) { // 设置基础信息
list.add(HPKC005.getStatisticalNumber()); this.setBaseInfo(fKc005);
continue; DaoUtils.update(HPKC005.UPDATE, fKc005);
}
Map params=new HashMap<>();
params.put("whCode", HPKC005.getWhCode());
List query = dao.query("HPPZ007.queryByWhCode",params);
String whName = ((HPPZ007)query.get(0)).getWhName();
HPKC005.setWhName(whName);
Map params1=new HashMap<>();
params1.put("inventCode", HPKC005.getInventCode());
List query1 = dao.query("HPPZ004.queryMatNameByCode",params1);
String matName = ((THppz004)query1.get(0)).getInventName();
HPKC005.setInventName(matName);
this.dao.update("HPKC005.update", HPKC005.toMap());
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
...@@ -217,30 +180,45 @@ public class ServiceHPKC005 extends ServiceBase { ...@@ -217,30 +180,45 @@ public class ServiceHPKC005 extends ServiceBase {
LogUtils.setDetailMsg(inInfo, e, "修改失败"); LogUtils.setDetailMsg(inInfo, e, "修改失败");
} }
return inInfo; return inInfo;
} }
/** /**
* 删除操作. * 设置基础信息
*/ *
public EiInfo delete(EiInfo eiInfo) { * @param fKc005
HPKC005 HPKC005 = new HPKC005(); */
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock); private void setBaseInfo(HPKC005 fKc005) {
try { // 去除日期字符串中的-
for (int i = 0; i < eiBlock.getRowCount(); i++) { fKc005.setReceiptDate(StringUtil.removeHorizontalLine(fKc005.getReceiptDate()));
Map<?, ?> map = eiBlock.getRow(i); // 仓库名称
HPKC005.fromMap(map); fKc005.setWhName(HPPZTools.getPz007ByCode(fKc005.getWhCode()).getWhName());
this.dao.delete("HPKC005.delete", HPKC005.toMap()); // 物料名称
} fKc005.setInventName(HPPZTools.getPz004ByCode(fKc005.getInventCode()).getInventName());
} catch (PlatException e) { // 差异数量
eiInfo.setStatus(EiConstant.STATUS_FAILURE); fKc005.setDiffAmount(fKc005.getEntityAmount().subtract(fKc005.getBookAmount()));
eiInfo.setMsg("删除失败,原因参见详细错误描述!"); // 差异重量
eiInfo.setDetailMsg(e.getMessage()); fKc005.setDiffWeight(fKc005.getEntityWeight().subtract(fKc005.getBookWeight()));
logError("删除失败!", e.getMessage()); }
return eiInfo;
} /**
eiInfo.setStatus(EiConstant.STATUS_SUCCESS); * 删除操作
eiInfo.setMsg("删除成功!"); *
return eiInfo; * @param inInfo
} * @return
*/
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
DaoUtils.update(HPKC005.DELETE, resultRows.get(i));
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
} }
package com.baosight.hpjx.hp.kc.service; package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant; import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC005;
import com.baosight.hpjx.hp.kc.domain.HPKC008; import com.baosight.hpjx.hp.kc.domain.HPKC008;
import com.baosight.hpjx.hp.pz.domain.HPPZ007; import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.pz.domain.THppz004; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils; import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils; import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil; import com.baosight.hpjx.util.StringUtil;
import com.baosight.iplat4j.core.ei.EiBlock;
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.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -52,8 +45,8 @@ public class ServiceHPKC008 extends ServiceBase { ...@@ -52,8 +45,8 @@ public class ServiceHPKC008 extends ServiceBase {
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo); Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String receiptDate = MapUtils.getString(queryRow, "receiptDate"); String dateMonth = MapUtils.getString(queryRow, "dateMonth");
queryRow.put("receiptDate", StringUtil.removeSpecifiedCharacter(receiptDate, queryRow.put("dateMonth", StringUtil.removeSpecifiedCharacter(dateMonth,
StringUtil.DEFAULT_CHARACTER_TO_BE_REMOVED)); StringUtil.DEFAULT_CHARACTER_TO_BE_REMOVED));
inInfo = super.query(inInfo, "HPKC008.query", new HPKC008()); inInfo = super.query(inInfo, "HPKC008.query", new HPKC008());
List sum = dao.query("HPKC008.querySum", queryRow); List sum = dao.query("HPKC008.querySum", queryRow);
...@@ -63,88 +56,85 @@ public class ServiceHPKC008 extends ServiceBase { ...@@ -63,88 +56,85 @@ public class ServiceHPKC008 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 新增操作. * 新增操作
*/ *
@Override * @param inInfo
public EiInfo insert(EiInfo inInfo) { * @return
try { */
CommonMethod.creatorInfo(inInfo, EiConstant.resultBlock); public EiInfo insert(EiInfo inInfo) {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); try {
for (int i = 0; i < resultRows.size(); i++) { List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
Map resultRow = resultRows.get(i); for (int i = 0; i < resultRows.size(); i++) {
// 去除日期字符串中的- HPKC008 fKc008 = new HPKC008();
String datemonth = MapUtils.getString(resultRow, "datemonth"); fKc008.fromMap(resultRows.get(i));
resultRow.put("datemonth", StringUtil.removeHorizontalLine(datemonth)); // 去除日期字符串中的-
// 物料名称 fKc008.setDateMonth(StringUtil.removeHorizontalLine(fKc008.getDateMonth()));
Map params1 = new HashMap<>(); // 物料名称
params1.put("inventCode", MapUtils.getString(resultRow, "materialCode")); fKc008.setInventName(HPPZTools.getPz004ByCode(fKc008.getInventCode()).getInventName());
List query1 = dao.query("HPPZ004.queryMatNameByCode", params1); // 计算总金额
String matName = ((THppz004) query1.get(0)).getInventName(); fKc008.setTotalPrice(fKc008.getAmount().multiply(fKc008.getPrice()));
resultRow.put("materialName", matName); // 生成单据号
// 生成单据号 fKc008.setStatNo(SequenceGenerator.getNextSequence(
resultRow.put("statisticalNumber", SequenceGenerator.getNextSequence( HPConstant.SequenceId.HPKC008_NUMBER));
HPConstant.SequenceId.HPKC008_NUMBER)); DaoUtils.insert(HPKC008.INSERT, fKc008);
DaoUtils.insert("HPKC008.insert", resultRow); }
} inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!"); } catch (Exception e) {
} catch (Exception e) { LogUtils.setDetailMsg(inInfo, e, "新增失败");
LogUtils.setDetailMsg(inInfo, e, "新增失败"); }
} return inInfo;
return inInfo; }
}
/**
* 修改操作
/** *
* 修改操作. * @param inInfo
*/ * @return
public EiInfo update(EiInfo inInfo) { */
try { public EiInfo update(EiInfo inInfo) {
HPKC008 HPKC008 = new HPKC008(); try {
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < eiBlock.getRowCount(); i++) { for (int i = 0; i < resultRows.size(); i++) {
Map<?, ?> map = eiBlock.getRow(i); HPKC008 fKc008 = new HPKC008();
HPKC008.fromMap(map); fKc008.fromMap(resultRows.get(i));
// 去除日期字符串中的-
this.dao.update("HPKC008.update", HPKC008.toMap()); fKc008.setDateMonth(StringUtil.removeHorizontalLine(fKc008.getDateMonth()));
} // 物料名称
inInfo.setStatus(EiConstant.STATUS_SUCCESS); fKc008.setInventName(HPPZTools.getPz004ByCode(fKc008.getInventCode()).getInventName());
inInfo.setMsg("修改成功!"); // 计算总金额
} catch (PlatException e) { fKc008.setTotalPrice(fKc008.getAmount().multiply(fKc008.getPrice()));
inInfo.setStatus(EiConstant.STATUS_FAILURE); DaoUtils.update(HPKC008.UPDATE, fKc008);
inInfo.setMsg("操作失败!原因参见详细错误描述!"); }
inInfo.setDetailMsg(e.getMessage()); inInfo = this.query(inInfo);
logError("修改失败", e.getMessage()); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
return inInfo; inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
} } catch (Exception e) {
return query(inInfo); LogUtils.setDetailMsg(inInfo, e, "修改失败");
} }
return inInfo;
/** }
* 删除操作.
*/ /**
public EiInfo delete(EiInfo eiInfo) { * 删除操作
HPKC008 HPKC008 = new HPKC008(); *
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock); * @param inInfo
try { * @return
for (int i = 0; i < eiBlock.getRowCount(); i++) { */
Map<?, ?> map = eiBlock.getRow(i); public EiInfo delete(EiInfo inInfo) {
HPKC008.fromMap(map); try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
this.dao.delete("HPKC008.delete", HPKC008.toMap()); for (int i = 0; i < resultRows.size(); i++) {
} DaoUtils.update(HPKC008.DELETE, resultRows.get(i));
} catch (PlatException e) { }
eiInfo.setStatus(EiConstant.STATUS_FAILURE); inInfo = this.query(inInfo);
eiInfo.setMsg("删除失败,原因参见详细错误描述!"); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
eiInfo.setDetailMsg(e.getMessage()); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
logError("删除失败!", e.getMessage()); } catch (Exception e) {
return eiInfo; LogUtils.setDetailMsg(inInfo, e, "删除失败");
} }
return inInfo;
eiInfo.setStatus(EiConstant.STATUS_SUCCESS); }
eiInfo.setMsg("删除成功!");
return eiInfo;
}
} }
...@@ -2,6 +2,29 @@ ...@@ -2,6 +2,29 @@
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd"> <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPKC001"> <sqlMap namespace="HPKC001">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="documentTime">
DOCUMENT_TIME = #documentTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="documentCode">
DOCUMENT_CODE LIKE CONCAT('%',CONCAT( #documentCode#,'%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="materialType">
MATERIAL_TYPE = #materialType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="materialCode">
MATERIAL_CODE = #materialCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.kc.domain.HPKC001"> resultClass="com.baosight.hpjx.hp.kc.domain.HPKC001">
SELECT SELECT
...@@ -28,22 +51,11 @@ ...@@ -28,22 +51,11 @@
QUANTITY as "quantity", <!-- 数量 --> QUANTITY as "quantity", <!-- 数量 -->
WEIGHT as "weight", <!-- 重量 --> WEIGHT as "weight", <!-- 重量 -->
REMARKS as "remarks", <!-- 备注 --> REMARKS as "remarks", <!-- 备注 -->
APPROVAL_STATUS as "approvalStatus", <!-- 审批状态:0-未审核,1-已审核 --> APPROVAL_STATUS as "approvalStatus", <!-- 审批状态:1-保存,2-已提交,3-审批通过,4-审批拒绝 -->
CUST_CODE as "custCode", <!-- 供应商编码 --> CUST_CODE as "custCode", <!-- 供应商编码 -->
CUST_NAME as "custName" <!-- 供应商名称 --> CUST_NAME as "custName" <!-- 供应商名称 -->
FROM hpjx.t_hpkc001 WHERE 1=1 FROM hpjx.t_hpkc001 WHERE 1=1
<isNotEmpty prepend=" AND " property="id"> <include refid="condition"/>
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="documentTime">
DOCUMENT_TIME = #documentTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="documentCode">
DOCUMENT_CODE LIKE CONCAT('%',CONCAT( #documentCode#,'%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy"> <isNotEmpty property="orderBy">
$orderBy$ $orderBy$
...@@ -56,15 +68,7 @@ ...@@ -56,15 +68,7 @@
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hpkc001 WHERE 1=1 SELECT COUNT(*) FROM hpjx.t_hpkc001 WHERE 1=1
<isNotEmpty prepend=" AND " property="id"> <include refid="condition"/>
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="documentTime">
DOCUMENT_TIME = #documentTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="documentCode">
DOCUMENT_CODE LIKE CONCAT('%',CONCAT( #documentCode#,'%'))
</isNotEmpty>
</select> </select>
<insert id="insert"> <insert id="insert">
...@@ -91,7 +95,7 @@ ...@@ -91,7 +95,7 @@
QUANTITY, <!-- 数量 --> QUANTITY, <!-- 数量 -->
WEIGHT, <!-- 重量 --> WEIGHT, <!-- 重量 -->
REMARKS, <!-- 备注 --> REMARKS, <!-- 备注 -->
APPROVAL_STATUS, <!-- 审批状态:0-未审核,1-已审核 --> APPROVAL_STATUS, <!-- 审批状态:1-保存,2-已提交,3-审批通过,4-审批拒绝 -->
CUST_CODE, <!-- 供应商编码 --> CUST_CODE, <!-- 供应商编码 -->
CUST_NAME <!-- 供应商名称 --> CUST_NAME <!-- 供应商名称 -->
) )
...@@ -106,12 +110,18 @@ ...@@ -106,12 +110,18 @@
DELETE FROM hpjx.t_hpkc001 WHERE ID = #id# DELETE FROM hpjx.t_hpkc001 WHERE ID = #id#
</delete> </delete>
<update id="approvalStatusUpdate">
UPDATE hpjx.t_hpkc001
SET APPROVAL_STATUS = #approvalStatus#
WHERE ID = #id#
</update>
<update id="update"> <update id="update">
UPDATE hpjx.t_hpkc001 UPDATE hpjx.t_hpkc001
SET SET
UPDATED_BY = #updatedBy#, UPDATED_BY = #updatedBy#,
UPDATED_BY = #updatedBy#, UPDATED_NAME = #updatedName#,
UPDATED_BY = #updatedBy# UPDATED_TIME = #updatedTime#
<isNotEmpty property="companyCode"> <isNotEmpty property="companyCode">
,COMPANY_CODE = #companyCode# ,COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
...@@ -172,8 +182,8 @@ ...@@ -172,8 +182,8 @@
WHERE ID = #id# WHERE ID = #id#
</update> </update>
<!-- 按天统计 --> <!-- 统计库存 -->
<select id="statDay" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC001"> <select id="statDate" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC001">
SELECT SELECT
COMPANY_CODE AS "companyCode", COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode", DEP_CODE AS "depCode",
......
...@@ -2,6 +2,29 @@ ...@@ -2,6 +2,29 @@
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd"> <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPKC002"> <sqlMap namespace="HPKC002">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="documentTime">
DOCUMENT_TIME = #documentTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="documentCode">
DOCUMENT_CODE LIKE CONCAT('%',CONCAT( #documentCode#,'%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="materialType">
MATERIAL_TYPE = #materialType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="materialCode">
MATERIAL_CODE = #materialCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.kc.domain.HPKC002"> resultClass="com.baosight.hpjx.hp.kc.domain.HPKC002">
SELECT SELECT
...@@ -28,19 +51,11 @@ ...@@ -28,19 +51,11 @@
QUANTITY as "quantity", <!-- 数量 --> QUANTITY as "quantity", <!-- 数量 -->
WEIGHT as "weight", <!-- 重量 --> WEIGHT as "weight", <!-- 重量 -->
REMARKS as "remarks", <!-- 备注 --> REMARKS as "remarks", <!-- 备注 -->
APPROVAL_STATUS as "approvalStatus", <!-- 审批状态:0-未审核,1-已审核 --> APPROVAL_STATUS as "approvalStatus", <!-- 审批状态:1-保存,2-已提交,3-审批通过,4-审批拒绝 -->
CUST_CODE as "custCode", <!-- 供应商编码 --> CUST_CODE as "custCode", <!-- 供应商编码 -->
CUST_NAME as "custName" <!-- 供应商名称 --> CUST_NAME as "custName" <!-- 供应商名称 -->
FROM hpjx.t_hpkc002 WHERE 1=1 FROM hpjx.t_hpkc002 WHERE 1=1
<isNotEmpty prepend=" AND " property="id"> <include refid="condition"/>
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="documentTime">
DOCUMENT_TIME = #documentTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="documentCode">
DOCUMENT_CODE LIKE CONCAT('%',CONCAT( #documentCode#,'%'))
</isNotEmpty>
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy"> <isNotEmpty property="orderBy">
$orderBy$ $orderBy$
...@@ -52,17 +67,10 @@ ...@@ -52,17 +67,10 @@
</select> </select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hpkc002 WHERE 1=1 SELECT COUNT(*) FROM hpjx.t_hpkc002 WHERE 1=1
<isNotEmpty prepend=" AND " property="id"> <include refid="condition"/>
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="documentTime">
DOCUMENT_TIME = #documentTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="documentCode">
DOCUMENT_CODE LIKE CONCAT('%',CONCAT( #documentCode#,'%'))
</isNotEmpty>
</select> </select>
<insert id="insert"> <insert id="insert">
...@@ -89,7 +97,7 @@ ...@@ -89,7 +97,7 @@
QUANTITY, <!-- 数量 --> QUANTITY, <!-- 数量 -->
WEIGHT, <!-- 重量 --> WEIGHT, <!-- 重量 -->
REMARKS, <!-- 备注 --> REMARKS, <!-- 备注 -->
APPROVAL_STATUS, <!-- 审批状态:0-未审核,1-已审核 --> APPROVAL_STATUS, <!-- 审批状态:1-保存,2-已提交,3-审批通过,4-审批拒绝 -->
CUST_CODE, <!-- 供应商编码 --> CUST_CODE, <!-- 供应商编码 -->
CUST_NAME <!-- 供应商名称 --> CUST_NAME <!-- 供应商名称 -->
) )
...@@ -170,8 +178,8 @@ ...@@ -170,8 +178,8 @@
WHERE ID = #id# WHERE ID = #id#
</update> </update>
<!-- 按天统计 --> <!-- 统计库存 -->
<select id="statDay" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC002"> <select id="statDate" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC002">
SELECT SELECT
COMPANY_CODE AS "companyCode", COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode", DEP_CODE AS "depCode",
......
...@@ -120,8 +120,8 @@ ...@@ -120,8 +120,8 @@
ID = #id# ID = #id#
</update> </update>
<!-- 按天统计 --> <!-- 统计库存 -->
<select id="statDay" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC006"> <select id="statDate" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC006">
SELECT SELECT
COMPANY_CODE AS "companyCode", COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode", DEP_CODE AS "depCode",
......
...@@ -163,8 +163,8 @@ ...@@ -163,8 +163,8 @@
ID = #id# ID = #id#
</update> </update>
<!-- 按天统计 --> <!-- 统计库存 -->
<select id="statDay" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC007"> <select id="statDate" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC007">
SELECT SELECT
COMPANY_CODE AS "companyCode", COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode", DEP_CODE AS "depCode",
......
...@@ -4,39 +4,50 @@ ...@@ -4,39 +4,50 @@
<sql id="column"> <sql id="column">
ID as "id", ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 --> COMPANY_CODE as "companyCode", <!-- 企业编码 -->
DATEMONTH as "datemonth", <!-- 月份 --> DEP_CODE as "depCode", <!-- 部门编码 -->
STATISTICAL_NUMBER as "statisticalNumber", <!-- 统计单单号 --> DATE_MONTH as "dateMonth", <!-- 月份 -->
MATERIAL_CODE as "materialCode", <!-- 物料编码 --> STAT_NO as "statNo", <!-- 统计单号 -->
MATERIAL_NAME as "materialName", <!-- 物料名称 --> INVENT_CODE as "inventCode", <!-- 存货代码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
UNIT as "unit", <!-- 单位 --> UNIT as "unit", <!-- 单位 -->
AMOUNT as "amount", <!-- 数量 --> AMOUNT as "amount", <!-- 数量 -->
PRICE as "price", <!-- 单价 --> PRICE as "price", <!-- 单价 -->
TOTAL_PRICE as "totalPrice", <!-- 金额 --> TOTAL_PRICE as "totalPrice", <!-- 总价 -->
NOTES as "notes", <!-- 备注 --> REMARK as "remark", <!-- 备注 -->
CREATED_BY as "createdBy", <!-- 创建人 --> CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人姓名 -->
CREATED_TIME as "createdTime", <!-- 创建时间 --> CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 --> UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_TIME as "updatedTime" <!-- 更新时间 --> UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime" <!-- 修改时间 -->
</sql> </sql>
<sql id="condition"> <sql id="condition">
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="datemonth"> <isNotEmpty prepend=" AND " property="companyCode">
DATEMONTH = #datemonth# COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="statisticalNumber"> <isNotEmpty prepend=" AND " property="depCode">
STATISTICAL_NUMBER = #statisticalNumber# DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="dateMonth">
DATE_MONTH = #dateMonth#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="statNo">
STAT_NO = #statNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<select id="query" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC008"> <sql id="order">
SELECT
<include refid="column"/>
FROM hpjx.t_hpkc008 WHERE 1=1
<include refid="condition"/>
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy"> <isNotEmpty property="orderBy">
$orderBy$ $orderBy$
...@@ -45,36 +56,53 @@ ...@@ -45,36 +56,53 @@
ID DESC ID DESC
</isEmpty> </isEmpty>
</dynamic> </dynamic>
</select> </sql>
<select id="count" resultClass="int"> <select id="query" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC008">
SELECT COUNT(*) FROM hpjx.t_hpkc008 WHERE 1=1 SELECT
<isNotEmpty prepend=" AND " property="id"> <include refid="column"/>
ID = #id# FROM ${hpjxSchema}.T_HPKC008 WHERE 1=1
</isNotEmpty> <include refid="condition"/>
</select> <include refid="order"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPKC008 WHERE 1=1
<include refid="condition"/>
</select>
<!-- 查询统计 --> <!-- 查询统计 -->
<select id="querySum" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC008"> <select id="querySum" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC008">
SELECT SELECT
COALESCE(SUM(AMOUNT), 0) AS "amount", <!-- 数量 --> COALESCE(SUM(AMOUNT), 0) AS "amount", <!-- 数量 -->
COALESCE(SUM(TOTAL_PRICE), 0) AS "totalPrice" <!-- 金额 --> COALESCE(SUM(TOTAL_PRICE), 0) AS "totalPrice" <!-- 金额 -->
FROM ${hpjxSchema}.t_hpkc008 FROM ${hpjxSchema}.T_HPKC008
WHERE 1=1 WHERE 1=1
<include refid="condition"/> <include refid="condition"/>
</select> </select>
<insert id="insert"> <insert id="insert">
INSERT INTO hpjx.t_hpkc008 ( INSERT INTO hpjx.t_hpkc008 (
COMPANY_CODE, DATEMONTH, STATISTICAL_NUMBER, MATERIAL_CODE, COMPANY_CODE, <!-- 企业编码 -->
MATERIAL_NAME, UNIT, AMOUNT, PRICE, TOTAL_PRICE, NOTES, DEP_CODE, <!-- 部门编码 -->
CREATED_BY, CREATED_TIME DATE_MONTH, <!-- 月份 -->
STAT_NO, <!-- 统计单号 -->
INVENT_CODE, <!-- 存货代码 -->
INVENT_NAME, <!-- 存货名称 -->
UNIT, <!-- 单位 -->
AMOUNT, <!-- 数量 -->
PRICE, <!-- 单价 -->
TOTAL_PRICE, <!-- 总价 -->
REMARK, <!-- 备注 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人姓名 -->
CREATED_TIME <!-- 创建时间 -->
) VALUES ( ) VALUES (
#companyCode#, #datemonth#, #statisticalNumber#, #materialCode#, #materialName#, #companyCode#, #depCode#, #dateMonth#, #statNo#, #inventCode#, #inventName#,
#unit#, #amount#, #price#, #totalPrice#, #notes#, #createdBy#, #createdTime#, #unit#, #amount#, #price#, #totalPrice#, #remark#, #createdBy#, #createdName#,
#updatedBy#, #updatedTime# #createdTime#
) )
</insert> </insert>
<delete id="delete"> <delete id="delete">
DELETE FROM hpjx.t_hpkc008 WHERE ID = #id# DELETE FROM hpjx.t_hpkc008 WHERE ID = #id#
...@@ -83,16 +111,17 @@ ...@@ -83,16 +111,17 @@
<update id="update"> <update id="update">
UPDATE hpjx.t_hpkc008 UPDATE hpjx.t_hpkc008
SET SET
DATEMONTH = #datemonth#, <!-- 月份 --> DATE_MONTH = #dateMonth#, <!-- 月份 -->
MATERIAL_CODE = #materialCode#, <!-- 物料编码 --> INVENT_CODE = #inventCode#, <!-- 存货代码 -->
MATERIAL_NAME = #materialName#, <!-- 物料名称 --> INVENT_NAME = #inventName#, <!-- 存货名称 -->
UNIT = #unit#, <!-- 单位 --> UNIT = #unit#, <!-- 单位 -->
AMOUNT = #amount#, <!-- 数量 --> AMOUNT = #amount#, <!-- 数量 -->
PRICE = #price#, <!-- 单价 --> PRICE = #price#, <!-- 单价 -->
TOTAL_PRICE = #totalPrice#, <!-- 金额 --> TOTAL_PRICE = #totalPrice#, <!-- 总价 -->
NOTES = #notes#, <!-- 备注 --> REMARK = #remark#, <!-- 备注 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 --> UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 --> UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime# <!-- 修改时间 -->
WHERE ID = #id# WHERE ID = #id#
</update> </update>
......
/**
* Generate time : 2024-01-10 10:28:33
* Version : 1.0
*/
package com.baosight.hpjx.hp.pz.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* THppz002
*
*/
public class THppz002 extends DaoEPBase {
private Long id = 0L;
private String companyCode = " "; /* 企业编码 预留*/
private int custType; /* 供应商类型 1 国企 : 2 民营*/
private String custCode = " "; /* 供应商编码*/
private String custName = " "; /* 供应商名称*/
private String address = " "; /* 地址*/
private int status; /* 状态 0禁用 1启用*/
private String createdBy = " "; /* 创建人*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedTime = " "; /* 更新时间*/
private String depCode = " "; /* 部门编码*/
/**
* initialize the metadata
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn("id");
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("companyCode");
eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("custType");
eiColumn.setDescName("供应商类型 1 国企 : 2 民营");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("custCode");
eiColumn.setDescName("供应商编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("custName");
eiColumn.setDescName("供应商名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("address");
eiColumn.setDescName("地址");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("status");
eiColumn.setDescName("状态 0禁用 1启用");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdBy");
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdTime");
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedBy");
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedTime");
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("depCode");
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor
*/
public THppz002() {
initMetaData();
}
/**
* get the id
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the companyCode - 企业编码 预留
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 企业编码 预留
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the custType - 供应商类型 1 国企 : 2 民营
* @return the custType
*/
public int getCustType() {
return this.custType;
}
/**
* set the custType - 供应商类型 1 国企 : 2 民营
*/
public void setCustType(int custType) {
this.custType = custType;
}
/**
* get the custCode - 供应商编码
* @return the custCode
*/
public String getCustCode() {
return this.custCode;
}
/**
* set the custCode - 供应商编码
*/
public void setCustCode(String custCode) {
this.custCode = custCode;
}
/**
* get the custName - 供应商名称
* @return the custName
*/
public String getCustName() {
return this.custName;
}
/**
* set the custName - 供应商名称
*/
public void setCustName(String custName) {
this.custName = custName;
}
/**
* get the address - 地址
* @return the address
*/
public String getAddress() {
return this.address;
}
/**
* set the address - 地址
*/
public void setAddress(String address) {
this.address = address;
}
/**
* get the status - 状态 0未启用 1启用
* @return the status
*/
public int getStatus() {
return this.status;
}
/**
* set the status - 状态 0未启用 1启用
*/
public void setStatus(int status) {
this.status = status;
}
/**
* get the createdBy - 创建人
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdTime - 创建时间
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedTime - 更新时间
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the depCode - 部门编码
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the value from Map
*/
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get("id")), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("companyCode")), companyCode));
setCustType(NumberUtils.toint(StringUtils.toString(map.get("custType")), custType));
setCustCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("custCode")), custCode));
setCustName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("custName")), custName));
setAddress(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("address")), address));
setStatus(NumberUtils.toint(StringUtils.toString(map.get("status")), status));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdBy")), createdBy));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdTime")), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedBy")), updatedBy));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedTime")), updatedTime));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("depCode")), depCode));
}
/**
* set the value to Map
*/
public Map toMap() {
Map map = new HashMap();
map.put("id",StringUtils.toString(id, eiMetadata.getMeta("id")));
map.put("companyCode",StringUtils.toString(companyCode, eiMetadata.getMeta("companyCode")));
map.put("custType",StringUtils.toString(custType, eiMetadata.getMeta("custType")));
map.put("custCode",StringUtils.toString(custCode, eiMetadata.getMeta("custCode")));
map.put("custName",StringUtils.toString(custName, eiMetadata.getMeta("custName")));
map.put("address",StringUtils.toString(address, eiMetadata.getMeta("address")));
map.put("status",StringUtils.toString(status, eiMetadata.getMeta("status")));
map.put("createdBy",StringUtils.toString(createdBy, eiMetadata.getMeta("createdBy")));
map.put("createdTime",StringUtils.toString(createdTime, eiMetadata.getMeta("createdTime")));
map.put("updatedBy",StringUtils.toString(updatedBy, eiMetadata.getMeta("updatedBy")));
map.put("updatedTime",StringUtils.toString(updatedTime, eiMetadata.getMeta("updatedTime")));
map.put("depCode",StringUtils.toString(depCode, eiMetadata.getMeta("depCode")));
return map;
}
}
\ No newline at end of file
/**
* Generate time : 2024-01-09 17:46:33
* Version : 1.0
*/
package com.baosight.hpjx.hp.pz.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* THppz003
*
*/
public class THppz003 extends DaoEPBase {
private Long id = 0L;
private String companyCode = " "; /* 企业编码 预留*/
private int custType; /* 客商类型 1:国企;2:民营;*/
private String custCode = " "; /* 客户编码*/
private String custCname = " "; /* 客户名称*/
private String custAddr = " "; /* 地址*/
private int status; /* 状态 0未启用 1启用*/
private String createdBy = " "; /* 创建人*/
private String createdTime; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedTime; /* 更新时间*/
/**
* initialize the metadata
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn("id");
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("companyCode");
eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("custType");
eiColumn.setDescName("客商类型 1:国企;2:民营;");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("custCode");
eiColumn.setDescName("客户编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("custCname");
eiColumn.setDescName("客户名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("custAddr");
eiColumn.setDescName("地址");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("status");
eiColumn.setDescName("状态 0未启用 1启用");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdBy");
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdTime");
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedBy");
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedTime");
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor
*/
public THppz003() {
initMetaData();
}
/**
* get the id
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the companyCode - 企业编码 预留
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 企业编码 预留
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the custType - 客商类型 1:国企;2:民营;
* @return the custType
*/
public int getCustType() {
return this.custType;
}
/**
* set the custType - 客商类型 1:国企;2:民营;
*/
public void setCustType(int custType) {
this.custType = custType;
}
/**
* get the custCode - 客户编码
* @return the custCode
*/
public String getCustCode() {
return this.custCode;
}
/**
* set the custCode - 客户编码
*/
public void setCustCode(String custCode) {
this.custCode = custCode;
}
/**
* get the custCname - 客户名称
* @return the custCname
*/
public String getCustCname() {
return this.custCname;
}
/**
* set the custCname - 客户名称
*/
public void setCustCname(String custCname) {
this.custCname = custCname;
}
/**
* get the custAddr - 地址
* @return the custAddr
*/
public String getCustAddr() {
return this.custAddr;
}
/**
* set the custAddr - 地址
*/
public void setCustAddr(String custAddr) {
this.custAddr = custAddr;
}
/**
* get the status - 状态 0未启用 1启用
* @return the status
*/
public int getStatus() {
return this.status;
}
/**
* set the status - 状态 0未启用 1启用
*/
public void setStatus(int status) {
this.status = status;
}
/**
* get the createdBy - 创建人
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdTime - 创建时间
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedTime - 更新时间
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the value from Map
*/
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get("id")), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("companyCode")), companyCode));
setCustType(NumberUtils.toint(StringUtils.toString(map.get("custType")), custType));
setCustCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("custCode")), custCode));
setCustCname(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("custCname")), custCname));
setCustAddr(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("custAddr")), custAddr));
setStatus(NumberUtils.toint(StringUtils.toString(map.get("status")), status));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdBy")), createdBy));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdTime")), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedBy")), updatedBy));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedTime")), updatedTime));
}
/**
* set the value to Map
*/
public Map toMap() {
Map map = new HashMap();
map.put("id", StringUtils.toString(id, eiMetadata.getMeta("id")));
map.put("companyCode", StringUtils.toString(companyCode, eiMetadata.getMeta("companyCode")));
map.put("custType", StringUtils.toString(custType, eiMetadata.getMeta("custType")));
map.put("custCode", StringUtils.toString(custCode, eiMetadata.getMeta("custCode")));
map.put("custCname", StringUtils.toString(custCname, eiMetadata.getMeta("custCname")));
map.put("custAddr", StringUtils.toString(custAddr, eiMetadata.getMeta("custAddr")));
map.put("status", StringUtils.toString(status, eiMetadata.getMeta("status")));
map.put("createdBy", StringUtils.toString(createdBy, eiMetadata.getMeta("createdBy")));
map.put("createdTime", StringUtils.toString(createdTime, eiMetadata.getMeta("createdTime")));
map.put("updatedBy", StringUtils.toString(updatedBy, eiMetadata.getMeta("updatedBy")));
map.put("updatedTime", StringUtils.toString(updatedTime, eiMetadata.getMeta("updatedTime")));
return map;
}
}
\ No newline at end of file
/**
* Generate time : 2024-01-10 14:11:21
* Version : 1.0
*/
package com.baosight.hpjx.hp.pz.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* THppz004
*
*/
public class THppz004 extends DaoEPBase {
private Long id = 0L;
private String companyCode = " "; /* 企业编码 预留*/
private String inventName = " "; /* 存货名称*/
private String inventCode = " "; /* 存货编码*/
private int inventType; /* 存货类型*/
private int status; /* 状态 0未启用 1启用*/
private String createdBy = " "; /* 创建人*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedTime = " "; /* 更新时间*/
private String depCode = " "; /* 部门编码*/
/**
* initialize the metadata
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn("id");
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("companyCode");
eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("inventName");
eiColumn.setDescName("存货名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("inventCode");
eiColumn.setDescName("存货编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("inventType");
eiColumn.setDescName("存货类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("status");
eiColumn.setDescName("状态 0未启用 1启用");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdBy");
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdTime");
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedBy");
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedTime");
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("depCode");
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor
*/
public THppz004() {
initMetaData();
}
/**
* get the id
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the companyCode - 企业编码 预留
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 企业编码 预留
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the inventName - 存货名称
* @return the inventName
*/
public String getInventName() {
return this.inventName;
}
/**
* set the inventName - 存货名称
*/
public void setInventName(String inventName) {
this.inventName = inventName;
}
/**
* get the inventCode - 存货编码
* @return the inventCode
*/
public String getInventCode() {
return this.inventCode;
}
/**
* set the inventCode - 存货编码
*/
public void setInventCode(String inventCode) {
this.inventCode = inventCode;
}
/**
* get the inventType - 存货类型
* @return the inventType
*/
public int getInventType() {
return this.inventType;
}
/**
* set the inventType - 存货类型
*/
public void setInventType(int inventType) {
this.inventType = inventType;
}
/**
* get the status - 状态 0未启用 1启用
* @return the status
*/
public int getStatus() {
return this.status;
}
/**
* set the status - 状态 0未启用 1启用
*/
public void setStatus(int status) {
this.status = status;
}
/**
* get the createdBy - 创建人
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdTime - 创建时间
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedTime - 更新时间
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the depCode - 部门编码
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the value from Map
*/
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get("id")), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("companyCode")), companyCode));
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("inventName")), inventName));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("inventCode")), inventCode));
setInventType(NumberUtils.toint(StringUtils.toString(map.get("inventType")), inventType));
setStatus(NumberUtils.toint(StringUtils.toString(map.get("status")), status));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdBy")), createdBy));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdTime")), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedBy")), updatedBy));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedTime")), updatedTime));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("depCode")), depCode));
}
/**
* set the value to Map
*/
public Map toMap() {
Map map = new HashMap();
map.put("id",StringUtils.toString(id, eiMetadata.getMeta("id")));
map.put("companyCode",StringUtils.toString(companyCode, eiMetadata.getMeta("companyCode")));
map.put("inventName",StringUtils.toString(inventName, eiMetadata.getMeta("inventName")));
map.put("inventCode",StringUtils.toString(inventCode, eiMetadata.getMeta("inventCode")));
map.put("inventType",StringUtils.toString(inventType, eiMetadata.getMeta("inventType")));
map.put("status",StringUtils.toString(status, eiMetadata.getMeta("status")));
map.put("createdBy",StringUtils.toString(createdBy, eiMetadata.getMeta("createdBy")));
map.put("createdTime",StringUtils.toString(createdTime, eiMetadata.getMeta("createdTime")));
map.put("updatedBy",StringUtils.toString(updatedBy, eiMetadata.getMeta("updatedBy")));
map.put("updatedTime",StringUtils.toString(updatedTime, eiMetadata.getMeta("updatedTime")));
map.put("depCode",StringUtils.toString(depCode, eiMetadata.getMeta("depCode")));
return map;
}
}
\ No newline at end of file
...@@ -2,14 +2,26 @@ package com.baosight.hpjx.hp.pz.service; ...@@ -2,14 +2,26 @@ package com.baosight.hpjx.hp.pz.service;
import com.baosight.hpjx.common.CompanyTypeEnum; import com.baosight.hpjx.common.CompanyTypeEnum;
import com.baosight.hpjx.common.InitiateModeEnum; 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.kc.domain.HPKC004;
import com.baosight.hpjx.hp.pz.domain.HPPZ009;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
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.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.hpjx.hp.pz.domain.THppz002; import com.baosight.hpjx.hp.pz.domain.HPPZ002;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.MapUtils;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -17,112 +29,111 @@ import java.util.Map; ...@@ -17,112 +29,111 @@ import java.util.Map;
* @date 2024年01月09日 10:18 * @date 2024年01月09日 10:18
*/ */
public class ServiceHPPZ002 extends ServiceBase { public class ServiceHPPZ002 extends ServiceBase {
/** /**
* 画面初始化. * 画面初始化
*/ *
public EiInfo initLoad(EiInfo inInfo) { * @param inInfo
THppz002 hppz002 = new THppz002(); * @return
EiInfo outInfo = new EiInfo(); */
outInfo.addBlock(EiConstant.queryBlock); public EiInfo initLoad(EiInfo inInfo) {
outInfo.getBlock(EiConstant.queryBlock).addBlockMeta(hppz002.eiMetadata); try {
outInfo.addBlock(EiConstant.resultBlock); inInfo.setBlock(CompanyTypeEnum.generatorEiBlock());
outInfo.getBlock(EiConstant.resultBlock).addBlockMeta(hppz002.eiMetadata); inInfo.setBlock(InitiateModeEnum.generatorEiBlock());
outInfo.setBlock(CompanyTypeEnum.generatorEiBlock()); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPPZ002().eiMetadata);
outInfo.setBlock(InitiateModeEnum.generatorEiBlock()); } catch (PlatException e) {
return outInfo; LogUtils.setDetailMsg(inInfo, e, "初始化失败");
} }
return inInfo;
/** }
* 查询操作.
*/ /**
@Override * 查询操作
public EiInfo query(EiInfo inInfo) { *
/* 调用EI查询方法.*/ * @param inInfo
EiInfo outInfo = super.query(inInfo, "HPPZ002.query", new THppz002()); * @return
return outInfo; */
@Override
} public EiInfo query(EiInfo inInfo) {
try {
/** inInfo = super.query(inInfo, "HPPZ002.query", new HPPZ002());
* 新增操作. } catch (Exception e) {
*/ LogUtils.setDetailMsg(inInfo, e, "查询失败");
@Override }
public EiInfo insert(EiInfo inInfo) { return inInfo;
try { }
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
THppz002 hppz002 = new THppz002(); /**
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); * 新增操作
for (int i = 0; i < eiBlock.getRowCount(); i++) { *
Map<?, ?> map = eiBlock.getRow(i); * @param inInfo
hppz002.fromMap(map); * @return
this.dao.insert("HPPZ002.insert", hppz002.toMap()); */
} @Override
inInfo.setStatus(EiConstant.STATUS_SUCCESS); public EiInfo insert(EiInfo inInfo) {
inInfo.setMsg("新增成功!"); CommonMethod.creatorInfo(inInfo, EiConstant.resultBlock);
try {
} catch (PlatException e) { List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
e.printStackTrace(); // 数据写入
inInfo.setStatus(EiConstant.STATUS_FAILURE); for (int i = 0; i < resultRows.size(); i++) {
inInfo.setMsg("新增失败!原因参见详细错误描述!"); HPPZ002 fPz002 = new HPPZ002();
inInfo.setDetailMsg(e.getMessage()); fPz002.fromMap(resultRows.get(i));
logError("新增失败", e.getMessage()); // 生成供应商编码
return inInfo; fPz002.setCustCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPPZ002_CUST_CODE));
} DaoUtils.insert("HPPZ002.insert", fPz002);
return inInfo; }
} inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
/** } catch (Exception e) {
* 修改操作. LogUtils.setDetailMsg(inInfo, e, "新增失败");
*/ }
public EiInfo update(EiInfo inInfo) { return inInfo;
try { }
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
THppz002 HPPZ002 = new THppz002(); /**
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); * 修改操作
for (int i = 0; i < eiBlock.getRowCount(); i++) { *
Map<?, ?> map = eiBlock.getRow(i); * @param inInfo
HPPZ002.fromMap(map); * @return
*/
this.dao.update("HPPZ002.update", HPPZ002.toMap()); public EiInfo update(EiInfo inInfo) {
} CommonMethod.creatorInfo(inInfo, EiConstant.resultBlock);
inInfo.setStatus(EiConstant.STATUS_SUCCESS); try {
inInfo.setMsg("修改成功!"); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
} catch (PlatException e) { for (int i = 0; i < resultRows.size(); i++) {
inInfo.setStatus(EiConstant.STATUS_FAILURE); HPPZ002 fPz002 = new HPPZ002();
inInfo.setMsg("操作失败!原因参见详细错误描述!"); fPz002.fromMap(resultRows.get(i));
inInfo.setDetailMsg(e.getMessage()); DaoUtils.update("HPPZ002.update", fPz002);
logError("修改失败", e.getMessage()); }
return inInfo; inInfo = this.query(inInfo);
} inInfo.setStatus(EiConstant.STATUS_DEFAULT);
return query(inInfo); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
} } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
/** }
* 删除操作. return inInfo;
*/ }
public EiInfo delete(EiInfo eiInfo) {
THppz002 HPPZ002 = new THppz002(); /**
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock); * 删除操作
try { *
for (int i = 0; i < eiBlock.getRowCount(); i++) { * @param inInfo
Map<?, ?> map = eiBlock.getRow(i); * @return
HPPZ002.fromMap(map); */
public EiInfo delete(EiInfo inInfo) {
this.dao.delete("HPPZ002.delete", HPPZ002.toMap()); try {
} List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
} catch (PlatException e) { for (int i = 0; i < resultRows.size(); i++) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE); DaoUtils.update("HPPZ002.delete", resultRows.get(i));
eiInfo.setMsg("删除失败,原因参见详细错误描述!"); }
eiInfo.setDetailMsg(e.getMessage()); inInfo = this.query(inInfo);
logError("删除失败!", e.getMessage()); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
return eiInfo; inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
eiInfo.setStatus(EiConstant.STATUS_SUCCESS); }
eiInfo.setMsg("删除成功!"); return inInfo;
return eiInfo; }
}
} }
package com.baosight.hpjx.hp.pz.service; package com.baosight.hpjx.hp.pz.service;
import com.baosight.hpjx.common.CompanyTypeEnum;
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.HPPZ002;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
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.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.web.threadlocal.UserSession; import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.hpjx.hp.pz.domain.THppz003; import com.baosight.hpjx.hp.pz.domain.HPPZ003;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* * @author:songx
* @date:2024/1/22,14:13
*/ */
public class ServiceHPPZ003 extends ServiceBase { public class ServiceHPPZ003 extends ServiceBase {
/**
* 画面初始化
/** *
* 画面初始化. * @param inInfo
*/ * @return
public EiInfo initLoad(EiInfo inInfo) { */
THppz003 hppz003 = new THppz003(); public EiInfo initLoad(EiInfo inInfo) {
EiInfo outInfo = super.initLoad(inInfo, hppz003); try {
outInfo.addBlock(EiConstant.resultBlock).addBlockMeta(hppz003.eiMetadata); inInfo.setBlock(CompanyTypeEnum.generatorEiBlock());
return inInfo; inInfo.setBlock(InitiateModeEnum.generatorEiBlock());
} inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPPZ003().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
/** }
* 查询操作. return inInfo;
*/ }
@Override
public EiInfo query(EiInfo inInfo) { /**
/* 调用EI查询方法.*/ * 查询操作
EiInfo outInfo = super.query(inInfo, "HPPZ003.query", new THppz003()); *
return outInfo; * @param inInfo
* @return
} */
@Override
/** public EiInfo query(EiInfo inInfo) {
* 新增操作. try {
*/ inInfo = super.query(inInfo, "HPPZ003.query", new HPPZ003());
@Override } catch (Exception e) {
public EiInfo insert(EiInfo inInfo) { LogUtils.setDetailMsg(inInfo, e, "查询失败");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); }
try { return inInfo;
THppz003 hppz003 = new THppz003(); }
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) { /**
Map<?, ?> map = eiBlock.getRow(i); * 新增操作
hppz003.fromMap(map); *
hppz003.setCreatedBy(UserSession.getUserId()); * @param inInfo
hppz003.setCreatedTime(sdf.format(new Date())); * @return
hppz003.setUpdatedBy(null); */
hppz003.setUpdatedTime(null); @Override
this.dao.insert("HPPZ003.insert", hppz003.toMap()); public EiInfo insert(EiInfo inInfo) {
} try {
inInfo.setStatus(EiConstant.STATUS_SUCCESS); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
inInfo.setMsg("新增成功!"); // 数据写入
for (int i = 0; i < resultRows.size(); i++) {
} catch (PlatException e) { HPPZ003 fPz003 = new HPPZ003();
e.printStackTrace(); fPz003.fromMap(resultRows.get(i));
inInfo.setStatus(EiConstant.STATUS_FAILURE); // 生成客户编码
inInfo.setMsg("新增失败!原因参见详细错误描述!"); fPz003.setCustCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPPZ003_CUST_CODE));
inInfo.setDetailMsg(e.getMessage()); DaoUtils.insert("HPPZ003.insert", fPz003);
logError("新增失败", e.getMessage()); }
return inInfo; inInfo = this.query(inInfo);
} inInfo.setStatus(EiConstant.STATUS_DEFAULT);
return query(inInfo); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
/** }
* 修改操作. return inInfo;
*/ }
public EiInfo update(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); /**
try { * 修改操作
THppz003 hppz003 = new THppz003(); *
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); * @param inInfo
for (int i = 0; i < eiBlock.getRowCount(); i++) { * @return
Map<?, ?> map = eiBlock.getRow(i); */
hppz003.fromMap(map); public EiInfo update(EiInfo inInfo) {
hppz003.setUpdatedBy(UserSession.getUserId()); try {
hppz003.setUpdatedTime(sdf.format(new Date())); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
this.dao.update("HPPZ003.update", hppz003.toMap()); for (int i = 0; i < resultRows.size(); i++) {
} HPPZ003 fPz003 = new HPPZ003();
inInfo.setStatus(EiConstant.STATUS_SUCCESS); fPz003.fromMap(resultRows.get(i));
inInfo.setMsg("修改成功!"); DaoUtils.update("HPPZ003.update", fPz003);
} catch (PlatException e) { }
inInfo.setStatus(EiConstant.STATUS_FAILURE); inInfo = this.query(inInfo);
inInfo.setMsg("操作失败!原因参见详细错误描述!"); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setDetailMsg(e.getMessage()); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
logError("修改失败", e.getMessage()); } catch (Exception e) {
return inInfo; LogUtils.setDetailMsg(inInfo, e, "修改失败");
} }
return query(inInfo); return inInfo;
} }
/** /**
* 删除操作. * 删除操作
*/ *
public EiInfo delete(EiInfo eiInfo) { * @param inInfo
THppz003 hppz003 = new THppz003(); * @return
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock); */
try { public EiInfo delete(EiInfo inInfo) {
for (int i = 0; i < eiBlock.getRowCount(); i++) { try {
Map<?, ?> map = eiBlock.getRow(i); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
hppz003.fromMap(map); for (int i = 0; i < resultRows.size(); i++) {
DaoUtils.update("HPPZ003.delete", resultRows.get(i));
this.dao.delete("HPPZ003.delete", hppz003.toMap()); }
} inInfo = this.query(inInfo);
} catch (PlatException e) { inInfo.setStatus(EiConstant.STATUS_DEFAULT);
eiInfo.setStatus(EiConstant.STATUS_FAILURE); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
eiInfo.setMsg("删除失败,原因参见详细错误描述!"); } catch (Exception e) {
eiInfo.setDetailMsg(e.getMessage()); LogUtils.setDetailMsg(inInfo, e, "删除失败");
logError("删除失败!", e.getMessage()); }
return eiInfo; return inInfo;
} }
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
return eiInfo;
}
} }
package com.baosight.hpjx.hp.pz.service; package com.baosight.hpjx.hp.pz.service;
import com.baosight.hpjx.common.CompanyTypeEnum;
import com.baosight.hpjx.common.DdynamicEnum; import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InitiateModeEnum; import com.baosight.hpjx.common.InitiateModeEnum;
import com.baosight.hpjx.common.InventTypeEnun; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.pz.domain.THppz004; 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.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.iplat4j.core.data.DaoEPBase; import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
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.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
...@@ -19,124 +20,125 @@ import java.util.List; ...@@ -19,124 +20,125 @@ import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* @author xuao * @author:songx
* @date 2024年01月09日 19:35 * @date:2024/1/22,15:18
*/ */
public class ServiceHPPZ004 extends ServiceBase { public class ServiceHPPZ004 extends ServiceBase {
/** /**
* 画面初始化. * 画面初始化
*/ *
public EiInfo initLoad(EiInfo inInfo) { * @param inInfo
THppz004 hppz004 = new THppz004(); * @return
EiInfo outInfo = new EiInfo(); */
outInfo.addBlock(EiConstant.resultBlock); public EiInfo initLoad(EiInfo inInfo) {
outInfo.getBlock(EiConstant.resultBlock).addBlockMeta(hppz004.eiMetadata); try {
outInfo.setBlock(InventTypeEnun.generatorEiBlock()); inInfo.setBlock(InitiateModeEnum.generatorEiBlock());
outInfo.setBlock(InitiateModeEnum.generatorEiBlock()); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPPZ004().eiMetadata);
return outInfo; } catch (PlatException e) {
} LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
/** return inInfo;
* 查询操作. }
*/
@Override /**
public EiInfo query(EiInfo inInfo) { * 查询操作
/* 调用EI查询方法.*/ *
EiInfo outInfo = super.query(inInfo, "HPPZ004.query", new THppz004()); * @param inInfo
return outInfo; * @return
*/
} @Override
public EiInfo query(EiInfo inInfo) {
/** try {
* 新增操作. inInfo = super.query(inInfo, "HPPZ004.query", new HPPZ003());
*/ } catch (Exception e) {
@Override LogUtils.setDetailMsg(inInfo, e, "查询失败");
public EiInfo insert(EiInfo inInfo) { }
try { return inInfo;
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock); }
THppz004 hppz004 = new THppz004();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); /**
for (int i = 0; i < eiBlock.getRowCount(); i++) { * 新增操作
Map<?, ?> map = eiBlock.getRow(i); *
hppz004.fromMap(map); * @param inInfo
* @return
this.dao.insert("HPPZ004.insert", hppz004.toMap()); */
} @Override
inInfo.setStatus(EiConstant.STATUS_SUCCESS); public EiInfo insert(EiInfo inInfo) {
inInfo.setMsg("新增成功!"); try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
} catch (PlatException e) { // 数据写入
e.printStackTrace(); for (int i = 0; i < resultRows.size(); i++) {
inInfo.setStatus(EiConstant.STATUS_FAILURE); HPPZ004 fPz004 = new HPPZ004();
inInfo.setMsg("新增失败!原因参见详细错误描述!"); fPz004.fromMap(resultRows.get(i));
inInfo.setDetailMsg(e.getMessage()); // 生成客户编码
logError("新增失败", e.getMessage()); fPz004.setInventCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.INVENT_CODE));
return inInfo; DaoUtils.insert(HPPZ004.INSERT, fPz004);
} }
return inInfo; inInfo = this.query(inInfo);
} inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
/** LogUtils.setDetailMsg(inInfo, e, "新增失败");
* 修改操作. }
*/ return inInfo;
public EiInfo update(EiInfo inInfo) { }
try {
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock); /**
THppz004 HPPZ004 = new THppz004(); * 修改操作
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); *
for (int i = 0; i < eiBlock.getRowCount(); i++) { * @param inInfo
Map<?, ?> map = eiBlock.getRow(i); * @return
HPPZ004.fromMap(map); */
public EiInfo update(EiInfo inInfo) {
this.dao.update("HPPZ004.update", HPPZ004.toMap()); try {
} List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
inInfo.setStatus(EiConstant.STATUS_SUCCESS); for (int i = 0; i < resultRows.size(); i++) {
inInfo.setMsg("修改成功!"); HPPZ004 fPz004 = new HPPZ004();
} catch (PlatException e) { fPz004.fromMap(resultRows.get(i));
inInfo.setStatus(EiConstant.STATUS_FAILURE); DaoUtils.update(HPPZ004.UPDATE, fPz004);
inInfo.setMsg("操作失败!原因参见详细错误描述!"); }
inInfo.setDetailMsg(e.getMessage()); inInfo = this.query(inInfo);
logError("修改失败", e.getMessage()); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
return inInfo; inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
} } catch (Exception e) {
return query(inInfo); LogUtils.setDetailMsg(inInfo, e, "修改失败");
} }
return inInfo;
/** }
* 删除操作.
*/ /**
public EiInfo delete(EiInfo eiInfo) { * 删除操作
THppz004 HPPZ004 = new THppz004(); *
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock); * @param inInfo
try { * @return
for (int i = 0; i < eiBlock.getRowCount(); i++) { */
Map<?, ?> map = eiBlock.getRow(i); public EiInfo delete(EiInfo inInfo) {
HPPZ004.fromMap(map); try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
this.dao.delete("HPPZ004.delete", HPPZ004.toMap()); for (int i = 0; i < resultRows.size(); i++) {
} DaoUtils.update(HPPZ004.DELETE, resultRows.get(i));
} catch (PlatException e) { }
eiInfo.setStatus(EiConstant.STATUS_FAILURE); inInfo = this.query(inInfo);
eiInfo.setMsg("删除失败,原因参见详细错误描述!"); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
eiInfo.setDetailMsg(e.getMessage()); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
logError("删除失败!", e.getMessage()); } catch (Exception e) {
return eiInfo; LogUtils.setDetailMsg(inInfo, e, "删除失败");
} }
return inInfo;
eiInfo.setStatus(EiConstant.STATUS_SUCCESS); }
eiInfo.setMsg("删除成功!");
return eiInfo; /**
} * @param eiInfo
* @return
public EiInfo queryComboBox(EiInfo eiInfo) { */
Map map = new HashMap(); public EiInfo queryComboBox(EiInfo eiInfo) {
map.put("inventType", eiInfo.getString("inventType")); Map map = new HashMap();
List<DdynamicEnum> list = new ArrayList<>(); map.put("inventType", eiInfo.getString("inventType"));
list.add(DdynamicEnum.INVENT_NAME_BLOCK_ID); List<DdynamicEnum> list = new ArrayList<>();
CommonMethod.initBlock(eiInfo, list, map); list.add(DdynamicEnum.INVENT_NAME_BLOCK_ID);
return eiInfo; CommonMethod.initBlock(eiInfo, list, map);
} return eiInfo;
}
} }
...@@ -2,141 +2,146 @@ package com.baosight.hpjx.hp.pz.service; ...@@ -2,141 +2,146 @@ package com.baosight.hpjx.hp.pz.service;
import com.baosight.hpjx.common.DdynamicEnum; import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InitiateModeEnum; import com.baosight.hpjx.common.InitiateModeEnum;
import com.baosight.hpjx.common.InventTypeEnun; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.pz.domain.THppz006; import com.baosight.hpjx.hp.kc.domain.HPKC006;
import com.baosight.hpjx.hp.pz.domain.HPPZ006;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils; import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils; import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
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.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* @author xuao * @author:songx
* @date 2024年01月10日 15:51 * @date:2024/1/22,15:17
*/ */
public class ServiceHPPZ006 extends ServiceBase { public class ServiceHPPZ006 extends ServiceBase {
/** /**
* 画面初始化. * 画面初始化
*/ *
public EiInfo initLoad(EiInfo inInfo) { * @param inInfo
THppz006 hppz006 = new THppz006(); * @return
EiInfo outInfo = new EiInfo(); */
outInfo.addBlock(EiConstant.resultBlock); public EiInfo initLoad(EiInfo inInfo) {
outInfo.getBlock(EiConstant.resultBlock).addBlockMeta(hppz006.eiMetadata); try {
outInfo.setBlock(InitiateModeEnum.generatorEiBlock()); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null);
outInfo.setBlock(InventTypeEnun.generatorEiBlock()); inInfo.setBlock(InitiateModeEnum.generatorEiBlock());
CommonMethod.initBlock(outInfo, Arrays.asList( inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPPZ006().eiMetadata);
DdynamicEnum.INVENT_NAME_BLOCK_ID), } catch (PlatException e) {
new HashMap<String,String>(1) {{ LogUtils.setDetailMsg(inInfo, e, "初始化失败");
put("status", "1" ); }
}}); return inInfo;
}
return outInfo;
}
/**
* 查询操作.
*/
@Override
public EiInfo query(EiInfo inInfo) {
/* 调用EI查询方法.*/
EiInfo outInfo = super.query(inInfo, "HPPZ006.query", new THppz006());
return outInfo;
}
/**
* 新增操作.
*/
@Override
public EiInfo insert(EiInfo inInfo) {
try {
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
for (int i = 0; i < inInfo.getBlock(EiConstant.resultBlock).getRowCount(); i++) {
String inventName =inInfo.getCellStr(EiConstant.resultBlock,i,"inventName");
String[] str = inventName.split("-");
inInfo.setCell(EiConstant.resultBlock,i,"inventCode", str[0]);
inInfo.setCell(EiConstant.resultBlock,i,"inventName", str[1]);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("新增失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("新增失败", e.getMessage());
return inInfo;
}
return super.insert(inInfo,"HPPZ006.insert");
}
/**
* 查询操作.
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, "HPPZ006.query", new HPKC006());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/** /**
* 修改操作. * 新增操作
*/ *
public EiInfo update(EiInfo inInfo) { * @param inInfo
try { * @return
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock); */
THppz006 hppz006 = new THppz006(); @Override
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); public EiInfo insert(EiInfo inInfo) {
for (int i = 0; i < eiBlock.getRowCount(); i++) { try {
Map<?, ?> map = eiBlock.getRow(i); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
hppz006.fromMap(map); // 数据写入
this.checkSaveData(resultRows);
// 数据写入
for (int i = 0; i < resultRows.size(); i++) {
HPPZ006 fPz006 = new HPPZ006();
fPz006.fromMap(resultRows.get(i));
// 存货名称
fPz006.setInventName(HPPZTools.getPz004ByCode(fPz006.getInventCode()).getInventName());
DaoUtils.insert(HPPZ006.INSERT, fPz006);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
this.dao.update("HPPZ006.update", hppz006.toMap()); /**
} * 校验保存的数据
inInfo.setStatus(EiConstant.STATUS_SUCCESS); *
inInfo.setMsg("修改成功!"); * @param resultRows
} catch (PlatException e) { */
inInfo.setStatus(EiConstant.STATUS_FAILURE); private void checkSaveData(List<Map> resultRows) {
inInfo.setMsg("操作失败!原因参见详细错误描述!"); for (int i = 0; i < resultRows.size(); i++) {
inInfo.setDetailMsg(e.getMessage()); HPPZ006 fPz006 = new HPPZ006();
logError("修改失败", e.getMessage()); fPz006.fromMap(resultRows.get(i));
return inInfo; AssertUtils.isNull(fPz006.getInventType(), "存货类型不能为空");
} AssertUtils.isNull(fPz006.getInventCode(), "存货名称不能为空");
return query(inInfo); }
} }
/** /**
* 删除操作. * 修改操作
*/ *
public EiInfo delete(EiInfo eiInfo) { * @param inInfo
THppz006 hppz006 = new THppz006(); * @return
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock); */
try { public EiInfo update(EiInfo inInfo) {
for (int i = 0; i < eiBlock.getRowCount(); i++) { try {
Map<?, ?> map = eiBlock.getRow(i); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
hppz006.fromMap(map); for (int i = 0; i < resultRows.size(); i++) {
HPPZ006 fPz006 = new HPPZ006();
fPz006.fromMap(resultRows.get(i));
// 存货名称
fPz006.setInventName(HPPZTools.getPz004ByCode(fPz006.getInventCode()).getInventName());
DaoUtils.update(HPPZ006.UPDATE, fPz006);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
this.dao.delete("HPPZ006.delete", hppz006.toMap()); /**
} * 删除操作
} catch (PlatException e) { *
eiInfo.setStatus(EiConstant.STATUS_FAILURE); * @param inInfo
eiInfo.setMsg("删除失败,原因参见详细错误描述!"); * @return
eiInfo.setDetailMsg(e.getMessage()); */
logError("删除失败!", e.getMessage()); public EiInfo delete(EiInfo inInfo) {
return eiInfo; try {
} List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
DaoUtils.update(HPPZ006.DELETE, resultRows.get(i));
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
return eiInfo;
}
/** /**
* 规格下拉框 * 规格下拉框
* *
...@@ -149,9 +154,28 @@ public class ServiceHPPZ006 extends ServiceBase { ...@@ -149,9 +154,28 @@ public class ServiceHPPZ006 extends ServiceBase {
list.add(DdynamicEnum.INVENT_SPEC_BLOCK_ID); list.add(DdynamicEnum.INVENT_SPEC_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false); CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false);
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "规格下拉框"); LogUtils.setDetailMsg(inInfo, e, "查询规格失败");
} }
return inInfo; return inInfo;
} }
public EiInfo queryComboBox(EiInfo eiInfo) {
Map map = new HashMap();
map.put("inventType", eiInfo.getString("inventType"));
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.INVENT_RECORD_BLOCK_ID);
CommonMethod.initBlock(eiInfo, list, map);
return eiInfo;
}
public EiInfo queryMaterialComboBox(EiInfo eiInfo) {
Map map = new HashMap();
map.put("inventType", eiInfo.getString("inventType"));
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.MATERIAL_RECORD_BLOCK_ID);
CommonMethod.initBlock(eiInfo, list, map);
return eiInfo;
}
} }
package com.baosight.hpjx.hp.pz.service; package com.baosight.hpjx.hp.pz.service;
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.kc.domain.HPKC007;
import com.baosight.hpjx.hp.pz.domain.HPPZ007; import com.baosight.hpjx.hp.pz.domain.HPPZ007;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.web.threadlocal.UserSession; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.sql.Timestamp; import java.util.ArrayList;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
/**
* @author:songx
* @date:2024/1/22,15:57
*/
public class ServiceHPPZ007 extends ServiceBase { public class ServiceHPPZ007 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) { /**
HPPZ007 hppz007 = new HPPZ007(); * @param inInfo
EiInfo outInfo = super.initLoad(inInfo, hppz007); * @return
outInfo.addBlock(EiConstant.resultBlock).addBlockMeta(hppz007.eiMetadata); */
return inInfo; public EiInfo initLoad(EiInfo inInfo) {
} try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPPZ007().eiMetadata);
} catch (PlatException e) {
/** LogUtils.setDetailMsg(inInfo, e, "初始化失败");
* 查询操作. }
*/ return inInfo;
@Override }
public EiInfo query(EiInfo inInfo) {
/* 调用EI查询方法.*/ /**
EiInfo outInfo = super.query(inInfo, "HPPZ007.query", new HPPZ007()); * 查询操作
return outInfo; *
* @param inInfo
} * @return
*/
/** @Override
* 新增操作. public EiInfo query(EiInfo inInfo) {
*/ try {
@Override inInfo = super.query(inInfo, HPPZ007.QUERY, new HPKC007());
public EiInfo insert(EiInfo inInfo) { } catch (Exception e) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
try { }
HPPZ007 hppz007 = new HPPZ007(); return inInfo;
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); }
/**
for (int i = 0; i < eiBlock.getRowCount(); i++) { * 新增操作.
Map<?, ?> map = eiBlock.getRow(i); */
hppz007.fromMap(map); @Override
hppz007.setCreatedBy(UserSession.getLoginName()); public EiInfo insert(EiInfo inInfo) {
hppz007.setCreatedTime(Timestamp.valueOf(sdf.format(new Date()))); try {
this.dao.insert("HPPZ007.insert", hppz007.toMap()); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
} // 数据写入
inInfo.setStatus(EiConstant.STATUS_SUCCESS); for (int i = 0; i < resultRows.size(); i++) {
inInfo.setMsg("新增成功!"); HPPZ007 fPz007 = new HPPZ007();
fPz007.fromMap(resultRows.get(i));
} catch (PlatException e) { // 仓库编码
e.printStackTrace(); fPz007.setWhCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.WH_CODE));
inInfo.setStatus(EiConstant.STATUS_FAILURE); DaoUtils.insert(HPPZ007.INSERT, fPz007);
inInfo.setMsg("新增失败!原因参见详细错误描述!"); }
inInfo.setDetailMsg(e.getMessage()); inInfo = this.query(inInfo);
logError("新增失败", e.getMessage()); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
return inInfo; inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} } catch (Exception e) {
return inInfo; LogUtils.setDetailMsg(inInfo, e, "新增失败");
} }
return inInfo;
/** }
* 修改操作.
*/ /**
public EiInfo update(EiInfo inInfo) { * 修改操作
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); *
try { * @param inInfo
HPPZ007 hppz007 = new HPPZ007(); * @return
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); */
for (int i = 0; i < eiBlock.getRowCount(); i++) { public EiInfo update(EiInfo inInfo) {
Map<?, ?> map = eiBlock.getRow(i); try {
hppz007.fromMap(map); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
hppz007.setUpdatedBy(UserSession.getLoginName()); for (int i = 0; i < resultRows.size(); i++) {
hppz007.setUpdatedTime(Timestamp.valueOf(sdf.format(new Date()))); HPPZ007 fPz007 = new HPPZ007();
System.out.println(Timestamp.valueOf(sdf.format(new Date()))); fPz007.fromMap(resultRows.get(i));
this.dao.update("HPPZ007.update", hppz007.toMap()); DaoUtils.update(HPPZ007.UPDATE, fPz007);
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo = this.query(inInfo);
inInfo.setMsg("修改成功!"); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) { inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
inInfo.setStatus(EiConstant.STATUS_FAILURE); } catch (Exception e) {
inInfo.setMsg("操作失败!原因参见详细错误描述!"); LogUtils.setDetailMsg(inInfo, e, "修改失败");
inInfo.setDetailMsg(e.getMessage()); }
logError("修改失败", e.getMessage()); return inInfo;
return inInfo; }
}
return query(inInfo); /**
} * 删除操作
*
/** * @param inInfo
* 删除操作. * @return
*/ */
public EiInfo delete(EiInfo eiInfo) { public EiInfo delete(EiInfo inInfo) {
HPPZ007 hppz007 = new HPPZ007(); try {
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
try { for (int i = 0; i < resultRows.size(); i++) {
for (int i = 0; i < eiBlock.getRowCount(); i++) { DaoUtils.update(HPPZ007.DELETE, resultRows.get(i));
Map<?, ?> map = eiBlock.getRow(i); }
hppz007.fromMap(map); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
this.dao.delete("HPPZ007.delete", hppz007.toMap()); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} } catch (Exception e) {
} catch (PlatException e) { LogUtils.setDetailMsg(inInfo, e, "删除失败");
eiInfo.setStatus(EiConstant.STATUS_FAILURE); }
eiInfo.setMsg("删除失败,原因参见详细错误描述!"); return inInfo;
eiInfo.setDetailMsg(e.getMessage()); }
logError("删除失败!", e.getMessage());
return eiInfo; /**
} * 根据仓库CODE找对象
*
eiInfo.setStatus(EiConstant.STATUS_SUCCESS); * @param inInfo
eiInfo.setMsg("删除成功!"); * @return
return eiInfo; */
} public EiInfo queryByWhCode(EiInfo inInfo) {
Map params = new HashMap<>();
/** params.put("whCode", inInfo.getString("whCode"));
* 根据仓库CODE找对象 List query = dao.query("HPPZ007.queryByWhCode", params);
* @param inInfo inInfo.set("list", query);
* @return return inInfo;
*/ }
public EiInfo queryByWhCode(EiInfo inInfo) {
Map params=new HashMap<>(); public EiInfo queryComboBox(EiInfo eiInfo) {
params.put("whCode", inInfo.getString("whCode")); Map map = new HashMap();
List query = dao.query("HPPZ007.queryByWhCode",params); map.put("whType", eiInfo.getString("whType"));
inInfo.set("list", query); List<DdynamicEnum> list = new ArrayList<>();
return inInfo; list.add(DdynamicEnum.WH_RECORD_BLOCK_ID);
} CommonMethod.initBlock(eiInfo, list, map);
return eiInfo;
}
} }
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<!-- table information
Generate time : 2024-01-09 14:40:53
Version : 1.0
tableName :hpjx.t_hppz002
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
CUST_TYPE TINYINT NOT NULL,
CUST_CODE VARCHAR NOT NULL,
CUST_NAME VARCHAR NOT NULL,
ADDRESS VARCHAR NOT NULL,
STATUS TINYINT NOT NULL,
CREATED_BY VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_TIME VARCHAR
-->
<sqlMap namespace="HPPZ002"> <sqlMap namespace="HPPZ002">
<select id="query" parameterClass="java.util.HashMap" <sql id="column">
resultClass="com.baosight.hpjx.hp.pz.domain.THppz002"> ID as "id",
SELECT COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
ID as "id", DEP_CODE as "depCode", <!-- 部门编码 -->
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 --> CUST_TYPE as "custType", <!-- 供应商类型 1 国企 : 2 民营 -->
CUST_TYPE as "custType", <!-- 供应商类型 1 国企 : 2 民营 --> CUST_CODE as "custCode", <!-- 供应商编码 -->
CUST_CODE as "custCode", <!-- 供应商编码 --> CUST_NAME as "custName", <!-- 供应商名称 -->
CUST_NAME as "custName", <!-- 供应商名称 --> ADDRESS as "address", <!-- 地址 -->
ADDRESS as "address", <!-- 地址 --> STATUS as "status", <!-- 状态 0禁用 1启用 -->
STATUS as "status", <!-- 状态 0禁用 1启用 --> CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_BY as "createdBy", <!-- 创建人 --> CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 --> CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 --> UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 --> UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
DEP_CODE as "depCode" <!-- 部门编码 --> UPDATED_TIME as "updatedTime" <!-- 更新时间 -->
FROM hpjx.t_hppz002 WHERE 1=1 </sql>
<isNotEmpty prepend=" AND " property="id">
ID = #id# <sql id="condition">
</isNotEmpty> <isNotEmpty prepend=" AND " property="id">
<isNotEmpty prepend=" AND " property="status"> ID = #id#
STATUS = #status# </isNotEmpty>
</isNotEmpty> <isNotEmpty prepend=" AND " property="companyCode">
<isNotEmpty prepend=" AND " property="custType"> COMPANY_CODE = #companyCode#
CUST_TYPE = #custType# </isNotEmpty>
</isNotEmpty> <isNotEmpty prepend=" AND " property="depCode">
<dynamic prepend="ORDER BY"> DEP_CODE = #depCode#
<isNotEmpty property="orderBy"> </isNotEmpty>
$orderBy$ <isNotEmpty prepend=" AND " property="custType">
</isNotEmpty> CUST_TYPE = #custType#
<isEmpty property="orderBy"> </isNotEmpty>
ID asc <isNotEmpty prepend=" AND " property="custCode">
</isEmpty> CUST_CODE = #custCode#
</dynamic> </isNotEmpty>
<isNotEmpty prepend=" AND " property="custName">
</select> CUST_NAME LIKE CONCAT('%', #custName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="address">
ADDRESS = #address#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
</sql>
<sql id="order">
<dynamic prepend=" ORDER BY ">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ002">
SELECT
<include refid="column"/>
FROM hpjx.t_hppz002 WHERE 1=1
<include refid="condition"/>
<include refid="order"/>
</select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hppz002 WHERE 1=1 SELECT COUNT(*) FROM hpjx.t_hppz002 WHERE 1=1
<isNotEmpty prepend=" AND " property="id"> <include refid="condition"/>
ID = #id#
</isNotEmpty>
</select> </select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="custType">
CUST_TYPE = #custType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="custCode">
CUST_CODE = #custCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="custName">
CUST_NAME = #custName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="address">
ADDRESS = #address#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
-->
<insert id="insert"> <insert id="insert">
INSERT INTO hpjx.t_hppz002 ( INSERT INTO ${hpjxSchema}.T_HPPZ002 (
COMPANY_CODE, <!-- 企业编码 预留 --> COMPANY_CODE, <!-- 企业编码 预留 -->
CUST_TYPE, <!-- 供应商类型 1 国企 : 2 民营 --> DEP_CODE, <!-- 部门编码 -->
CUST_CODE, <!-- 供应商编码 --> CUST_TYPE, <!-- 供应商类型 1 国企 : 2 民营 -->
CUST_NAME, <!-- 供应商名称 --> CUST_CODE, <!-- 供应商编码 -->
ADDRESS, <!-- 地址 --> CUST_NAME, <!-- 供应商名称 -->
STATUS, <!-- 状态 0禁用 1启用 --> ADDRESS, <!-- 地址 -->
CREATED_BY, <!-- 创建人 --> STATUS, <!-- 状态 0禁用 1启用 -->
CREATED_TIME, <!-- 创建时间 --> CREATED_BY, <!-- 创建人 -->
DEP_CODE <!-- 部门编码 --> CREATED_NAME, <!-- 创建人名称 -->
) CREATED_TIME <!-- 创建时间 -->
VALUES ( #companyCode#, #custType#, #custCode#, #custName#, #address#, #status#, #createdBy#, #createdTime#, #depCode#) ) VALUES (
</insert> #companyCode#, #depCode#, #custType#, #custCode#, #custName#, #address#,
#status#, #createdBy#, #createdName#, #createdTime#
)
</insert>
<delete id="delete"> <delete id="delete">
DELETE FROM hpjx.t_hppz002 WHERE DELETE FROM hpjx.t_hppz002 WHERE ID = #id#
ID = #id#
</delete> </delete>
<update id="update"> <update id="update">
UPDATE hpjx.t_hppz002 UPDATE hpjx.t_hppz002
SET SET
CUST_TYPE = #custType#, <!-- 供应商类型 1 国企 : 2 民营 --> CUST_TYPE = #custType#, <!-- 供应商类型 1 国企 : 2 民营 -->
CUST_CODE = #custCode#, <!-- 供应商编码 --> CUST_NAME = #custName#, <!-- 供应商名称 -->
CUST_NAME = #custName#, <!-- 供应商名称 --> ADDRESS = #address#, <!-- 地址 -->
ADDRESS = #address#, <!-- 地址 --> STATUS = #status#, <!-- 状态 0禁用 1启用 -->
STATUS = #status#, <!-- 状态 0禁用 1启用 --> UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 --> UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 --> UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE WHERE ID = #id#
ID = #id#
</update> </update>
...@@ -147,4 +122,4 @@ ...@@ -147,4 +122,4 @@
</isNotEmpty> </isNotEmpty>
ORDER BY CUST_CODE ORDER BY CUST_CODE
</select> </select>
</sqlMap> </sqlMap>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<!-- table information
Generate time : 2024-01-09 17:46:33
Version : 1.0
tableName :hpjx.t_hppz003
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
CUST_TYPE TINYINT NOT NULL,
CUST_CODE VARCHAR NOT NULL,
CUST_CNAME VARCHAR NOT NULL,
CUST_ADDR VARCHAR NOT NULL,
STATUS TINYINT NOT NULL,
CREATED_BY VARCHAR,
CREATED_TIME DATETIME,
UPDATED_BY VARCHAR,
UPDATED_TIME DATETIME
-->
<sqlMap namespace="HPPZ003"> <sqlMap namespace="HPPZ003">
<select id="query" parameterClass="java.util.HashMap" <sql id="column">
resultClass="com.baosight.hpjx.hp.pz.domain.THppz003"> ID as "id",
SELECT COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
ID as "id", DEP_CODE as "depCode", <!-- 部门编码 预留 -->
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 --> CUST_TYPE as "custType", <!-- 客商类型 1:国企;2:民营; -->
CUST_TYPE as "custType", <!-- 客商类型 1:国企;2:民营; --> CUST_CODE as "custCode", <!-- 客户编码 -->
CUST_CODE as "custCode", <!-- 客户编码 --> CUST_NAME as "custName", <!-- 客户名称 -->
CUST_CNAME as "custCname", <!-- 客户名称 --> ADDRESS as "address", <!-- 地址 -->
CUST_ADDR as "custAddr", <!-- 地址 --> STATUS as "status", <!-- 状态 0未启用 1启用 -->
STATUS as "status", <!-- 状态 0未启用 1启用 --> CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_BY as "createdBy", <!-- 创建人 --> CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 --> CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 --> UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime" <!-- 更新时间 --> UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
FROM hpjx.t_hppz003 WHERE 1=1 UPDATED_TIME as "updatedTime" <!-- 更新时间 -->
<isNotEmpty prepend=" AND " property="custCname"> </sql>
CUST_CNAME LIKE CONCAT('%',CONCAT(#custCname#,'%'))
</isNotEmpty> <sql id="condition">
<isNotEmpty prepend=" AND " property="custType"> <isNotEmpty prepend=" AND " property="id">
CUST_TYPE = #custType# ID = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="status"> <isNotEmpty prepend=" AND " property="companyCode">
STATUS = #status# COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<dynamic prepend="ORDER BY"> <isNotEmpty prepend=" AND " property="depCode">
<isNotEmpty property="orderBy"> DEP_CODE = #depCode#
$orderBy$ </isNotEmpty>
</isNotEmpty> <isNotEmpty prepend=" AND " property="custType">
<isEmpty property="orderBy"> CUST_TYPE = #custType#
CREATED_TIME DESC </isNotEmpty>
</isEmpty> <isNotEmpty prepend=" AND " property="custCode">
</dynamic> CUST_CODE = #custCode#
</isNotEmpty>
</select> <isNotEmpty prepend=" AND " property="custName">
CUST_NAME LIKE CONCAT('%', #custName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="address">
ADDRESS = #address#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ003">
SELECT
<include refid="column"/>
FROM hpjx.t_hppz003 WHERE 1=1
<include refid="condition"/>
<include refid="order"/>
</select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hppz003 WHERE 1=1 SELECT COUNT(*) FROM hpjx.t_hppz003 WHERE 1=1
<isNotEmpty prepend=" AND " property="id"> <include refid="condition"/>
ID = #id#
</isNotEmpty>
</select> </select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="custType">
CUST_TYPE = #custType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="custCode">
CUST_CODE = #custCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="custCname">
CUST_CNAME = #custCname#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="custAddr">
CUST_ADDR = #custAddr#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
-->
<insert id="insert"> <insert id="insert">
INSERT INTO hpjx.t_hppz003 (ID, INSERT INTO ${hpjxSchema}.T_HPPZ003 (
COMPANY_CODE, <!-- 企业编码 预留 --> COMPANY_CODE, <!-- 企业编码 预留 -->
CUST_TYPE, <!-- 客商类型 1:国企;2:民营; --> DEP_CODE, <!-- 部门编码 预留 -->
CUST_CODE, <!-- 客户编码 --> CUST_TYPE, <!-- 客商类型 1:国企;2:民营; -->
CUST_CNAME, <!-- 客户名称 --> CUST_CODE, <!-- 客户编码 -->
CUST_ADDR, <!-- 地址 --> CUST_NAME, <!-- 客户名称 -->
STATUS, <!-- 状态 0未启用 1启用 --> ADDRESS, <!-- 地址 -->
CREATED_BY, <!-- 创建人 --> STATUS, <!-- 状态 0未启用 1启用 -->
CREATED_TIME, <!-- 创建时间 --> CREATED_BY, <!-- 创建人 -->
UPDATED_BY, <!-- 更新人 --> CREATED_NAME, <!-- 创建人名称 -->
UPDATED_TIME <!-- 更新时间 --> CREATED_TIME <!-- 创建时间 -->
) ) VALUES (
VALUES (#id#, #companyCode#, #custType#, #custCode#, #custCname#, #custAddr#, #status#, #createdBy#, #createdTime#, #updatedBy#, #updatedTime#) #companyCode#, #depCode#, #custType#, #custCode#, #custName#, #address#,
</insert> #status#, #createdBy#, #createdName#, #createdTime#
)
</insert>
<delete id="delete"> <delete id="delete">
DELETE FROM hpjx.t_hppz003 WHERE DELETE FROM hpjx.t_hppz003 WHERE ID = #id#
ID = #id#
</delete> </delete>
<update id="update"> <update id="update">
UPDATE hpjx.t_hppz003 UPDATE hpjx.t_hppz003
SET SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 --> CUST_TYPE = #custType#, <!-- 客商类型 1:国企;2:民营; -->
CUST_TYPE = #custType#, <!-- 客商类型 1:国企;2:民营; --> CUST_NAME = #custName#, <!-- 客户名称 -->
CUST_CODE = #custCode#, <!-- 客户编码 --> ADDRESS = #address#, <!-- 地址 -->
CUST_CNAME = #custCname#, <!-- 客户名称 --> STATUS = #status#, <!-- 状态 0未启用 1启用 -->
CUST_ADDR = #custAddr#, <!-- 地址 --> UPDATED_BY = #updatedBy#, <!-- 更新人 -->
STATUS = #status#, <!-- 状态 0未启用 1启用 --> UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
CREATED_BY = #createdBy#, <!-- 创建人 --> UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 --> WHERE ID = #id#
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE
ID = #id#
</update> </update>
<select id="queryComboBox" parameterClass="java.util.HashMap" <select id="queryComboBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
resultClass="java.util.HashMap">
SELECT DISTINCT SELECT DISTINCT
CUST_CODE as "custCode", CUST_CODE as "custCode",
CUST_CNAME as "custName" CUST_NAME as "custName"
FROM hpjx.t_hppz003 WHERE STATUS=1 FROM hpjx.t_hppz003 WHERE STATUS=1
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode# COMPANY_CODE = #companyCode#
...@@ -148,4 +118,5 @@ ...@@ -148,4 +118,5 @@
</isNotEmpty> </isNotEmpty>
ORDER BY CUST_CODE ORDER BY CUST_CODE
</select> </select>
</sqlMap>
\ No newline at end of file </sqlMap>
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<!-- table information
Generate time : 2024-01-09 19:25:19
Version : 1.0
tableName :hpjx.t_hppz004
ID INTEGER NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
INVENT_NAME VARCHAR NOT NULL,
INVENT_CODE VARCHAR NOT NULL,
INVENT_FATHER_NAME VARCHAR NOT NULL,
INVENT_FATHER_CODE VARCHAR NOT NULL,
STATUS TINYINT NOT NULL,
CREATED_BY VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_TIME VARCHAR
-->
<sqlMap namespace="HPPZ004"> <sqlMap namespace="HPPZ004">
<select id="query" parameterClass="java.util.HashMap" <sql id="column">
resultClass="com.baosight.hpjx.hp.pz.domain.THppz004"> ID as "id",
SELECT COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
ID as "id", DEP_CODE as "depCode", <!-- 部门编码 -->
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 --> INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_NAME as "inventName", <!-- 存货名称 --> INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_CODE as "inventCode", <!-- 存货编码 --> INVENT_NAME as "inventName", <!-- 存货名称 -->
INVENT_TYPE as "inventType", <!-- 存货类型 --> STATUS as "status", <!-- 状态 0未启用 1启用 -->
STATUS as "status", <!-- 状态 0未启用 1启用 --> CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_BY as "createdBy", <!-- 创建人 --> CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 --> CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 --> UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 --> UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
DEP_CODE as "depCode" <!-- 部门编码 --> UPDATED_TIME as "updatedTime" <!-- 更新时间 -->
FROM hpjx.t_hppz004 WHERE 1=1 </sql>
<isNotEmpty prepend=" AND " property="id">
ID = #id# <sql id="condition">
</isNotEmpty> <isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME LIKE CONCAT('%', #inventName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="inventCodes"> <isNotEmpty prepend=" AND " property="inventCodes">
INVENT_CODE IN <iterate close=")" open="(" conjunction="," property="inventCodes">#inventCodes[]#</iterate> INVENT_CODE IN <iterate close=")" open="(" conjunction="," property="inventCodes">#inventCodes[]#</iterate>
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName"> </sql>
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select> <sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="count" resultClass="int"> <select id="query" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ004">
SELECT COUNT(*) FROM hpjx.t_hppz004 WHERE 1=1 SELECT
<isNotEmpty prepend=" AND " property="id"> <include refid="column"/>
ID = #id# FROM hpjx.t_hppz004 WHERE 1=1
</isNotEmpty> <include refid="condition"/>
</select> <include refid="customCondition"/>
<include refid="order"/>
</select>
<!-- <select id="count" resultClass="int">
<isNotEmpty prepend=" AND " property="id"> SELECT COUNT(*) FROM hpjx.t_hppz004 WHERE 1=1
ID = #id# <include refid="condition"/>
</isNotEmpty> <include refid="customCondition"/>
<isNotEmpty prepend=" AND " property="companyCode"> </select>
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventFatherName">
INVENT_FATHER_NAME = #inventFatherName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventFatherCode">
INVENT_FATHER_CODE = #inventFatherCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
-->
<insert id="insert"> <insert id="insert">
INSERT INTO hpjx.t_hppz004 ( INSERT INTO ${hpjxSchema}.T_HPPZ004 (
COMPANY_CODE, <!-- 企业编码 预留 --> COMPANY_CODE, <!-- 企业编码 预留 -->
INVENT_NAME, <!-- 存货名称 --> DEP_CODE, <!-- 部门编码 -->
INVENT_CODE, <!-- 存货编码 --> INVENT_TYPE, <!-- 存货类型 -->
INVENT_TYPE, <!-- 存货类型 --> INVENT_CODE, <!-- 存货编码 -->
STATUS, <!-- 状态 0未启用 1启用 --> INVENT_NAME, <!-- 存货名称 -->
CREATED_BY, <!-- 创建人 --> STATUS, <!-- 状态 0未启用 1启用 -->
CREATED_TIME, <!-- 创建时间 --> CREATED_BY, <!-- 创建人 -->
DEP_CODE <!-- 部门编码 --> CREATED_NAME, <!-- 创建人名称 -->
) CREATED_TIME <!-- 创建时间 -->
VALUES ( #companyCode#, #inventName#, #inventCode#, #inventType#, #status#, #createdBy#, #createdTime#, #depCode#) ) VALUES (
</insert> #companyCode#, #depCode#, #inventType#, #inventCode#, #inventName#,
#status#, #createdBy#, #createdName#, #createdTime#
)
</insert>
<delete id="delete"> <delete id="delete">
DELETE FROM hpjx.t_hppz004 WHERE DELETE FROM hpjx.t_hppz004 WHERE ID = #id#
ID = #id#
</delete> </delete>
<update id="update"> <update id="update">
UPDATE hpjx.t_hppz004 UPDATE hpjx.t_hppz004
SET SET
INVENT_NAME = #inventName#, <!-- 存货名称 --> INVENT_TYPE = #inventType#, <!-- 存货类型 -->
INVENT_CODE = #inventCode#, <!-- 存货编码 --> INVENT_NAME = #inventName#, <!-- 存货名称 -->
INVENT_TYPE = #inventType#, <!-- 存货类型 --> STATUS = #status#, <!-- 状态 0未启用 1启用 -->
STATUS = #status#, <!-- 状态 0未启用 1启用 --> UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 --> UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 --> UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE WHERE ID = #id#
ID = #id#
</update> </update>
<select id="queryComboBox" parameterClass="java.util.HashMap" <!-- -->
resultClass="java.util.HashMap"> <select id="queryComboBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT SELECT DISTINCT
INVENT_CODE as "inventCode", INVENT_CODE as "inventCode",
INVENT_NAME as "inventName" INVENT_NAME as "inventName"
FROM hpjx.t_hppz004 WHERE STATUS=1 FROM hpjx.t_hppz004
WHERE STATUS = 1
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode# COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
...@@ -146,31 +123,6 @@ ...@@ -146,31 +123,6 @@
<isNotEmpty prepend=" AND " property="inventType"> <isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType# INVENT_TYPE = #inventType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
ORDER BY INVENT_CODE
</select>
<select id="queryMatNameByCode" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.pz.domain.THppz004">
SELECT DISTINCT
INVENT_CODE as "inventCode",
INVENT_NAME as "inventName"
FROM hpjx.t_hppz004 WHERE STATUS=1
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
ORDER BY INVENT_CODE ORDER BY INVENT_CODE
</select> </select>
......
...@@ -2,110 +2,145 @@ ...@@ -2,110 +2,145 @@
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd"> <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPPZ006"> <sqlMap namespace="HPPZ006">
<select id="query" parameterClass="java.util.HashMap" <sql id="column">
resultClass="com.baosight.hpjx.hp.pz.domain.THppz006"> ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
STATUS as "status", <!-- 状态 0未启用 1启用 -->
SPEC as "spec", <!-- 规格 -->
LENGTH as "length", <!-- 长 -->
WIDE as "wide", <!-- 宽 -->
THICK as "thick", <!-- 厚 -->
MATERIAL as "material", <!-- 材质 -->
COEFFICIENT as "coefficient", <!-- 系数 -->
UNIT as "unit", <!-- 单位 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime" <!-- 更新时间 -->
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="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="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
SPEC = #spec#
</isNotEmpty>
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ006">
SELECT SELECT
ID as "id", <include refid="column"/>
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
STATUS as "status", <!-- 状态 0未启用 1启用 -->
SPEC as "spec", <!-- 规格 -->
LENGTH as "length", <!-- 长 -->
WIDE as "wide", <!-- 宽 -->
THICK as "thick", <!-- 厚 -->
MATERIAL as "material", <!-- 材质 -->
COEFFICIENT as "coefficient", <!-- 系数 -->
UNIT as "unit", <!-- 单位 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DEP_CODE as "depCode" <!-- 部门编码 -->
FROM hpjx.t_hppz006 WHERE 1=1 FROM hpjx.t_hppz006 WHERE 1=1
<isNotEmpty prepend=" AND " property="id"> <include refid="condition"/>
ID = #id# <include refid="order"/>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select> </select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hppz006 WHERE 1=1 SELECT COUNT(*) FROM hpjx.t_hppz006 WHERE 1=1
<isNotEmpty prepend=" AND " property="id"> <include refid="condition"/>
ID = #id#
</isNotEmpty>
</select> </select>
<insert id="insert"> <insert id="insert">
INSERT INTO hpjx.t_hppz006 ( INSERT INTO ${hpjxSchema}.T_HPPZ006 (
COMPANY_CODE, <!-- 企业编码 预留 --> COMPANY_CODE, <!-- 企业编码 预留 -->
INVENT_NAME, <!-- 存货名称 --> DEP_CODE, <!-- 部门编码 -->
INVENT_CODE, <!-- 存货编码 --> INVENT_TYPE, <!-- 存货类型 -->
INVENT_TYPE, <!-- 存货类型 --> INVENT_CODE, <!-- 存货编码 -->
STATUS, <!-- 状态 0未启用 1启用 --> INVENT_NAME, <!-- 存货名称 -->
SPEC, <!-- 规格 --> STATUS, <!-- 状态 0未启用 1启用 -->
LENGTH, <!-- 长 --> SPEC, <!-- 规格 -->
WIDE, <!-- 宽 --> LENGTH, <!-- 长 -->
THICK, <!-- 厚 --> WIDE, <!-- 宽 -->
MATERIAL, <!-- 材质 --> THICK, <!-- 厚 -->
COEFFICIENT, <!-- 系数 --> MATERIAL, <!-- 材质 -->
UNIT, <!-- 单位 --> COEFFICIENT, <!-- 系数 -->
CREATED_BY, <!-- 创建人 --> UNIT, <!-- 单位 -->
CREATED_TIME, <!-- 创建时间 --> CREATED_BY, <!-- 创建人 -->
DEP_CODE <!-- 部门编码 --> CREATED_NAME, <!-- 创建人名称 -->
) CREATED_TIME <!-- 创建时间 -->
VALUES ( #companyCode#, #inventName#, #inventCode#, #inventType#, #status#, #spec#, #length#, #wide#, #thick#, #material#, #coefficient#, #unit#, #createdBy#, #createdTime#, #depCode#) ) VALUES (
</insert> #companyCode#, #depCode#, #inventType#, #inventCode#, #inventName#,
#status#, #spec#, #length#, #wide#, #thick#, #material#, #coefficient#,
#unit#, #createdBy#, #createdName#, #createdTime#
)
</insert>
<delete id="delete"> <delete id="delete">
DELETE FROM hpjx.t_hppz006 WHERE DELETE FROM hpjx.t_hppz006 WHERE ID = #id#
ID = #id#
</delete> </delete>
<update id="update"> <update id="update">
UPDATE hpjx.t_hppz006 UPDATE hpjx.t_hppz006
SET SET
INVENT_NAME = #inventName#, <!-- 存货名称 --> STATUS = #status#, <!-- 状态 0未启用 1启用 -->
INVENT_CODE = #inventCode#, <!-- 存货编码 --> SPEC = #spec#, <!-- 规格 -->
INVENT_TYPE = #inventType#, <!-- 存货类型 --> LENGTH = #length#, <!-- 长 -->
STATUS = #status#, <!-- 状态 0未启用 1启用 --> WIDE = #wide#, <!-- 宽 -->
SPEC = #spec#, <!-- 规格 --> THICK = #thick#, <!-- 厚 -->
LENGTH = #length#, <!-- 长 --> MATERIAL = #material#, <!-- 材质 -->
WIDE = #wide#, <!-- 宽 --> COEFFICIENT = #coefficient#, <!-- 系数 -->
THICK = #thick#, <!-- 厚 --> UNIT = #unit#, <!-- 单位 -->
MATERIAL = #material#, <!-- 材质 --> UPDATED_BY = #updatedBy#, <!-- 更新人 -->
COEFFICIENT = #coefficient#, <!-- 系数 --> UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UNIT = #unit#, <!-- 单位 --> UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 --> WHERE ID = #id#
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE
ID = #id#
</update> </update>
<select id="queryComboBox" parameterClass="java.util.HashMap" <select id="queryComboBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
ID as "id",
CONCAT(INVENT_CODE,'-',INVENT_NAME,'[',SPEC,']') as "inventName"
FROM hpjx.t_hppz006 WHERE STATUS=1
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
ORDER BY INVENT_CODE
</select>
<select id="queryMaterialComboBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap"> resultClass="java.util.HashMap">
SELECT DISTINCT SELECT DISTINCT
ID as "id", INVENT_CODE as "inventCode",
CONCAT(INVENT_CODE,'-',INVENT_NAME,'[',SPEC,']') as "inventName" INVENT_NAME as "inventName"
FROM hpjx.t_hppz006 WHERE STATUS=1 FROM hpjx.t_hppz006 WHERE STATUS=1
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode# COMPANY_CODE = #companyCode#
...@@ -127,6 +162,9 @@ ...@@ -127,6 +162,9 @@
<isNotEmpty prepend=" AND " property="inventCode"> <isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode# INVENT_CODE = #inventCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
ORDER BY ID ORDER BY ID
</select> </select>
......
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