Commit 055e978a by 宋祥

1.收发存汇总

parent c827f072
......@@ -44,6 +44,14 @@ public enum DdynamicEnum {
INVENT_RECORD_BLOCK_ID("invent_record_block_id","id","inventName","HPPZ006.queryComboBox"),
/**
* 模块:存货档案
* 用途:存货档案下拉框
* 编写:wwl
*/
INVENT_SPEC_BLOCK_ID("invent_spec_block_id","spec","spec","HPPZ006.queryComboBoxSpec"),
/**
* 模块:仓库档案
* 用途:仓库档案下拉框
* 编写:wwl
......
......@@ -24,4 +24,18 @@ public class CommonConstant {
public static final String NO = "N";
}
/**
* 日期类型
*
* @author:songx
* @date:2024/1/20,15:04
*/
public static class DateType {
// 月
public static final String MONTH = "MONTH";
// 日
public static final String DAY = "DAY";
}
}
......@@ -46,6 +46,11 @@ public class DaoUtils {
setCreator((DaoEPBase) obj);
} else if (obj instanceof Map) {
setCreator((Map) obj);
} else if (obj instanceof List) {
for (Object o : ((List) obj)) {
insert(sql, o);
}
return;
}
DaoBase.getInstance().insert(sql, obj);
}
......
package com.baosight.hpjx.hp.constant;
/**
* @author:songx
* @date:2024/1/18,17:16
*/
public class HPConstant {
/**
* 序列号
*
* @author:songx
* @date:2021/8/17,15:22
*/
public class SequenceId {
// 盘点单号
public static final String STATISTICAL_NUMBER = "STATISTICAL_NUMBER";
// 统计单号
public static final String HPKC008_NUMBER = "HPKC008_NUMBER";
// 巡检单号
public static final String HPZL001_NUMBER = "HPZL001_NUMBER";
}
/**
* 库存类型
*
* @author:songx
* @date:2024/1/20,15:18
*/
public class KcType {
// 采购
public static final String CG = "CG";
// 生产
public static final String SC = "SC";
// 其他
public static final String QT = "QT";
}
}
package com.baosight.hpjx.hp.constant;
/**
* @author:songx
* @date:2024/1/18,17:16
*/
public class HPSqlConstant {
/**
* HPPZ010 SQL 定义
*
* @author:songx
* @date:2024/1/18,17:17
*/
public class HPPZ010 {
// 新增
public static final String INSERT = "HPPZ010.insert";
// 查询
public static final String QUERY = "HPPZ010.query";
}
}
......@@ -14,7 +14,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
* THpkc003
*
*/
public class THpkc003 extends DaoEPBase {
public class HPKC003 extends DaoEPBase {
private Long id = 0L;
private String companyCode = " "; /* 企业编码 预留*/
......@@ -113,7 +113,7 @@ EiColumn eiColumn;
/**
* the constructor
*/
public THpkc003() {
public HPKC003() {
initMetaData();
}
......
......@@ -28,9 +28,10 @@ public class HPKC005 extends DaoEPBase {
public static final String FIELD_STATISTICAL_NUMBER = "statisticalNumber"; /* 盘点单号*/
public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/
public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/
public static final String FIELD_MAT_TYPE = "matType"; /* 物料类型*/
public static final String FIELD_MAT_CODE = "matCode"; /* 物料编码*/
public static final String FIELD_MAT_NAME = "matName"; /* 物料名称*/
public static final String FIELD_INVENT_TYPE = "inventType"; /* 物料类型*/
public static final String FIELD_INVENT_CODE = "inventCode"; /* 物料编码*/
public static final String FIELD_INVENT_NAME = "inventName"; /* 物料名称*/
public static final String FIELD_SPEC = "spec"; /* 规格*/
public static final String FIELD_BOOK_AMOUNT = "bookAmount"; /* 账面数量*/
public static final String FIELD_BOOK_WEIGHT = "bookWeight"; /* 账面重量*/
public static final String FIELD_ENTITY_AMOUNT = "entityAmount"; /* 实物数量*/
......@@ -51,9 +52,10 @@ public class HPKC005 extends DaoEPBase {
public static final String COL_STATISTICAL_NUMBER = "STATISTICAL_NUMBER"; /* 盘点单号*/
public static final String COL_WH_CODE = "WH_CODE"; /* 仓库编码*/
public static final String COL_WH_NAME = "WH_NAME"; /* 仓库名称*/
public static final String COL_MAT_TYPE = "MAT_TYPE"; /* 物料类型*/
public static final String COL_MAT_CODE = "MAT_CODE"; /* 物料编码*/
public static final String COL_MAT_NAME = "MAT_NAME"; /* 物料名称*/
public static final String COL_INVENT_TYPE = "INVENT_TYPE"; /* 物料类型*/
public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 物料编码*/
public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 物料名称*/
public static final String COL_SPEC = "SPEC"; /* 规格*/
public static final String COL_BOOK_AMOUNT = "BOOK_AMOUNT"; /* 账面数量*/
public static final String COL_BOOK_WEIGHT = "BOOK_WEIGHT"; /* 账面重量*/
public static final String COL_ENTITY_AMOUNT = "ENTITY_AMOUNT"; /* 实物数量*/
......@@ -80,9 +82,10 @@ public class HPKC005 extends DaoEPBase {
private String statisticalNumber = " "; /* 盘点单号*/
private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/
private String matType = " "; /* 物料类型*/
private String matCode = " "; /* 物料编码*/
private String matName = " "; /* 物料名称*/
private String inventType = " "; /* 物料类型*/
private String inventCode = " "; /* 物料编码*/
private String inventName = " "; /* 物料名称*/
private String spec = " "; /* 规格*/
private BigDecimal bookAmount = new BigDecimal(0.00); /* 账面数量*/
private BigDecimal bookWeight = new BigDecimal(0.00); /* 账面重量*/
private BigDecimal entityAmount = new BigDecimal(0.00); /* 实物数量*/
......@@ -128,16 +131,20 @@ public class HPKC005 extends DaoEPBase {
eiColumn.setDescName("仓库名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MAT_TYPE);
eiColumn.setDescName("物料类型");
eiColumn = new EiColumn(FIELD_INVENT_TYPE);
eiColumn.setDescName("存货类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MAT_CODE);
eiColumn.setDescName("物料编码");
eiColumn = new EiColumn(FIELD_INVENT_CODE);
eiColumn.setDescName("存货编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MAT_NAME);
eiColumn.setDescName("物料名称");
eiColumn = new EiColumn(FIELD_INVENT_NAME);
eiColumn.setDescName("存货名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SPEC);
eiColumn.setDescName("规格");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_BOOK_AMOUNT);
......@@ -320,50 +327,59 @@ public class HPKC005 extends DaoEPBase {
* get the matType - 物料类型.
* @return the matType
*/
public String getMatType() {
return this.matType;
public String getInventType() {
return this.inventType;
}
/**
* set the matType - 物料类型.
*
* @param matType - 物料类型
* @param inventType - 物料类型
*/
public void setMatType(String matType) {
this.matType = matType;
public void setInventType(String inventType) {
this.inventType = inventType;
}
/**
* get the matCode - 物料编码.
* @return the matCode
*/
public String getMatCode() {
return this.matCode;
public String getInventCode() {
return this.inventCode;
}
/**
* set the matCode - 物料编码.
*
* @param matCode - 物料编码
* @param inventCode - 物料编码
*/
public void setMatCode(String matCode) {
this.matCode = matCode;
public void setInventCode(String inventCode) {
this.inventCode = inventCode;
}
/**
* get the matName - 物料名称.
* @return the matName
*/
public String getMatName() {
return this.matName;
public String getInventName() {
return this.inventName;
}
/**
* set the matName - 物料名称.
*
* @param matName - 物料名称
* @param inventName - 物料名称
*/
public void setMatName(String matName) {
this.matName = matName;
public void setInventName(String inventName) {
this.inventName = inventName;
}
public String getSpec() {
return spec;
}
public void setSpec(String spec) {
this.spec = spec;
}
/**
* get the bookAmount - 账面数量.
* @return the bookAmount
......@@ -586,9 +602,10 @@ public class HPKC005 extends DaoEPBase {
setStatisticalNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_STATISTICAL_NUMBER)), statisticalNumber));
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode));
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName));
setMatType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MAT_TYPE)), matType));
setMatCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MAT_CODE)), matCode));
setMatName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MAT_NAME)), matName));
setInventType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_TYPE)), inventType));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode));
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SPEC)), spec));
setBookAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_BOOK_AMOUNT)), bookAmount));
setBookWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_BOOK_WEIGHT)), bookWeight));
setEntityAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_ENTITY_AMOUNT)), entityAmount));
......@@ -617,9 +634,10 @@ public class HPKC005 extends DaoEPBase {
map.put(FIELD_STATISTICAL_NUMBER, StringUtils.toString(statisticalNumber, eiMetadata.getMeta(FIELD_STATISTICAL_NUMBER)));
map.put(FIELD_WH_CODE, StringUtils.toString(whCode, eiMetadata.getMeta(FIELD_WH_CODE)));
map.put(FIELD_WH_NAME, StringUtils.toString(whName, eiMetadata.getMeta(FIELD_WH_NAME)));
map.put(FIELD_MAT_TYPE, StringUtils.toString(matType, eiMetadata.getMeta(FIELD_MAT_TYPE)));
map.put(FIELD_MAT_CODE, StringUtils.toString(matCode, eiMetadata.getMeta(FIELD_MAT_CODE)));
map.put(FIELD_MAT_NAME, StringUtils.toString(matName, eiMetadata.getMeta(FIELD_MAT_NAME)));
map.put(FIELD_INVENT_TYPE, StringUtils.toString(inventType, eiMetadata.getMeta(FIELD_INVENT_TYPE)));
map.put(FIELD_INVENT_CODE, StringUtils.toString(inventCode, eiMetadata.getMeta(FIELD_INVENT_CODE)));
map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME)));
map.put(FIELD_SPEC, StringUtils.toString(spec, eiMetadata.getMeta(FIELD_SPEC)));
map.put(FIELD_BOOK_AMOUNT, StringUtils.toString(bookAmount, eiMetadata.getMeta(FIELD_BOOK_AMOUNT)));
map.put(FIELD_BOOK_WEIGHT, StringUtils.toString(bookWeight, eiMetadata.getMeta(FIELD_BOOK_WEIGHT)));
map.put(FIELD_ENTITY_AMOUNT, StringUtils.toString(entityAmount, eiMetadata.getMeta(FIELD_ENTITY_AMOUNT)));
......
package com.baosight.hpjx.hp.kc.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* Project: <br>
* Title:THpkc009.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-01-20 15:01:27 create
*/
public class HPKC009 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业编码 预留*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_KC_TYPE = "kcType"; /* 库存类型:CG:采购,SC:生产,QT:其他*/
public static final String FIELD_DATE_TYPE = "dateType"; /* 日期类型:DAY:天,MONTH:月*/
public static final String FIELD_DATE_PROC = "dateProc"; /* 日期*/
public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/
public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/
public static final String FIELD_INVENT_TYPE = "inventType"; /* 存货类型*/
public static final String FIELD_INVENT_CODE = "inventCode"; /* 存货编码*/
public static final String FIELD_INVENT_NAME = "inventName"; /* 存货名称*/
public static final String FIELD_SPEC = "spec"; /* 规格*/
public static final String FIELD_INIT_AMOUNT = "initAmount"; /* 期初数量*/
public static final String FIELD_INIT_WEIGHT = "initWeight"; /* 期初重量*/
public static final String FIELD_STOCKIN_AMOUNT = "stockinAmount"; /* 入库数量*/
public static final String FIELD_STOCKIN_WEIGHT = "stockinWeight"; /* 入库重量*/
public static final String FIELD_STOCKOUT_AMOUNT = "stockoutAmount"; /* 出库数量*/
public static final String FIELD_STOCKOUT_WEIGHT = "stockoutWeight"; /* 出库重量*/
public static final String FIELD_END_AMOUNT = "endAmount"; /* 期末数量*/
public static final String FIELD_END_WEIGHT = "endWeight"; /* 期末重量*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 更新人*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_KC_TYPE = "KC_TYPE"; /* 库存类型:CG:采购,SC:生产,QT:其他*/
public static final String COL_DATE_TYPE = "DATE_TYPE"; /* 日期类型:DAY:天,MONTH:月*/
public static final String COL_DATE_PROC = "DATE_PROC"; /* 日期*/
public static final String COL_WH_CODE = "WH_CODE"; /* 仓库编码*/
public static final String COL_WH_NAME = "WH_NAME"; /* 仓库名称*/
public static final String COL_INVENT_TYPE = "INVENT_TYPE"; /* 存货类型*/
public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 存货编码*/
public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 存货名称*/
public static final String COL_SPEC = "SPEC"; /* 规格*/
public static final String COL_INIT_AMOUNT = "INIT_AMOUNT"; /* 期初数量*/
public static final String COL_INIT_WEIGHT = "INIT_WEIGHT"; /* 期初重量*/
public static final String COL_STOCKIN_AMOUNT = "STOCKIN_AMOUNT"; /* 入库数量*/
public static final String COL_STOCKIN_WEIGHT = "STOCKIN_WEIGHT"; /* 入库重量*/
public static final String COL_STOCKOUT_AMOUNT = "STOCKOUT_AMOUNT"; /* 出库数量*/
public static final String COL_STOCKOUT_WEIGHT = "STOCKOUT_WEIGHT"; /* 出库重量*/
public static final String COL_END_AMOUNT = "END_AMOUNT"; /* 期末数量*/
public static final String COL_END_WEIGHT = "END_WEIGHT"; /* 期末重量*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
private Long id = null;
private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码*/
private String kcType = " "; /* 库存类型:CG:采购,SC:生产,QT:其他*/
private String dateType = " "; /* 日期类型:DAY:天,MONTH:月*/
private String dateProc = " "; /* 日期*/
private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/
private String inventType = " "; /* 存货类型*/
private String inventCode = " "; /* 存货编码*/
private String inventName = " "; /* 存货名称*/
private String spec = " "; /* 规格*/
private BigDecimal initAmount = new BigDecimal(0.00); /* 期初数量*/
private BigDecimal initWeight = new BigDecimal(0.00); /* 期初重量*/
private BigDecimal stockinAmount = new BigDecimal(0.00); /* 入库数量*/
private BigDecimal stockinWeight = new BigDecimal(0.00); /* 入库重量*/
private BigDecimal stockoutAmount = new BigDecimal(0.00); /* 出库数量*/
private BigDecimal stockoutWeight = new BigDecimal(0.00); /* 出库重量*/
private BigDecimal endAmount = new BigDecimal(0.00); /* 期末数量*/
private BigDecimal endWeight = new BigDecimal(0.00); /* 期末重量*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_KC_TYPE);
eiColumn.setDescName("库存类型:CG:采购,SC:生产,QT:其他");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DATE_TYPE);
eiColumn.setDescName("日期类型:DAY:天,MONTH:月");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DATE_PROC);
eiColumn.setDescName("日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WH_CODE);
eiColumn.setDescName("仓库编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WH_NAME);
eiColumn.setDescName("仓库名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_TYPE);
eiColumn.setDescName("存货类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_CODE);
eiColumn.setDescName("存货编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_NAME);
eiColumn.setDescName("存货名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SPEC);
eiColumn.setDescName("规格");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INIT_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(10);
eiColumn.setDescName("期初数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INIT_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(10);
eiColumn.setDescName("期初重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STOCKIN_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(10);
eiColumn.setDescName("入库数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STOCKIN_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(10);
eiColumn.setDescName("入库重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STOCKOUT_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(10);
eiColumn.setDescName("出库数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STOCKOUT_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(10);
eiColumn.setDescName("出库重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_END_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(10);
eiColumn.setDescName("期末数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_END_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(10);
eiColumn.setDescName("期末重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("更新人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HPKC009() {
initMetaData();
}
/**
* get the id .
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id .
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the companyCode - 企业编码 预留.
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 企业编码 预留.
*
* @param companyCode - 企业编码 预留
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the depCode - 部门编码.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
* @param depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the kcType - 库存类型:CG:采购,SC:生产,QT:其他.
* @return the kcType
*/
public String getKcType() {
return this.kcType;
}
/**
* set the kcType - 库存类型:CG:采购,SC:生产,QT:其他.
*
* @param kcType - 库存类型:CG:采购,SC:生产,QT:其他
*/
public void setKcType(String kcType) {
this.kcType = kcType;
}
/**
* get the dateType - 日期类型:DAY:天,MONTH:月.
* @return the dateType
*/
public String getDateType() {
return this.dateType;
}
/**
* set the dateType - 日期类型:DAY:天,MONTH:月.
*
* @param dateType - 日期类型:DAY:天,MONTH:月
*/
public void setDateType(String dateType) {
this.dateType = dateType;
}
/**
* get the dateProc - 日期.
* @return the dateProc
*/
public String getDateProc() {
return this.dateProc;
}
/**
* set the dateProc - 日期.
*
* @param dateProc - 日期
*/
public void setDateProc(String dateProc) {
this.dateProc = dateProc;
}
/**
* get the whCode - 仓库编码.
* @return the whCode
*/
public String getWhCode() {
return this.whCode;
}
/**
* set the whCode - 仓库编码.
*
* @param whCode - 仓库编码
*/
public void setWhCode(String whCode) {
this.whCode = whCode;
}
/**
* get the whName - 仓库名称.
* @return the whName
*/
public String getWhName() {
return this.whName;
}
/**
* set the whName - 仓库名称.
*
* @param whName - 仓库名称
*/
public void setWhName(String whName) {
this.whName = whName;
}
/**
* get the inventType - 存货类型.
* @return the inventType
*/
public String getInventType() {
return this.inventType;
}
/**
* set the inventType - 存货类型.
*
* @param inventType - 存货类型
*/
public void setInventType(String inventType) {
this.inventType = inventType;
}
/**
* get the inventCode - 存货编码.
* @return the inventCode
*/
public String getInventCode() {
return this.inventCode;
}
/**
* set the inventCode - 存货编码.
*
* @param inventCode - 存货编码
*/
public void setInventCode(String inventCode) {
this.inventCode = inventCode;
}
/**
* get the inventName - 存货名称.
* @return the inventName
*/
public String getInventName() {
return this.inventName;
}
/**
* set the inventName - 存货名称.
*
* @param inventName - 存货名称
*/
public void setInventName(String inventName) {
this.inventName = inventName;
}
/**
* get the spec - 规格.
* @return the spec
*/
public String getSpec() {
return this.spec;
}
/**
* set the spec - 规格.
*
* @param spec - 规格
*/
public void setSpec(String spec) {
this.spec = spec;
}
/**
* get the initAmount - 期初数量.
* @return the initAmount
*/
public BigDecimal getInitAmount() {
return this.initAmount;
}
/**
* set the initAmount - 期初数量.
*
* @param initAmount - 期初数量
*/
public void setInitAmount(BigDecimal initAmount) {
this.initAmount = initAmount;
}
/**
* get the initWeight - 期初重量.
* @return the initWeight
*/
public BigDecimal getInitWeight() {
return this.initWeight;
}
/**
* set the initWeight - 期初重量.
*
* @param initWeight - 期初重量
*/
public void setInitWeight(BigDecimal initWeight) {
this.initWeight = initWeight;
}
/**
* get the stockinAmount - 入库数量.
* @return the stockinAmount
*/
public BigDecimal getStockinAmount() {
return this.stockinAmount;
}
/**
* set the stockinAmount - 入库数量.
*
* @param stockinAmount - 入库数量
*/
public void setStockinAmount(BigDecimal stockinAmount) {
this.stockinAmount = stockinAmount;
}
/**
* get the stockinWeight - 入库重量.
* @return the stockinWeight
*/
public BigDecimal getStockinWeight() {
return this.stockinWeight;
}
/**
* set the stockinWeight - 入库重量.
*
* @param stockinWeight - 入库重量
*/
public void setStockinWeight(BigDecimal stockinWeight) {
this.stockinWeight = stockinWeight;
}
/**
* get the stockoutAmount - 出库数量.
* @return the stockoutAmount
*/
public BigDecimal getStockoutAmount() {
return this.stockoutAmount;
}
/**
* set the stockoutAmount - 出库数量.
*
* @param stockoutAmount - 出库数量
*/
public void setStockoutAmount(BigDecimal stockoutAmount) {
this.stockoutAmount = stockoutAmount;
}
/**
* get the stockoutWeight - 出库重量.
* @return the stockoutWeight
*/
public BigDecimal getStockoutWeight() {
return this.stockoutWeight;
}
/**
* set the stockoutWeight - 出库重量.
*
* @param stockoutWeight - 出库重量
*/
public void setStockoutWeight(BigDecimal stockoutWeight) {
this.stockoutWeight = stockoutWeight;
}
/**
* get the endAmount - 期末数量.
* @return the endAmount
*/
public BigDecimal getEndAmount() {
return this.endAmount;
}
/**
* set the endAmount - 期末数量.
*
* @param endAmount - 期末数量
*/
public void setEndAmount(BigDecimal endAmount) {
this.endAmount = endAmount;
}
/**
* get the endWeight - 期末重量.
* @return the endWeight
*/
public BigDecimal getEndWeight() {
return this.endWeight;
}
/**
* set the endWeight - 期末重量.
*
* @param endWeight - 期末重量
*/
public void setEndWeight(BigDecimal endWeight) {
this.endWeight = endWeight;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称.
*
* @param createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人.
*
* @param updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 更新人名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 更新人名称.
*
* @param updatedName - 更新人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 更新时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间.
*
* @param updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setKcType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_KC_TYPE)), kcType));
setDateType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DATE_TYPE)), dateType));
setDateProc(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DATE_PROC)), dateProc));
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode));
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName));
setInventType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_TYPE)), inventType));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode));
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SPEC)), spec));
setInitAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_INIT_AMOUNT)), initAmount));
setInitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_INIT_WEIGHT)), initWeight));
setStockinAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_STOCKIN_AMOUNT)), stockinAmount));
setStockinWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_STOCKIN_WEIGHT)), stockinWeight));
setStockoutAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_STOCKOUT_AMOUNT)), stockoutAmount));
setStockoutWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_STOCKOUT_WEIGHT)), stockoutWeight));
setEndAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_END_AMOUNT)), endAmount));
setEndWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_END_WEIGHT)), endWeight));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_KC_TYPE, StringUtils.toString(kcType, eiMetadata.getMeta(FIELD_KC_TYPE)));
map.put(FIELD_DATE_TYPE, StringUtils.toString(dateType, eiMetadata.getMeta(FIELD_DATE_TYPE)));
map.put(FIELD_DATE_PROC, StringUtils.toString(dateProc, eiMetadata.getMeta(FIELD_DATE_PROC)));
map.put(FIELD_WH_CODE, StringUtils.toString(whCode, eiMetadata.getMeta(FIELD_WH_CODE)));
map.put(FIELD_WH_NAME, StringUtils.toString(whName, eiMetadata.getMeta(FIELD_WH_NAME)));
map.put(FIELD_INVENT_TYPE, StringUtils.toString(inventType, eiMetadata.getMeta(FIELD_INVENT_TYPE)));
map.put(FIELD_INVENT_CODE, StringUtils.toString(inventCode, eiMetadata.getMeta(FIELD_INVENT_CODE)));
map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME)));
map.put(FIELD_SPEC, StringUtils.toString(spec, eiMetadata.getMeta(FIELD_SPEC)));
map.put(FIELD_INIT_AMOUNT, StringUtils.toString(initAmount, eiMetadata.getMeta(FIELD_INIT_AMOUNT)));
map.put(FIELD_INIT_WEIGHT, StringUtils.toString(initWeight, eiMetadata.getMeta(FIELD_INIT_WEIGHT)));
map.put(FIELD_STOCKIN_AMOUNT, StringUtils.toString(stockinAmount, eiMetadata.getMeta(FIELD_STOCKIN_AMOUNT)));
map.put(FIELD_STOCKIN_WEIGHT, StringUtils.toString(stockinWeight, eiMetadata.getMeta(FIELD_STOCKIN_WEIGHT)));
map.put(FIELD_STOCKOUT_AMOUNT, StringUtils.toString(stockoutAmount, eiMetadata.getMeta(FIELD_STOCKOUT_AMOUNT)));
map.put(FIELD_STOCKOUT_WEIGHT, StringUtils.toString(stockoutWeight, eiMetadata.getMeta(FIELD_STOCKOUT_WEIGHT)));
map.put(FIELD_END_AMOUNT, StringUtils.toString(endAmount, eiMetadata.getMeta(FIELD_END_AMOUNT)));
map.put(FIELD_END_WEIGHT, StringUtils.toString(endWeight, eiMetadata.getMeta(FIELD_END_WEIGHT)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
return map;
}
}
package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InitiateModeEnum;
import com.baosight.hpjx.common.InventTypeEnun;
import com.baosight.hpjx.hp.kc.domain.THpkc003;
import com.baosight.hpjx.hp.pz.domain.THppz006;
import com.baosight.hpjx.hp.kc.domain.HPKC003;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.iplat4j.core.ei.EiBlock;
......@@ -13,8 +9,6 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
......@@ -28,7 +22,7 @@ public class ServiceHPKC003 extends ServiceBase {
* 画面初始化.
*/
public EiInfo initLoad(EiInfo inInfo) {
THpkc003 hpkc003 = new THpkc003();
HPKC003 hpkc003 = new HPKC003();
EiInfo outInfo = new EiInfo();
outInfo.addBlock(EiConstant.resultBlock);
outInfo.getBlock(EiConstant.resultBlock).addBlockMeta(hpkc003.eiMetadata);
......@@ -41,7 +35,7 @@ public class ServiceHPKC003 extends ServiceBase {
@Override
public EiInfo query(EiInfo inInfo) {
/* 调用EI查询方法.*/
EiInfo outInfo = super.query(inInfo, "HPKC003.query", new THpkc003());
EiInfo outInfo = super.query(inInfo, "HPKC003.query", new HPKC003());
return outInfo;
}
......@@ -84,7 +78,7 @@ public class ServiceHPKC003 extends ServiceBase {
public EiInfo update(EiInfo inInfo) {
try {
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
THpkc003 hpkc003 = new THpkc003();
HPKC003 hpkc003 = new HPKC003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
......@@ -109,7 +103,7 @@ public class ServiceHPKC003 extends ServiceBase {
* 删除操作.
*/
public EiInfo delete(EiInfo eiInfo) {
THpkc003 hpkc003 = new THpkc003();
HPKC003 hpkc003 = new HPKC003();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
......
package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC005;
import com.baosight.hpjx.hp.pz.domain.HPPZ007;
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.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
......@@ -12,8 +19,14 @@ import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.MapUtils;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
......@@ -28,13 +41,11 @@ public class ServiceHPKC005 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
HPKC005 HPKC005 = new HPKC005();
EiInfo outInfo = super.initLoad(inInfo, HPKC005);
outInfo.addBlock(EiConstant.queryBlock).setCell(0,"receiptDate",CommonMethod.getCurrentSameYearMonth());
outInfo.addBlock(EiConstant.queryBlock).setCell(0, "receiptDate", CommonMethod.getCurrentSameYearMonth());
outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.WH_RECORD_QUERY_BLOCK_ID), null);
EiBlock block = outInfo.addBlock(EiConstant.queryBlock);
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));
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));
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), null);
return outInfo;
}
......@@ -43,11 +54,95 @@ public class ServiceHPKC005 extends ServiceBase {
*/
@Override
public EiInfo query(EiInfo inInfo) {
String receiptDate = inInfo.getCellStr(EiConstant.queryBlock,0,"receiptDate");
inInfo.setCell(EiConstant.queryBlock,0,"receiptDate", StringUtil.removeHorizontalLine(receiptDate));
/* 调用EI查询方法.*/
return super.query(inInfo, "HPKC005.query", new HPKC005());
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, "HPKC005.query", new HPKC005());
List sum = dao.query("HPKC005.querySum", queryRow);
inInfo.getBlock(EiConstant.resultBlock).set(EiConstant.COLUMN_TOTAL_SUM, sum.get(0));
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HPKC005 fKc005 = new HPKC005();
fKc005.fromMap(resultRows.get(i));
// 去除日期字符串中的-
fKc005.setReceiptDate(StringUtil.removeHorizontalLine(fKc005.getReceiptDate()));
// 仓库名称
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) {
this.add(fKc005);
} else {
this.modify(fKc005);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param resultRows
*/
private void checkSaveData(List<Map> resultRows) {
for (int i = 0; i < resultRows.size(); i++) {
HPKC005 fKc005 = new HPKC005();
fKc005.fromMap(resultRows.get(i));
AssertUtils.isEmpty(fKc005.getWhCode(), "仓库名称不能为空");
AssertUtils.isNull(fKc005.getInventCode(), "存货名称不能为空");
}
}
/**
* 新增
*
* @param fKc005
*/
private void add(HPKC005 fKc005) {
// 生成单据号
fKc005.setStatisticalNumber(SequenceGenerator.getNextSequence(
HPConstant.SequenceId.STATISTICAL_NUMBER));
DaoUtils.insert("HPKC005.insert", fKc005);
}
/**
* 修改数据
*
* @param fKc005
*/
private void modify(HPKC005 fKc005) {
DaoUtils.update("HPKC005.update", fKc005);
}
/**
......@@ -55,40 +150,50 @@ public class ServiceHPKC005 extends ServiceBase {
*/
@Override
public EiInfo insert(EiInfo inInfo) {
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
for (int i = 0; i < inInfo.getBlock(EiConstant.resultBlock).getRowCount(); i++) {
String receiptDate = inInfo.getCellStr(EiConstant.resultBlock,i,"receiptDate");
inInfo.setCell(EiConstant.resultBlock,i,"receiptDate", StringUtil.removeHorizontalLine(receiptDate));
String whCode = inInfo.getCellStr(EiConstant.resultBlock,i,"whCode");
String matCode = inInfo.getCellStr(EiConstant.resultBlock,i,"matCode");
Map params=new HashMap<>();
try {
CommonMethod.creatorInfo(inInfo, EiConstant.resultBlock);
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
Map resultRow = resultRows.get(i);
// 去除日期字符串中的-
String receiptDate = MapUtils.getString(resultRow, "receiptDate");
resultRow.put("receiptDate", StringUtil.removeHorizontalLine(receiptDate));
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();
inInfo.setCell(EiConstant.resultBlock,i,"whName", whName);
Map params1=new HashMap<>();
params1.put("inventCode", matCode);
List query1 = dao.query("HPPZ004.queryMatNameByCode",params1);
String matName = ((THppz004)query1.get(0)).getInventName();
inInfo.setCell(EiConstant.resultBlock,i,"matName", matName);
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(
HPConstant.SequenceId.STATISTICAL_NUMBER));
DaoUtils.insert("HPKC005.insert", resultRow);
}
return super.insert(inInfo,"HPKC005.insert");
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 修改操作.
*/
public EiInfo update(EiInfo inInfo) {
try {
HPKC005 HPKC005 = new HPKC005();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
List<String> list = new ArrayList<>();
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPKC005.fromMap(map);
HPKC005 HPKC005 = new HPKC005();
HPKC005.fromMap(eiBlock.getRow(i));
if (HPKC005.getStatus() == 1) {
list.add(HPKC005.getStatisticalNumber());
continue;
......@@ -99,28 +204,19 @@ public class ServiceHPKC005 extends ServiceBase {
String whName = ((HPPZ007)query.get(0)).getWhName();
HPKC005.setWhName(whName);
Map params1=new HashMap<>();
params1.put("inventCode", HPKC005.getMatCode());
params1.put("inventCode", HPKC005.getInventCode());
List query1 = dao.query("HPPZ004.queryMatNameByCode",params1);
String matName = ((THppz004)query1.get(0)).getInventName();
HPKC005.setMatName(matName);
HPKC005.setInventName(matName);
this.dao.update("HPKC005.update", HPKC005.toMap());
}
if (list.size() > 0) {
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("部分数据修改成功!销售出库单号为:" + list.stream()
.collect(Collectors.joining(",")) + "状态为已审核不能进行修改!");
} else {
inInfo = this.query(inInfo);
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;
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return query(inInfo);
return inInfo;
}
/**
......@@ -133,7 +229,6 @@ public class ServiceHPKC005 extends ServiceBase {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HPKC005.fromMap(map);
this.dao.delete("HPKC005.delete", HPKC005.toMap());
}
} catch (PlatException e) {
......@@ -143,7 +238,6 @@ public class ServiceHPKC005 extends ServiceBase {
logError("删除失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
return eiInfo;
......
package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.core.dao.DaoUtils;
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.pz.domain.HPPZ007;
import com.baosight.hpjx.hp.pz.domain.THppz004;
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.EiConstant;
......@@ -10,9 +17,13 @@ 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 org.apache.commons.collections.MapUtils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
......@@ -25,11 +36,13 @@ public class ServiceHPKC008 extends ServiceBase {
* 画面初始化.
*/
public EiInfo initLoad(EiInfo inInfo) {
HPKC008 HPKC008 = new HPKC008();
EiInfo outInfo = super.initLoad(inInfo, HPKC008);
outInfo.addBlock(EiConstant.queryBlock).setCell(0,"datemonth",CommonMethod.getCurrentSameYearMonth());
outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
return outInfo;
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC008().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
......@@ -37,11 +50,18 @@ public class ServiceHPKC008 extends ServiceBase {
*/
@Override
public EiInfo query(EiInfo inInfo) {
String datemonth = inInfo.getCellStr(EiConstant.queryBlock,0,"datemonth");
inInfo.setCell(EiConstant.queryBlock,0,"datemonth", StringUtil.removeHorizontalLine(datemonth));
/* 调用EI查询方法.*/
return super.query(inInfo, "HPKC008.query", new HPKC008());
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, "HPKC008.query", new HPKC008());
List sum = dao.query("HPKC008.querySum", queryRow);
inInfo.getBlock(EiConstant.resultBlock).set(EiConstant.COLUMN_TOTAL_SUM, sum.get(0));
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
......@@ -49,13 +69,30 @@ public class ServiceHPKC008 extends ServiceBase {
*/
@Override
public EiInfo insert(EiInfo inInfo) {
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
for (int i = 0; i < inInfo.getBlock(EiConstant.resultBlock).getRowCount(); i++) {
String datemonth = inInfo.getCellStr(EiConstant.resultBlock,i,"datemonth");
inInfo.setCell(EiConstant.resultBlock,i,"datemonth", StringUtil.removeHorizontalLine(datemonth));
try {
CommonMethod.creatorInfo(inInfo, EiConstant.resultBlock);
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
Map resultRow = resultRows.get(i);
// 去除日期字符串中的-
String datemonth = MapUtils.getString(resultRow, "datemonth");
resultRow.put("datemonth", StringUtil.removeHorizontalLine(datemonth));
// 物料名称
Map params1 = new HashMap<>();
params1.put("inventCode", MapUtils.getString(resultRow, "materialCode"));
List query1 = dao.query("HPPZ004.queryMatNameByCode", params1);
String matName = ((THppz004) query1.get(0)).getInventName();
resultRow.put("materialName", matName);
// 生成单据号
resultRow.put("statisticalNumber", SequenceGenerator.getNextSequence(
HPConstant.SequenceId.HPKC008_NUMBER));
DaoUtils.insert("HPKC008.insert", resultRow);
}
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return super.insert(inInfo,"HPKC008.insert");
return inInfo;
}
......
package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC001;
import com.baosight.hpjx.hp.kc.domain.HPKC002;
import com.baosight.hpjx.hp.kc.domain.HPKC003;
import com.baosight.hpjx.hp.kc.domain.HPKC004;
import com.baosight.hpjx.hp.kc.domain.HPKC006;
import com.baosight.hpjx.hp.kc.domain.HPKC007;
import com.baosight.hpjx.hp.kc.domain.HPKC009;
import com.baosight.hpjx.hp.pz.domain.HPPZ009;
import com.baosight.hpjx.hp.xs.tools.HPXSUserTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.BeanUtils;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.RsaUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import com.baosight.xservices.xs.constants.LoginConstants;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 库存收发存
*
* @author:songx
* @date:2024/1/15,11:20
*/
public class ServiceHPKC009 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC009().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put("dateType", "MONTH");
inInfo = super.query(inInfo, "HPKC009.query", new HPPZ009());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 按天统计
*
* @param inInfo
* @return
*/
public EiInfo statDay(EiInfo inInfo) {
try {
List<HPKC009> results = new ArrayList<>();
// 取昨天的日期
Map queryMap = new HashMap();
LocalDate nowData = LocalDate.now();
queryMap.put("yesterday", nowData.minusDays(1).format(DateUtils.SHORT_DATE));
queryMap.put("beforeDay", nowData.minusDays(2).format(DateUtils.SHORT_DATE));
// 1、统计采购库存
results.addAll(this.statDayCg(queryMap));
// 2、统计生产库存
results.addAll(this.statDaySc(queryMap));
// 3、统计其他库存
results.addAll(this.statDayQt(queryMap));
// 4、写入数据库
DaoUtils.insert("HPKC009.insert", results);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("按天统计成功");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 按天统计采购库存
*
* @return
*/
private List<HPKC009> statDayCg(Map queryMap) {
Map<String, HPKC009> kc009Map = new HashMap();
// 1.1、期末库存
List<HPKC001> aKc001s = dao.query("HPKC001.statDay", new HashMap<>());
// 1.2、收入
queryMap.put("createdTimeFrom", queryMap.get("yesterday") + "000000");
queryMap.put("createdTimeTo", queryMap.get("yesterday") + "235959");
List<HPKC001> bKc001s = dao.query("HPKC001.statDay", queryMap);
Map<String, HPKC001> bKc001Map = bKc001s.stream().collect(Collectors.toMap(item ->
item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#"
+ item.getMaterialType() + "#" + item.getMaterialCode() + "#"
+ item.getSpec(), item -> item));
// 1.3、发出
List<HPKC002> cKc002s = dao.query("HPKC002.statDay", queryMap);
Map<String, HPKC002> cKc001Map = cKc002s.stream().collect(Collectors.toMap(item ->
item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#"
+ item.getMaterialType() + "#" + item.getMaterialCode() + "#"
+ item.getSpec(), item -> item));
// 1.4、期初库存
// 取天天的日期
queryMap.put("createdTimeFrom", queryMap.get("beforeDay") + "000000");
queryMap.put("createdTimeTo", queryMap.get("beforeDay") + "235959");
queryMap.put("kcType", HPConstant.KcType.CG);
List<HPKC009> dKc009s = dao.query("HPKC009.query", new HashMap<>());
Map<String, HPKC009> dKc009Map = dKc009s.stream().collect(Collectors.toMap(item ->
item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#"
+ item.getInventType() + "#" + item.getInventCode() + "#"
+ item.getSpec(), item -> item));
// 根据期末库存生成收发存对象
for (HPKC001 aKc001 : aKc001s) {
String key = aKc001.getCompanyCode() + "#" + aKc001.getDepCode() + "#"
+ aKc001.getWhCode() + "#" + aKc001.getMaterialType() + "#"
+ aKc001.getMaterialCode() + "#" + aKc001.getSpec();
HPKC009 kc009 = BeanUtils.copy(aKc001, HPKC009.class);
kc009.setKcType(HPConstant.KcType.CG);
kc009.setDateType(CommonConstant.DateType.DAY);
kc009.setDateProc(queryMap.get("yesterday").toString());
// 期末
kc009.setEndAmount(BigDecimal.valueOf(aKc001.getQuantity()));
kc009.setEndWeight(aKc001.getWeight());
// 收入
HPKC001 bKc001 = bKc001Map.get(key);
kc009.setStockinAmount(bKc001 == null ? BigDecimal.ZERO : BigDecimal.valueOf(bKc001.getQuantity()));
kc009.setStockinWeight(bKc001 == null ? BigDecimal.ZERO : bKc001.getWeight());
// 发出
HPKC002 cKc002 = cKc001Map.get(key);
kc009.setStockoutAmount(cKc002 == null ? BigDecimal.ZERO : BigDecimal.valueOf(cKc002.getQuantity()));
kc009.setStockoutWeight(cKc002 == null ? BigDecimal.ZERO : cKc002.getWeight());
// 期初
HPKC009 dKc009 = dKc009Map.get(key);
if (dKc009 != null) {
kc009.setInitAmount(dKc009.getEndAmount());
kc009.setInitWeight(dKc009.getEndWeight());
} else {
kc009.setInitAmount(kc009.getEndAmount().add(kc009.getStockoutAmount())
.subtract(kc009.getStockinAmount()));
kc009.setInitWeight(kc009.getEndWeight().add(kc009.getStockoutWeight())
.subtract(kc009.getStockinWeight()));
}
kc009Map.put(key, kc009);
}
return kc009Map.values().stream().collect(Collectors.toList());
}
/**
* 按天统计生产库存
*
* @param queryMap
* @return
*/
private List<HPKC009> statDaySc(Map queryMap) {
Map<String, HPKC009> kc009Map = new HashMap();
// 1.1、期末库存
List<HPKC003> aItems = dao.query("HPKC003.statDay", new HashMap<>());
// 1.2、收入
queryMap.put("createdTimeFrom", queryMap.get("yesterday") + "000000");
queryMap.put("createdTimeTo", queryMap.get("yesterday") + "235959");
List<HPKC003> bItems = dao.query("HPKC003.statDay", queryMap);
Map<String, HPKC003> bItemMap = bItems.stream().collect(Collectors.toMap(item ->
item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWarehouseCode() + "#"
+ item.getMaterialType() + "#" + item.getMaterialCode(), item -> item));
// 1.3、发出
List<HPKC004> cItems = dao.query("HPKC004.statDay", queryMap);
Map<String, HPKC004> cItemMap = cItems.stream().collect(Collectors.toMap(item ->
item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#"
+ item.getMatType() + "#" + item.getMatCode(), item -> item));
// 1.4、期初库存
queryMap.put("createdTimeFrom", queryMap.get("beforeDay") + "000000");
queryMap.put("createdTimeTo", queryMap.get("beforeDay") + "235959");
queryMap.put("kcType", HPConstant.KcType.SC);
List<HPKC009> dItems = dao.query("HPKC009.query", new HashMap<>());
Map<String, HPKC009> dItemMap = dItems.stream().collect(Collectors.toMap(item ->
item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#"
+ item.getInventType() + "#" + item.getInventCode(), item -> item));
// 根据期末库存生成收发存对象
for (HPKC003 aItem : aItems) {
String key = aItem.getCompanyCode() + "#" + aItem.getDepCode() + "#"
+ aItem.getWarehouseCode() + "#" + aItem.getMaterialType() + "#"
+ aItem.getMaterialCode();
HPKC009 kc009 = BeanUtils.copy(aItem, HPKC009.class);
kc009.setKcType(HPConstant.KcType.SC);
kc009.setDateType(CommonConstant.DateType.DAY);
kc009.setDateProc(queryMap.get("yesterday").toString());
// 期末
kc009.setEndAmount(new BigDecimal(aItem.getNumber()));
kc009.setEndWeight(new BigDecimal(aItem.getWeight()));
// 收入
HPKC003 bItem = bItemMap.get(key);
kc009.setStockinAmount(bItem == null ? BigDecimal.ZERO : new BigDecimal(bItem.getNumber()));
kc009.setStockinWeight(bItem == null ? BigDecimal.ZERO : new BigDecimal(bItem.getWeight()));
// 发出
HPKC004 cItem = cItemMap.get(key);
kc009.setStockoutAmount(cItem == null ? BigDecimal.ZERO : cItem.getAmount());
kc009.setStockoutWeight(cItem == null ? BigDecimal.ZERO : cItem.getWeight());
// 期初
HPKC009 dItem = dItemMap.get(key);
if (dItem != null) {
kc009.setInitAmount(dItem.getEndAmount());
kc009.setInitWeight(dItem.getEndWeight());
} else {
kc009.setInitAmount(kc009.getEndAmount().add(kc009.getStockoutAmount())
.subtract(kc009.getStockinAmount()));
kc009.setInitWeight(kc009.getEndWeight().add(kc009.getStockoutWeight())
.subtract(kc009.getStockinWeight()));
}
kc009Map.put(key, kc009);
}
return kc009Map.values().stream().collect(Collectors.toList());
}
/**
* 按天统计其他库存
*
* @param queryMap
* @return
*/
private List<HPKC009> statDayQt(Map queryMap) {
Map<String, HPKC009> kc009Map = new HashMap();
// 1.1、期末库存
List<HPKC006> aItems = dao.query("HPKC006.statDay", new HashMap<>());
// 1.2、收入
queryMap.put("createdTimeFrom", queryMap.get("yesterday") + "000000");
queryMap.put("createdTimeTo", queryMap.get("yesterday") + "235959");
List<HPKC006> bItems = dao.query("HPKC006.statDay", queryMap);
Map<String, HPKC006> bItemMap = bItems.stream().collect(Collectors.toMap(item ->
item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#"
+ item.getMatType() + "#" + item.getMatCode(), item -> item));
// 1.3、发出
List<HPKC007> cItems = dao.query("HPKC007.statDay", queryMap);
Map<String, HPKC007> cItemMap = cItems.stream().collect(Collectors.toMap(item ->
item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#"
+ item.getMatType() + "#" + item.getMatCode(), item -> item));
// 1.4、期初库存
queryMap.put("createdTimeFrom", queryMap.get("beforeDay") + "000000");
queryMap.put("createdTimeTo", queryMap.get("beforeDay") + "235959");
queryMap.put("kcType", HPConstant.KcType.QT);
List<HPKC009> dItems = dao.query("HPKC009.query", new HashMap<>());
Map<String, HPKC009> dItemMap = dItems.stream().collect(Collectors.toMap(item ->
item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#"
+ item.getInventType() + "#" + item.getInventCode(), item -> item));
// 根据期末库存生成收发存对象
for (HPKC006 aItem : aItems) {
String key = aItem.getCompanyCode() + "#" + aItem.getDepCode() + "#"
+ aItem.getWhCode() + "#" + aItem.getMatType() + "#" + aItem.getMatCode();
HPKC009 kc009 = BeanUtils.copy(aItem, HPKC009.class);
kc009.setKcType(HPConstant.KcType.QT);
kc009.setDateType(CommonConstant.DateType.DAY);
kc009.setDateProc(queryMap.get("yesterday").toString());
// 期末
kc009.setEndAmount(aItem.getAmount());
kc009.setEndWeight(aItem.getWeight());
// 收入
HPKC006 bItem = bItemMap.get(key);
kc009.setStockinAmount(bItem == null ? BigDecimal.ZERO : bItem.getAmount());
kc009.setStockinWeight(bItem == null ? BigDecimal.ZERO : bItem.getWeight());
// 发出
HPKC007 cItem = cItemMap.get(key);
kc009.setStockoutAmount(cItem == null ? BigDecimal.ZERO : cItem.getAmount());
kc009.setStockoutWeight(cItem == null ? BigDecimal.ZERO : cItem.getWeight());
// 期初
HPKC009 dItem = dItemMap.get(key);
if (dItem != null) {
kc009.setInitAmount(dItem.getEndAmount());
kc009.setInitWeight(dItem.getEndWeight());
} else {
kc009.setInitAmount(kc009.getEndAmount().add(kc009.getStockoutAmount())
.subtract(kc009.getStockinAmount()));
kc009.setInitWeight(kc009.getEndWeight().add(kc009.getStockoutWeight())
.subtract(kc009.getStockinWeight()));
}
kc009Map.put(key, kc009);
}
return kc009Map.values().stream().collect(Collectors.toList());
}
}
......@@ -41,6 +41,9 @@
<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">
<isNotEmpty property="orderBy">
$orderBy$
......@@ -49,7 +52,6 @@
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
......@@ -170,4 +172,23 @@
WHERE ID = #id#
</update>
<!-- 按天统计 -->
<select id="statDay" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC001">
SELECT
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
WH_CODE AS "whCode",
MATERIAL_TYPE AS "materialType",
MATERIAL_CODE AS "materialCode",
SPEC AS "spec",
COALESCE(SUM(QUANTITY), 0) AS "quantity",
COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hpjxSchema}.T_HPKC001
WHERE 1=1
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, MATERIAL_TYPE, MATERIAL_CODE, SPEC
</select>
</sqlMap>
......@@ -170,4 +170,23 @@
WHERE ID = #id#
</update>
<!-- 按天统计 -->
<select id="statDay" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC002">
SELECT
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
WH_CODE AS "whCode",
MATERIAL_TYPE AS "materialType",
MATERIAL_CODE AS "materialCode",
SPEC AS "spec",
COALESCE(SUM(QUANTITY), 0) AS "quantity",
COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hpjxSchema}.T_HPKC002
WHERE 1=1
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, MATERIAL_TYPE, MATERIAL_CODE, SPEC
</select>
</sqlMap>
......@@ -25,7 +25,7 @@
<sqlMap namespace="HPKC003">
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.kc.domain.THpkc003">
resultClass="com.baosight.hpjx.hp.kc.domain.HPKC003">
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
......@@ -173,4 +173,22 @@
ID = #id#
</update>
<!-- 按天统计 -->
<select id="statDay" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC003">
SELECT
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
WAREHOUSE_CODE AS "warehouseCode",
MATERIAL_TYPE AS "materialType",
MATERIAL_CODE AS "materialCode",
COALESCE(SUM(NUMBER), 0) AS "number",
COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hpjxSchema}.T_HPKC003
WHERE 1=1
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WAREHOUSE_CODE, MATERIAL_TYPE, MATERIAL_CODE
</select>
</sqlMap>
......@@ -247,4 +247,22 @@
ID = #id#
</update>
<!-- 按天统计 -->
<select id="statDay" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC004">
SELECT
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
WH_CODE AS "whCode",
MAT_TYPE AS "matType",
MAT_CODE AS "matCode",
COALESCE(SUM(AMOUNT), 0) AS "amount",
COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hpjxSchema}.T_HPKC004
WHERE 1=1
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, MAT_TYPE, MAT_CODE
</select>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-01-11 15:32:44
Version : 1.0
schema : hpjx
tableName : T_HPKC005
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
RECEIPT_DATE VARCHAR NOT NULL,
STATISTICAL_NUMBER VARCHAR NOT NULL,
WH_CODE VARCHAR NOT NULL,
WH_NAME VARCHAR NOT NULL,
MAT_TYPE VARCHAR,
MAT_CODE VARCHAR,
MAT_NAME VARCHAR,
BOOK_AMOUNT DECIMAL,
BOOK_WEIGHT DECIMAL,
ENTITY_AMOUNT DECIMAL,
ENTITY_WEIGHT DECIMAL,
DIFF_AMOUNT DECIMAL,
DIFF_WEIGHT DECIMAL,
STATUS TINYINT NOT NULL,
NOTES VARCHAR,
CREATED_BY VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_TIME VARCHAR,
DEP_CODE VARCHAR
-->
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPKC005">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="statisticalNumber">
STATISTICAL_NUMBER = #statisticalNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matType">
MAT_TYPE = #matType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matCode">
MAT_CODE = #matCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matName">
MAT_NAME = #matName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="bookAmount">
BOOK_AMOUNT = #bookAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="bookWeight">
BOOK_WEIGHT = #bookWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="entityAmount">
ENTITY_AMOUNT = #entityAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="entityWeight">
ENTITY_WEIGHT = #entityWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="diffAmount">
DIFF_AMOUNT = #diffAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="diffWeight">
DIFF_WEIGHT = #diffWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="notes">
NOTES = #notes#
</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>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.kc.domain.HPKC005">
SELECT
<sql id="column">
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
RECEIPT_DATE as "receiptDate", <!-- 单据日期 -->
STATISTICAL_NUMBER as "statisticalNumber", <!-- 盘点单号 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
MAT_TYPE as "matType", <!-- 物料类型 -->
MAT_CODE as "matCode", <!-- 物料编码 -->
MAT_NAME as "matName", <!-- 物料名称 -->
INVENT_TYPE as "inventType", <!-- 物料类型 -->
INVENT_CODE as "inventCode", <!-- 物料编码 -->
INVENT_NAME as "inventName", <!-- 物料名称 -->
SPEC as "spec", <!-- 规格 -->
BOOK_AMOUNT as "bookAmount", <!-- 账面数量 -->
BOOK_WEIGHT as "bookWeight", <!-- 账面重量 -->
ENTITY_AMOUNT as "entityAmount", <!-- 实物数量 -->
......@@ -123,47 +26,9 @@
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DEP_CODE as "depCode" <!-- 部门编码 -->
FROM hpjx.T_HPKC005 WHERE 1=1
<isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matType">
MAT_TYPE = #matType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME LIKE '%' || #whName# || '%'
</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 id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.T_HPKC005 WHERE 1=1
<isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matType">
MAT_TYPE = #matType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME LIKE '%' || #whName# || '%'
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
</select>
</sql>
<!--
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
......@@ -180,34 +45,16 @@
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matType">
MAT_TYPE = #matType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matCode">
MAT_CODE = #matCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matName">
MAT_NAME = #matName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="bookAmount">
BOOK_AMOUNT = #bookAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="bookWeight">
BOOK_WEIGHT = #bookWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="entityAmount">
ENTITY_AMOUNT = #entityAmount#
WH_NAME LIKE '%' || #whName# || '%'
</isNotEmpty>
<isNotEmpty prepend=" AND " property="entityWeight">
ENTITY_WEIGHT = #entityWeight#
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="diffAmount">
DIFF_AMOUNT = #diffAmount#
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="diffWeight">
DIFF_WEIGHT = #diffWeight#
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
......@@ -230,7 +77,42 @@
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
-->
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC005">
SELECT <include refid="column"/>
FROM hpjx.T_HPKC005
WHERE 1=1
<include refid="condition"/>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.T_HPKC005
WHERE 1=1
<include refid="condition"/>
</select>
<!-- 查询统计 -->
<select id="querySum" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC005">
SELECT
COALESCE(SUM(BOOK_AMOUNT), 0) AS "bookAmount", <!-- 账面数量 -->
COALESCE(SUM(BOOK_WEIGHT), 0) AS "bookWeight", <!-- 账面重量 -->
COALESCE(SUM(ENTITY_AMOUNT), 0) AS "entityAmount", <!-- 实物数量 -->
COALESCE(SUM(ENTITY_WEIGHT), 0) AS "entityWeight", <!-- 实物重量 -->
COALESCE(SUM(DIFF_AMOUNT), 0) AS "diffAmount", <!-- 差异数量 -->
COALESCE(SUM(DIFF_WEIGHT), 0) AS "diffWeight" <!-- 差异重量 -->
FROM ${hpjxSchema}.T_HPKC005
WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO hpjx.T_HPKC005 (
......@@ -239,9 +121,10 @@
STATISTICAL_NUMBER, <!-- 盘点单号 -->
WH_CODE, <!-- 仓库编码 -->
WH_NAME, <!-- 仓库名称 -->
MAT_TYPE, <!-- 物料类型 -->
MAT_CODE, <!-- 物料编码 -->
MAT_NAME, <!-- 物料名称 -->
INVENT_TYPE, <!-- 物料类型 -->
INVENT_CODE, <!-- 物料编码 -->
INVENT_NAME, <!-- 物料名称 -->
SPEC, <!-- 规格 -->
BOOK_AMOUNT, <!-- 账面数量 -->
BOOK_WEIGHT, <!-- 账面重量 -->
ENTITY_AMOUNT, <!-- 实物数量 -->
......@@ -255,41 +138,37 @@
UPDATED_BY, <!-- 更新人 -->
UPDATED_TIME, <!-- 更新时间 -->
DEP_CODE <!-- 部门编码 -->
) VALUES (
#companyCode#, #receiptDate#, #statisticalNumber#, #whCode#, #whName#, #inventType#,
#inventCode#, #inventName#, #spec#, #bookAmount#, #bookWeight#, #entityAmount#, #entityWeight#,
#diffAmount#, #diffWeight#, 0, #notes#, #createdBy#, #createdTime#, #updatedBy#,
#updatedTime#, #depCode#
)
VALUES (#companyCode#, #receiptDate#, #statisticalNumber#, #whCode#, #whName#, #matType#, #matCode#, #matName#, #bookAmount#, #bookWeight#, #entityAmount#, #entityWeight#, #diffAmount#, #diffWeight#, 0, #notes#, #createdBy#, #createdTime#, #updatedBy#, #updatedTime#, #depCode#)
</insert>
<delete id="delete">
DELETE FROM hpjx.T_HPKC005 WHERE
ID = #id#
DELETE FROM hpjx.T_HPKC005 WHERE ID = #id#
</delete>
<update id="update">
UPDATE hpjx.T_HPKC005
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 -->
RECEIPT_DATE = #receiptDate#, <!-- 单据日期 -->
STATISTICAL_NUMBER = #statisticalNumber#, <!-- 盘点单号 -->
WH_CODE = #whCode#, <!-- 仓库编码 -->
WH_NAME = #whName#, <!-- 仓库名称 -->
MAT_TYPE = #matType#, <!-- 物料类型 -->
MAT_CODE = #matCode#, <!-- 物料编码 -->
MAT_NAME = #matName#, <!-- 物料名称 -->
INVENT_TYPE = #inventType#, <!-- 物料类型 -->
INVENT_CODE = #inventCode#, <!-- 物料编码 -->
INVENT_NAME = #inventName#, <!-- 物料名称 -->
SPEC = #spec#, <!-- 规格 -->
BOOK_AMOUNT = #bookAmount#, <!-- 账面数量 -->
BOOK_WEIGHT = #bookWeight#, <!-- 账面重量 -->
ENTITY_AMOUNT = #entityAmount#, <!-- 实物数量 -->
ENTITY_WEIGHT = #entityWeight#, <!-- 实物重量 -->
DIFF_AMOUNT = #diffAmount#, <!-- 差异数量 -->
DIFF_WEIGHT = #diffWeight#, <!-- 差异重量 -->
STATUS = #status#, <!-- 单据状态 0待审核 1已审核 -->
NOTES = #notes#, <!-- 备注 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DEP_CODE = #depCode# <!-- 部门编码 -->
WHERE
ID = #id#
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE ID = #id#
</update>
</sqlMap>
......@@ -120,4 +120,22 @@
ID = #id#
</update>
<!-- 按天统计 -->
<select id="statDay" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC006">
SELECT
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
WH_CODE AS "whCode",
MAT_TYPE AS "matType",
MAT_CODE AS "matCode",
COALESCE(SUM(AMOUNT), 0) AS "amount",
COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hpjxSchema}.T_HPKC006
WHERE 1=1
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, MAT_TYPE, MAT_CODE
</select>
</sqlMap>
......@@ -163,4 +163,22 @@
ID = #id#
</update>
<!-- 按天统计 -->
<select id="statDay" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC007">
SELECT
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
WH_CODE AS "whCode",
MAT_TYPE AS "matType",
MAT_CODE AS "matCode",
COALESCE(SUM(AMOUNT), 0) AS "amount",
COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hpjxSchema}.T_HPKC004
WHERE 1=1
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, MATERIAL_TYPE, MATERIAL_CODE
</select>
</sqlMap>
<?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">
<!-- table information
Generate time : 2024-01-09 18:54:54
Version : 1.0
tableName :hpjx.t_hpkc008
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
DATEMONTH VARCHAR NOT NULL,
STATISTICAL_NUMBER VARCHAR NOT NULL,
MATERIAL_CODE VARCHAR NOT NULL,
MATERIAL_NAME VARCHAR NOT NULL,
UNIT VARCHAR,
AMOUNT DECIMAL NOT NULL,
PRICE DECIMAL NOT NULL,
TOTAL_PRICE DECIMAL NOT NULL,
NOTES VARCHAR,
CREATED_BY VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_TIME VARCHAR
-->
<sqlMap namespace="HPKC008">
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.kc.domain.HPKC008">
SELECT
<sql id="column">
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DATEMONTH as "datemonth", <!-- 月份 -->
......@@ -40,7 +18,9 @@
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime" <!-- 更新时间 -->
FROM hpjx.t_hpkc008 WHERE 1=1
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
......@@ -50,15 +30,21 @@
<isNotEmpty prepend=" AND " property="statisticalNumber">
STATISTICAL_NUMBER = #statisticalNumber#
</isNotEmpty>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC008">
SELECT
<include refid="column"/>
FROM hpjx.t_hpkc008 WHERE 1=1
<include refid="condition"/>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
ID DESC
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
......@@ -68,37 +54,36 @@
</isNotEmpty>
</select>
<!-- 查询统计 -->
<select id="querySum" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC008">
SELECT
COALESCE(SUM(AMOUNT), 0) AS "amount", <!-- 数量 -->
COALESCE(SUM(TOTAL_PRICE), 0) AS "totalPrice" <!-- 金额 -->
FROM ${hpjxSchema}.t_hpkc008
WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO hpjx.t_hpkc008 (
COMPANY_CODE, <!-- 企业编码 预留 -->
DATEMONTH, <!-- 月份 -->
STATISTICAL_NUMBER, <!-- 统计单单号 -->
MATERIAL_CODE, <!-- 物料编码 -->
MATERIAL_NAME, <!-- 物料名称 -->
UNIT, <!-- 单位 -->
AMOUNT, <!-- 数量 -->
PRICE, <!-- 单价 -->
TOTAL_PRICE, <!-- 金额 -->
NOTES, <!-- 备注 -->
CREATED_BY, <!-- 创建人 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_TIME <!-- 更新时间 -->
COMPANY_CODE, DATEMONTH, STATISTICAL_NUMBER, MATERIAL_CODE,
MATERIAL_NAME, UNIT, AMOUNT, PRICE, TOTAL_PRICE, NOTES,
CREATED_BY, CREATED_TIME
) VALUES (
#companyCode#, #datemonth#, #statisticalNumber#, #materialCode#, #materialName#,
#unit#, #amount#, #price#, #totalPrice#, #notes#, #createdBy#, #createdTime#,
#updatedBy#, #updatedTime#
)
VALUES (#companyCode#, #datemonth#, #statisticalNumber#, #materialCode#, #materialName#, #unit#, #amount#, #price#, #totalPrice#, #notes#, #createdBy#, #createdTime#, #updatedBy#, #updatedTime#)
</insert>
<delete id="delete">
DELETE FROM hpjx.t_hpkc008 WHERE
ID = #id#
DELETE FROM hpjx.t_hpkc008 WHERE ID = #id#
</delete>
<update id="update">
UPDATE hpjx.t_hpkc008
SET
DATEMONTH = #datemonth#, <!-- 月份 -->
STATISTICAL_NUMBER = #statisticalNumber#, <!-- 统计单单号 -->
MATERIAL_CODE = #materialCode#, <!-- 物料编码 -->
MATERIAL_NAME = #materialName#, <!-- 物料名称 -->
UNIT = #unit#, <!-- 单位 -->
......@@ -108,8 +93,7 @@
NOTES = #notes#, <!-- 备注 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE
ID = #id#
WHERE ID = #id#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPKC009">
<sql id="column">
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
KC_TYPE as "kcType", <!-- 库存类型:CG:采购,SC:生产,QT:其他 -->
DATE_TYPE as "dateType", <!-- 日期类型:DAY:天,MONTH:月 -->
DATE_PROC as "dateProc", <!-- 日期 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
SPEC as "spec", <!-- 规格 -->
INIT_AMOUNT as "initAmount", <!-- 期初数量 -->
INIT_WEIGHT as "initWeight", <!-- 期初重量 -->
STOCKIN_AMOUNT as "stockinAmount", <!-- 入库数量 -->
STOCKIN_WEIGHT as "stockinWeight", <!-- 入库重量 -->
STOCKOUT_AMOUNT as "stockoutAmount", <!-- 出库数量 -->
STOCKOUT_WEIGHT as "stockoutWeight", <!-- 出库重量 -->
END_AMOUNT as "endAmount", <!-- 期末数量 -->
END_WEIGHT as "endWeight", <!-- 期末重量 -->
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="dateType">
DATE_TYPE = #dateType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="datemonth">
DATEMONTH = #datemonth#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</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="spec">
SPEC = #spec#
</isNotEmpty>
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
</sql>
<!-- 查询 -->
<select id="query" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC009">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPKC009
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPKC009 WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPKC009 (
COMPANY_CODE, DEP_CODE, KC_TYPE, DATE_TYPE, DATE_PROC, WH_CODE, WH_NAME, INVENT_TYPE,
INVENT_CODE, INVENT_NAME, SPEC, INIT_AMOUNT, INIT_WEIGHT, STOCKIN_AMOUNT,
STOCKIN_WEIGHT, STOCKOUT_AMOUNT, STOCKOUT_WEIGHT, END_AMOUNT, END_WEIGHT,
CREATED_BY, CREATED_NAME, CREATED_TIME
) VALUES (
#companyCode#, #depCode#, #kcType#, #dateType#, #dateProc#, #whCode#, #whName#, #inventType#,
#inventCode#, #inventName#, #spec#, #initAmount#, #initWeight#, #stockinAmount#,
#stockinWeight#, #stockoutAmount#, #stockoutWeight#, #endAmount#, #endWeight#,
#createdBy#, #createdName#, #createdTime#
)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPKC009 WHERE ID = #id#
</delete>
</sqlMap>
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;
/**
* Project: <br>
* Title:THppz010.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-01-18 17:09:53 create
*/
public class HPPZ010 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_SUBJECT_ID = "subjectId"; /* 授权主体ID*/
public static final String FIELD_SUBJECT_TYPE = "subjectType"; /* 授权主体类别*/
public static final String FIELD_OBJECT_ID = "objectId"; /* 授权客体ID*/
public static final String FIELD_OBJECT_TYPE = "objectType"; /* 授权客体类别*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 更新人*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String COL_ID = "ID";
public static final String COL_SUBJECT_ID = "SUBJECT_ID"; /* 授权主体ID*/
public static final String COL_SUBJECT_TYPE = "SUBJECT_TYPE"; /* 授权主体类别*/
public static final String COL_OBJECT_ID = "OBJECT_ID"; /* 授权客体ID*/
public static final String COL_OBJECT_TYPE = "OBJECT_TYPE"; /* 授权客体类别*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
private Long id = null;
private String subjectId = " "; /* 授权主体ID*/
private String subjectType = " "; /* 授权主体类别*/
private String objectId = " "; /* 授权客体ID*/
private String objectType = " "; /* 授权客体类别*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SUBJECT_ID);
eiColumn.setDescName("授权主体ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SUBJECT_TYPE);
eiColumn.setDescName("授权主体类别");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_OBJECT_ID);
eiColumn.setDescName("授权客体ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_OBJECT_TYPE);
eiColumn.setDescName("授权客体类别");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("更新人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HPPZ010() {
initMetaData();
}
/**
* get the id .
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id .
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the subjectId - 授权主体ID.
* @return the subjectId
*/
public String getSubjectId() {
return this.subjectId;
}
/**
* set the subjectId - 授权主体ID.
*
* @param subjectId - 授权主体ID
*/
public void setSubjectId(String subjectId) {
this.subjectId = subjectId;
}
/**
* get the subjectType - 授权主体类别.
* @return the subjectType
*/
public String getSubjectType() {
return this.subjectType;
}
/**
* set the subjectType - 授权主体类别.
*
* @param subjectType - 授权主体类别
*/
public void setSubjectType(String subjectType) {
this.subjectType = subjectType;
}
/**
* get the objectId - 授权客体ID.
* @return the objectId
*/
public String getObjectId() {
return this.objectId;
}
/**
* set the objectId - 授权客体ID.
*
* @param objectId - 授权客体ID
*/
public void setObjectId(String objectId) {
this.objectId = objectId;
}
/**
* get the objectType - 授权客体类别.
* @return the objectType
*/
public String getObjectType() {
return this.objectType;
}
/**
* set the objectType - 授权客体类别.
*
* @param objectType - 授权客体类别
*/
public void setObjectType(String objectType) {
this.objectType = objectType;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称.
*
* @param createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人.
*
* @param updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 更新人名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 更新人名称.
*
* @param updatedName - 更新人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 更新时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间.
*
* @param updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setSubjectId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SUBJECT_ID)), subjectId));
setSubjectType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SUBJECT_TYPE)), subjectType));
setObjectId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_OBJECT_ID)), objectId));
setObjectType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_OBJECT_TYPE)), objectType));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_SUBJECT_ID, StringUtils.toString(subjectId, eiMetadata.getMeta(FIELD_SUBJECT_ID)));
map.put(FIELD_SUBJECT_TYPE, StringUtils.toString(subjectType, eiMetadata.getMeta(FIELD_SUBJECT_TYPE)));
map.put(FIELD_OBJECT_ID, StringUtils.toString(objectId, eiMetadata.getMeta(FIELD_OBJECT_ID)));
map.put(FIELD_OBJECT_TYPE, StringUtils.toString(objectType, eiMetadata.getMeta(FIELD_OBJECT_TYPE)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
return map;
}
}
......@@ -5,14 +5,18 @@ import com.baosight.hpjx.common.InitiateModeEnum;
import com.baosight.hpjx.common.InventTypeEnun;
import com.baosight.hpjx.hp.pz.domain.THppz006;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
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.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
......@@ -133,4 +137,21 @@ public class ServiceHPPZ006 extends ServiceBase {
return eiInfo;
}
/**
* 规格下拉框
*
* @param inInfo
* @return
*/
public EiInfo queryComboBoxSpec(EiInfo inInfo) {
try {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.INVENT_SPEC_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "规格下拉框");
}
return inInfo;
}
}
package com.baosight.hpjx.hp.pz.service;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ009;
import com.baosight.hpjx.hp.pz.domain.HPPZ010;
import com.baosight.hpjx.hp.xs.tools.HPXSUserTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.RsaUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import com.baosight.xservices.xs.constants.LoginConstants;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 数据授权
*
* @author:songx
* @date:2024/1/18,17:15
*/
public class ServiceHPPZ010 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPPZ010().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPSqlConstant.HPPZ010.QUERY, new HPPZ010());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HPPZ009 fPz009 = new HPPZ009();
fPz009.fromMap(resultRows.get(i));
if (fPz009.getId() == null || fPz009.getId() == 0) {
this.add(fPz009);
} else {
this.modify(fPz009);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param resultRows
*/
private void checkSaveData(List<Map> resultRows) {
// 数据校验
for (int i = 0; i < resultRows.size(); i++) {
HPPZ009 hppz009 = new HPPZ009();
hppz009.fromMap(resultRows.get(i));
AssertUtils.isEmpty(hppz009.getCompanyName(), "企业名称不能为空");
AssertUtils.isNull(hppz009.getValidFlag(), "是否启用不能为空");
}
}
/**
* 新增企业信息
*
* @param fPz009
* @throws Exception
*/
private void add(HPPZ009 fPz009) throws Exception {
// 生成企业编码
fPz009.setCompanyCode(SequenceGenerator.getNextSequence("COMPANY_CODE"));
fPz009.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert("HPPZ009.insert", fPz009);
// 默认新增企业管理员账号
this.initUser(fPz009);
// 关联企业管理员角色
this.insertGroupMember(fPz009);
}
/**
* 修改数据
*
* @param fPz009
*/
private void modify(HPPZ009 fPz009) {
DaoUtils.update("HPPZ009.update", fPz009);
}
/**
* 新增操作.
*
* @param inInfo
* @return
*/
@Override
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 数据写入
for (int i = 0; i < resultRows.size(); i++) {
HPPZ009 fPz009 = new HPPZ009();
fPz009.fromMap(resultRows.get(i));
this.add(fPz009);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 初始化用户
*
* @param hppz009
*/
private void initUser(HPPZ009 hppz009) throws Exception {
String companyCode = hppz009.getCompanyCode();
Map inInfoRowMap = new HashMap();
inInfoRowMap.put("userId", companyCode);
inInfoRowMap.put("loginName", companyCode);
inInfoRowMap.put("userName", hppz009.getCompanyName());
// 使用公钥加密密码
String password = RsaUtils.encryptByPublicKey(LoginConstants.rsaPublicKey, companyCode);
inInfoRowMap.put("password", password);
inInfoRowMap.put("rePass", password);
inInfoRowMap.put("email", " ");
inInfoRowMap.put("mobile", " ");
inInfoRowMap.put("companyCode", hppz009.getCompanyCode());
EiInfo inInfo = new EiInfo();
inInfo.addBlock("details").addRow(inInfoRowMap);
inInfo.set(EiConstant.serviceName, "XS0102");
inInfo.set(EiConstant.methodName, "insert");
EiInfo outInfo = XLocalManager.call(inInfo);
if (outInfo.getStatus() < 0) {
throw new PlatException(outInfo.getMsg());
}
}
/**
* 用户关联角色
*
* @param hppz009
*/
private void insertGroupMember(HPPZ009 hppz009) {
String companyCode = hppz009.getCompanyCode();
Map inInfoRowMap = new HashMap();
inInfoRowMap.put("memberId", companyCode);
inInfoRowMap.put("memberName", hppz009.getCompanyName());
// TODO 该用户组固定不能修改,代码中其他地方有写死的地方
inInfoRowMap.put("parentId", "companyManage");
inInfoRowMap.put("parentName", "企业管理员");
inInfoRowMap.put("memberType", "USER");
EiInfo inInfo = new EiInfo();
inInfo.addBlock(EiConstant.resultBlock).addRow(inInfoRowMap);
inInfo.set(EiConstant.serviceName, "XS03");
inInfo.set(EiConstant.methodName, "insert");
EiInfo outInfo = XLocalManager.call(inInfo);
if (outInfo.getStatus() < 0) {
throw new PlatException(outInfo.getMsg());
}
}
/**
* 修改操作
*
* @param inInfo
* @return
*/
public EiInfo update(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
for (int i = 0; i < resultRows.size(); i++) {
HPPZ009 hppz009 = new HPPZ009();
hppz009.fromMap(resultRows.get(i));
DaoUtils.update("HPPZ009.update", hppz009);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HPPZ009 fPz009 = new HPPZ009();
fPz009.fromMap(resultRows.get(i));
// 校验企业下是否存在用户
int count = HPXSUserTools.countByCompany(fPz009.getCompanyCode());
if (count > 0) {
throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户",
fPz009.getCompanyName()));
}
DaoUtils.update("HPPZ009.delete", fPz009);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
}
......@@ -195,4 +195,19 @@
</isNotEmpty>
ORDER BY INVENT_CODE
</select>
<!-- 规格下拉框 -->
<select id="queryComboBoxSpec" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
SPEC AS "spec"
FROM hpjx.t_hppz006 WHERE STATUS=1
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
ORDER BY ID
</select>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPPZ010">
<sql id="column">
ID as "id",
SUBJECT_ID as "subjectId", <!-- 授权主体ID -->
SUBJECT_TYPE as "subjectType", <!-- 授权主体类别 -->
OBJECT_ID as "objectId", <!-- 授权客体ID -->
OBJECT_TYPE as "objectType", <!-- 授权客体类别 -->
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="subjectId">
SUBJECT_ID = #subjectId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="subjectType">
SUBJECT_TYPE = #subjectType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="objectId">
OBJECT_ID = #objectId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="objectType">
OBJECT_TYPE = #objectType#
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ010">
SELECT <include refid="column"/>
FROM ${hpjxSchema}.T_HPPZ010
WHERE 1=1
<include refid="condition" />
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPPZ010 WHERE 1=1
<include refid="condition" />
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPPZ010 (
SUBJECT_ID, <!-- 授权主体ID -->
SUBJECT_TYPE, <!-- 授权主体类别 -->
OBJECT_ID, <!-- 授权客体ID -->
OBJECT_TYPE, <!-- 授权客体类别 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME <!-- 创建时间 -->
) VALUES (
#subjectId#, #subjectType#, #objectId#, #objectType#, #createdBy#,
#createdName#, #createdTime#
)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPPZ010 WHERE ID = #id#
</delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPPZ010
SET
SUBJECT_ID = #subjectId#, <!-- 授权主体ID -->
SUBJECT_TYPE = #subjectType#, <!-- 授权主体类别 -->
OBJECT_ID = #objectId#, <!-- 授权客体ID -->
OBJECT_TYPE = #objectType#, <!-- 授权客体类别 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE ID = #id#
</update>
</sqlMap>
package com.baosight.hpjx.hp.zl.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.HPKC008;
import com.baosight.hpjx.hp.pz.domain.THppz004;
import com.baosight.hpjx.hp.sc.domain.THPSC001;
import com.baosight.hpjx.hp.sc.domain.THPSC002;
import com.baosight.hpjx.hp.zl.domain.HPZL001;
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.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.MapUtils;
import java.util.*;
......@@ -23,15 +34,10 @@ public class ServiceHPZL001 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
HPZL001 HPZL001 = new HPZL001();
EiInfo outInfo = super.initLoad(inInfo, HPZL001);
outInfo.addBlock(EiConstant.queryBlock).setCell(0,"receiptDate",CommonMethod.getCurrentSameYearMonthDay());
outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
CommonMethod.initBlock(outInfo,
Arrays.asList(
DdynamicEnum.PROJ_RECORD_BLOCK_ID),
new HashMap<String,String>(1) {{
put("status", "1" );
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID),
new HashMap<String,String>(1) {{put("status", "1" );
}});
return outInfo;
}
......@@ -40,11 +46,16 @@ public class ServiceHPZL001 extends ServiceBase {
*/
@Override
public EiInfo query(EiInfo inInfo) {
String receiptDate = inInfo.getCellStr(EiConstant.queryBlock,0,"receiptDate");
inInfo.setCell(EiConstant.queryBlock,0,"receiptDate", StringUtil.removeHorizontalLine(receiptDate));
/* 调用EI查询方法.*/
return super.query(inInfo, "HPZL001.query", new HPZL001());
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String receiptDate = MapUtils.getString(queryMap, "receiptDate");
queryMap.put("receiptDate", StringUtil.removeSpecifiedCharacter(receiptDate,
StringUtil.DEFAULT_CHARACTER_TO_BE_REMOVED));
inInfo = super.query(inInfo, "HPZL001.query", new HPKC008());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
......@@ -52,16 +63,29 @@ public class ServiceHPZL001 extends ServiceBase {
*/
@Override
public EiInfo insert(EiInfo inInfo) {
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
for (int i = 0; i < inInfo.getBlock(EiConstant.resultBlock).getRowCount(); i++) {
String itemName =inInfo.getCellStr(EiConstant.resultBlock,i,"itemName");
String[] str = itemName.split("-");
inInfo.setCell(EiConstant.resultBlock,i,"itemCode", str[0]);
inInfo.setCell(EiConstant.resultBlock,i,"itemName", str[1]);
String receiptDate = inInfo.getCellStr(EiConstant.resultBlock,i,"receiptDate");
inInfo.setCell(EiConstant.resultBlock,i,"receiptDate", StringUtil.removeHorizontalLine(receiptDate));
try {
CommonMethod.creatorInfo(inInfo, EiConstant.resultBlock);
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
Map resultRow = resultRows.get(i);
// 去除日期字符串中的-
String datemonth = MapUtils.getString(resultRow, "receiptDate");
resultRow.put("datemonth", StringUtil.removeHorizontalLine(datemonth));
// 项目名称
Map params1 = new HashMap<>();
params1.put("itemCode", MapUtils.getString(resultRow, "itemCode"));
List<THPSC001> query1 = dao.query("HPSC001.query", params1);
resultRow.put("itemName", query1.get(0).getProjName());
// 生成单据号
resultRow.put("chkBillno", SequenceGenerator.getNextSequence(
HPConstant.SequenceId.HPZL001_NUMBER));
DaoUtils.insert("HPZL001.insert", resultRow);
}
return super.insert(inInfo,"HPZL001.insert");
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
......@@ -131,13 +155,29 @@ public class ServiceHPZL001 extends ServiceBase {
public EiInfo operator(EiInfo inInfo) {
HPZL001 HPZL001 = new HPZL001();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
CommonMethod.updateuserInfo(inInfo,EiConstant.resultBlock);
return super.update(inInfo,"HPZL001.operator");
CommonMethod.updateuserInfo(inInfo, EiConstant.resultBlock);
return super.update(inInfo, "HPZL001.operator");
}
/**
* 导入数据
* 上传附件
*
* @param inInfo
* @return
*/
public EiInfo bindDocIdById(EiInfo inInfo) {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
try {
for (int i = 0; i < resultRows.size(); i++) {
Map resultRow = resultRows.get(i);
DaoUtils.update("HPZL001.updateAffix", resultRow);
}
inInfo.setMsg("更新附件成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "更新附件信息失败");
}
return inInfo;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<!-- table information
Generate time : 2024-01-10 14:47:08
Version : 1.0
tableName :hpjx.t_hpzl001
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
RECEIPT_DATE VARCHAR NOT NULL,
CHK_BILLNO VARCHAR NOT NULL,
ITEM_CODE VARCHAR NOT NULL,
ITEM_NAME VARCHAR NOT NULL,
UNIT VARCHAR,
DESC VARCHAR,
PRINC VARCHAR NOT NULL,
STATUS TINYINT NOT NULL,
AFFIX VARCHAR,
CREATED_BY VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_TIME VARCHAR,
DEP_CODE VARCHAR
-->
<sqlMap namespace="HPZL001">
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.zl.domain.HPZL001">
<select id="query" resultClass="com.baosight.hpjx.hp.zl.domain.HPZL001">
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
......@@ -63,10 +41,9 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
ID DESC
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
......@@ -76,57 +53,6 @@
</isNotEmpty>
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="chkBillno">
CHK_BILLNO = #chkBillno#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemCode">
ITEM_CODE = #itemCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemName">
ITEM_NAME = #itemName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unit">
UNIT = #unit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="desc">
NOTES = #notes#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="princ">
PRINC = #princ#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="affix">
AFFIX = #affix#
</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>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO hpjx.t_hpzl001 (
COMPANY_CODE, <!-- 企业编码 预留 -->
......@@ -141,19 +67,19 @@
AFFIX, <!-- 附件 -->
CREATED_BY, <!-- 创建人 -->
CREATED_TIME <!-- 创建时间 -->
) VALUES (
#companyCode#, #receiptDate#, #chkBillno#, #itemCode#, #itemName#, #unit#,
#notes#, #createdBy#, #status#, #affix#, #createdBy#, #createdTime#
)
VALUES (#companyCode#, #receiptDate#, #chkBillno#, #itemCode#, #itemName#, #unit#, #notes#, #createdBy#, #status#, #affix#, #createdBy#, #createdTime#)
</insert>
<delete id="delete">
DELETE FROM hpjx.t_hpzl001 WHERE
ID = #id#
DELETE FROM hpjx.t_hpzl001 WHERE ID = #id#
</delete>
<update id="update">
UPDATE hpjx.t_hpzl001
SET
RECEIPT_DATE = #receiptDate#, <!-- 单据日期 -->
CHK_BILLNO = #chkBillno#, <!-- 检查单号 -->
ITEM_CODE = #itemCode#, <!-- 项目号 -->
......@@ -165,19 +91,27 @@
AFFIX = #affix#, <!-- 附件 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE
ID = #id#
WHERE ID = #id#
</update>
<!-- 审核操作 -->
<update id="operator">
UPDATE hpjx.t_hpzl001
SET
STATUS = #status#, <!-- 单据状态 0待审核 1已审核 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE
ID = #id#
WHERE ID = #id#
</update>
<!-- 更新附件信息 -->
<update id="updateAffix">
UPDATE hpjx.t_hpzl001
SET
AFFIX = #affix#, <!-- 附件 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE ID = #id#
</update>
</sqlMap>
package com.baosight.hpjx.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
/**
* 实体类之间的属性复制
*
* @author:songx
* @date:2020/7/30,15:34
*/
public class BeanUtils extends org.springframework.beans.BeanUtils {
private static Logger logger = LoggerFactory.getLogger(BeanUtils.class);
/**
* 单个实体类之间的属性复制
*
* @param object
* @param clazz
* @param <T>
* @return
*/
public static <T> T copy(Object object, Class<T> clazz) {
return copy(object, clazz, false);
}
/**
* 单个对象实例化
*
* @param object
* @param clazz
* @param <T>
* @return
*/
public static <T> T copyOrEmpty(Object object, Class<T> clazz) {
return copy(object, clazz, true);
}
/**
* 单个对象实例化
*
* @param object
* @param clazz
* @param isNewEmpty 是否构建空对象,true:是
* @param <T>
* @return
*/
private static <T> T copy(Object object, Class<T> clazz, boolean isNewEmpty) {
if (object == null && !isNewEmpty) {
return null;
}
try {
T t = clazz.newInstance();
if (object != null) {
copyProperties(object, t);
}
return t;
} catch (Exception e) {
logger.error("clazz newInstance is error:{}", e.getMessage(), e);
return null;
}
}
/**
* 实体类之间的转换
*
* @param sources 来源
* @param clazz 目标对象
* @return
*/
public static <T> List<T> copy(Collection<?> sources, Class<T> clazz) {
return copy(sources, clazz, false);
}
/**
* 实体类之间的转换
*
* @param sources 来源
* @param clazz 目标对象
* @return
*/
public static <T> List<T> copyOrEmpty(Collection<?> sources, Class<T> clazz) {
return copy(sources, clazz, true);
}
/**
* 实体类之间的转换
*
* @param sources
* @param clazz
* @param isNewEmpty 是否构建空对象,true:是
* @param <T>
* @return
*/
private static <T> List<T> copy(Collection<?> sources, Class<T> clazz, boolean isNewEmpty) {
if (sources == null) {
return isNewEmpty ? Collections.emptyList() : null;
}
return sources.stream().map(source -> copy(source, clazz)).collect(Collectors.toList());
}
}
......@@ -33,18 +33,19 @@ public class LogUtils {
if (inInfo == null) {
return;
}
inInfo.setMsg(title.concat(",原因:"));
inInfo.setMsg(title);
if (e == null) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setDetailMsg("未知");
return;
}
// 由于平台调用链不支持查看detailMsg的消息内容,因此这里修改成往Msg中写错误信息
inInfo.setMsg(inInfo.getMsg().concat(e.getMessage()));
inInfo.setDetailMsg(e.getMessage());
if (e instanceof PlatException) {
inInfo.setMsg(inInfo.getMsg().concat(",原因:").concat(e.getMessage()));
inInfo.setStatus(EiConstant.STATUS_FAILURE);
} else {
inInfo.setMsg(inInfo.getMsg().concat(",原因参见详细错误描述!"));
inInfo.setStatus(EiConstant.STATUS_FAILURE);
}
}
......@@ -69,11 +70,9 @@ public class LogUtils {
if (e == null) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg(msg.concat("未知"));
inInfo.setDetailMsg("未知");
return;
}
inInfo.setMsg(msg.concat(e.getMessage()));
inInfo.setDetailMsg(e.getMessage());
if (e instanceof PlatException) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
} else {
......
......@@ -13,7 +13,7 @@ public class StringUtil {
/**
* 默认的待去除字符, 用于{@link }静态方法.
*/
private static final Character DEFAULT_CHARACTER_TO_BE_REMOVED = '-';
public static final Character DEFAULT_CHARACTER_TO_BE_REMOVED = '-';
/**
......
var inventNameGlobalData = [];
var specGlobalData = [];
$(function() {
var eiInfo = new EiInfo();
var globalData = [];
var day1 = new Date();
day1.setTime(day1.getTime());
var s1 = day1.getFullYear() + "-" + (day1.getMonth() + 1) + "-" + day1.getDate();
$("#inqu_status-0-receiptDate").val(s1);
// var day1 = new Date();
// day1.setTime(day1.getTime());
// var s1 = day1.getFullYear() + "-" + (day1.getMonth() + 1) + "-" + day1.getDate();
// $("#inqu_status-0-receiptDate").val(s1);
// 查询
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询
var dataSource;
eiInfo = new EiInfo();
EiCommunicator.send("HPPZ004", "queryComboBox", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("invent_name_block_id").getMappedRows();
globalData = dataSource;
}, onFail: function (ei) {
}
}, {async: false});
});
$("#QUERY").on("click", query);
IPLATUI.EFGrid = {
// 保存
$("#BTN_SAVE").on("click", save);
IPLATUI.EFGrid = {
"result": {
columns: [
{
field: "matCode",
template: function(dataItem) {
for (var i = 0 ; i < globalData.length ; i++) {
if ( globalData[i]['valueField'] === dataItem['matCode']) {
return globalData[i]['textField'];
columns: [{
field: "inventCode",
template: function (dataItem) {
for (let i = 0; i < inventNameGlobalData.length; i++) {
if (inventNameGlobalData[i]['valueField'] === dataItem['inventCode']) {
return inventNameGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
var grid = container.closest(".k-grid").data("kendoGrid");
......@@ -41,18 +30,17 @@ $(function() {
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
eiInfo.set("inventType", options.model["matType"]);
let eiInfo = new EiInfo();
eiInfo.set("inventType", options.model["inventType"]);
var dataSource;
EiCommunicator.send("HPPZ004", "queryComboBox", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("invent_name_block_id").getMappedRows();
globalData = dataSource;
}, onFail: function (ei) {
inventNameGlobalData = dataSource;
},
onFail: function (ei) {
}
}, {async: false});
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
......@@ -61,85 +49,49 @@ $(function() {
template: "#=textField#"
});
}
}, {
field: "spec",
template: function (dataItem) {
for (let i = 0; i < specGlobalData.length; i++) {
if (specGlobalData[i]['valueField'] === dataItem['spec']) {
return specGlobalData[i]['textField'];
}
],
loadComplete: function (grid) {
// 新增
$("#BTN_INSERT").on("click", function () {
var btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
IPLAT.submitNode($("#HPKC005"), "HPKC005", "insert", {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
// 绑定grid
resultGrid.setEiInfo(ei);
NotificationUtil({
msg: '新增成功'
});
}
//释放禁用按钮
btnNode.attr("disabled", false);
resultGrid.dataSource.page(1);
return "";
},
onFail: function (ei) { // onFail 表示失败回调函数
// 发生异常
console.log(ei);
//释放禁用按钮
btnNode.attr("disabled", false);
}
});
});
// 修改
$("#BTN_UPDATE").on("click", function () {
var rowCount = resultGrid.getCheckedRows();
// 检验是否选中数据
if (rowCount == null || rowCount == "") {
NotificationUtil({
msg : '请选择一条或多条数据'
}, "warning");
return false;
}
var btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
IPLAT.submitNode($("#HPKC005"), "HPKC005", "update", {
editor: function (container, options) {
var grid = container.closest(".k-grid").data("kendoGrid");
var cellIndex = grid.cellIndex(container);
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
let eiInfo = new EiInfo();
eiInfo.set("inqu_status-0-inventCode", options.model["inventCode"]);
var dataSource;
EiCommunicator.send("HPPZ006", "queryComboBoxSpec", eiInfo, {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
NotificationUtil({
msg: '修改成功'
});
// 绑定grid
resultGrid.setEiInfo(ei);
}
//释放禁用按钮
btnNode.attr("disabled", false);
dataSource = ei.getBlock("invent_spec_block_id").getMappedRows();
specGlobalData = dataSource;
},
onFail: function (ei) { // onFail 表示失败回调函数
// 发生异常
console.log(ei);
//释放禁用按钮
btnNode.attr("disabled", false);
onFail: function (ei) {
}
}, {async: false});
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
dataSource: dataSource,
template: "#=textField#"
});
});
}
}],
loadComplete: function (grid) {
//删除
$("#DELETE").on("click", function () {
var btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
var dataItems = resultGrid.getCheckedRows();
if (dataItems == null || dataItems == "") {
NotificationUtil({
......@@ -157,31 +109,62 @@ $(function() {
NotificationUtil({
msg: '删除成功'
});
// 绑定grid
resultGrid.setEiInfo(ei);
}
//释放禁用按钮
btnNode.attr("disabled", false);
},
onFail: function (ei) {// onFail
// 表示失败回调函数
onFail: function (ei) {
// 发生异常
console.log(ei);
//释放禁用按钮
btnNode.attr("disabled", false);
}
});
});
}
},
};
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询
// 存货名称
let eiInfo = new EiInfo();
EiCommunicator.send("HPPZ004", "queryComboBox", eiInfo, {
onSuccess: function (ei) {
inventNameGlobalData = ei.getBlock("invent_name_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
// 规格
EiCommunicator.send("HPPZ006", "queryComboBoxSpec", eiInfo, {
onSuccess: function (ei) {
specGlobalData = ei.getBlock("invent_spec_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPKC005", "save", true);
}
});
}
......@@ -6,76 +6,64 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="库存盘点单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker ename="inqu_status-0-receiptDate" cname="单据日期"
format="yyyy-MM-dd" required="true"/>
<EF:EFSelect ename="inqu_status-0-matType" cname="物料类型" filter="contains" required="false"
template="#=textField#" valueTemplate="#=textField#" defaultValue="">
<EF:EFOption label="请选择" value=""></EF:EFOption>
<EF:EFOption label="1-原材料" value="1"></EF:EFOption>
<EF:EFOption label="2-耗材" value="2"></EF:EFOption>
<EF:EFOption label="3-半成品" value="3"></EF:EFOption>
<EF:EFOption label="4-产成品" value="4"></EF:EFOption>
role="date" format="yyyy-MM-dd" readonly="true"/>
<EF:EFSelect ename="inqu_status-0-inventType" cname="存货类型" filter="contains" defaultValue="">
<EF:EFOption label="请选择" value=""/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-whCode" cname="仓库名称"
valueTemplate="#=textField#" filter="contains"
required="false" defultValue="ALL"
template="#=textField#">
<EF:EFOption label="请选择" value=""></EF:EFOption>
<EF:EFSelect ename="inqu_status-0-whCode" cname="仓库名称" filter="contains" defultValue="">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="whName_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-status" cname="单据状态" filter="contains" required="false"
<%--<EF:EFSelect ename="inqu_status-0-status" cname="单据状态" filter="contains" required="false"
template="#=textField#" valueTemplate="#=textField#" defaultValue="">
<EF:EFOption label="请选择" value=""></EF:EFOption>
<EF:EFOption label="0-待审核" value="0"></EF:EFOption>
<EF:EFOption label="1-已审核" value="1"></EF:EFOption>
</EF:EFSelect>
</EF:EFSelect>--%>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="false" isFloat="true" autoFit="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" width="100" readonly="false" />
<EF:EFColumn ename="statisticalNumber" cname="盘点单号" width="100" readonly="false" />
<EF:EFComboColumn ename="whCode"
cname="仓库编码"
columnTemplate="#=textField#"
itemTemplate="#=textField#"
blockName="wh_record_block_id"
textField="textField"
valueField="valueField"
align="center"
filter="contains"
width="100"
>
</EF:EFComboColumn>
<%-- <EF:EFColumn ename="whName" cname="仓库名称" width="100" readonly="false"/>--%>
<EF:EFComboColumn ename="matType" cname="物料类型" width="100" readonly="false"
textField="textField" valueField="valueField" align="center">
<EF:EFOption label="1-原材料" value="1"></EF:EFOption>
<EF:EFOption label="2-耗材" value="2"></EF:EFOption>
<EF:EFOption label="3-半成品" value="3"></EF:EFOption>
<EF:EFOption label="4-产成品" value="4"></EF:EFOption>
</EF:EFComboColumn>
<EF:EFColumn ename="matCode" cname="物料编码" width="100" readonly="false" align="center"/>
<%-- <EF:EFColumn ename="matName" cname="物料名称" width="100" readonly="false"/>--%>
<EF:EFColumn ename="bookAmount" cname="账面数量" format="{0:N3}" maxLength="20" width="100" readonly="false"/>
<EF:EFColumn ename="bookWeight" cname="账面重量" format="{0:N3}" maxLength="20" width="100" readonly="false"/>
<EF:EFColumn ename="entityAmount" cname="实物数量" format="{0:N3}" maxLength="20" width="100" readonly="false"/>
<EF:EFColumn ename="entityWeight" cname="实物重量" format="{0:N3}" maxLength="20" width="100" readonly="false"/>
<EF:EFColumn ename="diffAmount" cname="差异数量" format="{0:N3}" maxLength="20" width="100" readonly="false"/>
<EF:EFColumn ename="diffWeight" cname="差异重量" format="{0:N3}" maxLength="20" width="100" readonly="false"/>
<EF:EFComboColumn ename="status" cname="单据状态" width="100" readonly="true"
<EF:EFColumn ename="statisticalNumber" cname="盘点单号" enable="false" width="130" algin="center"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" editType="date" dateFormat="yyyy-MM-dd"
parseFormats="['yyyyMMdd']" width="90" align="center"/>
<%--<EF:EFComboColumn ename="status" cname="单据状态" enable="false" width="100" readonly="true"
textField="textField" valueField="valueField" align="center">
<EF:EFOption label="0-待审核" value="0"></EF:EFOption>
<EF:EFOption label="1-已审核" value="1"></EF:EFOption>
</EF:EFComboColumn>--%>
<EF:EFComboColumn ename="whCode" cname="仓库编码" columnTemplate="#=textField#"
itemTemplate="#=textField#" blockName="wh_record_block_id"
textField="textField" valueField="valueField"
align="center" filter="contains" width="100">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="90" align="center">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" />
</EF:EFComboColumn>
<EF:EFColumn ename="notes" cname="备注" width="100" readonly="false"/>
<EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center"/>
<EF:EFColumn ename="spec" cname="规格" width="120" align="center"/>
<EF:EFColumn ename="bookAmount" cname="账面数量" format="{0:N3}" maxLength="20" width="90" align="right"
sumType="all"/>
<EF:EFColumn ename="bookWeight" cname="账面重量" format="{0:N3}" maxLength="20" width="90" align="right"
sumType="all"/>
<EF:EFColumn ename="entityAmount" cname="实物数量" format="{0:N3}" maxLength="20" width="100" align="right"
sumType="all"/>
<EF:EFColumn ename="entityWeight" cname="实物重量" format="{0:N3}" maxLength="20" width="100" align="right"
sumType="all"/>
<EF:EFColumn ename="diffAmount" cname="差异数量" format="{0:N3}" maxLength="20" width="100" align="right"
sumType="all"/>
<EF:EFColumn ename="diffWeight" cname="差异重量" format="{0:N3}" maxLength="20" width="100" align="right"
sumType="all"/>
<EF:EFColumn ename="notes" cname="备注" width="100"/>
<EF:EFColumn ename="createdBy" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid>
</EF:EFRegion>
......
$(function() {
$("#inqu_status-0-receiptDate").val(__eiInfo.blocks.inqu_status.rows[0]);
// $("#inqu_status-0-receiptDate").val(__eiInfo.blocks.inqu_status.rows[0]);
// 查询
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询
});
$(function () {
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1);
});
IPLATUI.EFGrid.result = {
IPLATUI.EFGrid = {
result:{
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
pageSizes: [10, 20, 30, 50, 100, 200],
},
columns: [
{
field:"money",
valueType:"N",//小计设置
type:"N",
},
{
field:"assessmentAmount",
valueType:"N",//小计设置
type:"N",
columns: [{
field: "datemonth",
attributes: {
'class': 'i-input-readonly',
required: true
}
}]
}
]
}
});
});
......@@ -6,38 +6,35 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="数据统计单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker ename="inqu_status-0-datemonth" cname="单据日期"
format="yyyy-MM" start="year" depth="year" required="true"/>
format="yyyy-MM" start="year" depth="year" readonly="true" required="true"/>
<EF:EFInput ename="inqu_status-0-statisticalNumber" cname="统计单单号" colWidth="4" readonly="false"/>
</div>
<EF:EFButton ename="QUERY" cname="查询" row="1" class="btn-align-right"></EF:EFButton>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="false" isFloat="true" autoFit="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" autoFit="true">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="datemonth" cname="月份" editType="date" dateFormat="yyyy-MM" parseFormats="['yyyyMM']" start="year" depth="year" width="100" readonly="false" />
<EF:EFColumn ename="statisticalNumber" cname="统计单单号" width="100" readonly="false" />
<EF:EFColumn ename="materialCode" cname="物料编码" width="100" readonly="false"/>
<EF:EFColumn ename="materialName" cname="物料名称" width="100" readonly="false"/>
<EF:EFColumn ename="unit" cname="单位" width="100" readonly="false"/>
<EF:EFColumn ename="amount" cname="数量" width="100" readonly="false"/>
<EF:EFColumn ename="price" cname="单价" width="100" readonly="false"/>
<EF:EFColumn ename="totalPrice" cname="金额" width="100" readonly="false"/>
<EF:EFColumn ename="statisticalNumber" cname="统计单单号" enable="false" width="130" align="center"/>
<EF:EFColumn ename="datemonth" cname="月份" editType="date" dateFormat="yyyy-MM" parseFormats="['yyyyMM']"
start="year" depth="year" width="100" align="center"/>
<EF:EFComboColumn ename="materialCode" cname="存货名称" width="120" align="center">
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="unit" cname="单位" width="100" align="center" maxLength="2"/>
<EF:EFColumn ename="amount" cname="数量" width="100" align="right" format="{0:N3}" sumType="all"/>
<EF:EFColumn ename="price" cname="单价" width="100" align="right" format="{0:C3}"/>
<EF:EFColumn ename="totalPrice" cname="金额" width="100" align="right" format="{0:C3}" sumType="all"/>
<EF:EFColumn ename="notes" cname="备注" width="100" readonly="false"/>
<EF:EFColumn ename="createdTime" cname="创建时间" readonly="true" width="150" align="center" enable="false" parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="createdTime" cname="创建时间" readonly="true" width="150" align="center" enable="false"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="createdBy" cname="创建人" readonly="true" width="150" align="center" enable="false"/>
<EF:EFColumn ename="updatedTime" cname="更新时间" readonly="true" width="150" align="center" enable="false" parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="updatedTime" cname="更新时间" readonly="true" width="150" align="center" enable="false"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="updatedBy" cname="更新人" readonly="true" width="150" align="center" enable="false"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
}
// 查询
$("#QUERY").on("click", query);
// 保存
$("#BTN_SAVE").on("click", save);
// 删除
$("#BTN_DELETE").on("click", deleteFunc);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ009", "save", true);
}
});
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ009", "delete", true);
}
});
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage>
<div class="row" style="margin: 0 -10px;">
<div class="col-md-4">
<EF:EFRegion title="系统菜单树" id="tree" fitHeight="true">
<EF:EFTree bindId="groupsTree" ename="node" textField="text" valueField="label" hasChildren="leaf"
serviceName="XS0705" methodName="query" style="height:435px;">
</EF:EFTree>
</EF:EFRegion>
</div>
<div class="col-md-8">
<EF:EFRegion title="查询区" id="inqu">
<div class="row" >
<EF:EFInput type="hidden" cname="授权主体ID" ename="subjectId" row="0" blockId="inqu_status"/>
<EF:EFInput type="hidden" ename="objectCname" row ="0" blockId="inqu_status"/>
<EF:EFInput type="hidden" cname="授权类别" ename="operationType" row="0" blockId="inqu_status" value="ACCESS"/>
<EF:EFInput row="0" blockId="inqu_status" ename="objectEname" cname="授权客体名称" type="hidden"/>
<div class="col-xs-4">
<div class="form-group">
<label class="col-md-5 control-label">
授权主体名称
</label>
<div class="col-md-7">
<input name="inqu_status-0-subjectName" data-query="gt" class="k-textbox input-time query-need"
placeholder="请输入授权主体名称" />
</div>
</div>
</div>
<EF:EFSelect blockId="inqu_status" cname="授权主体类别" ename="subjectType" row="0" defaultValue="全部" colWidth="4" ratio="5:7">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="iplat.xs.subjectType" textField="label" valueField="value"/>
</EF:EFSelect>
<div class="col-xs-4">
<div class="form-group">
<label class="col-md-5 control-label">
授权客体名称
</label>
<div class="col-md-7">
<input name="inqu_status-0-objectName" data-query="gt" class="k-textbox input-time query-need"
placeholder="请输入授权客体名称" />
</div>
</div>
</div>
<EF:EFSelect blockId="inqu_status" cname="授权客体类别" colWidth="4" ename="objectType" row="0" defaultValue="全部" ratio="5:7">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="xs.og.objectType" textField="label" valueField="value"/>
</EF:EFSelect>
<div class="col-xs-8" style="text-align: right" id="inqu_inside"></div>
</div>
</EF:EFRegion>
<EF:EFInput ename="objectCname" cname="授权主体名称" type="hidden"/>
<EF:EFRegion title="记录集" id="result" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="false">
<EF:EFColumn ename="subjectId" cname="授权主体ID" hidden="true"/>
<EF:EFColumn ename="subjectName" cname="授权主体名称" readonly="true" locked="true"/>
<EF:EFComboColumn enable="false" cname="授权主体类别" locked="true" ename="subjectType"
defaultValue="USER" style="text-align:center;">
<EF:EFCodeOption codeName="iplat.xs.subjectType" textField="label" valueField="value"/>
</EF:EFComboColumn>
<EF:EFColumn ename="objectId" cname="授权客体ID" hidden="true"/>
<EF:EFColumn ename="objectName" cname="授权客体名称" readonly="true" locked="true"/>
<EF:EFComboColumn enable="false" cname="授权客体类别" locked="true" ename="objectType"
defaultValue="RESOURCE" style="text-align:center;">
<EF:EFCodeOption codeName="xs.og.objectType" textField="label" valueField="value"/>
</EF:EFComboColumn>
<EF:EFComboColumn cname="操作类型" ename="operationType" readonly="true"
defaultValue="ACCESS" style="text-align:center;">
<EF:EFCodeOption codeName="services.xs.operationType" textField="label" valueField="value"/>
</EF:EFComboColumn>
<EF:EFColumn ename="sortIndex" cname="排序" style="text-align:center;"/>
<EF:EFColumn ename="recCreator" cname="创建人" style="text-align:center;" readonly="true"/>
<EF:EFColumn ename="recCreateTime" cname="创建时间" editType="datetime" readonly="true" displayType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']" style="text-align:center;"/>
<EF:EFColumn ename="recRevisor" cname="修改人" style="text-align:center;" readonly="true"/>
<EF:EFColumn ename="recReviseTime" cname="修改时间" readonly="true" editType="datetime" displayType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']" style="text-align:center;"/>
<EF:EFColumn ename="archiveFlag" cname="归档标记" style="text-align:center;"/>
</EF:EFGrid>
</EF:EFRegion>
</div>
</div>
<EF:EFWindow id="authSubject" width="58%" top="100px" left="280px">
<div id="ef_popup_gridA" >
<EF:EFRegion id="inquA" title="查询条件" type="query" efRegionShowClear="true" efRegionSave="true">
<div class="row">
<div class="col-xs-2 control-label">
<span>用户组英文名</span>
</div>
<div class="col-xs-2">
<EF:EFInput ename="inqu_status-0-groupEname" cname="用户组英文名" inline="true"/>
</div>
<div class="col-xs-3 control-label">
<span>用户组中文名</span>
</div>
<div class="col-xs-2">
<EF:EFInput ename="inqu_status-0-groupCname" cname="用户组中文名" inline="true"/>
</div>
<div class="col-xs-2" style="text-align: right" id="inqua_inside"></div>
</div>
</EF:EFRegion>
<EF:EFRegion id="resultA" title="记录集">
<div class="text-right">
<EF:EFButton cname="确定" ename="ef_popup_gridA_commit"></EF:EFButton>
</div>
<EF:EFGrid blockId="resultA" queryMethod="queryForGridSubject" autoDraw="false">
<EF:EFColumn ename="groupId" locked="true" cname="群组ID" hidden="true" primaryKey="true"/>
<EF:EFColumn ename="groupEname" locked="true" cname="群组英文名" readonly="true" width="300"/>
<EF:EFColumn ename="groupCname" cname="群组中文名" readonly="true" width="300"/>
</EF:EFGrid>
</EF:EFRegion>
</div>
</EF:EFWindow>
<EF:EFWindow id="menuPageAuth" url="${ctx}/web/XS0707" width="78%" top="80px" left="120px"></EF:EFWindow>
</EF:EFPage>
let rowId;
$(function() {
var day1 = new Date();
day1.setTime(day1.getTime());
day1.setDate(day1.getDate()-1);
var month = day1.getMonth() + 1;
var year = day1.getFullYear();
var day = day1.getDate();
let inqu = $("#inqu")
,result = $("#result")
,from = $("#from")
,receiptDate = $("#inqu_status-0-receiptDate");
receiptDate.val(year+"-"+month+"-"+day)
$("#inqu_status-0-receiptDate").val(year+"-"+month+"-"+day);
// var day1 = new Date();
// day1.setTime(day1.getTime());
// day1.setDate(day1.getDate()-1);
// var month = day1.getMonth() + 1;
// var year = day1.getFullYear();
// var day = day1.getDate();
// let inqu = $("#inqu")
// ,result = $("#result")
// ,from = $("#from")
// ,receiptDate = $("#inqu_status-0-receiptDate");
// receiptDate.val(year+"-"+month+"-"+day)
//
// $("#inqu_status-0-receiptDate").val(year+"-"+month+"-"+day);
// 查询
$("#QUERY").on("click", function () {
......@@ -27,87 +26,100 @@ $(function() {
input: true,
numeric: false,
pageSize: 20,
pageSizes: [10,20,30,50,100,200]
},
columns:[
{
field: "receiptDate",
title: "单据日期",
},
{
field: "chkBillno",
title: "检查单号",
},
{
field: "itemName",
title: "项目名称",
},
{
field: "unit",
title: "生产组",
},
{
field: "notes",
title: "质量问题描述",
},
{
field: "princ",
title: "检查人",
},
{
field: "status",
title: "状态",
pageSizes: [10, 20, 30, 50, 100, 200]
},
{
columns: [{
field: "affix",
title: "附件",
},
{
template: function (item) {
let affix = item.affix;
if (isBlank(affix)) {
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="openUploadFile(' + item.id + ',1)" >附件上传</a>';
} else {
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + IPLATUI.CONTEXT_PATH + '/EU/DM/EUDM06.jsp?docId=' + affix
+ '" >下载</a>';
}
}
}, {
field: "operator",
template:function(item){
template: function (item) {
let chkBillno = item.chkBillno;
let auditStatus = item.status;
if(auditStatus == 0) {
if (auditStatus == 0) {
return '<a style="cursor: pointer;display: flex;justify-content: center;" ' +
'onclick="audit('+item.id+',1)" >审核</a>';
}else{
'onclick="audit(' + item.id + ',\'' + chkBillno + '\',1)" >审核</a>';
} else {
return '<a style="cursor: pointer;display: flex;justify-content: center;" ' +
'onclick="audit('+item.id+',0)" >反审</a>';
'onclick="audit(' + item.id + ',\'' + chkBillno + '\',0)" >反审</a>';
}
}
}]
}
],
};
// 关闭事件
IPLATUI.EFWindow = {
"uploadFile": {
close: function (e) {
let $iframe = uploadFileWindow.element.children("iframe");
let iframejQuery = $iframe[0].contentWindow.$; // 子窗口中的jQuery对象
let uploadFile = iframejQuery("#fileDocId").val();
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", rowId);
inEiInfo.set("result-0-affix", uploadFile);
EiCommunicator.send('HPZL001', 'bindDocIdById', inEiInfo, {
onSuccess(response) {
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
},
}
};
});
function audit(id,auditStatus){
/**
* 文件上传
*
* @param id
*/
function openUploadFile(id) {
uploadFileWindow.open().center();
rowId = id;
}
/**
* 审核操作
*
* @param id
* @param chkBillno
* @param auditStatus
*/
function audit(id, chkBillno, auditStatus) {
let message = "确认对单号[" + chkBillno + "]进行" + (auditStatus == 1 ? "审核" : "反审") + "操作吗? ";
JSUtils.confirm(message, {
ok: function () {
const inEiInfo = new EiInfo();
inEiInfo.set("result-0-id",id);
inEiInfo.set("result-0-status",auditStatus );
EiCommunicator.send('HPZL001','operator', inEiInfo, {
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-status", auditStatus);
EiCommunicator.send('HPZL001', 'operator', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
if(response.status >= 0){
resultGrid.dataSource.page(1);
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
}, {
async: false
});
}
);
});
}
......@@ -6,19 +6,14 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="质量巡检单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker ename="inqu_status-0-receiptDate" cname="单据日期" colWidth="3"
format="yyyy-MM-dd" required="true"/>
format="yyyy-MM-dd" readonly="true"/>
<EF:EFSelect ename="inqu_status-0-itemCode" cname="项目名称" colWidth="3"
valueTemplate="#=textField#"
template="#=textField#"
textField="textField"
valueField="valueField"
required="true"
locked="true"
filter="contains">
valueTemplate="#=textField#" template="#=textField#"
textField="textField" valueField="valueField"
required="true" locked="true" filter="contains">
<EF:EFOption label="--请选择--" value=""/>
<EF:EFOptions blockId="proj_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
......@@ -29,49 +24,45 @@
<EF:EFOption label="待审核" value="0"></EF:EFOption>
</EF:EFSelect>
</div>
<EF:EFButton ename="QUERY" cname="查询" row="1" class="btn-align-right"></EF:EFButton>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="false" isFloat="true" autoFit="true">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" width="100" readonly="false" />
<EF:EFColumn ename="chkBillno" cname="检查单号" width="100" readonly="false" />
<EF:EFComboColumn ename="itemName" cname="项目名称"
columnTemplate="#=textField#"
itemTemplate="#=textField#"
blockName="proj_record_block_id"
textField="textField"
valueField="textField"
maxLength="20"
readonly="false"
style="color:blue;"
required="true"
filter="contains"
width="220">
<EF:EFColumn ename="chkBillno" cname="检查单号" enable="false" width="130" align="center"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" editType="date" dateFormat="yyyy-MM-dd"
parseFormats="['yyyyMMdd']" width="120" readonly="false"/>
<EF:EFComboColumn ename="itemCode" cname="项目名称" columnTemplate="#=textField#"
itemTemplate="#=textField#" blockName="proj_record_block_id"
textField="textField" valueField="valueField" maxLength="20"
readonly="false" style="color:blue;" required="true" filter="contains" width="220">
</EF:EFComboColumn>
<EF:EFColumn ename="unit" cname="生产组" width="100" readonly="false"/>
<EF:EFColumn ename="notes" cname="质量问题描述" width="100" readonly="false"/>
<EF:EFColumn ename="princ" cname="检查人" width="100" readonly="true"/>
<EF:EFComboColumn ename="status" cname="状态" align="center" columnTemplate="#=valueField#-#=textField#" optionLabel=" "
<EF:EFComboColumn ename="status" cname="状态" enable="false" align="center"
columnTemplate="#=valueField#-#=textField#"
itemTemplate="#=valueField#-#=textField#" textField="textField"
valueField="valueField" width="100" required="true">
valueField="valueField" width="100" required="true" optionLabel=" ">
<EF:EFOption label="--请选择--" value=""></EF:EFOption>
<EF:EFOption label="审核" value="1"></EF:EFOption>
<EF:EFOption label="未审核" value="0"></EF:EFOption>
</EF:EFComboColumn>
<EF:EFColumn ename="affix" cname="附件" width="100" readonly="false"/>
<EF:EFColumn ename="operator" cname="操作" width="100" readonly="false"/>
<EF:EFColumn ename="affix" cname="附件" enable="false" width="100" align="center"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="100" readonly="false"/>
<EF:EFColumn ename="createdTime" cname="创建时间" readonly="true" width="150" align="center" enable="false"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss" hidden ="true" />
<EF:EFColumn ename="createdBy" cname="创建人" readonly="true" width="150" align="center" enable="false" hidden ="true"/>
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"
hidden="true"/>
<EF:EFColumn ename="createdBy" cname="创建人" readonly="true" width="150" align="center" enable="false"
hidden="true"/>
<EF:EFColumn ename="updatedTime" cname="更新时间" readonly="true" width="150" align="center" enable="false"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss" hidden ="true"/>
<EF:EFColumn ename="updatedBy" cname="更新人" readonly="true" width="150" align="center" enable="false" hidden ="true"/>
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"
hidden="true"/>
<EF:EFColumn ename="updatedBy" cname="更新人" readonly="true" width="150" align="center" enable="false"
hidden="true"/>
</EF:EFGrid>
</EF:EFRegion>
<%-- EEDM8010页面加载时,不会加载EEDM6000 (lazyload="true") --%>
<EF:EFWindow id="uploadFile" url="${ctx}/web/HPSC099" lazyload="true" refresh="true">
</EF:EFWindow>
</EF:EFPage>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment