Commit 19022e84 by liuyang

2024-07-04 1、原材料成本核算

parent 3032d3e4
package com.baosight.hggp.common;
import com.baosight.iplat4j.core.ei.EiBlock;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/6/25
*/
public enum BizTypeEnum {
/**
* 采购入库单
*/
CGRK(1,"采购入库单"),
/**
* 其他入库单
*/
QTRK(2,"其他入库单"),
/**
* 生产领料单
*/
SCLL(3,"生产领料单"),
/**
* 其他出库单
*/
QTCK(4,"其他出库单");
private Integer code;
private String value;
BizTypeEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
public static EiBlock generatorEiBlock() {
EiBlock block = new EiBlock("biz_type_block_id");
List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>() {{
add(new HashMap<String, Object>() {{
put(HGConstants.TEXT_FIELD, CGRK.value);
put(HGConstants.VALUE_FIELD, CGRK.code);
}});
add(new HashMap<String, Object>() {{
put(HGConstants.TEXT_FIELD, QTRK.value);
put(HGConstants.VALUE_FIELD, QTRK.code);
}});
add(new HashMap<String, Object>() {{
put(HGConstants.TEXT_FIELD, SCLL.value);
put(HGConstants.VALUE_FIELD, SCLL.code);
}});
add(new HashMap<String, Object>() {{
put(HGConstants.TEXT_FIELD, QTCK.value);
put(HGConstants.VALUE_FIELD, QTCK.code);
}});
}};
block.setRows(rows);
return block;
}
public static BizTypeEnum getEnumByCode(Integer code){
for (BizTypeEnum en : BizTypeEnum.values()){
if(code.compareTo(en.code)==0){
return en;
}
}
return null;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
...@@ -9,10 +9,21 @@ import java.util.*; ...@@ -9,10 +9,21 @@ import java.util.*;
* @version 1.0 2024/6/27 * @version 1.0 2024/6/27
*/ */
public enum InventTypeDetailEnum { public enum InventTypeDetailEnum {
/**
* 构件
*/
COMPONENT(1,"构件"), COMPONENT(1,"构件"),
/**
* 零件
*/
SEMI_FINISHED_PRODUCT(2,"零件"), SEMI_FINISHED_PRODUCT(2,"零件"),
/**
* 原料
*/
RAW(3,"原料"), RAW(3,"原料"),
/**
* 耗材
*/
CONSUMABLE(4,"耗材"); CONSUMABLE(4,"耗材");
private Integer code; private Integer code;
......
package com.baosight.hggp.hg.cb.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cb.domain.HGCB002;
import com.baosight.hggp.hg.cb.domain.HGCB004;
import com.baosight.hggp.hg.cb.tools.HGCBTools;
import com.baosight.hggp.hg.cw.domain.HGCW001;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/6/25
*/
public class ServiceHGCB002 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
//CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_CODE_BLOCK_ID), null);
inInfo = super.initLoad(inInfo, EiConstant.resultBlock, new HGCB002());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_RECORD_BLOCK_ID), null, false);
EiInfoUtils.addBlock(inInfo,"company_code_block_id", UserSessionUtils.getRoleCompany(), Company.class);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
String accountPeriod = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGCB002.FIELD_ACCOUNT_PERIOD);
if(accountPeriod != null && ObjectUtils.isNotBlank(accountPeriod)){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGCB002.FIELD_ACCOUNT_PERIOD, DateUtils.formatShort(accountPeriod));
}
return super.query(inInfo, HGCB002.QUERY, new HGCB002());
}
public EiInfo select(EiInfo inInfo) {
Map params= EiInfoUtils.getFirstRow(inInfo);
HGCW001 hgcw001 = HGCWTools.HgCw001.getMaxAccountPeriod(params.get(HGCB002.FIELD_COMPANY_CODE).toString());
params.put(HGCW001.FIELD_ACCOUNT_CODE, hgcw001.getAccountCode());
params.put(HGCW001.FIELD_ACCOUNT_PERIOD, hgcw001.getAccountPeriod());
HGCBTools.HgCb002.select(params);
return inInfo;
}
}
package com.baosight.hggp.hg.cb.service;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
/**
* @author LiuYang
* @version 1.0 2024/6/27
*/
public class ServiceHGCB002A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"查询角色所属公司失败!");
}
return inInfo;
}
}
package com.baosight.hggp.hg.cb.service;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cb.domain.HGCB003;
import com.baosight.hggp.hg.cb.tools.HGCBTools;
import com.baosight.hggp.hg.cw.domain.HGCW001;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/6/25
*/
public class ServiceHGCB003 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
EiInfoUtils.addBlock(inInfo,"company_code_block_id", UserSessionUtils.getRoleCompany(), Company.class);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
String accountPeriod = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGCB003.FIELD_ACCOUNT_PERIOD);
if(accountPeriod != null && ObjectUtils.isNotBlank(accountPeriod)){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGCB003.FIELD_ACCOUNT_PERIOD, DateUtils.formatShort(accountPeriod));
}
return super.query(inInfo, HGCB003.QUERY, new HGCB003());
}
public EiInfo select(EiInfo inInfo) {
Map params= EiInfoUtils.getFirstRow(inInfo);
HGCW001 hgcw001 = HGCWTools.HgCw001.getMaxAccountPeriod(params.get(HGCB003.FIELD_COMPANY_CODE).toString());
params.put(HGCW001.FIELD_ACCOUNT_CODE, hgcw001.getAccountCode());
params.put(HGCW001.FIELD_ACCOUNT_PERIOD, hgcw001.getAccountPeriod());
HGCBTools.HgCb003.select(params);
return inInfo;
}
}
package com.baosight.hggp.hg.cb.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.hg.cb.domain.HGCB001;
import com.baosight.hggp.hg.cb.domain.HGCB002;
import com.baosight.hggp.hg.cb.domain.HGCB004;
import com.baosight.hggp.hg.cb.tools.HGCBTools;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.cw.domain.HGCW001;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.kc.domain.*;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.domain.HGPZ007;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.data.DaoEPBase;
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.ServiceEPBase;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author LiuYang
* @version 1.0 2024/6/25
*/
public class ServiceHGCB004 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_TYPE_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCB004().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String receiptDate = MapUtils.getString(queryRow, HGCB004.FIELD_ACCOUNT_PERIOD);
queryRow.put(HGCB004.FIELD_ACCOUNT_PERIOD, StringUtil.removeSpecifiedCharacter(receiptDate, StringUtil.DEFAULT_CHARACTER_TO_BE_REMOVED));
queryRow.put(HGCB004.FIELD_DATE_TYPE, CommonConstant.DateType.MONTH);
inInfo = super.query(inInfo, HGCB004.QUERY, new HGCB004());
List sum = dao.query(HGCB004.QUERY_SUM, 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
*/
@OperationLogAnnotation(operModul = "收发存汇总",operType = "同步数据",operDesc = "同步数据")
public EiInfo synchData(EiInfo inInfo) {
try {
Map<String, Object> queryRow = EiInfoUtils.getFirstRow(inInfo);
HGCW001 hgcw001 = HGCWTools.HgCw001.getMaxAccountPeriod(queryRow.get(HGCB002.FIELD_COMPANY_CODE).toString());
queryRow.put(HGCB004.FIELD_ACCOUNT_CODE, hgcw001.getAccountCode());
queryRow.put(HGCB004.FIELD_ACCOUNT_PERIOD, hgcw001.getAccountPeriod());
List<HGCB004> cb004s =HGCBTools.HgCb004.synchData(queryRow);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + cb004s.size() + "]条数据同步成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "同步数据失败");
}
return inInfo;
}
}
...@@ -11,6 +11,7 @@ import com.baosight.hggp.hg.cw.tools.HGCWTools; ...@@ -11,6 +11,7 @@ import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO; import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.sc.domain.HGSC001; import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.tools.HGSCTools; import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils; import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
...@@ -93,6 +94,7 @@ public class ServiceHGCW010 extends ServiceBase { ...@@ -93,6 +94,7 @@ public class ServiceHGCW010 extends ServiceBase {
HGCW010.setSigningDate(DateUtils.formatShort(HGCW010.getSigningDate())); HGCW010.setSigningDate(DateUtils.formatShort(HGCW010.getSigningDate()));
// 获取项目名称 // 获取项目名称
HGSC001 HGSC001 = HGSCTools.Hgsc001.queryByCode(HGCW010.getProjCode()); HGSC001 HGSC001 = HGSCTools.Hgsc001.queryByCode(HGCW010.getProjCode());
AssertUtils.isNull(HGSC001, "项目编码[" + HGCW010.getProjCode() + "]不存在");
HGCW010.setProjName(HGSC001.getProjName()); HGCW010.setProjName(HGSC001.getProjName());
if (HGCW010.getId() == null || HGCW010.getId() == 0) { if (HGCW010.getId() == null || HGCW010.getId() == 0) {
this.add(HGCW010); this.add(HGCW010);
......
...@@ -269,14 +269,14 @@ ...@@ -269,14 +269,14 @@
</select> </select>
<select id="getMaxAccountPeriod" resultClass="java.util.HashMap"> <select id="getMaxAccountPeriod" resultClass="com.baosight.hggp.hg.cw.domain.HGCW001">
select select
ACCOUNT_CODE as "accountCode", ACCOUNT_CODE as "accountCode",
COMPANY_CODE as "companyCode", COMPANY_CODE as "companyCode",
ACCOUNT_YEAR as "accountYear", ACCOUNT_YEAR as "accountYear",
MAX(ACCOUNT_PERIOD) as "accountPeriod" MAX(ACCOUNT_PERIOD) as "accountPeriod"
from ${hggpSchema}.HGCW001 from ${hggpSchema}.HGCW001
where ACCOUNT_PERIOD_STATUS = '0' where 1=1
<include refid="condition" /> <include refid="condition" />
group by group by
ACCOUNT_CODE, COMPANY_CODE, ACCOUNT_YEAR ACCOUNT_CODE, COMPANY_CODE, ACCOUNT_YEAR
......
...@@ -102,6 +102,7 @@ public class HGKC001 extends DaoEPBase { ...@@ -102,6 +102,7 @@ public class HGKC001 extends DaoEPBase {
public static final String QUERY = "HGKC001.query"; public static final String QUERY = "HGKC001.query";
public static final String QUERY_LIST = "HGKC001.queryList";
public static final String COUNT = "HGKC001.count"; public static final String COUNT = "HGKC001.count";
public static final String INSERT = "HGKC001.insert"; public static final String INSERT = "HGKC001.insert";
public static final String UPDATE = "HGKC001.update"; public static final String UPDATE = "HGKC001.update";
...@@ -860,43 +861,83 @@ public class HGKC001 extends DaoEPBase { ...@@ -860,43 +861,83 @@ public class HGKC001 extends DaoEPBase {
public void setSubmitStatus(Integer submitStatus) { public void setSubmitStatus(Integer submitStatus) {
this.submitStatus = submitStatus; this.submitStatus = submitStatus;
} }
/**
* get the storageType - 存储类型.
* @return the storageType
*/
public Integer getStorageType() { public Integer getStorageType() {
return storageType; return storageType;
} }
/**
* set the storageType - 存储类型.
*
* @param storageType - 存储类型
*/
public void setStorageType(Integer storageType) { public void setStorageType(Integer storageType) {
this.storageType = storageType; this.storageType = storageType;
} }
/**
* get the isReturn - 是否退货.
* @return the isReturn
*/
public Integer getIsReturn() { public Integer getIsReturn() {
return isReturn; return isReturn;
} }
/**
* set the isReturn - 是否退货.
*
* @param isReturn - 是否退货
*/
public void setIsReturn(Integer isReturn) { public void setIsReturn(Integer isReturn) {
this.isReturn = isReturn; this.isReturn = isReturn;
} }
/**
* get the price - 单价.
* @return the price
*/
public BigDecimal getPrice() { public BigDecimal getPrice() {
return price; return price;
} }
/**
* set the price - 单价.
*
* @param price - 单价
*/
public void setPrice(BigDecimal price) { public void setPrice(BigDecimal price) {
this.price = price; this.price = price;
} }
/**
* get the amount - 金额.
* @return the amount
*/
public BigDecimal getAmount() { public BigDecimal getAmount() {
return amount; return amount;
} }
/**
* set the amount - 金额.
*
* @param amount - 金额
*/
public void setAmount(BigDecimal amount) { public void setAmount(BigDecimal amount) {
this.amount = amount; this.amount = amount;
} }
/**
* get the inventTypeDetail - 存货类型明细.
* @return the inventTypeDetail
*/
public Integer getInventTypeDetail() { public Integer getInventTypeDetail() {
return inventTypeDetail; return inventTypeDetail;
} }
/**
* set the inventTypeDetail - 存货类型明细.
*
* @param inventTypeDetail - 存货类型明细
*/
public void setInventTypeDetail(Integer inventTypeDetail) { public void setInventTypeDetail(Integer inventTypeDetail) {
this.inventTypeDetail = inventTypeDetail; this.inventTypeDetail = inventTypeDetail;
} }
......
...@@ -116,6 +116,7 @@ public class HGKC003 extends DaoEPBase { ...@@ -116,6 +116,7 @@ public class HGKC003 extends DaoEPBase {
public static final String COL_IS_RETURN = "IS_RETURN"; /* 是否退回*/ public static final String COL_IS_RETURN = "IS_RETURN"; /* 是否退回*/
public static final String QUERY = "HGKC003.query"; public static final String QUERY = "HGKC003.query";
public static final String QUERY_DETAIL = "HGKC003.queryDetail";
public static final String COUNT = "HGKC003.count"; public static final String COUNT = "HGKC003.count";
public static final String INSERT = "HGKC003.insert"; public static final String INSERT = "HGKC003.insert";
public static final String UPDATE = "HGKC003.update"; public static final String UPDATE = "HGKC003.update";
......
...@@ -53,6 +53,7 @@ public class HGKC004A extends DaoEPBase { ...@@ -53,6 +53,7 @@ public class HGKC004A extends DaoEPBase {
public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/ public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/
public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/ public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/ public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String FIELD_INVENT_TYPE_DETAIL = "inventTypeDetail"; /*存货类型明细*/
public static final String COL_ID = "ID"; /* ID*/ public static final String COL_ID = "ID"; /* ID*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
...@@ -88,6 +89,7 @@ public class HGKC004A extends DaoEPBase { ...@@ -88,6 +89,7 @@ public class HGKC004A extends DaoEPBase {
public static final String COL_PROJ_NAME = "PROJ_NAME"; /* 项目名称*/ public static final String COL_PROJ_NAME = "PROJ_NAME"; /* 项目名称*/
public static final String QUERY = "HGKC004A.query"; public static final String QUERY = "HGKC004A.query";
public static final String QUERY_DETAIL = "HGKC004A.queryDetail";
public static final String COUNT = "HGKC004A.count"; public static final String COUNT = "HGKC004A.count";
public static final String INSERT = "HGKC004A.insert"; public static final String INSERT = "HGKC004A.insert";
public static final String UPDATE = "HGKC004A.update"; public static final String UPDATE = "HGKC004A.update";
...@@ -125,6 +127,7 @@ public class HGKC004A extends DaoEPBase { ...@@ -125,6 +127,7 @@ public class HGKC004A extends DaoEPBase {
private String whName = " "; /* 仓库名称*/ private String whName = " "; /* 仓库名称*/
private String projCode = " "; /* 项目编码*/ private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/ private String projName = " "; /* 项目名称*/
private String inventTypeDetail;
...@@ -280,7 +283,9 @@ public class HGKC004A extends DaoEPBase { ...@@ -280,7 +283,9 @@ public class HGKC004A extends DaoEPBase {
eiColumn.setDescName("项目名称"); eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_TYPE_DETAIL);
eiColumn.setDescName("存货类型明细");
eiMetadata.addMeta(eiColumn);
} }
/** /**
...@@ -739,6 +744,13 @@ public class HGKC004A extends DaoEPBase { ...@@ -739,6 +744,13 @@ public class HGKC004A extends DaoEPBase {
this.projName = projName; this.projName = projName;
} }
public String getInventTypeDetail() {
return inventTypeDetail;
}
public void setInventTypeDetail(String inventTypeDetail) {
this.inventTypeDetail = inventTypeDetail;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -778,6 +790,7 @@ public class HGKC004A extends DaoEPBase { ...@@ -778,6 +790,7 @@ public class HGKC004A extends DaoEPBase {
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName)); setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode)); setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName)); setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setInventTypeDetail(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_TYPE_DETAIL)), inventTypeDetail));
} }
/** /**
...@@ -818,6 +831,7 @@ public class HGKC004A extends DaoEPBase { ...@@ -818,6 +831,7 @@ public class HGKC004A extends DaoEPBase {
map.put(FIELD_WH_NAME, StringUtils.toString(whName, eiMetadata.getMeta(FIELD_WH_NAME))); map.put(FIELD_WH_NAME, StringUtils.toString(whName, eiMetadata.getMeta(FIELD_WH_NAME)));
map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE))); map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE)));
map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME))); map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
map.put(FIELD_INVENT_TYPE_DETAIL,StringUtils.toString(inventTypeDetail, eiMetadata.getMeta(FIELD_INVENT_TYPE_DETAIL)));
return map; return map;
} }
......
...@@ -291,6 +291,9 @@ ...@@ -291,6 +291,9 @@
<isNotEmpty prepend=" AND " property="accountPeriod"> <isNotEmpty prepend=" AND " property="accountPeriod">
LEFT(DEPOSIT_DATE,6) = #accountPeriod# LEFT(DEPOSIT_DATE,6) = #accountPeriod#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypeDetail">
INVENT_TYPE_DETAIL = #inventTypeDetail#
</isNotEmpty>
<include refid="orderBy"/> <include refid="orderBy"/>
</select> </select>
......
...@@ -376,7 +376,7 @@ ...@@ -376,7 +376,7 @@
COALESCE(SUM(INV_QTY), 0) AS "invQty", COALESCE(SUM(INV_QTY), 0) AS "invQty",
COALESCE(SUM(INV_WEIGHT), 0) AS "invWeight" COALESCE(SUM(INV_WEIGHT), 0) AS "invWeight"
FROM ${hggpSchema}.HGKC003 FROM ${hggpSchema}.HGKC003
WHERE 1=1 WHERE DELETE_FLAG = '0'
<isNotEmpty prepend=" AND " property="createdTimeFrom"> <isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo# CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty> </isNotEmpty>
...@@ -454,4 +454,39 @@ ...@@ -454,4 +454,39 @@
</select> </select>
<select id="queryDetail" parameterClass="java.util.HashMap" resultClass="com.baosight.hggp.hg.kc.domain.HGKC003">
SELECT
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
SUM(INV_QTY) as "invQty", <!-- 数量 -->
SUM(INV_WEIGHT) as "invWeight", <!-- 重量 -->
SUM(AMOUNT) as "amount" <!-- 金额 -->
FROM ${hggpSchema}.HGKC003
WHERE 1=1 AND DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountPeriod">
LEFT(DEPOSIT_DATE,6) = #accountPeriod#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypeDetail">
INVENT_TYPE_DETAIL = #inventTypeDetail#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitStatus">
SUBMIT_STATUS = #submitStatus#
</isNotEmpty>
<isEmpty prepend=" AND " property="submitStatus">
SUBMIT_STATUS = 1
</isEmpty>
GROUP BY ACCOUNT_CODE, DEP_CODE, COMPANY_CODE, WH_CODE
</select>
</sqlMap> </sqlMap>
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
WEIGHT as "weight", <!-- 重量 --> WEIGHT as "weight", <!-- 重量 -->
PARENT_ID as "parentId", <!-- 销售出库单ID --> PARENT_ID as "parentId", <!-- 销售出库单ID -->
PRICE as "price", <!-- 单价 --> PRICE as "price", <!-- 单价 -->
AMOUNT as "amount" <!-- 金额 --> AMOUNT as "amount", <!-- 金额 -->
INVENT_TYPE_DETAIL as "inventTypeDetail"
</sql> </sql>
<sql id="condition"> <sql id="condition">
...@@ -113,6 +114,9 @@ ...@@ -113,6 +114,9 @@
<isNotEmpty prepend=" AND " property="amount"> <isNotEmpty prepend=" AND " property="amount">
AMOUNT = #amount# AMOUNT = #amount#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypeDetail">
INVENT_TYPE_DETAIL = #inventTypeDetail#
</isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="HashMap" resultClass="HGKC004A"> <select id="query" parameterClass="HashMap" resultClass="HGKC004A">
...@@ -162,9 +166,10 @@ ...@@ -162,9 +166,10 @@
WEIGHT, <!-- 重量 --> WEIGHT, <!-- 重量 -->
PARENT_ID, <!-- 销售出库单ID --> PARENT_ID, <!-- 销售出库单ID -->
PRICE, <!-- 单价 --> PRICE, <!-- 单价 -->
AMOUNT <!-- 金额 --> AMOUNT, <!-- 金额 -->
INVENT_TYPE_DETAIL
) )
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #inventRecordId#, #inventType#, #inventCode#, #inventName#, #spec#, #length#, #width#, #thick#, #quantity#, #unitWeight#, #weight#, #parentId#, #price#, #amount#) VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #inventRecordId#, #inventType#, #inventCode#, #inventName#, #spec#, #length#, #width#, #thick#, #quantity#, #unitWeight#, #weight#, #parentId#, #price#, #amount#,#inventTypeDetail#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -210,7 +215,8 @@ ...@@ -210,7 +215,8 @@
WEIGHT = #weight#, <!-- 重量 --> WEIGHT = #weight#, <!-- 重量 -->
PARENT_ID = #parentId#, <!-- 销售出库单ID --> PARENT_ID = #parentId#, <!-- 销售出库单ID -->
PRICE = #price#, <!-- 单价 --> PRICE = #price#, <!-- 单价 -->
AMOUNT = #amount# <!-- 金额 --> AMOUNT = #amount#, <!-- 金额 -->
INVENT_TYPE_DETAIL = #inventTypeDetail#
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
...@@ -235,4 +241,42 @@ ...@@ -235,4 +241,42 @@
GROUP BY a.ACCOUNT_CODE,a.COMPANY_CODE,a.COMPANY_NAME, a.DEP_CODE, b.WH_CODE, b.PROJ_CODE, a.INVENT_CODE GROUP BY a.ACCOUNT_CODE,a.COMPANY_CODE,a.COMPANY_NAME, a.DEP_CODE, b.WH_CODE, b.PROJ_CODE, a.INVENT_CODE
</select> </select>
<select id="queryDetail" resultClass="com.baosight.hggp.hg.kc.domain.HGKC004A">
SELECT
a.ACCOUNT_CODE AS "accountCode",
a.DEP_CODE AS "depCode",
a.COMPANY_CODE as "companyCode",
b.WH_CODE AS "whCode",
a.INVENT_RECORD_ID as "inventRecordId",
a.INVENT_TYPE as "inventType",
a.INVENT_CODE AS "inventCode",
COALESCE(SUM(a.QUANTITY), 0) AS "quantity",
COALESCE(SUM(a.WEIGHT), 0) AS "weight",
COALESCE(SUM(a.AMOUNT)) as "amount"
FROM ${hggpSchema}.HGKC004A a LEFT JOIN ${hggpSchema}.HGKC004 b on a.PARENT_ID = b.ID
WHERE 1=1 and a.DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="accountCode">
a.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
b.WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty property=" AND " prepend="accountPeriod">
LEFT(b.RECEIPT_DATE,6) = #accountPeriod#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypeDetail">
a.INVENT_TYPE_DETAIL = #inventTypeDetail#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitStatus">
b.STATUS = #submitStatus#
</isNotEmpty>
<isEmpty prepend=" AND " property="submitStatus">
b.STATUS = 1
</isEmpty>
GROUP BY a.ACCOUNT_CODE, a.DEP_CODE, a.COMPANY_CODE, b.WH_CODE, a.INVENT_RECORD_ID, a.INVENT_TYPE, a.INVENT_CODE
</select>
</sqlMap> </sqlMap>
...@@ -370,4 +370,81 @@ ...@@ -370,4 +370,81 @@
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, INVENT_TYPE, INVENT_CODE, INVENT_RECORD_ID GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, INVENT_TYPE, INVENT_CODE, INVENT_RECORD_ID
</select> </select>
<select id="queryList" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.kc.domain.HGKC006A">
SELECT
A.ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
A.DEP_CODE as "depCode", <!-- 部门编码 -->
A.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
A.COMPANY_NAME as "companyName", <!-- 公司名称 -->
B.FIELD_OTHER_ENTER_DATE as "otherEnterDate", <!-- 其他入库日期 -->
A.OTHER_ENTER_NO as "otherEnterNo", <!-- 其他入库单号 -->
A.WH_CODE as "whCode", <!-- 仓库编码 -->
A.WH_NAME as "whName", <!-- 仓库名称 -->
A.INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案id -->
A.INVENT_TYPE as "inventType", <!-- 存货类型 -->
A.INVENT_CODE as "inventCode", <!-- 存货编码 -->
A.INVENT_NAME as "inventName", <!-- 存货名称 -->
A.INV_QTY as "invQty", <!-- 数量 -->
A.INV_UNIT_WEIGHT as "invUnitWeight", <!-- 单重 -->
A.INV_WEIGHT as "invWeight", <!-- 重量 -->
A.OTHER_ENTER_NO_OLD as "otherEnterNoOld", <!-- 其他入库单号(旧) -->
A.REMARK as "remark", <!-- 备注 -->
A.FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
A.PROD_ORDER_NO as "prodOrderNo", <!-- 生产订单号 -->
A.PROD_TASK_NO as "prodTaskNo", <!-- 生产任务号 -->
A.PROJ_CODE as "projCode", <!-- 项目编码 -->
A.PROJ_NAME as "projName", <!-- 项目名称 -->
A.PRDT_TYPE as "prdtType", <!-- 产品类型 -->
A.PRDT_CODE as "prdtCode", <!-- 产品编码 -->
A.PRDT_NAME as "prdtName", <!-- 产品名称 -->
A.PRDT_LENGTH as "prdtLength", <!-- 产品-长 -->
A.PRDT_WIDTH as "prdtWidth", <!-- 产品-宽 -->
A.PRDT_THICK as "prdtThick", <!-- 产品-厚 -->
A.PRDT_SPEC as "prdtSpec", <!-- 产品规格 -->
A.PART_TYPE as "partType", <!-- 零件类型 -->
A.PART_CODE as "partCode", <!-- 零件编码 -->
A.PART_NAME as "partName", <!-- 零件名称 -->
A.PART_LENGTH as "partLength", <!-- 零件-长 -->
A.PART_WIDTH as "partWidth", <!-- 零件-宽 -->
A.PART_THICK as "partThick", <!-- 零件-厚 -->
A.PART_COEFFICIENT as "partCoefficient", <!-- 零件-系数 -->
A.PART_SPEC as "partSpec", <!-- 零件规格 -->
A.PART_SPEC_ID as "partSpecId", <!-- 零件规格id -->
A.PRIMARY_ID as "primaryId", <!-- 主表id -->
A.PRICE as "price", <!-- 单价 -->
A.AMOUNT as "amount", <!-- 金额 -->
A.SOURCE as "source", <!-- 数据来源 -->
A.INVENT_TYPE_DETAIL as "inventTypeDetail"
FROM ${hggpSchema}.HGKC006A A
LEFT JOIN ${hggpSchema}.HGKC006 B ON A.PRIMARY_ID = B.ID WHERE 1=1 and A.DELETE_FLAG = 0 AND B.SUBMIT_STATUS = 1
<isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="otherEnterDate">
LEFT(B.OTHER_ENTER_DATE,6) = #otherEnterDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="otherEnterNo">
A.OTHER_ENTER_NO = #otherEnterNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
A.WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypeDetail">
A.INVENT_TYPE_DETAIL = #inventTypeDetail#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
A.OTHER_ENTER_DATE desc
</isEmpty>
</dynamic>
</select>
</sqlMap> </sqlMap>
...@@ -281,7 +281,13 @@ ...@@ -281,7 +281,13 @@
SOURCE, <!-- 数据来源 --> SOURCE, <!-- 数据来源 -->
INVENT_TYPE_DETAIL INVENT_TYPE_DETAIL
) )
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #otherOutDate#, #otherOutNo#, #whCode#, #whName#, #inventRecordId#, #inventType#, #inventCode#, #inventName#, #invQty#, #invUnitWeight#, #invWeight#, #otherOutNoOld#, #remark#, #factoryCode#, #prodOrderNo#, #prodTaskNo#, #projCode#, #projName#, #prdtType#, #prdtCode#, #prdtName#, #prdtLength#, #prdtWidth#, #prdtThick#, #prdtSpec#, #partType#, #partCode#, #partName#, #partLength#, #partWidth#, #partThick#, #partSpec#, #partSpecId#,#primaryId#, #price#, #amount#, #source#,#inventTypeDetail#) VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #otherOutDate#, #otherOutNo#, #whCode#, #whName#,
#inventRecordId#, #inventType#, #inventCode#, #inventName#, #invQty#, #invUnitWeight#, #invWeight#,
#otherOutNoOld#, #remark#, #factoryCode#, #prodOrderNo#, #prodTaskNo#, #projCode#, #projName#, #prdtType#,
#prdtCode#, #prdtName#, #prdtLength#, #prdtWidth#, #prdtThick#, #prdtSpec#, #partType#, #partCode#, #partName#,
#partLength#, #partWidth#, #partThick#, #partSpec#, #partSpecId#,#primaryId#, #price#, #amount#,
#source#,#inventTypeDetail#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -364,4 +370,82 @@ ...@@ -364,4 +370,82 @@
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, INVENT_TYPE, INVENT_CODE, INVENT_RECORD_ID GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, INVENT_TYPE, INVENT_CODE, INVENT_RECORD_ID
</select> </select>
<select id="queryList" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.kc.domain.HGKC007A">
SELECT
A.ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
A.DEP_CODE as "depCode", <!-- 部门编码 -->
A.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
A.COMPANY_NAME as "companyName", <!-- 公司名称 -->
B.OTHER_OUT_DATE as "otherOutDate", <!-- 其他出库日期 -->
B.OTHER_OUT_NO as "otherOutNo", <!-- 其他出库单号 -->
A.WH_CODE as "whCode", <!-- 仓库编码 -->
A.WH_NAME as "whName", <!-- 仓库名称 -->
A.INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案id -->
A.INVENT_TYPE as "inventType", <!-- 存货类型 -->
A.INVENT_CODE as "inventCode", <!-- 存货编码 -->
A.INVENT_NAME as "inventName", <!-- 存货名称 -->
SUM(A.INV_QTY) as "invQty", <!-- 数量 -->
SUM(A.INV_WEIGHT) as "invWeight", <!-- 重量 -->
A.FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
A.PROD_ORDER_NO as "prodOrderNo", <!-- 生产订单号 -->
A.PROD_TASK_NO as "prodTaskNo", <!-- 生产任务号 -->
A.PROJ_CODE as "projCode", <!-- 项目编码 -->
A.PROJ_NAME as "projName", <!-- 项目名称 -->
A.PRDT_TYPE as "prdtType", <!-- 产品类型 -->
A.PRDT_CODE as "prdtCode", <!-- 产品编码 -->
A.PRDT_NAME as "prdtName", <!-- 产品名称 -->
A.PRDT_LENGTH as "prdtLength", <!-- 产品-长 -->
A.PRDT_WIDTH as "prdtWidth", <!-- 产品-宽 -->
A.PRDT_THICK as "prdtThick", <!-- 产品-厚 -->
A.PRDT_SPEC as "prdtSpec", <!-- 产品规格 -->
A.PART_TYPE as "partType", <!-- 零件类型 -->
A.PART_CODE as "partCode", <!-- 零件编码 -->
A.PART_NAME as "partName", <!-- 零件名称 -->
A.PART_LENGTH as "partLength", <!-- 零件-长 -->
A.PART_WIDTH as "partWidth", <!-- 零件-宽 -->
A.PART_THICK as "partThick", <!-- 零件-厚 -->
A.PART_SPEC as "partSpec", <!-- 零件规格 -->
A.PART_SPEC_ID as "partSpecId", <!-- 零件规格id -->
A.PRIMARY_ID as "primaryId", <!-- 主表id -->
CASE WHEN IFNULL(SUM(A.INV_QTY), 0) = 0 THEN 0 ELSE SUM(A.AMOUNT) / IFNULL(SUM(A.INV_QTY), 0) END as "price", <!-- 单价 -->
SUM(A.AMOUNT) as "amount" <!-- 金额 -->
FROM ${hggpSchema}.HGKC007A A
inner join ${hggpSchema}.HGKC007 B on A.PRIMARY_ID = B.ID
WHERE 1=1 and A.DELETE_FLAG = 0 AND B.SUBMIT_STATUS = 1
<isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="otherOutDate">
B.OTHER_OUT_DATE = #otherOutDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="otherOutNo">
B.OTHER_OUT_NO = #otherOutNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
A.WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventRecordId">
A.INVENT_RECORD_ID = #inventRecordId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypeDetail">
A.INVENT_TYPE_DETAIL = #inventTypeDetail#
</isNotEmpty>
GROUP BY A.ACCOUNT_CODE, A.DEP_CODE, A.COMPANY_CODE, A.COMPANY_NAME, B.OTHER_OUT_DATE, B.OTHER_OUT_NO, A.WH_CODE, A.WH_NAME, A.INVENT_RECORD_ID, A.INVENT_TYPE, A.INVENT_CODE, A.INVENT_NAME, A.FACTORY_CODE,
A.PROD_ORDER_NO, A.PROD_TASK_NO, A.PROJ_CODE, A.PROJ_NAME, A.PRDT_TYPE, A.PRDT_CODE, A.PRDT_NAME, A.PRDT_LENGTH, A.PRDT_WIDTH, A.PRDT_THICK, A.PRDT_SPEC, A.PART_TYPE, A.PART_CODE, A.PART_NAME,
A.PART_LENGTH, A.PART_WIDTH, A.PART_THICK, A.PART_SPEC, A.PART_SPEC_ID, A.PRIMARY_ID
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
B.OTHER_OUT_DATE desc
</isEmpty>
</dynamic>
</select>
</sqlMap> </sqlMap>
...@@ -157,7 +157,6 @@ ...@@ -157,7 +157,6 @@
<include refid="condition" /> <include refid="condition" />
</select> </select>
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGKC008A (ID, <!-- 主键id --> INSERT INTO ${hggpSchema}.HGKC008A (ID, <!-- 主键id -->
ACCOUNT_CODE, <!-- 账套 --> ACCOUNT_CODE, <!-- 账套 -->
...@@ -192,7 +191,10 @@ ...@@ -192,7 +191,10 @@
AMOUNT, <!-- 金额 --> AMOUNT, <!-- 金额 -->
INVENT_TYPE_DETAIL INVENT_TYPE_DETAIL
) )
VALUES (#id#, #accountCode#,#projCode#, #projName#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #receiveId#, #companyCode#, #companyName#, #whCode#, #whName#, #inventRecordId#, #inventType#, #inventCode#, #inventName#, #invSpecId#,#invSpec#, #invLength#, #invWidth#, #invThick#, #invQty#, #invUnitWeight#, #invWeight#, #price#, #amount#, #inventTypeDetail#) VALUES (#id#, #accountCode#,#projCode#, #projName#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #receiveId#, #companyCode#, #companyName#, #whCode#,
#whName#, #inventRecordId#, #inventType#, #inventCode#, #inventName#, #invSpecId#,#invSpec#, #invLength#,
#invWidth#, #invThick#, #invQty#, #invUnitWeight#, #invWeight#, #price#, #amount#, #inventTypeDetail#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -236,7 +238,6 @@ ...@@ -236,7 +238,6 @@
WHERE ID = #id# WHERE ID = #id#
</update> </update>
<delete id="batchDelete"> <delete id="batchDelete">
DELETE FROM ${hggpSchema}.HGKC008A WHERE DELETE FROM ${hggpSchema}.HGKC008A WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate> id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
...@@ -261,4 +262,58 @@ ...@@ -261,4 +262,58 @@
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, INVENT_TYPE, INVENT_CODE, INVENT_RECORD_ID GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, INVENT_TYPE, INVENT_CODE, INVENT_RECORD_ID
</select> </select>
<select id="queryList" resultClass="com.baosight.hggp.hg.kc.domain.HGKC008B">
SELECT
A.ACCOUNT_CODE as "accountCode", <!-- 账套 -->
A.DEP_CODE as "depCode", <!-- 部门编码 -->
A.RECEIVE_ID as "receiveId", <!-- 领料单id -->
A.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
A.COMPANY_NAME as "companyName", <!-- 公司名称 -->
B.RECEIPT_DATE as "receiptDate", <!-- 单据日期 -->
B.APPLY_CODE as "applyCode", <!-- 申请单号 -->
A.PROJ_CODE as "projCode", <!-- 项目编码 -->
A.PROJ_NAME as "projName", <!-- 项目名称 -->
A.WH_CODE as "whCode", <!-- 仓库编号 -->
A.WH_NAME as "whName", <!-- 仓库名称 -->
A.INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案id -->
A.INVENT_TYPE as "inventType", <!-- 存货类型 -->
A.INVENT_CODE as "inventCode", <!-- 存货编码 -->
A.INVENT_NAME as "inventName", <!-- 存货名称 -->
A.INV_SPEC_ID as "invSpecId", <!-- 规格Id -->
A.INV_SPEC as "invSpec", <!-- 规格 -->
A.INV_LENGTH as "invLength", <!-- 长度(MM) -->
A.INV_WIDTH as "invWidth", <!-- 宽度(MM) -->
A.INV_THICK as "invThick", <!-- 厚度(MM) -->
SUM(A.INV_QTY) as "invQty", <!-- 数量 -->
SUM(A.INV_WEIGHT) as "invWeight", <!-- 重量 -->
CASE WHEN IFNULL(SUM(A.INV_QTY),0)=0 THEN 0 ELSE SUM(A.AMOUNT) / SUM(A.INV_QTY) END as "price", <!-- 单价 -->
SUM(A.AMOUNT) as "amount", <!-- 金额 -->
A.INVENT_TYPE_DETAIL as "inventTypeDetail"
FROM ${hggpSchema}.HGKC008A A
INNER JOIN ${hggpSchema}.HGKC008 B ON A.RECEIVE_ID = B.ID
WHERE 1=1 AND A.DELETE_FLAG = 0 AND B.STATUS = 1
<isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveId">
A.RECEIVE_ID = #receiveId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
A.WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiptDate">
B.RECEIPT_DATE = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyCode">
B.APPLY_CODE = #applyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypeDetail">
A.INVENT_TYPE_DETAIL = #inventTypeDetail#
</isNotEmpty>
GROUP BY A.ACCOUNT_CODE, A.DEP_CODE, A.RECEIVE_ID, A.COMPANY_CODE, A.COMPANY_NAME, B.RECEIPT_DATE, B.APPLY_CODE, A.PROJ_CODE, A.PROJ_NAME, A.WH_CODE, A.WH_NAME, A.INVENT_RECORD_ID, A.INVENT_TYPE, A.INVENT_CODE, A.INVENT_NAME, A.INV_SPEC_ID, A.INV_SPEC, A.INV_LENGTH, A.INV_WIDTH, A.INV_THICK, A.INVENT_TYPE_DETAIL
</select>
</sqlMap> </sqlMap>
...@@ -295,6 +295,7 @@ public class ServiceHGYX001 extends ServiceEPBase { ...@@ -295,6 +295,7 @@ public class ServiceHGYX001 extends ServiceEPBase {
hgkc004A.setUnitWeight(hgyx001A.getUnitWeight()); hgkc004A.setUnitWeight(hgyx001A.getUnitWeight());
hgkc004A.setWeight(hgyx001A.getWeight()); hgkc004A.setWeight(hgyx001A.getWeight());
hgkc004A.setParentId(hgkc004.getId()); hgkc004A.setParentId(hgkc004.getId());
hgkc004A.setInventTypeDetail(hgyx001A.getInventTypeDetail());
DaoUtils.insert(HGKC004A.INSERT, hgkc004A); DaoUtils.insert(HGKC004A.INSERT, hgkc004A);
} }
......
...@@ -241,6 +241,7 @@ public class ServiceHGYX002 extends ServiceEPBase { ...@@ -241,6 +241,7 @@ public class ServiceHGYX002 extends ServiceEPBase {
hgkc004A.setUnitWeight(hgyx002A.getUnitWeight()); hgkc004A.setUnitWeight(hgyx002A.getUnitWeight());
hgkc004A.setWeight(hgyx002A.getReturnWeight()); hgkc004A.setWeight(hgyx002A.getReturnWeight());
hgkc004A.setParentId(hgkc004.getId()); hgkc004A.setParentId(hgkc004.getId());
hgkc004A.setInventTypeDetail(hgyx002A.getInventTypeDetail());
DaoUtils.insert(HGKC004A.INSERT, hgkc004A); DaoUtils.insert(HGKC004A.INSERT, hgkc004A);
} }
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
<sqlMap resource="com/baosight/hggp/hg/xs/sql/HGXSDataAuth.xml"/> <sqlMap resource="com/baosight/hggp/hg/xs/sql/HGXSDataAuth.xml"/>
<!--成本--> <!--成本-->
<!--<sqlMap resource="com/baosight/hggp/hg/cb/sql/HGCB002.xml"/> <sqlMap resource="com/baosight/hggp/hg/cb/sql/HGCB002.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cb/sql/HGCB003.xml"/> <sqlMap resource="com/baosight/hggp/hg/cb/sql/HGCB003.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cb/sql/HGCB004.xml"/>--> <sqlMap resource="com/baosight/hggp/hg/cb/sql/HGCB004.xml"/>
<!-- 采购 --> <!-- 采购 -->
<sqlMap resource="com/baosight/hggp/hg/cg/sql/HGCG001.xml"/> <sqlMap resource="com/baosight/hggp/hg/cg/sql/HGCG001.xml"/>
......
$(function (){
var companyCodeBox = __eiInfo.getBlock("company_code_block_id").getMappedRows();
var whCodeBox = __eiInfo.getBlock("wh_record_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", function (e) {
query();
})
$("#SYNC").on("click", function () {
showDetail();
});
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 100],
},
columns: [
/*{
field: "operator",
title: "操作",
template: function (item) {
let template = '';
if (item.id) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ')" >台账详情</a>';
}
return template;
}
},*/
{
field: "receiptDate",
attributes: {
class: "i-input-readonly"
},
defaultValue: function () {
return currShortDate();
}
}
],
exportGrid: {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "原材料入库成本核算_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls", // 默认值是xls,可选值为pdf[规划中]
exportBlockId: "result", // 默认值和blockId相同,导出的EiInfo中的指定数据块被导出
},
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "price") {
let items = e.items[0];
for (let i = 0; i < items.length; i++) {
let amount = items[i].price * items[i].quantity;
resultGrid.setCellValue(e.items[i],"amount",amount);
}
}
});
},
afterEdit:function (e) {
/*if (e.field === "groupCode" && e.model["companyCode"].length === 0) {
for (let i = 0; i < groupCodeBox.length; i++) {
if (e.model[e.field] === groupCodeBox[i]["valueField"]) {
e.model["companyCode"] = groupCodeBox[i]["param3Field"]
break;
}
}
}*/
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {
}
}
}
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let price= item.get("price");
let amount= item.get("amount");
if(isBlank(price)){
message("选中的第"+(index+1)+"行\"单价\",不能为空!");
flag = false;
return false;
}
if(isBlank(amount)){
message("选中的第"+(index+1)+"行\"金额\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCB002", "save", true);
btnNode.attr("disabled", false);
}
});
}
};
/**
* 显示详情
*/
function showDetail(id) {
JSColorbox.open({
href: "HGCB002A?methodName=initLoad",
title: "<div style='text-align: center;'>选择公司</div>",
width: "60%",
height: "60%",
callbackName: windowCallback
});
}
function windowCallback(companyCode) {
synchData(companyCode);
// 关闭弹窗
JSColorbox.close();
// 刷新列表
query();
}
/**
* 确认
*/
let synchData = function (companyCode) {
let info = new EiInfo();
info.set("inqu_status-0-companyCode", companyCode);
EiCommunicator.send("HGCB002", "select", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/6/25
Time: 10:22
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<EF:EFPage title="原材料入库成本核算">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="company_code_block_id" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="业务类型" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgcb.bizType"/>
</EF:EFSelect>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="accountPeriod" cname="会计期" colWidth="3"
format="yyyy-MM" depth="year" start="year" required="true"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="企业编码" hidden="true"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="company_code_block_id" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="accountPeriod" cname="会计期" enable="false" width="120" align="center"
editType="date" dateFormat="yyyy-MM" parseFormats="['yyyyMM']"/>
<EF:EFComboColumn ename="bizType" cname="业务类型" width="120" enable="true" align="center" required="true">
<EF:EFCodeOption codeName="hggp.hgcb.bizType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="receiptDate" cname="单据日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="false" required="true"/>
<EF:EFColumn ename="receiptCode" cname="单据号" enable="false" width="120" align="center" required="true"/>
<EF:EFComboColumn ename="whCode" cname="仓库名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="140" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货编码" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="spec" cname="规格" width="120" enable="true" readonly="true" align="center" required="true"/>
<%--<EF:EFComboColumn ename="spec" cname="规格" enable="true" width="120" align="center" required="true"
blockName="spec_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>--%>
<EF:EFColumn ename="unit" cname="单位" width="100" enable="true" readonly="false" align="center"/>
<EF:EFColumn ename="quantity" cname="数量" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn ename="weight" cname="重量" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFComboColumn ename="computeType" cname="是否暂估" width="100" enable="true" align="center" required="true">
<EF:EFCodeOption codeName="hggp.common.yesNo"/>
</EF:EFComboColumn>
<EF:EFColumn ename="price" cname="单价" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="amount" cname="金额" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function() {
$(".row").children().attr("class", "col-md-3");
$("#CONFIRM").on("click", function () {
confirm();
});
});
/**
* 确认
*/
let confirm = function () {
let companyCode = $("#inqu_status-0-companyCode").val();
if (companyCode.length < 1) {
message("请选择公司");
return;
}
parent.JSColorbox.setValueCallback(companyCode);
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/6/25
Time: 17:45
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="选择公司">
<EF:EFRegion id="inqu" title="记录明细">
<div class="row">
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3" filter="contains">
<EF:EFOption label="-- 请选择 --" value="" />
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
</EF:EFPage>
$(function (){
var companyCodeBox = __eiInfo.getBlock("company_code_block_id").getMappedRows();
var whCodeBox = __eiInfo.getBlock("wh_code_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 100],
},
columns: [
/*{
field: "operator",
title: "操作",
template: function (item) {
let template = '';
if (item.id) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ')" >台账详情</a>';
}
return template;
}
},*/
{
field: "receiptDate",
attributes: {
class: "i-input-readonly"
},
defaultValue: function () {
return currShortDate();
}
}
],
exportGrid: {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "原材料入库成本核算_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls", // 默认值是xls,可选值为pdf[规划中]
exportBlockId: "result", // 默认值和blockId相同,导出的EiInfo中的指定数据块被导出
},
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "price") {
let items = e.items[0];
for (let i = 0; i < items.length; i++) {
let amount = items[i].price * items[i].quantity;
resultGrid.setCellValue(e.items[i],"amount",amount);
}
}
});
},
afterEdit:function (e) {
/*if (e.field === "groupCode" && e.model["companyCode"].length === 0) {
for (let i = 0; i < groupCodeBox.length; i++) {
if (e.model[e.field] === groupCodeBox[i]["valueField"]) {
e.model["companyCode"] = groupCodeBox[i]["param3Field"]
break;
}
}
}*/
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {
}
}
}
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let price= item.get("price");
let amount= item.get("amount");
if(isBlank(price)){
message("选中的第"+(index+1)+"行\"单价\",不能为空!");
flag = false;
return false;
}
if(isBlank(amount)){
message("选中的第"+(index+1)+"行\"金额\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCB002", "save", true);
btnNode.attr("disabled", false);
}
});
}
};
/**
* 显示详情
*/
function showDetail(id) {
JSColorbox.open({
href: "HGCB002A?methodName=initLoad",
title: "<div style='text-align: center;'>选择公司</div>",
width: "60%",
height: "60%",
callbackName: windowCallback
});
}
function windowCallback(companyCode) {
synchData(companyCode);
// 关闭弹窗
JSColorbox.close();
// 刷新列表
query();
}
/**
* 确认
*/
let synchData = function (companyCode) {
let info = new EiInfo();
info.set("inqu_status-0-companyCode", companyCode);
EiCommunicator.send("HGCB004", "synchData", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/6/25
Time: 10:22
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<EF:EFPage title="原材料出库成本核算">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="业务类型" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFSelect>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="accountPeriod" cname="会计期" colWidth="3"
format="yyyy-MM" depth="year" start="year" required="true"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="80" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="accountPeriod" cname="会计期" enable="false" width="120" align="center"
editType="date" dateFormat="yyyy-MM" parseFormats="['yyyyMM']"/>
<EF:EFComboColumn ename="bizType" cname="业务类型" width="120" enable="true" align="center" required="true">
<EF:EFCodeOption codeName="hggp.hgsj.computeType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="receiptDate" cname="单据日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="false" required="true"/>
<EF:EFColumn ename="receiptCode" cname="单据号" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="whCode" cname="仓库名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="140" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="wh_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货编码" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFComboColumn ename="spec" cname="规格" enable="true" width="120" align="center" required="true"
blockName="spec_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="unit" cname="单位" width="80" enable="true" readonly="false" align="center"/>
<EF:EFColumn ename="quantity" cname="数量" width="100" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn ename="weight" cname="重量" width="100" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFComboColumn ename="computeType" cname="是否暂估" width="80" enable="true" align="center" required="true">
<EF:EFCodeOption codeName="hggp.hgsj.computeType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="price" cname="单价" width="100" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="amount" cname="金额" width="100" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function (){
$(".row").children().attr("class", "col-md-3");
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 100],
},
columns: [
],
exportGrid: {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "收发存汇总_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls", // 默认值是xls,可选值为pdf[规划中]
exportBlockId: "result", // 默认值和blockId相同,导出的EiInfo中的指定数据块被导出
},
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
/*grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "price") {
let items = e.items[0];
for (let i = 0; i < items.length; i++) {
let amount = items[i].price * items[i].quantity;
resultGrid.setCellValue(e.items[i],"amount",amount);
}
}
});*/
},
afterEdit:function (e) {
/*if (e.field === "groupCode" && e.model["companyCode"].length === 0) {
for (let i = 0; i < groupCodeBox.length; i++) {
if (e.model[e.field] === groupCodeBox[i]["valueField"]) {
e.model["companyCode"] = groupCodeBox[i]["param3Field"]
break;
}
}
}*/
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
//save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {
}
}
}
$("#SYNC").on("click", function () {
showDetail();
});
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 显示详情
*/
function showDetail() {
JSColorbox.open({
href: "HGCB002A?methodName=initLoad",
title: "<div style='text-align: center;'>选择公司</div>",
width: "30%",
height: "45%",
callbackName: windowCallback
});
}
function windowCallback(companyCode) {
synchData(companyCode);
JSColorbox.close();
}
/**
* 确认
*/
let synchData = function (companyCode) {
let info = new EiInfo();
info.set("inqu_status-0-companyCode", companyCode);
EiCommunicator.send("HGCB004", "synchData", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/6/25
Time: 10:23
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<EF:EFPage title="收发存汇总">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="accountPeriod" cname="会计期" colWidth="3"
format="yyyy-MM" depth="year" start="year" required="true"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="whCode" cname="仓库名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="inventName" cname="存货名称" placeholder="模糊查询" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="80" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="accountPeriod" cname="会计期" enable="false" width="120" align="center"
editType="date" dateFormat="yyyy-MM" parseFormats="['yyyyMM']"/>
<EF:EFComboColumn ename="whCode" cname="仓库名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="140" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="wh_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="物料编码" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="inventName" cname="物料名称" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFComboColumn ename="spec" cname="规格" enable="true" width="120" align="center" required="true"
blockName="spec_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="inventRecordId" cname="规格ID" width="80" enable="true" readonly="false" type="hidden" align="center"/>
<EF:EFColumn ename="initQuantity" cname="期初数量" width="100" enable="true" format="{0:N0}" editType="text"
displayType="0" sort="true" align="right" maxLength="15" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn ename="initAmount" cname="期初金额" width="100" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="15" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="enterQuantity" cname="入库数量" width="100" enable="true" format="{0:N0}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="15" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn ename="enterAmount" cname="入库金额" width="100" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="15" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="outerQuantity" cname="出库数量" width="100" enable="true" format="{0:N0}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="15" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn ename="outerAmount" cname="出库重量" width="100" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="endQuantity" cname="期末数量" width="100" enable="true" format="{0:N0}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="15" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn ename="endAmount" cname="期末金额" width="100" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment