Commit 560cbb37 by wuwenlong

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

parents 30d4345a 845601a8
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/5/29
*/
public enum AllotTypeEnum {
ZZN(1,"组织内"),
ZZJ(2,"组织间");
private Integer code;
private String value;
AllotTypeEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
public static EiBlock generatorEiBlock() {
EiBlock block = new EiBlock("allot_type_block_id");
List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>() {{
add(new HashMap<String, Object>() {{
put(HGConstants.TEXT_FIELD, ZZN.value);
put(HGConstants.VALUE_FIELD, ZZN.code);
}});
add(new HashMap<String, Object>() {{
put(HGConstants.TEXT_FIELD, ZZJ.value);
put(HGConstants.VALUE_FIELD, ZZJ.code);
}});
}};
block.setRows(rows);
return block;
}
public static AllotTypeEnum getEnumByCode(Integer code){
for (AllotTypeEnum en : AllotTypeEnum.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;
}
}
......@@ -91,7 +91,7 @@ public enum DdynamicEnum {
* 用途:存货档案下拉框,带id名称等信息
* 编写:
*/
PRODUCT_BLOCK_ID("product_block_id","inventCode","inventName","id","inventType","length","width","thick","HGPZ005.queryProductComboBox"),
PRODUCT_BLOCK_ID("product_block_id","inventCode","inventName","id","inventType","length","width","thick","inventTypeDetail","HGPZ005.queryProductComboBox"),
/**
* 模块:存货档案(ALL)
* 用途:存货档案下拉框
......@@ -123,6 +123,20 @@ public enum DdynamicEnum {
*/
SPEC_NAME_BLOCK_ID("spec_name_block_id", "spec", "spec", "HGPZ005.queryComboBoxSpecName"),
/**
* 模块:从实时库存取存货信息
* 用途:调拨单下拉框
* 编写:ly
*/
INVENT_CODE_BOX_BLOCK_ID("invent_code_box_block_id", "inventCode", "inventName","inventType", "specId", "HGKC010.queryInventCodeBox"),
/**
* 模块:从实时库存取规格信息
* 用途:调拨单下拉框
* 编写:ly
*/
SPEC_BOX_BLOCK_ID("spec_box_block_id", "spec", "spec","length", "width","thick","invQty","invUnitWeight","invWeight","specId", "HGKC010.querySpecIdBox"),
/**
* 模块:仓库类型
* 用途:仓库类型下拉框
......@@ -138,6 +152,17 @@ public enum DdynamicEnum {
WH_RECORD_BLOCK_ID("wh_record_block_id", "whCode", "whName", "HGPZ007.queryComboBox"),
/**
* 模块:从实时库存取仓库信息
* 用途:调拨单下拉框
* 编写:ly
*/
WH_RECORD_BOX_BLOCK_ID("wh_record_box_block_id", "whCode", "whName","companyCode","companyName", "HGKC010.queryWhCodeBox",
new HashMap<String,Object>(){{
put("deleteFlag", CommonConstant.YesNo.NO_0);
}}),
/**
* 模块:仓库档案
* 用途:仓库档案下拉框 不默认状态
* 编写:
......
......@@ -74,7 +74,7 @@ public class DaoUtils {
}
/**
* update method.
* updateBatch method.
*
* @param sql
* @param parameters
......@@ -91,6 +91,23 @@ public class DaoUtils {
}
/**
* insertBatch method.
*
* @param sql
* @param parameters
*/
public static int insertBatch(String sql, Collection parameters) {
parameters.forEach(obj->{
if (obj instanceof DaoEPBase) {
setRevisor((DaoEPBase) obj, true);
} else if (obj instanceof Map) {
setRevisor((Map) obj, true);
}
});
return DaoBase.getInstance().insertBatch(sql, parameters);
}
/**
* 创建人工号 创建人姓名 创建人岗号 创建时刻
*
* @param bean
......
......@@ -109,12 +109,16 @@ public class HGConstant {
public static final String UPKEEP_CODE = "UPKEEP_CODE";
// 蓝图编号
public static final String BLUEPRINT_CODE = "BLUEPRINT_CODE";
// 生产领料单编号
public static final String RECEIVE_CODE = "RECEIVE_CODE";
public static final String CW_CONTRACT_NO = "CW_CONTRACT_NO";
public static final String CW_SETTLEMENT_NO = "CW_SETTLEMENT_NO";
// 销售出库单号
public static final String SALE_OUT_CODE = "SALE_OUT_CODE";
// 调拨单号
public static final String ALLOT_NO = "ALLOT_NO";
public static final String CW_COLLECTION_NO = "CW_COLLECTION_NO";
......
......@@ -55,6 +55,7 @@ public class HGCW006 extends DaoEPBase {
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 记录修改名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 记录修改时间*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_REMAINING_AMOUNT = "remainingAmount"; /* 剩余开票/收票金额*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -89,6 +90,7 @@ public class HGCW006 extends DaoEPBase {
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 记录修改名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 记录修改时间*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_REMAINING_AMOUNT = "REMAINING_AMOUNT";
public static final String QUERY = "HGCW006.query";
public static final String COUNT = "HGCW006.count";
......@@ -129,7 +131,7 @@ public class HGCW006 extends DaoEPBase {
private String updatedName = " "; /* 记录修改名称*/
private String updatedTime = " "; /* 记录修改时间*/
private String depCode = " "; /* 部门编码*/
private BigDecimal remainingAmount = new BigDecimal("0"); /* 剩余开票/收票金额*/
/**
* initialize the metadata.
*/
......@@ -281,7 +283,12 @@ public class HGCW006 extends DaoEPBase {
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REMAINING_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("剩余开票/收票金额");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -819,6 +826,14 @@ public class HGCW006 extends DaoEPBase {
public void setDepCode(String depCode) {
this.depCode = depCode;
}
public BigDecimal getRemainingAmount() {
return remainingAmount;
}
public void setRemainingAmount(BigDecimal remainingAmount) {
this.remainingAmount = remainingAmount;
}
/**
* get the value from Map.
*
......@@ -860,6 +875,7 @@ public class HGCW006 extends DaoEPBase {
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setRemainingAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_REMAINING_AMOUNT)), remainingAmount));
}
/**
......@@ -902,6 +918,7 @@ public class HGCW006 extends DaoEPBase {
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)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_REMAINING_AMOUNT, StringUtils.toString(remainingAmount, eiMetadata.getMeta(FIELD_REMAINING_AMOUNT)));
return map;
}
......
......@@ -48,7 +48,7 @@ public class HGCW010 extends DaoEPBase {
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 记录修改名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 记录修改时间*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_REMAINING_AMOUNT = "remainingAmount"; /* 累计结算价税合计金额*/
public static final String FIELD_REMAINING_AMOUNT = "remainingAmount"; /* 剩余开票/收票金额*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -94,10 +94,10 @@ public class HGCW010 extends DaoEPBase {
private String settlementNumber = " "; /* 来源单号*/
private String billTybe = " "; /* 票据类型*/
private String billNumber = " "; /* 发票号*/
private String billState = " "; /* 开票状态*/
private Integer billState; /* 开票状态*/
private String signingDate = " "; /* 开票日期*/
private String partyA = " "; /* 客户名称*/
private Boolean reviewStatus; /* 审批状态*/
private Integer reviewStatus; /* 审批状态*/
private String thisSettlementTax = " "; /* 税额*/
private String thisSettlementAmount = " "; /* 不含税金额*/
private String taxPoints = " "; /* 税率*/
......@@ -381,7 +381,7 @@ public class HGCW010 extends DaoEPBase {
* get the billState - 开票状态.
* @return the billState
*/
public String getBillState() {
public Integer getBillState() {
return this.billState;
}
......@@ -390,7 +390,7 @@ public class HGCW010 extends DaoEPBase {
*
* @param billState - 开票状态
*/
public void setBillState(String billState) {
public void setBillState(Integer billState) {
this.billState = billState;
}
/**
......@@ -429,7 +429,7 @@ public class HGCW010 extends DaoEPBase {
* get the reviewStatus - 审批状态.
* @return the reviewStatus
*/
public Boolean getReviewStatus() {
public Integer getReviewStatus() {
return this.reviewStatus;
}
......@@ -438,7 +438,7 @@ public class HGCW010 extends DaoEPBase {
*
* @param reviewStatus - 审批状态
*/
public void setReviewStatus(Boolean reviewStatus) {
public void setReviewStatus(Integer reviewStatus) {
this.reviewStatus = reviewStatus;
}
/**
......@@ -642,10 +642,10 @@ public class HGCW010 extends DaoEPBase {
setSettlementNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SETTLEMENT_NUMBER)), settlementNumber));
setBillTybe(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BILL_TYBE)), billTybe));
setBillNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BILL_NUMBER)), billNumber));
setBillState(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BILL_STATE)), billState));
setBillState(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_BILL_STATE)), billState));
setSigningDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SIGNING_DATE)), signingDate));
setPartyA(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_A)), partyA));
setReviewStatus(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_REVIEW_STATUS)), reviewStatus));
setReviewStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_REVIEW_STATUS)), reviewStatus));
setThisSettlementTax(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_TAX)), thisSettlementTax));
setThisSettlementAmount(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_AMOUNT)), thisSettlementAmount));
setTaxPoints(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_TAX_POINTS)), taxPoints));
......
package com.baosight.hggp.hg.cw.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn;
......@@ -12,12 +13,13 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Project: <br>
* Title:HGCW012.java <br>
* Description: <br>
* yukang
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-05-27 16:53:39 create
* @history 2024-05-30 14:16:59 create
*/
public class HGCW012 extends DaoEPBase {
private static final long serialVersionUID = 1L;
......@@ -44,6 +46,7 @@ public class HGCW012 extends DaoEPBase {
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 记录修改名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 记录修改时间*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_REMAINING_AMOUNT = "remainingAmount"; /* 剩余开票/收票金额*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -67,6 +70,7 @@ public class HGCW012 extends DaoEPBase {
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 记录修改名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 记录修改时间*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_REMAINING_AMOUNT = "REMAINING_AMOUNT"; /* 剩余开票/收票金额*/
public static final String QUERY = "HGCW012.query";
public static final String COUNT = "HGCW012.count";
......@@ -84,7 +88,7 @@ public class HGCW012 extends DaoEPBase {
private Integer billState = new Integer(0); /* 开票状态*/
private String signingDate = " "; /* 开票日期*/
private String partyA = " "; /* 供应商名称*/
private Boolean reviewStatus; /* 审批状态*/
private Integer reviewStatus; /* 审批状态*/
private Integer taxPoints = new Integer(0); /* 税率*/
private String thisSettlementTax = " "; /* 税额*/
private String thisSettlementAmount = " "; /* 不含税金额*/
......@@ -96,6 +100,7 @@ public class HGCW012 extends DaoEPBase {
private String updatedName = " "; /* 记录修改名称*/
private String updatedTime = " "; /* 记录修改时间*/
private String depCode = " "; /* 部门编码*/
private BigDecimal remainingAmount = new BigDecimal("0"); /* 剩余开票/收票金额*/
/**
* initialize the metadata.
......@@ -145,7 +150,6 @@ public class HGCW012 extends DaoEPBase {
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REVIEW_STATUS);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("审批状态");
eiMetadata.addMeta(eiColumn);
......@@ -196,6 +200,13 @@ public class HGCW012 extends DaoEPBase {
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REMAINING_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("剩余开票/收票金额");
eiMetadata.addMeta(eiColumn);
}
......@@ -370,7 +381,7 @@ public class HGCW012 extends DaoEPBase {
* get the reviewStatus - 审批状态.
* @return the reviewStatus
*/
public Boolean getReviewStatus() {
public Integer getReviewStatus() {
return this.reviewStatus;
}
......@@ -379,7 +390,7 @@ public class HGCW012 extends DaoEPBase {
*
* @param reviewStatus - 审批状态
*/
public void setReviewStatus(Boolean reviewStatus) {
public void setReviewStatus(Integer reviewStatus) {
this.reviewStatus = reviewStatus;
}
/**
......@@ -559,6 +570,22 @@ public class HGCW012 extends DaoEPBase {
this.depCode = depCode;
}
/**
* get the remainingAmount - 剩余开票/收票金额.
* @return the remainingAmount
*/
public BigDecimal getRemainingAmount() {
return this.remainingAmount;
}
/**
* set the remainingAmount - 剩余开票/收票金额.
*
* @param remainingAmount - 剩余开票/收票金额
*/
public void setRemainingAmount(BigDecimal remainingAmount) {
this.remainingAmount = remainingAmount;
}
/**
* get the value from Map.
*
* @param map - source data map
......@@ -576,7 +603,7 @@ public class HGCW012 extends DaoEPBase {
setBillState(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_BILL_STATE)), billState));
setSigningDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SIGNING_DATE)), signingDate));
setPartyA(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_A)), partyA));
setReviewStatus(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_REVIEW_STATUS)), reviewStatus));
setReviewStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_REVIEW_STATUS)), reviewStatus));
setTaxPoints(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_TAX_POINTS)), taxPoints));
setThisSettlementTax(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_TAX)), thisSettlementTax));
setThisSettlementAmount(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_AMOUNT)), thisSettlementAmount));
......@@ -588,6 +615,7 @@ public class HGCW012 extends DaoEPBase {
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setRemainingAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_REMAINING_AMOUNT)), remainingAmount));
}
/**
......@@ -619,6 +647,7 @@ public class HGCW012 extends DaoEPBase {
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)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_REMAINING_AMOUNT, StringUtils.toString(remainingAmount, eiMetadata.getMeta(FIELD_REMAINING_AMOUNT)));
return map;
}
......
package com.baosight.hggp.hg.cw.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn;
......@@ -16,13 +17,14 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-05-27 16:30:51 create
* @history 2024-05-30 14:16:59 create
*/
public class HGCW013 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_ID = "id";
public static final String FIELD_MAIN_ID = "mainId"; /* 主表ID*/
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码*/
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 公司编码*/
......@@ -42,7 +44,7 @@ public class HGCW013 extends DaoEPBase {
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 记录修改时间*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String COL_ID = "ID";
public static final String COL_ID = "ID";
public static final String COL_MAIN_ID = "MAIN_ID"; /* 主表ID*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 公司编码*/
......@@ -68,7 +70,7 @@ public class HGCW013 extends DaoEPBase {
public static final String UPDATE = "HGCW013.update";
public static final String DELETE = "HGCW013.delete";
private Long id = new Long(0);
private Long id = new Long(0);
private Long mainId = new Long(0); /* 主表ID*/
private String accountCode = " "; /* 企业编码*/
private String companyCode = " "; /* 公司编码*/
......@@ -195,7 +197,7 @@ public class HGCW013 extends DaoEPBase {
/**
* set the id .
*
* @param id
* @param id
*/
public void setId(Long id) {
this.id = id;
......
......@@ -148,6 +148,9 @@ public class HGCW014 extends DaoEPBase {
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_TOTAL_CONTRACT_PRICE_INCLUDING);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("收款总额");
eiMetadata.addMeta(eiColumn);
......
......@@ -127,6 +127,9 @@ public class HGCW015 extends DaoEPBase {
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_TOTAL_CONTRACT_PRICE_INCLUDING);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("收款总额");
eiMetadata.addMeta(eiColumn);
......
......@@ -31,7 +31,7 @@ public class ServiceHGCW001 extends ServiceBase {
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW001().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
......
......@@ -2,22 +2,24 @@ package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW010;
import com.baosight.hggp.hg.cw.domain.HGCW010A;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.pz.domain.HGPZ002;
import com.baosight.hggp.hg.pz.domain.HGPZ003;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.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.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.util.StringUtils;
import org.apache.commons.collections.CollectionUtils;
import java.util.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author yukang
......@@ -31,129 +33,38 @@ public class ServiceHGCW010A extends ServiceBase {
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJECT_CODE_BOX_BLOCK_ID), null, false);
inInfo.addBlock("detail1").addBlockMeta(new HGCW010().eiMetadata);
inInfo.addBlock("detail2").addBlockMeta(new HGCW010().eiMetadata);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW010A().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 甲方名称查询
* 合同类别为收入时,乙方为组织机构中的公司,甲方选择客户档案里的客户;数据提交之后需要把客户档案中的客户类别更新为正式客户
* 合同类别为支出时,甲方为组织机构中的公司,乙方选择供应商档案里面的供应商
* @param inInfo
* @return
*/
public EiInfo partyAQuery(EiInfo inInfo) {
try {
List<UserVO> userVOList = new ArrayList<>();
String contractCategory = inInfo.getString("contractCategory");
if (contractCategory.equals("1")) {
List<HGPZ002> hgpz002List = HGPZTools.HgPz002.list(1);
if (CollectionUtils.isNotEmpty(hgpz002List)) {
hgpz002List.forEach(hgpz002 -> {
UserVO userVO = new UserVO();
userVO.setUsercode(hgpz002.getCustCode());
userVO.setUsername(hgpz002.getCustName());
userVOList.add(userVO);
});
}
} else if (contractCategory.equals("2")) {
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isNotEmpty(orgList)) {
Org org = orgList.get(0);
if (!org.getOrgType().equals("company")) {
//如果不是公司公司,则找到上一级
Org org1 = HGXSTools.XsOrg.queryCompany(org.getOrgId());
UserVO userVO = new UserVO();
userVO.setUsercode(org1.getOrgId());
userVO.setUsername(org1.getOrgCname());
userVOList.add(userVO);
} else {
UserVO userVO = new UserVO();
userVO.setUsercode(org.getOrgId());
userVO.setUsername(org.getOrgCname());
userVOList.add(userVO);
}
}
}
inInfo.addBlock("partyAResult").addRows(userVOList);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "甲方名称查询失败");
}
return inInfo;
}
/**
* 乙方名称查询
* 查询操作
*
*
* @param inInfo
* @return
*/
public EiInfo partyBQuery(EiInfo inInfo) {
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
List<UserVO> userVOList = new ArrayList<>();
String contractCategory = inInfo.getString("contractCategory");
if (contractCategory.equals("1")) {
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isNotEmpty(orgList)) {
Org org = orgList.get(0);
if (!org.getOrgType().equals("company")) {
//如果不是公司公司,则找到上一级
Org org1 = HGXSTools.XsOrg.queryCompany(org.getOrgId());
UserVO userVO = new UserVO();
userVO.setUsercode(org1.getOrgId());
userVO.setUsername(org1.getOrgCname());
userVOList.add(userVO);
} else {
UserVO userVO = new UserVO();
userVO.setUsercode(org.getOrgId());
userVO.setUsername(org.getOrgCname());
userVOList.add(userVO);
}
}
} else if (contractCategory.equals("2")) {
List<HGPZ003> hgpz003List = HGPZTools.HgPz003.list(4);
if (CollectionUtils.isNotEmpty(hgpz003List)) {
hgpz003List.forEach(hgpz003 -> {
UserVO userVO = new UserVO();
userVO.setUsercode(hgpz003.getSupCode());
userVO.setUsername(hgpz003.getSupName());
userVOList.add(userVO);
});
}
}
inInfo.addBlock("partyAResult").addRows(userVOList);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "乙方名称查询失败");
inInfo = super.query(inInfo, HGCW010A.QUERY, new HGCW010A());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
public EiInfo queryconteractComboBox(EiInfo inInfo){
Map<String, Object> map = new HashMap<>();
List<String> contractTypArray = new ArrayList<>();
if (StringUtils.isNotEmpty(inInfo.getString("contractNumber"))) {
map.put("contractNumber", inInfo.getString("contractNumber"));
}
if (StringUtils.isNotEmpty(inInfo.getString("settlementNumber"))) {
map.put("settlementNumber", inInfo.getString("settlementNumber"));
}
if (StringUtils.isNotEmpty(inInfo.getString("settlementNumbers"))) {
String[] settlementNumbers = inInfo.getString("settlementNumbers").split(",");
for (String c : settlementNumbers) {
contractTypArray.add(c);
}
map.put("settlementNumbers", contractTypArray);
}
List<HGCW010> HGCW010List = dao.query("HGCW010.queryconteractComboBox", map);
inInfo.addBlock("conteract_combo_box").setRows(HGCW010List);
return inInfo;
}
}
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW011;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.LogUtils;
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.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW011 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID,
DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW011().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGCW011.QUERY, new HGCW011());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGCW011 HGCW011 = new HGCW011();
HGCW011.fromMap(resultRows.get(i));
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
HGCW011.setCompanyCode(userVO.getUsercode());
HGCW011.setCompanyName(userVO.getUsername());
if (HGCW011.getId() == null || HGCW011.getId() == 0) {
this.add(HGCW011);
} else {
this.modify(HGCW011);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param HGCW011
* @return
*/
public void add(HGCW011 HGCW011) {
DaoUtils.insert("HGCW011.insert", HGCW011);
}
/**
* 修改操作
*
* @param HGCW011
* @return
*/
public void modify(HGCW011 HGCW011) {
DaoUtils.update("HGCW011.update", HGCW011);
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
DaoUtils.update("HGCW011.delete", resultRows.get(i));
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.cw.service;
import com.baosight.eplat.utils.StringUtils;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW012;
import com.baosight.hggp.hg.cw.domain.HGCW010;
import com.baosight.hggp.hg.cw.domain.HGCW011;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.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.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.util.NumberUtils;
import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
......@@ -33,12 +39,12 @@ public class ServiceHGCW012 extends ServiceBase {
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
@OperationLogAnnotation(operModul = "销售开票",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID,
DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW012().eiMetadata);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUP_RECORD_BLOCK_ID,
DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW010().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
......@@ -51,11 +57,11 @@ public class ServiceHGCW012 extends ServiceBase {
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "查询")
@OperationLogAnnotation(operModul = "销售开票",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGCW012.QUERY, new HGCW012());
inInfo = super.query(inInfo, HGCW010.QUERY, new HGCW010());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
......@@ -68,23 +74,27 @@ public class ServiceHGCW012 extends ServiceBase {
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "保存",operDesc = "保存")
@OperationLogAnnotation(operModul = "收款单",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGCW012 HGCW012 = new HGCW012();
HGCW012.fromMap(resultRows.get(i));
HGCW010 HGCW010 = new HGCW010();
HGCW010.fromMap(resultRows.get(i));
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
HGCW012.setCompanyCode(userVO.getUsercode());
HGCW012.setCompanyName(userVO.getUsername());
if (HGCW012.getId() == null || HGCW012.getId() == 0) {
this.add(HGCW012);
HGCW010.setCompanyCode(userVO.getUsercode());
HGCW010.setCompanyName(userVO.getUsername());
HGCW010.setBillState(1);
HGCW010.setReviewStatus(0);
HGCW010.setSigningDate(DateUtils.formatShort(HGCW010.getSigningDate()));
// 获取项目名称
HGSC001 HGSC001 = HGSCTools.Hgsc001.queryByCode(HGCW010.getProjCode());
HGCW010.setProjName(HGSC001.getProjName());
if (HGCW010.getId() == null || HGCW010.getId() == 0) {
this.add(HGCW010);
} else {
this.modify(HGCW012);
this.modify(HGCW010);
}
}
inInfo = this.query(inInfo);
......@@ -99,21 +109,21 @@ public class ServiceHGCW012 extends ServiceBase {
/**
* 新增操作
*
* @param HGCW012
* @param HGCW010
* @return
*/
public void add(HGCW012 HGCW012) {
DaoUtils.insert("HGCW012.insert", HGCW012);
public void add(HGCW010 HGCW010) {
DaoUtils.insert("HGCW010.insert", HGCW010);
}
/**
* 修改操作
*
* @param HGCW012
* @param HGCW010
* @return
*/
public void modify(HGCW012 HGCW012) {
DaoUtils.update("HGCW012.update", HGCW012);
public void modify(HGCW010 HGCW010) {
DaoUtils.update("HGCW010.update", HGCW010);
}
/**
......@@ -122,12 +132,12 @@ public class ServiceHGCW012 extends ServiceBase {
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "删除",operDesc = "删除")
@OperationLogAnnotation(operModul = "收款单",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
DaoUtils.update("HGCW012.delete", resultRows.get(i));
DaoUtils.update("HGCW010.delete", resultRows.get(i));
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......@@ -138,6 +148,68 @@ public class ServiceHGCW012 extends ServiceBase {
return inInfo;
}
@OperationLogAnnotation(operModul = "收款单",operType = "插入",operDesc = "生成收款单")
public EiInfo select(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<Map> queryRows = inInfo.getBlock(EiConstant.queryBlock).getRows();
String mainId = "";
if (CollectionUtils.isNotEmpty(queryRows)) {
mainId = queryRows.get(0).get("mainId").toString();
}
//获取相应的数据
List<HGCW011> hgcw011List = HGCWTools.HgCw011.mapToList(resultRows, NumberUtils.toLong(mainId));
DecimalFormat decimalFormat = new DecimalFormat("#.000");
if (CollectionUtils.isNotEmpty(hgcw011List)) {
if (StringUtils.isEmpty(mainId)) {
//先生成主表
HGCW010 HGCW010 = new HGCW010();
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
HGCW010.setCompanyCode(userVO.getUsercode());
HGCW010.setCompanyName(userVO.getUsername());
HGCW010.setBillState(1);
HGCW010.setReviewStatus(0);
HGCW010.setSigningDate(DateUtils.shortDate());
BigDecimal totalContractPriceIncluding = BigDecimal.ZERO;
StringBuffer contractNumber = new StringBuffer();
for (HGCW011 hgcw011 : hgcw011List) {
totalContractPriceIncluding = totalContractPriceIncluding.add(hgcw011.getTotalContractPriceIncluding());
}
HGCW010.setTotalContractPriceIncluding(new BigDecimal(decimalFormat.format(totalContractPriceIncluding)));
HGCW010.setPartyA(hgcw011List.get(0).getPartyA());
this.add(HGCW010);
//生成明细表
for (HGCW011 hgcw011 : hgcw011List) {
hgcw011.setMainId(HGCW010.getId());
DaoUtils.insert(HGCW011.INSERT, hgcw011);
}
} else {
// 更新主表
HGCW010 HGCW010 = HGCWTools.HgCw010.getId(mainId);
BigDecimal totalContractPriceIncluding = BigDecimal.ZERO;
StringBuffer contractNumber = new StringBuffer();
for (HGCW011 hgcw011 : hgcw011List) {
totalContractPriceIncluding = totalContractPriceIncluding.add(hgcw011.getTotalContractPriceIncluding());
}
HGCW010.setTotalContractPriceIncluding(new BigDecimal(decimalFormat.format(totalContractPriceIncluding)));
this.modify(HGCW010);
// 生成明细表
for (HGCW011 hgcw011 : hgcw011List) {
hgcw011.setMainId(HGCW010.getId());
DaoUtils.insert(HGCW011.INSERT, hgcw011);
}
}
}
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "生成收款单失败");
}
return inInfo;
}
}
......
......@@ -6,6 +6,7 @@ import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.cw.domain.HGCW005;
import com.baosight.hggp.hg.cw.domain.HGCW006;
import com.baosight.hggp.hg.cw.domain.HGCW014;
import com.baosight.hggp.hg.cw.domain.HGCW015;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
......@@ -46,7 +47,7 @@ public class ServiceHGCW014 extends ServiceBase {
@OperationLogAnnotation(operModul = "收款单",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUP_RECORD_BLOCK_ID,
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID,
DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW014().eiMetadata);
} catch (PlatException e) {
......@@ -142,7 +143,17 @@ public class ServiceHGCW014 extends ServiceBase {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
DaoUtils.update("HGCW014.delete", resultRows.get(i));
HGCW014 HGCW014 = new HGCW014();
HGCW014.fromMap(resultRows.get(i));
List<HGCW015> hgcw015List = HGCWTools.HgCw015.getMainId(HGCW014.getId());
if (CollectionUtils.isNotEmpty(hgcw015List)) {
for (HGCW015 hgcw015 : hgcw015List) {
HGCWTools.HgCw010.cutAmount(hgcw015.getContractNumber(),
hgcw015.getTotalContractPriceIncluding().multiply(new BigDecimal(-1)));
DaoUtils.update("HGCW015.delete", hgcw015);
}
}
DaoUtils.update("HGCW014.delete", HGCW014);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......@@ -246,6 +257,47 @@ public class ServiceHGCW014 extends ServiceBase {
DaoUtils.insert("HGCW015.insert", HGCW015);
}
/**
* 提交操作
* @param inInfo
* @return
*/
public EiInfo submit(EiInfo inInfo){
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGCW014 HGCW014 = new HGCW014();
HGCW014.fromMap(resultRows.get(i));
HGCW014.setReviewStatus(3);
DaoUtils.update("HGCW014.submit", HGCW014);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据提交成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
public EiInfo writeoff(EiInfo inInfo){
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGCW014 HGCW014 = new HGCW014();
HGCW014.fromMap(resultRows.get(i));
HGCW014.setCancelStatus(2);
DaoUtils.update("HGCW014.writeoff", HGCW014);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据提交成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
......
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.hg.cw.domain.HGCW015;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.LogUtils;
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.Arrays;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW014C extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID,
DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW015().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGCW015.QUERY, new HGCW015());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.hg.cw.domain.HGCW012;
import com.baosight.hggp.hg.cw.domain.HGCW012;
import com.baosight.hggp.util.LogUtils;
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;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW016A extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW012().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGCW012.QUERY, new HGCW012());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.hg.cw.domain.HGCW017;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.LogUtils;
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.Arrays;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW016B extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUP_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW017().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGCW017.QUERY, new HGCW017());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.hg.cw.domain.HGCW015;
import com.baosight.hggp.hg.cw.domain.HGCW017;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.LogUtils;
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.Arrays;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW016C extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUP_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW017().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGCW017.QUERY, new HGCW017());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW017;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.LogUtils;
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.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW017 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID,
DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW017().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGCW017.QUERY, new HGCW017());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
Long mainId = null;
for (int i = 0; i < resultRows.size(); i++) {
HGCW017 HGCW017 = new HGCW017();
HGCW017.fromMap(resultRows.get(i));
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
HGCW017.setCompanyCode(userVO.getUsercode());
HGCW017.setCompanyName(userVO.getUsername());
mainId = HGCW017.getMainId();
if (HGCW017.getId() == null || HGCW017.getId() == 0) {
this.add(HGCW017);
} else {
// 回写数据
HGCW017 oldHGCW017 = HGCWTools.HgCw017.getId(HGCW017.getId());
//先加再扣
HGCWTools.HgCw012.cutAmount(oldHGCW017.getContractNumber(),
oldHGCW017.getTotalContractPriceIncluding().multiply(new BigDecimal(-1)));
this.modify(HGCW017);
HGCWTools.HgCw012.cutAmount(HGCW017.getContractNumber(),
HGCW017.getTotalContractPriceIncluding());
}
}
// 更新主表
HGCWTools.HgCw016.updateAmount(mainId);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param HGCW017
* @return
*/
public void add(HGCW017 HGCW017) {
DaoUtils.insert("HGCW017.insert", HGCW017);
}
/**
* 修改操作
*
* @param HGCW017
* @return
*/
public void modify(HGCW017 HGCW017) {
DaoUtils.update("HGCW017.update", HGCW017);
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
Long mainId = null;
for (int i = 0; i < resultRows.size(); i++) {
HGCW017 HGCW017 = new HGCW017();
HGCW017.fromMap(resultRows.get(i));
mainId = HGCW017.getMainId();
DaoUtils.update("HGCW017.delete", HGCW017);
HGCWTools.HgCw012.cutAmount(HGCW017.getContractNumber(),
HGCW017.getTotalContractPriceIncluding().multiply(new BigDecimal(-1)));
}
// 更新主表
HGCWTools.HgCw016.updateAmount(mainId);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
......@@ -171,6 +171,7 @@
TOTAL_CONTRACT_PRICE_EXCLUDING as "totalContractPriceExcluding", <!-- 合同总价(不含税) -->
VALUE_ADDED_TAX as "valueAddedTax", <!-- 增值税 -->
TOTAL_CONTRACT_PRICE_INCLUDING as "totalContractPriceIncluding", <!-- 合同总价(含税) -->
REMAINING_AMOUNT as "remainingAmount", <!-- 剩余金额 -->
REVIEW_STATUS as "reviewStatus", <!-- 审核状态 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
......@@ -325,6 +326,7 @@
TOTAL_CONTRACT_PRICE_EXCLUDING, <!-- 合同总价(不含税) -->
VALUE_ADDED_TAX, <!-- 增值税 -->
TOTAL_CONTRACT_PRICE_INCLUDING, <!-- 合同总价(含税) -->
REMAINING_AMOUNT, <!-- 剩余金额 -->
REVIEW_STATUS, <!-- 审核状态 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
......@@ -334,7 +336,7 @@
UPDATED_TIME, <!-- 记录修改时间 -->
DEP_CODE <!-- 部门编码 -->
)
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #projCode#, #projName#, #contractNumber#, #contractName#, #partyA#, #partyB#, #signingDate#, #totalQuantity#, #partyAName#, #partyAPhoneNumber#, #alreadyName#, #alreadyPhoneNumber#, #contractStatus#, #leaseStartDate#, #leaseEndDate#, #paymentMethod#, #pricingMethod#, #taxPoints#, #totalContractPriceExcluding#, #valueAddedTax#, #totalContractPriceIncluding#, #reviewStatus#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #projCode#, #projName#, #contractNumber#, #contractName#, #partyA#, #partyB#, #signingDate#, #totalQuantity#, #partyAName#, #partyAPhoneNumber#, #alreadyName#, #alreadyPhoneNumber#, #contractStatus#, #leaseStartDate#, #leaseEndDate#, #paymentMethod#, #pricingMethod#, #taxPoints#, #totalContractPriceExcluding#, #valueAddedTax#, #totalContractPriceIncluding#,#remainingAmount#, #reviewStatus#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGCW006
</selectKey>
......@@ -388,4 +390,14 @@
ID = #id#
</update>
<update id="updateDeductionAmount">
UPDATE ${hggpSchema}.HGCW006
SET
REMAINING_AMOUNT = #remainingAmount#, <!-- 审核状态 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime# <!-- 记录修改时间 -->
WHERE
ID = #id#
</update>
</sqlMap>
......@@ -294,32 +294,6 @@
WHERE
ID = #id#
</update>
<select id="queryconteractComboBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT DISTINCT
A.COMPANY_NAME as "companyName", <!-- 所属公司 -->
A.PROJ_CODE as "projCode", <!-- 项目编号 -->
A.PROJ_NAME as "projName", <!-- 项目名称 -->
A.CONTRACT_NUMBER as "contractNumber", <!-- 合同号 -->
A.CONTRACT_NAME as "contractName", <!-- 合同名称 -->
A.SETTLEMENT_NUMBER as "settlementNumber", <!-- 结算编号 -->
A.THIS_SETTLEMENT_TAX as "thisSettlementTax", <!-- 税金 -->
A.THIS_SETTLEMENT_AMOUNT as "thisSettlementAmount", <!-- 结算金额 -->
A.THIS_PRICE_TAX as "thisPriceTax", <!-- 税价合计 -->
B.CONTRACT_TYPE as "contractType" <!-- 合同类型 -->
FROM ${hggpSchema}.HGCW008 A LEFT JOIN ${hggpSchema}.HGCW002 B
ON A.PROJ_CODE = B.PROJ_CODE
AND A.CONTRACT_NUMBER = B.CONTRACT_NUMBER
AND A.COMPANY_CODE = B.COMPANY_CODE
WHERE 1=1 AND B.CONTRACT_TYPE = 1 AND A.SETTLEMENT_TYPE = 2
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
A.COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
ORDER BY A.CONTRACT_NUMBER
</select>
<update id="updateDeductionAmount">
UPDATE ${hggpSchema}.HGCW010
......
<?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-05-27 16:30:51
Generate time : 2024-05-30 14:16:59
Version : 1.0
schema : hggp
tableName : HGCW013
......@@ -24,7 +24,7 @@
UPDATED_TIME VARCHAR NOT NULL,
DEP_CODE VARCHAR
-->
<sqlMap namespace="HGCW013">
<sqlMap namespace="hgcw013">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
......@@ -87,7 +87,7 @@
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cw.domain.HGCW013">
resultClass="com.baosight.hggp.hg.cw.service.Hgcw013">
SELECT
ID as "id",
MAIN_ID as "mainId", <!-- 主表ID -->
......
......@@ -56,8 +56,14 @@
<isNotEmpty prepend=" AND " property="signingDate">
SIGNING_DATE = #signingDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDateFrom">
SIGNING_DATE &gt;= REPLACE(#signingDateFrom#, '-', '')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDateTo">
SIGNING_DATE &lt;= REPLACE(#signingDateTo#, '-', '')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
PARTY_A like ('%$partyA$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="cancelStatus">
CANCEL_STATUS = #cancelStatus#
......@@ -254,4 +260,25 @@
ID = #id#
</update>
<update id="submit">
UPDATE ${hggpSchema}.HGCW014
SET
REVIEW_STATUS = #reviewStatus#, <!-- 审核状态 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime# <!-- 记录修改时间 -->
WHERE
ID = #id#
</update>
<update id="writeoff">
UPDATE ${hggpSchema}.HGCW014
SET
CANCEL_STATUS = #cancelStatus#, <!-- 审核状态 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime# <!-- 记录修改时间 -->
WHERE
ID = #id#
</update>
</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-05-30 11:09:35
Version : 1.0
schema : hggp
tableName : HGCW016
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
CONTRACT_NUMBER VARCHAR,
INCOME_NUMBER VARCHAR,
SIGNING_DATE VARCHAR,
PARTY_A VARCHAR,
CANCEL_STATUS TINYINT,
REVIEW_STATUS TINYINT,
TOTAL_CONTRACT_PRICE_INCLUDING VARCHAR,
CREATED_BY VARCHAR NOT NULL,
CREATED_NAME VARCHAR NOT NULL,
CREATED_TIME VARCHAR NOT NULL,
UPDATED_BY VARCHAR NOT NULL,
UPDATED_NAME VARCHAR NOT NULL,
UPDATED_TIME VARCHAR NOT NULL,
DEP_CODE VARCHAR
-->
<sqlMap namespace="HGCW016">
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="incomeNumber">
INCOME_NUMBER = #incomeNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDateFrom">
SIGNING_DATE &gt;= REPLACE(#signingDateFrom#, '-', '')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDateTo">
SIGNING_DATE &lt;= REPLACE(#signingDateTo#, '-', '')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A like ('%$partyA$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="cancelStatus">
CANCEL_STATUS = #cancelStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reviewStatus">
REVIEW_STATUS = #reviewStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceIncluding">
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cw.domain.HGCW016">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
CONTRACT_NUMBER as "contractNumber", <!-- 来源单号 -->
INCOME_NUMBER as "incomeNumber", <!-- 单号 -->
SIGNING_DATE as "signingDate", <!-- 付款日期 -->
PARTY_A as "partyA", <!-- 供应商名称 -->
CANCEL_STATUS as "cancelStatus", <!-- 核销状态 -->
REVIEW_STATUS as "reviewStatus", <!-- 审批状态 -->
TOTAL_CONTRACT_PRICE_INCLUDING as "totalContractPriceIncluding", <!-- 付款总额 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DEP_CODE as "depCode" <!-- 部门编码 -->
FROM ${hggpSchema}.HGCW016 WHERE 1=1
<include refid="condition" />
<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 ${hggpSchema}.HGCW016 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="incomeNumber">
INCOME_NUMBER = #incomeNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDate">
SIGNING_DATE = #signingDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="cancelStatus">
CANCEL_STATUS = #cancelStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reviewStatus">
REVIEW_STATUS = #reviewStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceIncluding">
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGCW016 (ID,
ACCOUNT_CODE, <!-- 企业编码 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
CONTRACT_NUMBER, <!-- 来源单号 -->
INCOME_NUMBER, <!-- 单号 -->
SIGNING_DATE, <!-- 付款日期 -->
PARTY_A, <!-- 供应商名称 -->
CANCEL_STATUS, <!-- 核销状态 -->
REVIEW_STATUS, <!-- 审批状态 -->
TOTAL_CONTRACT_PRICE_INCLUDING, <!-- 付款总额 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
DEP_CODE <!-- 部门编码 -->
)
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #contractNumber#, #incomeNumber#, #signingDate#, #partyA#, #cancelStatus#, #reviewStatus#, #totalContractPriceIncluding#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGCW016
</selectKey>
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGCW016 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGCW016
SET
CONTRACT_NUMBER = #contractNumber#, <!-- 来源单号 -->
INCOME_NUMBER = #incomeNumber#, <!-- 单号 -->
SIGNING_DATE = #signingDate#, <!-- 付款日期 -->
PARTY_A = #partyA#, <!-- 供应商名称 -->
CANCEL_STATUS = #cancelStatus#, <!-- 核销状态 -->
REVIEW_STATUS = #reviewStatus#, <!-- 审批状态 -->
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#, <!-- 付款总额 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime# <!-- 记录修改时间 -->
WHERE
ID = #id#
</update>
<update id="submit">
UPDATE ${hggpSchema}.HGCW016
SET
REVIEW_STATUS = #reviewStatus#, <!-- 审核状态 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime# <!-- 记录修改时间 -->
WHERE
ID = #id#
</update>
<update id="writeoff">
UPDATE ${hggpSchema}.HGCW016
SET
CANCEL_STATUS = #cancelStatus#, <!-- 审核状态 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime# <!-- 记录修改时间 -->
WHERE
ID = #id#
</update>
</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-05-30 11:09:41
Version : 1.0
schema : hggp
tableName : HGCW017
ID BIGINT NOT NULL primarykey,
MAIN_ID BIGINT NOT NULL,
ACCOUNT_CODE VARCHAR,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
CONTRACT_NUMBER VARCHAR,
PARTY_A VARCHAR,
TOTAL_CONTRACT_PRICE_INCLUDING DECIMAL,
CREATED_BY VARCHAR NOT NULL,
CREATED_NAME VARCHAR NOT NULL,
CREATED_TIME VARCHAR NOT NULL,
UPDATED_BY VARCHAR NOT NULL,
UPDATED_NAME VARCHAR NOT NULL,
UPDATED_TIME VARCHAR NOT NULL,
DEP_CODE VARCHAR
-->
<sqlMap namespace="HGCW017">
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="mainId">
MAIN_ID = #mainId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceIncluding">
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cw.domain.HGCW017">
SELECT
ID as "id",
MAIN_ID as "mainId", <!-- 主表ID -->
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
CONTRACT_NUMBER as "contractNumber", <!-- 来源单号 -->
PARTY_A as "partyA", <!-- 供应商名称 -->
TOTAL_CONTRACT_PRICE_INCLUDING as "totalContractPriceIncluding", <!-- 收款总额 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DEP_CODE as "depCode" <!-- 部门编码 -->
FROM ${hggpSchema}.HGCW017 WHERE 1=1
<include refid="condition" />
<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 ${hggpSchema}.HGCW017 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="mainId">
MAIN_ID = #mainId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceIncluding">
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGCW017 (
MAIN_ID, <!-- 主表ID -->
ACCOUNT_CODE, <!-- 企业编码 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
CONTRACT_NUMBER, <!-- 来源单号 -->
PARTY_A, <!-- 供应商名称 -->
TOTAL_CONTRACT_PRICE_INCLUDING, <!-- 收款总额 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
DEP_CODE <!-- 部门编码 -->
)
VALUES (#mainId#, #accountCode#, #companyCode#, #companyName#, #contractNumber#, #partyA#, #totalContractPriceIncluding#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGCW017 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGCW017
SET
MAIN_ID = #mainId#, <!-- 主表ID -->
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
CONTRACT_NUMBER = #contractNumber#, <!-- 来源单号 -->
PARTY_A = #partyA#, <!-- 供应商名称 -->
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#, <!-- 收款总额 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
DEP_CODE = #depCode# <!-- 部门编码 -->
WHERE
ID = #id#
</update>
</sqlMap>
......@@ -301,6 +301,15 @@ public class HGCWTools {
}
public static class HgCw010 {
public static HGCW010 getId(String id) {
AssertUtils.isNull(id, "销售票据ID不能为空!");
List<HGCW010> results = DaoBase.getInstance().query(HGCW010.QUERY,new HashMap<String,Object>(){
{put("id",id);}
});
return results.get(0);
}
public static void cutAmount(String settlementNumber, BigDecimal cutAmount) {
AssertUtils.isNull(settlementNumber, "来源单号不能为空!");
// if (cutAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
......@@ -323,6 +332,52 @@ public class HGCWTools {
}
}
public static class HgCw011 {
public static List<HGCW011> mapToList(List<Map> rows, Long mainId) {
List<HGCW011> hgcw011List = new ArrayList<>();
if (CollectionUtils.isNotEmpty(rows)) {
rows.forEach(row -> {
HGCW011 hgcw011 = new HGCW011();
hgcw011.fromMap(row);
String contractNumber = row.get("settlementNumber").toString();
String remainingAmount = row.get("remainingAmount").toString();
hgcw011.setBillNumber(contractNumber);
hgcw011.setTotalContractPriceIncluding(new BigDecimal(remainingAmount));
if (mainId != null) {
hgcw011.setMainId(mainId);
}
hgcw011List.add(hgcw011);
});
}
return hgcw011List;
}
}
public static class HgCw012 {
public static void cutAmount(String settlementNumber, BigDecimal cutAmount) {
AssertUtils.isNull(settlementNumber, "来源单号不能为空!");
// if (cutAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
// throw new PlatException("扣款金额不能小于等于0!");
// }
List<HGCW012> results = DaoBase.getInstance().query(HGCW012.QUERY,new HashMap<String,Object>(){
{put("settlementNumber",settlementNumber);}
});
if (CollectionUtils.isEmpty(results)) {
throw new PlatException("找不到对应的采购收票记录!");
}
DecimalFormat decimalFormat = new DecimalFormat("#.000");
HGCW012 HGCW012 = results.get(0);
BigDecimal remainingAmount = new BigDecimal(decimalFormat.format(HGCW012.getRemainingAmount().subtract(cutAmount)));
if (remainingAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
throw new PlatException("扣款金额不能大于采购收票剩余金额!");
}
HGCW012.setRemainingAmount(remainingAmount);
DaoUtils.update("HGCW012.updateDeductionAmount", HGCW012);
}
}
public static class HgCw014 {
public static HGCW014 getId(String id) {
......@@ -392,6 +447,74 @@ public class HGCWTools {
}
}
public static class HgCw016 {
public static HGCW016 getId(String id) {
AssertUtils.isNull(id, "付款单ID不能为空!");
List<HGCW016> results = DaoBase.getInstance().query(HGCW016.QUERY,new HashMap<String,Object>(){
{put("id",id);}
});
return results.get(0);
}
public static void updateAmount(Long id) {
AssertUtils.isNull(id, "收款单ID不能为空!");
HGCW016 hgcw016 = HGCWTools.HgCw016.getId(id.toString());
List<HGCW017> hgcw017s = HGCWTools.HgCw017.getMainId(hgcw016.getId());
if (CollectionUtils.isNotEmpty(hgcw017s)) {
// 更新主表
BigDecimal totalContractPriceIncluding = BigDecimal.ZERO;
StringBuffer contractNumber = new StringBuffer();
for (HGCW017 hgcw017 : hgcw017s) {
totalContractPriceIncluding = totalContractPriceIncluding.add(hgcw017.getTotalContractPriceIncluding());
contractNumber.append(hgcw017.getContractNumber()).append(",");
}
hgcw016.setTotalContractPriceIncluding(totalContractPriceIncluding);
hgcw016.setPartyA(hgcw017s.get(0).getPartyA());
hgcw016.setContractNumber(contractNumber.toString().substring(0, contractNumber.length() - 1));
DaoUtils.update("HGCW016.update", hgcw016);
}
}
}
public static class HgCw017 {
public static HGCW017 getId(Long id) {
AssertUtils.isNull(id, "付款单ID不能为空!");
List<HGCW017> results = DaoBase.getInstance().query(HGCW017.QUERY,new HashMap<String,Object>(){
{put("id",id);}
});
return results.get(0);
}
public static List<HGCW017> mapToList(List<Map> rows, Long mainId) {
List<HGCW017> hgcw017List = new ArrayList<>();
if (CollectionUtils.isNotEmpty(rows)) {
rows.forEach(row -> {
HGCW017 hgcw017 = new HGCW017();
hgcw017.fromMap(row);
String contractNumber = row.get("settlementNumber").toString();
String remainingAmount = row.get("thisAmount").toString();
hgcw017.setContractNumber(contractNumber);
hgcw017.setTotalContractPriceIncluding(new BigDecimal(remainingAmount));
if (mainId != null) {
hgcw017.setMainId(mainId);
}
hgcw017List.add(hgcw017);
});
}
return hgcw017List;
}
public static List<HGCW017> getMainId(Long mainId) {
AssertUtils.isNull(mainId, "主表ID不能为空!");
List<HGCW017> results = DaoBase.getInstance().query(HGCW017.QUERY,new HashMap<String,Object>(){
{put("mainId",mainId);}
});
return results;
}
}
public static class HgCw999 {
public static void batchUpdate(List<Map> rows, Long id) {
......
......@@ -115,6 +115,7 @@ public class HGKC003 extends DaoEPBase {
public static final String UPDATE = "HGKC003.update";
public static final String DELETE = "HGKC003.delete";
public static final String UPDATE_SUBMIT_STATUS = "HGKC003.updateSubmitStatus";
public static final String MAX_ID = "HGKC003.maxId";
private Long id = new Long(0);
private Long qualityId = new Long(0); /* 质检单id*/
......
......@@ -23,6 +23,7 @@ public class HGKC003A extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_QUALITY_DETAIL_ID = "qualityDetailId"; /* 质检单明细ID*/
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 记录创建者*/
......@@ -68,6 +69,7 @@ public class HGKC003A extends DaoEPBase {
public static final String FIELD_STORAGE_TYPE = "storageType"; /* 入库类型:0:入库 1:退回*/
public static final String COL_ID = "ID";
public static final String COL_QUALITY_DETAIL_ID = "QUALITY_DETAIL_ID"; /* 质检单明细ID*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 记录创建者*/
......@@ -120,6 +122,7 @@ public class HGKC003A extends DaoEPBase {
public static final String BATCH_DELETE = "HGKC003A.batchDelete";
private Long id = new Long(0);
private Long qualityDetailId = new Long(0); /* 质检单明细ID*/
private String accountCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 记录创建者*/
......@@ -175,6 +178,10 @@ public class HGKC003A extends DaoEPBase {
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_QUALITY_DETAIL_ID);
eiColumn.setDescName("质检单明细ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ACCOUNT_CODE);
eiColumn.setDescName("企业编码");
eiMetadata.addMeta(eiColumn);
......@@ -1094,6 +1101,15 @@ public class HGKC003A extends DaoEPBase {
public void setStorageType(Boolean storageType) {
this.storageType = storageType;
}
public Long getQualityDetailId() {
return qualityDetailId;
}
public void setQualityDetailId(Long qualityDetailId) {
this.qualityDetailId = qualityDetailId;
}
/**
* get the value from Map.
*
......@@ -1103,6 +1119,7 @@ public class HGKC003A extends DaoEPBase {
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setQualityDetailId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_QUALITY_DETAIL_ID)), qualityDetailId));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
......@@ -1156,6 +1173,7 @@ public class HGKC003A extends DaoEPBase {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_QUALITY_DETAIL_ID, StringUtils.toString(qualityDetailId, eiMetadata.getMeta(FIELD_QUALITY_DETAIL_ID)));
map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
......
......@@ -56,8 +56,8 @@ public class ServiceHGKC003 extends ServiceBase {
@OperationLogAnnotation(operModul = "生产入库单", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
HGKCUtils.HgKc003.setCondition(queryRow);
// Map queryRow = EiInfoUtils.getFirstRow(inInfo);
// HGKCUtils.HgKc003.setCondition(queryRow);
inInfo = super.query(inInfo, HGKC003.QUERY, new HGKC003());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......
......@@ -84,7 +84,6 @@ public class ServiceHGKC006A extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) {
HGKC006A hgkc006A = new HGKC006A();
hgkc006A.fromMap(resultRows.get(i));
hgkc006A.setInvWeight(hgkc006A.getInvUnitWeight().multiply(hgkc006A.getInvQty()));
if (hgkc006A.getId() == null || hgkc006A.getId() == 0) {
Map queryMap = new HashMap();
queryMap.put("id",inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC006A.FIELD_PRIMARY_ID));
......
......@@ -86,7 +86,6 @@ public class ServiceHGKC007A extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) {
HGKC007A hgkc007A = new HGKC007A();
hgkc007A.fromMap(resultRows.get(i));
hgkc007A.setInvWeight(hgkc007A.getInvUnitWeight().multiply(hgkc007A.getInvQty()));
if (hgkc007A.getId() == null || hgkc007A.getId() == 0) {
Map queryMap = new HashMap();
queryMap.put("id",inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC006A.FIELD_PRIMARY_ID));
......
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.domain.HGKC008;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.*;
/**
* @Author jhs
* @Date 2024/5/14 14:46
*/
public class ServiceHGKC008 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGKC008.QUERY, new HGKC008());
Map map = new HashMap();
map.put(HGKC008.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID,DdynamicEnum.WH_RECORD_BOX_BLOCK_ID),map,false
);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGKC008.QUERY, new HGKC008());
Map map = new HashMap();
map.put(HGKC008.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID,DdynamicEnum.WH_RECORD_BOX_BLOCK_ID),map,false
);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 蓝图ids
List<Long> ids = ObjectUtils.listKey(resultRows, HGKC008.FIELD_ID);
DaoUtils.update(HGKC008.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}});
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
public EiInfo save(EiInfo inInfo){
try {
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
HGKC008 hgkc008 = new HGKC008();
hgkc008.fromMap(resultMap);
this.checkSaveData(hgkc008);
if(Objects.nonNull(hgkc008.getId())&&hgkc008.getId()!=0){
DaoUtils.update(HGKC008.UPDATE, hgkc008);
}else {
//生成蓝图编号
hgkc008.setApplyCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.BLUEPRINT_CODE));
hgkc008.setStatus(HGConstant.ProductStatus.WTJ);
DaoUtils.insert(HGKC008.INSERT, hgkc008);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param hgkc008
*/
private void checkSaveData(HGKC008 hgkc008) {
if(Objects.nonNull(hgkc008.getId())&&hgkc008.getId()>0){
AssertUtils.isTrue(hgkc008.getStatus().compareTo(HGConstant.ProductStatus.YTJ) == 0,"领料单已提交,不可修改");
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(hgkc008.getCompanyCode(), "请选择公司!");
AssertUtils.isEmpty(hgkc008.getWhCode(), "请选择仓库信息!");
AssertUtils.isEmpty(hgkc008.getWhName(), "请选择仓库信息!");
}
/**
* 修改启用状态
* @param inInfo
* @return
*/
public EiInfo updateStatus(EiInfo inInfo){
int i = 0;
try {
HGKC008 hgkc008 = new HGKC008();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgkc008.fromMap(map);
DaoUtils.update(HGKC008.UPDATE_STATUS, hgkc008);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleUpdateException(inInfo,i,e);
logError("修改失败", e.getMessage());
return inInfo;
}
return inInfo;
}
}
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.kc.domain.HGKC004;
import com.baosight.hggp.hg.kc.domain.HGKC008;
import com.baosight.hggp.hg.kc.domain.HGKC008A;
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.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.*;
/**
* @Author jhs
* @Date 2024/5/14 14:46
*/
public class ServiceHGKC008A extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGKC008A.QUERY, new HGKC008A());
String whCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC008A.FIELD_WH_CODE);
Map map = new HashMap();
map.put(HGKC008A.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode());
map.put(HGKC008A.FIELD_WH_CODE, whCode);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID,DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID,DdynamicEnum.SPEC_BOX_BLOCK_ID),map,false
);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGKC008A.QUERY, new HGKC008A());
String whCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC008A.FIELD_WH_CODE);
Map map = new HashMap();
map.put(HGKC008A.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode());
map.put(HGKC008A.FIELD_WH_CODE, whCode);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID,DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID,DdynamicEnum.SPEC_BOX_BLOCK_ID),map,false
);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 蓝图ids
List<Long> ids = ObjectUtils.listKey(resultRows, HGKC008A.FIELD_ID);
DaoUtils.update(HGKC008A.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}});
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
public EiInfo save(EiInfo inInfo){
try {
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
HGKC008A hgkc008a = new HGKC008A();
hgkc008a.fromMap(resultMap);
//查询领料单
HGKC008 hgkc008 = (HGKC008) super.dao.get(HGKC008.QUERY,HGKC008.FIELD_ID,hgkc008a.getReceiveId());
this.setData(hgkc008a,hgkc008);
this.checkSaveData(hgkc008a);
if(Objects.nonNull(hgkc008a.getId())&&hgkc008a.getId()!=0){
DaoUtils.update(HGKC008A.UPDATE, hgkc008a);
}else {
DaoUtils.insert(HGKC008A.INSERT, hgkc008a);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 给明细赋值
* @param hgkc008a
* @param hgkc008
*/
private void setData(HGKC008A hgkc008a, HGKC008 hgkc008) {
if(Objects.nonNull(hgkc008)){
hgkc008a.setProjCode(hgkc008.getProjCode());
hgkc008a.setProjName(hgkc008.getProjName());
hgkc008a.setWhCode(hgkc008.getWhCode());
hgkc008a.setWhName(hgkc008.getWhName());
}
}
/**
* 校验保存的数据
*
* @param hgkc008a
*/
private void checkSaveData(HGKC008A hgkc008a) {
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isNull(hgkc008a.getReceiveId(), "未获取到生产领料单ID信息");
}
}
......@@ -2,16 +2,20 @@ package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
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.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
......@@ -19,7 +23,7 @@ import java.util.Map;
* @date:2024/5/9,11:04
*/
public class ServiceHGKC010 extends ServiceBase {
/**
* 画面初始化
*
......@@ -41,7 +45,7 @@ public class ServiceHGKC010 extends ServiceBase {
}
return inInfo;
}
/**
* 查询操作
*
......@@ -59,5 +63,44 @@ public class ServiceHGKC010 extends ServiceBase {
}
return inInfo;
}
/**
* 实时库存下拉框
* @param inInfo
* @return
*/
public EiInfo queryInventCodeBox(EiInfo inInfo){
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String whCode = MapUtils.getString(queryMap, HGKC010.FIELD_WH_CODE);
String inventType = MapUtils.getString(queryMap, HGKC010.FIELD_INVENT_TYPE);
Map map = new HashMap();
map.put(HGKC010.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode());
map.put(HGKC010.FIELD_WH_CODE, whCode);
map.put(HGKC010.FIELD_INVENT_TYPE, inventType);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID), map,false);
return inInfo;
}
/**
* 实时库存规格下拉框
* @param inInfo
* @return
*/
public EiInfo querySpecBox(EiInfo inInfo){
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String whCode = MapUtils.getString(queryMap, HGKC010.FIELD_WH_CODE);
String inventType = MapUtils.getString(queryMap, HGKC010.FIELD_INVENT_TYPE);
String inventCode = MapUtils.getString(queryMap, HGKC010.FIELD_INVENT_CODE);
Map map = new HashMap();
map.put(HGKC010.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode());
map.put(HGKC010.FIELD_WH_CODE, whCode);
map.put(HGKC010.FIELD_INVENT_TYPE, inventType);
map.put(HGKC010.FIELD_INVENT_CODE, inventCode);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_BOX_BLOCK_ID), map,false);
return inInfo;
}
}
package com.baosight.hggp.hg.kc.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.core.dao.DaoUtils;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.domain.HGKC013;
import com.baosight.hggp.hg.kc.domain.HGKC013A;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.*;
/**
* @author LiuYang
* @version 1.0 2024/5/29
*/
public class ServiceHGKC013A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
Map map = EiInfoUtils.getFirstRow(inInfo);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC013A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGKC013A.QUERY, new HGKC013A());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID,DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID,DdynamicEnum.SPEC_BOX_BLOCK_ID),
new HashMap<String,Object>(){{
put(HGKC013.FIELD_COMPANY_CODE,map.get(HGKC013.FIELD_CALLOUT_COMPANY_CODE));
put(HGKC010.FIELD_WH_CODE,map.get(HGKC013A.FIELD_CALLOUT_WH_CODE));
put(HGKC013A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
}}, false);
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC013A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo, HGKC013A.QUERY,new HGKC013A());
}
@OperationLogAnnotation(operModul = "调拨单详情",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
int status = Integer.parseInt(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC013.FIELD_STATUS));
if (status==1) {
throw new PlatException("单据状态为已提交,不能删除!");
}
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HGKC013A hgkc013a = new HGKC013A();
hgkc013a.fromMap(map);
hgkc013a.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGKC013A.DELETE_FLAG, hgkc013a);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "调拨单详情",operType = "保存",operDesc = "保存操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
int status = Integer.parseInt(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC013.FIELD_STATUS));
String calloutWhCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC013A.FIELD_CALLOUT_WH_CODE);
String calloutWhName = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC013A.FIELD_CALLOUT_WH_NAME);
String callinWhCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC013A.FIELD_CALLIN_WH_CODE);
String callinWhName = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC013A.FIELD_CALLIN_WH_NAME);
Long parentId = Long.parseLong(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC013A.FIELD_PARENT_ID));
if (status==1) {
throw new PlatException("单据状态为已提交,不能保存!");
}
// 写入数据
for (Map resultRow : resultRows) {
HGKC013A hgkc013a = new HGKC013A();
hgkc013a.fromMap(resultRow);
hgkc013a.setParentId(parentId);
hgkc013a.setCalloutWhCode(calloutWhCode);
hgkc013a.setCalloutWhName(calloutWhName);
hgkc013a.setCallinWhCode(callinWhCode);
hgkc013a.setCallinWhName(callinWhName);
Object object = this.dao.get(HGKC013.QUERY,HGKC010.FIELD_ID,parentId);
if (object!=null){
Map map1 = MapUtils.toMap(object);
HGKC010 hgkc010 = HGKCTools.HgKc010.get(map1.get(HGKC013.FIELD_COMPANY_CODE).toString(),map1.get(HGKC013.FIELD_CALLOUT_WH_CODE).toString(),hgkc013a.getInventRecordId());
if (hgkc010==null){
throw new PlatException("实时库存不存在!");
}
int result = hgkc013a.getQuantity().compareTo(hgkc010.getInvQty());
if ( result > 0){
throw new PlatException("实时库存数量不够,无法保存!");
}
}
if (hgkc013a.getId() == null || hgkc013a.getId() == 0) {
this.add(hgkc013a);
} else {
this.modify(hgkc013a);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HGKC013A hgkc013a) {
DaoUtils.insert(HGKC013A.INSERT, hgkc013a);
}
/**
* 修改操作
*/
public void modify(HGKC013A hgkc013a) {
DaoUtils.update(HGKC013A.UPDATE, hgkc013a);
}
/**
* 下拉框
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "仓库档案",operType = "查询",operDesc = "下拉框")
public EiInfo queryComboBox(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.INVENT_ALL_BOX_BLOCK_ID);
boolean isSplicingSymbol = true;
if (inInfo.getString("isSplicingSymbol") != null) {
isSplicingSymbol = Boolean.parseBoolean(inInfo.getString("isSplicingSymbol"));
} else if (queryRow.get("isSplicingSymbol") != null) {
isSplicingSymbol = MapUtils.getBoolean(queryRow, "isSplicingSymbol");
}
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), isSplicingSymbol);
return inInfo;
}
}
......@@ -62,19 +62,19 @@
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME like '%' || #companyName#|| '%'
COMPANY_NAME like ('%$companyName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositDate">
DEPOSIT_DATE = #depositDate#
date_format(DEPOSIT_DATE,'%Y-%m-%d') = #depositDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositNo">
DEPOSIT_NO like '%' || #depositNo# || '%'
DEPOSIT_NO like ('%$depositNo$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
WH_NAME like ('%$whName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositNoOld">
DEPOSIT_NO_OLD = #depositNoOld#
......@@ -95,7 +95,7 @@
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME like '%' || #projName# || '%'
PROJ_NAME like ('%$projName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtType">
PRDT_TYPE = #prdtType#
......@@ -151,9 +151,6 @@
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositNo">
DEPOSIT_NO = #depositNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositNos">
DEPOSIT_NO IN <iterate open="(" close=")" conjunction="," property="depositNos">#depositNos[]#</iterate>
</isNotEmpty>
......@@ -308,4 +305,8 @@
ID = #id#
</update>
<select id="maxId" resultClass="long">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGKC003
</select>
</sqlMap>
......@@ -37,13 +37,13 @@
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
COMPANY_NAME like ('%$companyName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositDate">
DEPOSIT_DATE = #depositDate#
date_format(DEPOSIT_DATE,'%Y-%m-%d') = #depositDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositNo">
DEPOSIT_NO = #depositNo#
DEPOSIT_NO like ('%$depositNo$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
......@@ -79,7 +79,7 @@
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
PROJ_NAME like ('%$projName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtType">
PRDT_TYPE = #prdtType#
......@@ -135,12 +135,16 @@
<isNotEmpty prepend=" AND " property="storageType">
STORAGE_TYPE = #storageType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="qualityDetailId">
QUALITY_DETAIL_ID = #qualityDetailId#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.kc.domain.HGKC003A">
SELECT
ID as "id",
QUALITY_DETAIL_ID as "qualityDetailId",<!-- 质检单明细ID -->
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
......@@ -204,7 +208,8 @@
<insert id="insert">
INSERT INTO ${hggpSchema}.HGKC003A (ID,
INSERT INTO ${hggpSchema}.HGKC003A (
QUALITY_DETAIL_ID,<!-- 企业编码 -->
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
......@@ -249,7 +254,7 @@
AMOUNT, <!-- 金额 -->
STORAGE_TYPE <!-- 入库类型:0:入库 1:退回 -->
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #depositDate#, #depositNo#, #whCode#, #whName#, #invQty#, #invUnitWeight#, #invWeight#, #depositNoOld#, #remark#, #factoryCode#, #prodOrderNo#, #prodTaskNo#, #projCode#, #projName#, #prdtType#, #prdtCode#, #prdtName#, #prdtLength#, #prdtWidth#, #prdtThick#, #prdtSpec#, #partType#, #partCode#, #partName#, #partLength#, #partWidth#, #partThick#, #partSpec#, #primaryId#, #price#, #amount#, #storageType#)
VALUES (#qualityDetailId#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #depositDate#, #depositNo#, #whCode#, #whName#, #invQty#, #invUnitWeight#, #invWeight#, #depositNoOld#, #remark#, #factoryCode#, #prodOrderNo#, #prodTaskNo#, #projCode#, #projName#, #prdtType#, #prdtCode#, #prdtName#, #prdtLength#, #prdtWidth#, #prdtThick#, #prdtSpec#, #partType#, #partCode#, #partName#, #partLength#, #partWidth#, #partThick#, #partSpec#, #primaryId#, #price#, #amount#, #storageType#)
</insert>
<delete id="delete">
......@@ -265,6 +270,7 @@
<update id="update">
UPDATE ${hggpSchema}.HGKC003A
SET
QUALITY_DETAIL_ID = #qualityDetailId#,<!-- 企业编码 -->
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
......
......@@ -48,6 +48,7 @@
STATUS as "status" <!-- 状态 0-停止 1-启用 -->
</sql>
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
......
......@@ -61,6 +61,7 @@
</sql>
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
......
......@@ -93,7 +93,7 @@
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
WH_NAME LIKE CONCAT('%', #whName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="otherEnterNoOld">
OTHER_ENTER_NO_OLD = #otherEnterNoOld#
......@@ -444,4 +444,94 @@
ID = #id#
</update>
<select id="queryList" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.kc.domain.HGKC006">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
OTHER_ENTER_DATE as "otherEnterDate", <!-- 其他入库日期 -->
OTHER_ENTER_NO as "otherEnterNo", <!-- 其他入库单号 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
OTHER_ENTER_NO_OLD as "otherEnterNoOld", <!-- 其他入库单号(旧) -->
REMARK as "remark", <!-- 备注 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
PROD_ORDER_NO as "prodOrderNo", <!-- 生产订单号 -->
PROD_TASK_NO as "prodTaskNo", <!-- 生产任务号 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PRDT_TYPE as "prdtType", <!-- 产品类型 -->
PRDT_CODE as "prdtCode", <!-- 产品编码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
PRDT_LENGTH as "prdtLength", <!-- 产品-长 -->
PRDT_WIDTH as "prdtWidth", <!-- 产品-宽 -->
PRDT_THICK as "prdtThick", <!-- 产品-厚 -->
PRDT_SPEC as "prdtSpec", <!-- 产品规格 -->
PART_TYPE as "partType", <!-- 零件类型 -->
PART_CODE as "partCode", <!-- 零件编码 -->
PART_NAME as "partName", <!-- 零件名称 -->
PART_LENGTH as "partLength", <!-- 零件-长 -->
PART_WIDTH as "partWidth", <!-- 零件-宽 -->
PART_THICK as "partThick", <!-- 零件-厚 -->
PART_SPEC as "partSpec", <!-- 零件规格 -->
SUBMIT_STATUS as "submitStatus", <!-- 提交状态 -->
SOURCE as "source" <!-- 数据来源 -->
FROM ${hggpSchema}.HGKC006 WHERE 1=1 and DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="otherEnterDate">
OTHER_ENTER_DATE = #otherEnterDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="otherEnterNo">
OTHER_ENTER_NO = #otherEnterNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="otherEnterNoOld">
OTHER_ENTER_NO_OLD = #otherEnterNoOld#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
</sqlMap>
......@@ -114,7 +114,7 @@
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
INVENT_NAME LIKE CONCAT('%', #inventName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invQty">
INV_QTY = #invQty#
......
......@@ -93,7 +93,7 @@
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
WH_NAME LIKE CONCAT('%', #whName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="otherOutNoOld">
OTHER_OUT_NO_OLD = #otherOutNoOld#
......@@ -442,4 +442,94 @@
ID = #id#
</update>
<select id="queryList" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.kc.domain.HGKC007">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
OTHER_OUT_DATE as "otherOutDate", <!-- 其他出库日期 -->
OTHER_OUT_NO as "otherOutNo", <!-- 其他出库单号 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
OTHER_OUT_NO_OLD as "otherOutNoOld", <!-- 其他出库单号(旧) -->
REMARK as "remark", <!-- 备注 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
PROD_ORDER_NO as "prodOrderNo", <!-- 生产订单号 -->
PROD_TASK_NO as "prodTaskNo", <!-- 生产任务号 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PRDT_TYPE as "prdtType", <!-- 产品类型 -->
PRDT_CODE as "prdtCode", <!-- 产品编码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
PRDT_LENGTH as "prdtLength", <!-- 产品-长 -->
PRDT_WIDTH as "prdtWidth", <!-- 产品-宽 -->
PRDT_THICK as "prdtThick", <!-- 产品-厚 -->
PRDT_SPEC as "prdtSpec", <!-- 产品规格 -->
PART_TYPE as "partType", <!-- 零件类型 -->
PART_CODE as "partCode", <!-- 零件编码 -->
PART_NAME as "partName", <!-- 零件名称 -->
PART_LENGTH as "partLength", <!-- 零件-长 -->
PART_WIDTH as "partWidth", <!-- 零件-宽 -->
PART_THICK as "partThick", <!-- 零件-厚 -->
PART_SPEC as "partSpec", <!-- 零件规格 -->
SUBMIT_STATUS as "submitStatus", <!-- 提交状态 -->
SOURCE as "source" <!-- 数据来源 -->
FROM ${hggpSchema}.HGKC007 WHERE 1=1 and DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="otherOutDate">
OTHER_OUT_DATE = #otherOutDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="otherOutNo">
OTHER_OUT_NO = #otherOutNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="otherOutNoOld">
OTHER_OUT_NO_OLD = #otherOutNoOld#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
</sqlMap>
......@@ -114,7 +114,7 @@
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
INVENT_NAME LIKE CONCAT('%', #inventName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invQty">
INV_QTY = #invQty#
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HGKC008">
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME like CONCAT('%',#companyName#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiptDate">
date_format(RECEIPT_DATE,'%Y-%m-%d') = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyCode">
APPLY_CODE like CONCAT('%',#applyCode#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME like CONCAT('%',#whName#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveType">
RECEIVE_TYPE = #receiveType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME like ('%$projName$%')
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.kc.domain.HGKC008">
SELECT
ID as "id", <!-- 主键id -->
ACCOUNT_CODE as "accountCode", <!-- 账套 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
RECEIPT_DATE as "receiptDate", <!-- 单据日期 -->
APPLY_CODE as "applyCode", <!-- 申请单号 -->
WH_CODE as "whCode", <!-- 仓库编号 -->
WH_NAME as "whName", <!-- 仓库名称 -->
STATUS as "status", <!-- 状态 0未提交,1已提交 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
RECEIVE_TYPE as "receiveType" <!-- 领料单类型 0:正常,1:退库 -->
FROM ${hggpSchema}.HGKC008 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGKC008 WHERE 1=1
<include refid="condition" />
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGKC008 (ID, <!-- 主键id -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
ACCOUNT_CODE, <!-- 账套 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
RECEIPT_DATE, <!-- 单据日期 -->
APPLY_CODE, <!-- 申请单号 -->
WH_CODE, <!-- 仓库编号 -->
WH_NAME, <!-- 仓库名称 -->
STATUS, <!-- 状态 0未提交,1已提交 -->
RECEIVE_TYPE <!-- 领料单类型 0:正常,1:退库 -->
)
VALUES (#id#,#projCode#, #projName#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #receiptDate#, #applyCode#, #whCode#, #whName#, #status#, #receiveType#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGKC008 WHERE ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGKC008
SET
ACCOUNT_CODE = #accountCode#, <!-- 账套 -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除 0-否1-是 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
RECEIPT_DATE = #receiptDate#, <!-- 单据日期 -->
APPLY_CODE = #applyCode#, <!-- 申请单号 -->
WH_CODE = #whCode#, <!-- 仓库编号 -->
WH_NAME = #whName#, <!-- 仓库名称 -->
STATUS = #status#, <!-- 状态 0未提交,1已提交 -->
RECEIVE_TYPE = #receiveType# <!-- 领料单类型 0:正常,1:退库 -->
WHERE ID = #id#
</update>
<delete id="batchDelete">
DELETE FROM ${hggpSchema}.HGKC008 WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete>
<update id="updateStatus">
UPDATE ${hggpSchema}.HGKC008
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
STATUS = #status# <!-- 状态 0未提交,1已提交 -->
WHERE
ID = #id#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HGKC008A">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveId">
RECEIVE_ID = #receiveId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME like CONCAT('%',#whName#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventRecordId">
INVENT_RECORD_ID = #inventRecordId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE like CONCAT('%',#inventCode#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME like CONCAT('%',#inventName#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invSpec">
INV_SPEC = #invSpec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invLength">
INV_LENGTH = #invLength#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invWidth">
INV_WIDTH = #invWidth#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invThick">
INV_THICK = #invThick#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invQty">
INV_QTY = #invQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invUnitWeight">
INV_UNIT_WEIGHT = #invUnitWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invWeight">
INV_WEIGHT = #invWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="price">
PRICE = #price#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="amount">
AMOUNT = #amount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME like ('%$projName$%')
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.kc.domain.HGKC008A">
SELECT
ID as "id", <!-- 主键id -->
ACCOUNT_CODE as "accountCode", <!-- 账套 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
RECEIVE_ID as "receiveId", <!-- 领料单id -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
WH_CODE as "whCode", <!-- 仓库编号 -->
WH_NAME as "whName", <!-- 仓库名称 -->
INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案id -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
INV_SPEC as "invSpec", <!-- 规格 -->
INV_LENGTH as "invLength", <!-- 长度(MM) -->
INV_WIDTH as "invWidth", <!-- 宽度(MM) -->
INV_THICK as "invThick", <!-- 厚度(MM) -->
INV_QTY as "invQty", <!-- 数量 -->
INV_UNIT_WEIGHT as "invUnitWeight", <!-- 单重 -->
INV_WEIGHT as "invWeight", <!-- 重量 -->
PRICE as "price", <!-- 单价 -->
AMOUNT as "amount" <!-- 金额 -->
FROM ${hggpSchema}.HGKC008A WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGKC008A WHERE 1=1
<include refid="condition" />
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGKC008A (ID, <!-- 主键id -->
ACCOUNT_CODE, <!-- 账套 -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
RECEIVE_ID, <!-- 领料单id -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
WH_CODE, <!-- 仓库编号 -->
WH_NAME, <!-- 仓库名称 -->
INVENT_RECORD_ID, <!-- 存货档案id -->
INVENT_TYPE, <!-- 存货类型 -->
INVENT_CODE, <!-- 存货编码 -->
INVENT_NAME, <!-- 存货名称 -->
INV_SPEC, <!-- 规格 -->
INV_LENGTH, <!-- 长度(MM) -->
INV_WIDTH, <!-- 宽度(MM) -->
INV_THICK, <!-- 厚度(MM) -->
INV_QTY, <!-- 数量 -->
INV_UNIT_WEIGHT, <!-- 单重 -->
INV_WEIGHT, <!-- 重量 -->
PRICE, <!-- 单价 -->
AMOUNT <!-- 金额 -->
)
VALUES (#id#, #accountCode#,#projCode#, #projName#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #receiveId#, #companyCode#, #companyName#, #whCode#, #whName#, #inventRecordId#, #inventType#, #inventCode#, #inventName#, #invSpec#, #invLength#, #invWidth#, #invThick#, #invQty#, #invUnitWeight#, #invWeight#, #price#, #amount#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGKC008A WHERE ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGKC008A
SET
ACCOUNT_CODE = #accountCode#, <!-- 账套 -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除 0-否1-是 -->
RECEIVE_ID = #receiveId#, <!-- 领料单id -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
WH_CODE = #whCode#, <!-- 仓库编号 -->
WH_NAME = #whName#, <!-- 仓库名称 -->
INVENT_RECORD_ID = #inventRecordId#, <!-- 存货档案id -->
INVENT_TYPE = #inventType#, <!-- 存货类型 -->
INVENT_CODE = #inventCode#, <!-- 存货编码 -->
INVENT_NAME = #inventName#, <!-- 存货名称 -->
INV_SPEC = #invSpec#, <!-- 规格 -->
INV_LENGTH = #invLength#, <!-- 长度(MM) -->
INV_WIDTH = #invWidth#, <!-- 宽度(MM) -->
INV_THICK = #invThick#, <!-- 厚度(MM) -->
INV_QTY = #invQty#, <!-- 数量 -->
INV_UNIT_WEIGHT = #invUnitWeight#, <!-- 单重 -->
INV_WEIGHT = #invWeight#, <!-- 重量 -->
PRICE = #price#, <!-- 单价 -->
AMOUNT = #amount# <!-- 金额 -->
WHERE ID = #id#
</update>
<delete id="batchDelete">
DELETE FROM ${hggpSchema}.HGKC008A WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete>
</sqlMap>
......@@ -200,4 +200,44 @@
WHERE ID = #id#
</update>
<!--仓库公司下拉框-->
<select id="queryWhCodeBox" resultClass="java.util.HashMap">
SELECT distinct
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName" <!-- 仓库名称 -->
FROM ${hggpSchema}.HGKC010
WHERE 1=1
<include refid="condition"/>
</select>
<!--存货名称下拉框-->
<select id="queryInventCodeBox" resultClass="java.util.HashMap">
SELECT distinct
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
SPEC_ID as "specId" <!-- 规格ID -->
FROM ${hggpSchema}.HGKC010
WHERE 1=1
<include refid="condition"/>
</select>
<!--规格下拉框-->
<select id="querySpecIdBox" resultClass="java.util.HashMap">
SELECT distinct
SPEC_ID as "specId", <!-- 规格ID -->
SPEC as "spec", <!-- 规格 -->
LENGTH as "length", <!-- 长度 -->
WIDTH as "width", <!-- 宽度 -->
THICK as "thick", <!-- 厚度 -->
INV_QTY as "invQty", <!-- 库存数量 -->
INV_UNIT_WEIGHT as "invUnitWeight", <!-- 库存单重 -->
INV_WEIGHT as "invWeight" <!-- 库存重量 -->
FROM ${hggpSchema}.HGKC010
WHERE 1=1
<include refid="condition"/>
</select>
</sqlMap>
......@@ -5,16 +5,14 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.*;
import com.baosight.hggp.hg.sc.domain.HGSC004;
import com.baosight.hggp.hg.sc.domain.HGSC005;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -131,21 +129,39 @@ public class HGKCTools {
public static class HgKc003 {
public static HGKC003 save(HGKC003 hgkc003){
checkSaveData(hgkc003);
public static HGKC003 save(HGKC003 hgkc003,List<HGKC003A> hgkc003aList){
checkSaveData(hgkc003,hgkc003aList);
hgkc003.setDepositNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PROD_DEPOSIT_NO));
Long maxId = (Long)DaoBase.getInstance().get(HGKC003.MAX_ID,null,null);
Long setId = maxId+1;
hgkc003.setId(setId);
DaoUtils.insert(HGKC003.INSERT,hgkc003);
hgkc003aList.forEach(o->{
o.setPrimaryId(setId);
});
DaoUtils.insertBatch(HGKC003A.INSERT,hgkc003aList);
return hgkc003;
}
private static void checkSaveData(HGKC003 hgkc003) {
private static void checkSaveData(HGKC003 hgkc003,List<HGKC003A> hgkc003aList) {
AssertUtils.isEmpty(hgkc003.getCompanyCode(), "公司编码不能为空!");
AssertUtils.isEmpty(hgkc003.getCompanyName(), "公司名称不能为空!");
AssertUtils.isEmpty(hgkc003.getWhCode(), "仓库编码不能为空!");
AssertUtils.isEmpty(hgkc003.getWhName(), "仓库名称不能为空!");
AssertUtils.isEmpty(hgkc003.getProjCode(), "项目编号不能为空!");
AssertUtils.isEmpty(hgkc003.getProjName(), "项目名称不能为空!");
AssertUtils.isTrue(Objects.isNull(hgkc003.getQualityId())||hgkc003.getQualityId()<=0, "质检单idID不能为空!");
AssertUtils.isTrue(Objects.isNull(hgkc003.getQualityId())||hgkc003.getQualityId()<=0, "质检单ID不能为空!");
for(HGKC003A hgkc003a : hgkc003aList){
AssertUtils.isEmpty(hgkc003a.getCompanyCode(), "公司编码不能为空!");
AssertUtils.isEmpty(hgkc003a.getCompanyName(), "公司名称不能为空!");
AssertUtils.isEmpty(hgkc003a.getProjCode(), "项目编号不能为空!");
AssertUtils.isEmpty(hgkc003a.getProjName(), "项目名称不能为空!");
AssertUtils.isEmpty(hgkc003a.getWhCode(), "仓库编码不能为空!");
AssertUtils.isEmpty(hgkc003a.getWhName(), "仓库名称不能为空!");
AssertUtils.isEmpty(hgkc003a.getPrdtCode(), "存货编码不能为空!");
AssertUtils.isEmpty(hgkc003a.getPrdtName(), "存货名称不能为空!");
AssertUtils.isTrue(Objects.isNull(hgkc003a.getQualityDetailId())||hgkc003a.getQualityDetailId()<=0, "质检单明细ID不能为空!");
}
}
/**
......@@ -207,8 +223,13 @@ public class HGKCTools {
private static void checkSaveData(HGKC003A hgkc003a) {
AssertUtils.isEmpty(hgkc003a.getCompanyCode(), "公司编码不能为空!");
AssertUtils.isEmpty(hgkc003a.getCompanyName(), "公司名称不能为空!");
// AssertUtils.isTrue(Objects.isNull(hgkc003.getQualityId())||hgkc003.getQualityId()<=0, "质检单idID不能为空!");
AssertUtils.isEmpty(hgkc003a.getProjCode(), "项目编号不能为空!");
AssertUtils.isEmpty(hgkc003a.getProjName(), "项目名称不能为空!");
AssertUtils.isEmpty(hgkc003a.getWhCode(), "仓库编码不能为空!");
AssertUtils.isEmpty(hgkc003a.getWhName(), "仓库名称不能为空!");
AssertUtils.isEmpty(hgkc003a.getPrdtCode(), "存货编码不能为空!");
AssertUtils.isEmpty(hgkc003a.getPrdtName(), "存货名称不能为空!");
AssertUtils.isTrue(Objects.isNull(hgkc003a.getQualityDetailId())||hgkc003a.getQualityDetailId()<=0, "质检单明细ID不能为空!");
}
}
......@@ -465,4 +486,26 @@ public class HGKCTools {
}
}
public static class HgKc013 {
public static HGKC013 getId(Long id) {
AssertUtils.isEmpty(Collections.singleton(id), "调拨单为空!");
Map<String, Object> paramMap = new HashMap();
paramMap.put("id", id);
paramMap.put("deleteFlag", 0);
List<HGKC013> list = DaoBase.getInstance().query(HGKC013.QUERY, paramMap);
AssertUtils.isEmpty(list, "调拨单为空!");
return list.get(0);
}
public static List<HGKC013A> getDetail(Long parentId) {
AssertUtils.isEmpty(Collections.singleton(parentId), "调拨单ID不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("parentId", parentId);
paramMap.put("deleteFlag", 0);
List<HGKC013A> list = DaoBase.getInstance().query(HGKC013A.QUERY, paramMap);
AssertUtils.isEmpty(list, "调拨单明细为空!");
return list;
}
}
}
......@@ -345,10 +345,11 @@
a.INVENT_TYPE as "inventType",
a.INVENT_CODE as "inventCode",
a.INVENT_NAME as "inventName",
LENGTH as "length", <!-- 长 -->
WIDTH as "width", <!-- 宽 -->
THICK as "thick", <!-- 厚 -->
b.PAR_INVENT_TYPE as "parInventType"
a.LENGTH as "length", <!-- 长 -->
a.WIDTH as "width", <!-- 宽 -->
a.THICK as "thick", <!-- 厚 -->
b.PAR_INVENT_TYPE as "parInventType",
b.INVENT_TYPE_DETAIL as "inventTypeDetail"
FROM ${hggpSchema}.HGPZ005 a
left join ${hggpSchema}.hgpz004 b on a.INVENT_TYPE = b.INVENT_TYPE and b.STATUS=1 and b.DELETE_FLAG = 0
WHERE a.DELETE_FLAG = 0
......
......@@ -24,6 +24,7 @@
<sqlMap namespace="HGPZ005A">
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
......
......@@ -66,7 +66,7 @@ public class HGSC003A extends DaoEPBase {
public static final String INSERT = "HGSC003A.insert";
public static final String UPDATE = "HGSC003A.update";
public static final String DELETE = "HGSC003A.delete";
public static final String BATCH_DELETE = "HGSC003.batchDelete";
public static final String BATCH_DELETE = "HGSC003A.batchDelete";
private Long id = new Long(0); /* 主键*/
private String companyCode = " "; /* 公司编码*/
......
......@@ -140,13 +140,13 @@ public class ServiceHGSC004 extends ServiceBase {
AssertUtils.isTrue(hgsc003.getBlueprintStatus().compareTo(HGConstant.EnablingStatus.TY) == 0,"蓝图已停用不可修改!");
}
Map<String,Object> map = new HashMap<>();
map.put("blueprintId",hgsc004.getBlueprintId());
map.put("projCode",hgsc004.getProjCode());
List<HGSC004> hgsc004List = this.dao.query(HGSC004.QUERY,map);
for(HGSC004 o : hgsc004List){
if(Objects.nonNull(hgsc004.getId())&&hgsc004.getId()>0){
AssertUtils.isTrue(!(o.getId().intValue() == hgsc004.getId().intValue()),"当前蓝图已存在!");
AssertUtils.isTrue(!(o.getId().intValue() == hgsc004.getId().intValue()),"当前项目已存在!");
}else{
AssertUtils.isTrue(Objects.nonNull(o),"当前蓝图已存在!");
AssertUtils.isTrue(Objects.nonNull(o),"当前项目已存在!");
}
}
......@@ -165,38 +165,31 @@ public class ServiceHGSC004 extends ServiceBase {
* @param hgsc004
*/
private void insertTree(HGSC004 hgsc004) {
//变更清单里面的公司、项目信息
Map<String,Object> map = new HashMap<>();
map.put("companyCode",hgsc004.getCompanyCode());
map.put("projCode",hgsc004.getProjCode());
List<HGSC004A> hgsc004AList = dao.query(HGSC004A.QUERY_ALL,map, 0, -999999);
if(CollectionUtils.isEmpty(hgsc004AList)){
//录入树结构,公司
HGSC004A rootHgsc004A = new HGSC004A();
BeanUtil.copyProperties(hgsc004,rootHgsc004A,"id");
//因为获取不到id,所以根据公司编号+项目编号得到树结构
rootHgsc004A.setMaterialId(hgsc004.getId());
rootHgsc004A.setParentProdCode("root");
rootHgsc004A.setParentProdName(hgsc004.getCompanyName());
rootHgsc004A.setLeaf(2);//有叶子节点
rootHgsc004A.setLv(1);
rootHgsc004A.setSort(1);
rootHgsc004A.setProductCode(hgsc004.getCompanyCode());
rootHgsc004A.setProductName(hgsc004.getCompanyName());
DaoUtils.insert(HGSC004A.INSERT, rootHgsc004A);
//录入2级目录,项目
HGSC004A projectHgsc004A = new HGSC004A();
BeanUtil.copyProperties(hgsc004,projectHgsc004A,"id");
projectHgsc004A.setMaterialId(hgsc004.getId());
projectHgsc004A.setParentProdCode(rootHgsc004A.getProductCode());
projectHgsc004A.setParentProdName(rootHgsc004A.getProductName());
projectHgsc004A.setLeaf(2);//有叶子节点
projectHgsc004A.setLv(2);
projectHgsc004A.setSort(1);
projectHgsc004A.setProductCode(hgsc004.getProjCode());
projectHgsc004A.setProductName(hgsc004.getProjName());
DaoUtils.insert(HGSC004A.INSERT, projectHgsc004A);
}
//录入树结构,公司
HGSC004A rootHgsc004A = new HGSC004A();
BeanUtil.copyProperties(hgsc004,rootHgsc004A,"id");
//因为获取不到id,所以根据公司编号+项目编号得到树结构
rootHgsc004A.setMaterialId(hgsc004.getId());
rootHgsc004A.setParentProdCode("root");
rootHgsc004A.setParentProdName(hgsc004.getCompanyName());
rootHgsc004A.setLeaf(2);//有叶子节点
rootHgsc004A.setLv(1);
rootHgsc004A.setSort(1);
rootHgsc004A.setProductCode(hgsc004.getCompanyCode());
rootHgsc004A.setProductName(hgsc004.getCompanyName());
DaoUtils.insert(HGSC004A.INSERT, rootHgsc004A);
//录入2级目录,项目
HGSC004A projectHgsc004A = new HGSC004A();
BeanUtil.copyProperties(hgsc004,projectHgsc004A,"id");
projectHgsc004A.setMaterialId(hgsc004.getId());
projectHgsc004A.setParentProdCode(rootHgsc004A.getProductCode());
projectHgsc004A.setParentProdName(rootHgsc004A.getProductName());
projectHgsc004A.setLeaf(2);//有叶子节点
projectHgsc004A.setLv(2);
projectHgsc004A.setSort(1);
projectHgsc004A.setProductCode(hgsc004.getProjCode());
projectHgsc004A.setProductName(hgsc004.getProjName());
DaoUtils.insert(HGSC004A.INSERT, projectHgsc004A);
}
......
......@@ -122,7 +122,7 @@ public class ServiceHGSC004A extends ServiceBase {
hgsc004a.setMaterialId(hgsc004.getId());
hgsc004a.setLv(hgsc004a.getLv() + 1);
//不为4级都有叶子节点
if(hgsc004a.getLv().intValue() <= 4){
if(hgsc004a.getLv().intValue() < 4){
hgsc004a.setLeaf(2);
}else{
hgsc004a.setLeaf(1);
......@@ -177,9 +177,18 @@ public class ServiceHGSC004A extends ServiceBase {
private void checkSaveData(HGSC004A hgsc004a,HGSC004 hgsc004) {
if(Objects.nonNull(hgsc004a.getId())&&hgsc004a.getId()>0){
//蓝图信息,用于蓝图状态校验
HGSC003 hgsc003 = (HGSC003) super.dao.get(HGSC003.QUERY,HGSC004A.FIELD_id,hgsc004.getBlueprintId());
HGSC003 hgsc003 = (HGSC003) super.dao.get(HGSC003.QUERY,HGSC003.FIELD_id,hgsc004.getBlueprintId());
AssertUtils.isTrue(hgsc003.getBlueprintStatus().compareTo(HGConstant.EnablingStatus.TY) == 0,"蓝图已停用不可修改!");
}
//为构件的需要验证是否已经存在了,不能重复添加
if(hgsc004a.getLv().intValue() == 3){
Map<String,Object> mapA = new HashMap<>();
mapA.put("materialId",hgsc004a.getMaterialId());
mapA.put("productId",hgsc004a.getProductId());
mapA.put("notId",hgsc004a.getId());
List<HGSC004A> hgsc004AList = dao.query(HGSC004A.QUERY,mapA, 0, -999999);
AssertUtils.isTrue(!CollectionUtils.isEmpty(hgsc004AList), "已存在构建"+hgsc004a.getProductName());
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(hgsc004a.getCompanyCode(), "请选择公司!");
......
......@@ -3,6 +3,7 @@
<sqlMap namespace="HGSC003">
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
......
......@@ -151,4 +151,9 @@
WHERE id = #id#
</update>
<delete id="batchDelete">
DELETE FROM ${hggpSchema}.HGSC003A WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete>
</sqlMap>
......@@ -3,6 +3,7 @@
<sqlMap namespace="HGSC004">
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
......
......@@ -307,11 +307,13 @@
<!--查询用户所在的公司-->
<select id="queryCompany" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
select DISTINCT
a.ORG_ENAME as "orgEname",
a.ORG_CNAME as "orgCname"
from ${platSchema}.txsog01 a
left join ${platSchema}.txsog02 b on a.ORG_ID = b.ORG_ID
<isNotEmpty prepend="AND" property="userId">
left join ${platSchema}.txsog02 b on a.ORG_ID = b.ORG_ID
</isNotEmpty>
where 1=1
<isNotEmpty prepend=" AND " property="accountCode">
a.ACCOUNT_CODE = #accountCode#
......
......@@ -6,6 +6,7 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Arrays;
......@@ -202,5 +203,26 @@ public class MapUtils extends org.apache.commons.collections.MapUtils {
return newBean;
}).filter(t -> t != null).collect(Collectors.toList());
}
/**
* object 转 map
*/
public static Map<String, Object> toMap(Object obj) {
Map<String, Object> map = new HashMap<>();
Method[] methods = obj.getClass().getMethods();
for (Method method : methods) {
if (method.getName().startsWith("get")) {
try {
Object value = method.invoke(obj);
String key = method.getName().substring(3);
key = key.substring(0, 1).toLowerCase() + key.substring(1);
map.put(key, value);
} catch (Exception e) {
// Handle exception
}
}
}
return map;
}
}
......@@ -24,16 +24,21 @@
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC006A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC007.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC007A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC008.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC004.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC004A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC010.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC011.xml"/>
<!-- <sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC013.xml"/>-->
<!-- <sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC013A.xml"/>-->
<!-- 质量 -->
<sqlMap resource="com/baosight/hggp/hg/zl/sql/HGZL001.xml"/>
<!-- 生产 -->
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC001.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC001A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC002.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC003.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC004.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC005.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC005A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC006.xml"/>
......@@ -51,7 +56,8 @@
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW014.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW015.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW016.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW017.xml"/>
<!--配置-->
<sqlMap resource="com/baosight/hggp/hg/pz/sql/HGPZ005A.xml"/>
......
......@@ -12,7 +12,7 @@
<div class="row">
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDatePicker cname="会计期" blockId="inqu_status" ename="accountPeriod" row="0" colWidth="3"
format="yyyy-MM" parseFormats="['yyyyMM']" start="year" depth="year"/>
......@@ -28,7 +28,7 @@
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称" width="110" align="center"
filter="contains" readonly="true">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
<EF:EFOptions blockId="companyBox_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="accountYear" cname="会计年度" width="100" align="center" start="decade" depth="decade"
editType="date" dateFormat="yyyy" parseFormats="['yyyy']" required="true"/>
......
......@@ -16,7 +16,7 @@ $(function() {
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="contractDetailFunc(' + item.id + ')">合同详情</a>';
+ 'onclick="contractDetailFunc(' + item.id + ')">明细详情</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="fileDetailFunc(' + item.id + ')">附件详情</a>';
return template;
......@@ -100,8 +100,8 @@ function windowCallback() {
function contractDetailFunc(id) {
JSColorbox.open({
href: "HGCW010C?methodName=initLoad&id=" + id + "&efParentFormEname=HGCW010",
title: "<div style='text-align: center;'>合同详情</div>",
href: "HGCW011?methodName=initLoad&id=" + id + "&efParentFormEname=HGCW011",
title: "<div style='text-align: center;'>明细详情</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
......
......@@ -27,7 +27,7 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="140" align="center"/>
<EF:EFColumn ename="partyA" cname="客户名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="settlementNumber" cname="来源单号" width="120" enable="false" readonly="true" align="center"/>
......
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
$("#cancel").on("click", function () {
cancelFunc();
});
$("#btn_save").on("click", function () {
btnSaveFunc();
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
columns: [{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="contractDetailFunc(' + item.id + ')">合同详情</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="fileDetailFunc(' + item.id + ')">附件详情</a>';
return template;
}
}
],
loadComplete: function (e) {
$("#BTN_UPDATE").on("click",updateFunc);
$("#BTN_SUBMIT").on("click",submitFunc);
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
}
......@@ -55,79 +37,43 @@ $(window).load(function () {
* 查询
*/
let query = function () {
resultGrid.dataSource.page(2);
}
/**
* 结算单选择
*/
function windowCallback() {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
function fileDetailFunc(id) {
JSColorbox.open({
href: "HGCW999?methodName=initLoad&inqu_status-0-bizType=KP&inqu_status-0-matId=" + id + "&efParentFormEname=HGCW010",
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
function cancelFunc() {
// 关闭弹窗
parent.JSColorbox.setValueCallback();
}
function submitFunc() {
function btnSaveFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
if (rows.length < 1) {
message("请选择数据")
return;
}
var flag = true;
rows.forEach(function (row) {
if (row.reviewStatus == "3") {
message("勾选的数据中有已经提交的合同!");
flag = false;
for (let i = 0; i < rows.length; i++) {
let thisAmount = rows[i]['thisAmount'];
let remainingAmount = rows[i]['remainingAmount'];
if (!isNumber(thisAmount) && !isPositiveNumber(thisAmount)) {
message("勾选的第" + (i + 1) + "行本次开票金额必须是大于0的数字");
return;
}
if (parseFloat(thisAmount) > parseFloat(remainingAmount)) {
message("第" + (i + 1) + "行本次开票金额不能大于剩余开票金额");
return;
}
})
if (flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW010", "submit", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
query();
} catch (e) {
// TODO: handle exception
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成销售票据吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCW010", "select",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
// parent.JSColorbox.setValueCallback();
}
}
);
}
});
}
......@@ -6,31 +6,38 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<head>
</head>
<EF:EFPage title="结算单">
<EF:EFRegion id="detail1" title="结算单明细">
<EF:EFGrid blockId="detail1" autoDraw="override" checkMode="row" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFPage title="结算单选择">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="隐藏条件" ename="mainId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFDateSpan startCname="结算日期(从)" endCname="至" blockId="inqu_status"
startName="signingDateFrom" endName="signingDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="项目编号" ename="projCode" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="结算编号" ename="settlementNumber" blockId="inqu_status" row="0" colWidth="3" />
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="companyName" cname="所属公司" width="120" serviceName="HGCW010" methodName="queryconteractComboBox" resultId="conteract_combo_box" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编号" width="120" serviceName="HGCW010" methodName="queryconteractComboBox" resultId="conteract_combo_box" enable="false" readonly="true" align="center" />
<EF:EFColumn ename="projName" cname="项目名称" width="120" serviceName="HGCW010" methodName="queryconteractComboBox" resultId="conteract_combo_box" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="contractNumber" cname="合同号" width="120" serviceName="HGCW010" methodName="queryconteractComboBox" resultId="conteract_combo_box" enable="false" readonly="true" align="center" />
<EF:EFColumn ename="contractName" cname="合同名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="settlementNumber" cname="结算编号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisPriceTax" cname="结算价税合计金额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编号" width="120" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="settlementNumber" cname="结算编号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="contractDate" cname="结算日期" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="billNumber" cname="发票号" width="120" enable="true" align="center" required="true"/>
<EF:EFColumn ename="taxPoints" cname="税率(%)" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisPriceTax" cname="结算价税合计金额" hidden="true"/>
<EF:EFColumn ename="thisSettlementTax" cname="结算税金" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisSettlementAmount" cname="结算金额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="billNumber" cname="发票号" width="120" enable="false" readonly="true" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
<EF:EFRegion id="detail2" title="附件信息">
<EF:EFGrid blockId="detail2" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="thisSettlementAmount" cname="结算金额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="remainingAmount" cname="剩余开票金额" width="120" enable="false" readonly="true" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;">
......
......@@ -16,7 +16,7 @@ $(function() {
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="contractDetailFunc(' + item.id + ')">合同详情</a>';
+ 'onclick="contractDetailFunc(' + item.id + ')">明细详情</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="fileDetailFunc(' + item.id + ')">附件详情</a>';
return template;
......@@ -64,7 +64,7 @@ let query = function () {
*/
function addFunc() {
JSColorbox.open({
href: "HGCW012A?methodName=initLoad&efParentFormEname=HGCW012",
href: "HGCW012A?methodName=initLoad&efParentFormEname=HGCW010",
title: "<div style='text-align: center;'>结算单</div>",
width: "90%",
height: "90%",
......@@ -82,7 +82,7 @@ function updateFunc() {
return;
}
JSColorbox.open({
href: "HGCW012B?methodName=initLoad&id=" + rows[0].id + "&efParentFormEname=HGCW012",
href: "HGCW010B?methodName=initLoad&id=" + rows[0].id + "&efParentFormEname=HGCW010",
title: "<div style='text-align: center;'>修改合同</div>",
width: "90%",
height: "90%",
......@@ -100,8 +100,8 @@ function windowCallback() {
function contractDetailFunc(id) {
JSColorbox.open({
href: "HGCW012C?methodName=initLoad&id=" + id + "&efParentFormEname=HGCW012",
title: "<div style='text-align: center;'>合同详情</div>",
href: "HGCW012?methodName=initLoad&id=" + id + "&efParentFormEname=HGCW012",
title: "<div style='text-align: center;'>明细详情</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
......@@ -110,7 +110,7 @@ function contractDetailFunc(id) {
function fileDetailFunc(id) {
JSColorbox.open({
href: "HGCW999?methodName=initLoad&inqu_status-0-bizType=HT&inqu_status-0-matId=" + id + "&efParentFormEname=HGCW012",
href: "HGCW999?methodName=initLoad&inqu_status-0-bizType=HT&inqu_status-0-matId=" + id + "&efParentFormEname=HGCW010",
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
......
......@@ -6,18 +6,18 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<head>
</head>
<EF:EFPage title="销售开票">
<EF:EFPage title="采购收票">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDateSpan startCname="付款日期(从)" endCname="至" blockId="inqu_status"
<EF:EFDateSpan startCname="开票日期(从)" endCname="至" blockId="inqu_status"
startName="signingDateFrom" endName="signingDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFInput cname="供应商名称" ename="partyA" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="客户名称" ename="partyA" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="票据类型" ename="billTybe" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="发票号" ename="billNumber" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFSelect cname="审批状态" ename="inqu_status-0-billState" colWidth="3" filter="contains">
<EF:EFSelect cname="开票状态" ename="inqu_status-0-billState" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
</EF:EFSelect>
......@@ -27,17 +27,22 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="partyA" cname="供应商名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="140" align="center"/>
<EF:EFColumn ename="partyA" cname="客户名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="settlementNumber" cname="来源单号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="billTybe" cname="票据类型" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="signingDate" cname="票日期" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="signingDate" cname="票日期" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="billNumber" cname="发票号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="taxPoints" cname="税率" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisSettlementAmount" cname="不含税金额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisSettlementTax" cname="税额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="发票总额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="开票总额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFComboColumn ename="billState" cname="开票状态" width="100" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.billState"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="reviewStatus" cname="审批状态" width="100" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
......
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
$("#cancel").on("click", function () {
cancelFunc();
});
$("#btn_save").on("click", function () {
btnSaveFunc();
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
}
}
window.document.addEventListener("keyup",function (event) {
if(event.keyCode === 13){
var grid = $("#ef_grid_result").data("kendoGrid");
// 回填
//grid.addRows(returnRows);
grid.closeCell();
}
})
});
$(window).load(function () {
// 查
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
function cancelFunc() {
// 关闭弹窗
parent.JSColorbox.setValueCallback();
}
function btnSaveFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let thisAmount = rows[i]['thisAmount'];
let remainingAmount = rows[i]['remainingAmount'];
if (!isNumber(thisAmount) && !isPositiveNumber(thisAmount)) {
message("勾选的第" + (i + 1) + "行本次开票金额必须是大于0的数字");
return;
}
if (parseFloat(thisAmount) > parseFloat(remainingAmount)) {
message("第" + (i + 1) + "行本次开票金额不能大于剩余开票金额");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成销售票据吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCW010", "select",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
// parent.JSColorbox.setValueCallback();
}
}
);
}
});
}
<!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}"/>
<head>
</head>
<EF:EFPage title="结算单选择">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="隐藏条件" ename="mainId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFDateSpan startCname="结算日期(从)" endCname="至" blockId="inqu_status"
startName="signingDateFrom" endName="signingDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="项目编号" ename="projCode" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="结算编号" ename="settlementNumber" blockId="inqu_status" row="0" colWidth="3" />
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目编号" width="120" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="settlementNumber" cname="结算编号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="contractDate" cname="结算日期" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="billNumber" cname="发票号" width="120" enable="true" align="center" required="true"/>
<EF:EFColumn ename="taxPoints" cname="税率(%)" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisPriceTax" cname="结算价税合计金额" hidden="true"/>
<EF:EFColumn ename="thisSettlementTax" cname="结算税金" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisSettlementAmount" cname="结算金额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="remainingAmount" cname="剩余开票金额" width="120" enable="false" readonly="true" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;">
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-center"/>
<EF:EFButton ename="btn_save" cname="保存" type="button" class="btn-center"/>
</div>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
......@@ -12,7 +12,14 @@ $(function() {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
columns: [
columns: [{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="contractDetailFunc(' + item.id + ')">收款清单</a>';
return template;
}
}
],
loadComplete: function (grid) {
$("#BTN_CHOICE").on("click",choiceFunc);
......@@ -25,6 +32,11 @@ $(function() {
e.preventDefault();
saveResult1Func();
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
......@@ -94,6 +106,10 @@ function updateFunc() {
message("请选择一条数据");
return;
}
if (rows[0].cancelStatus == "2") {
message("已经核销的单据不能修改");
return;
}
JSColorbox.open({
href: "HGCW014B?methodName=initLoad&inqu_status-0-mainId=" + rows[0].id + "&efParentFormEname=HGCW014",
title: "<div style='text-align: center;'>收款清单</div>",
......@@ -155,9 +171,15 @@ function submitFunc() {
}
var flag = true;
rows.forEach(function (row) {
if (row.cancelStatus == "1") {
message("勾选的数据中有未核销的单据!");
flag = false;
return;
}
if (row.reviewStatus == "3") {
message("勾选的数据中有已经提交的合同!");
message("勾选的数据中有已经提交的单据!");
flag = false;
return;
}
})
......@@ -166,7 +188,7 @@ function submitFunc() {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW012", "submit", info, {
EiCommunicator.send("HGCW014", "submit", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
......@@ -195,6 +217,84 @@ function submitFunc() {
}
function writeoffFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
return;
}
var flag = true;
rows.forEach(function (row) {
if (row.cancelStatus == "2") {
message("勾选的数据中有已经核销的单据!");
flag = false;
return;
}
})
if (flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"核销\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW014", "writeoff", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
query();
} catch (e) {
// TODO: handle exception
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
}
}
function deleteFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let cancelStatus= item.get("cancelStatus");
if(cancelStatus === "2"){
message("选中的第"+(index+1)+"行记录为核销状态,不能删除!");
flag = false;
return;
}
});
if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCW014", "delete", true);
}
});
}
}
function contractDetailFunc(id) {
JSColorbox.open({
href: "HGCW014C?methodName=initLoad&inqu_status-0-mainId=" + id + "&efParentFormEname=HGCW014",
title: "<div style='text-align: center;'>收款详情</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
......@@ -14,10 +14,7 @@
startName="signingDateFrom" endName="signingDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFSelect cname="客户名称" blockId="inqu_status" ename="partyA" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="sup_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput cname="客户名称" ename="partyA" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFSelect cname="核销状态" ename="inqu_status-0-cancelStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.cancelStatus"/>
......@@ -28,10 +25,11 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFComboColumn ename="partyA" cname="客户名称" width="120" align="left" defaultValue=""
filter="contains" readonly="true">
<EF:EFOptions blockId="sup_record_block_id"
valueField="valueField" textField="textField"/>
<EF:EFOptions blockId="customer_record_block_id"
valueField="textField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="projCode" cname="项目名称" width="120" align="left" defaultValue=""
filter="contains" readonly="true">
......
......@@ -18,16 +18,11 @@
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFInput cname="客户名称" ename="partyA" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="票据类型" ename="billTybe" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFSelect cname="票据类型" ename="inqu_status-0-billTybe" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.billTybe"/>
</EF:EFSelect>
<EF:EFInput cname="发票号" ename="billNumber" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFSelect cname="开票状态" ename="inqu_status-0-billState" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
......
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
columns: [{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="contractDetailFunc(' + item.id + ')">合同详情</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="fileDetailFunc(' + item.id + ')">附件详情</a>';
return template;
}
}
],
loadComplete: function (e) {
$("#SELECT_BILL").on("click",addFunc);
$("#BTN_UPDATE").on("click",updateFunc);
$("#BTN_SUBMIT").on("click",submitFunc);
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
saveFunc();
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
}
......@@ -59,109 +44,57 @@ let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 结算单选择
*/
function addFunc() {
JSColorbox.open({
href: "HGCW012A?methodName=initLoad&efParentFormEname=HGCW012",
title: "<div style='text-align: center;'>结算单</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
function cancelFunc() {
// 关闭弹窗
parent.JSColorbox.setValueCallback();
}
/**
* 修改
*/
function updateFunc() {
function saveFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
if (rows.length < 1) {
message("请选择数据");
return;
}
JSColorbox.open({
href: "HGCW012B?methodName=initLoad&id=" + rows[0].id + "&efParentFormEname=HGCW012",
title: "<div style='text-align: center;'>修改合同</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
function windowCallback() {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
function contractDetailFunc(id) {
JSColorbox.open({
href: "HGCW012C?methodName=initLoad&id=" + id + "&efParentFormEname=HGCW012",
title: "<div style='text-align: center;'>合同详情</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW015", "save", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
query();
} catch (e) {
// TODO: handle exception
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
//JSUtils.submitGridsData("result", "HPSC001", "save", true);
function fileDetailFunc(id) {
JSColorbox.open({
href: "HGCW999?methodName=initLoad&inqu_status-0-bizType=HT&inqu_status-0-matId=" + id + "&efParentFormEname=HGCW012",
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
}
});
}
function submitFunc() {
function deleteFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
if (rows.length < 1) {
message("请选择数据");
return;
}
var flag = true;
rows.forEach(function (row) {
if (row.reviewStatus == "3") {
message("勾选的数据中有已经提交的合同!");
flag = false;
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCW015", "delete", true);
}
})
if (flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW012", "submit", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
query();
} catch (e) {
// TODO: handle exception
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
}
});
}
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