Commit 126faaed by liuyang
parents c06e494f 6400cb7a
......@@ -99,7 +99,7 @@ public enum DdynamicEnum {
* 用途:存货档案下拉框,带id名称等信息
* 编写:
*/
PRODUCT_BLOCK_ID("product_block_id","inventCode","inventName","id","inventType","length","width","thick","inventTypeDetail","HGPZ005.queryProductComboBox"),
PRODUCT_BLOCK_ID("product_block_id","inventCode","inventName","id","inventType","length","width","thick","inventTypeDetail", "spec","HGPZ005.queryProductComboBox"),
/**
* 模块:存货档案(ALL)
* 用途:存货档案下拉框
......
......@@ -585,7 +585,7 @@ public class HGCGTools {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("receiveNo", receiveNo);
paramMap.put("isInvoicing", isInvoicing);
DaoUtils.update(HGSqlConstant.HgCw003A.UPDATE_IS_INVOICING, paramMap);
DaoUtils.update(HGSqlConstant.HgCg003A.UPDATE_IS_INVOICING, paramMap);
}
/**
......
......@@ -383,4 +383,11 @@ public class HGConstant {
// 手动录入
public static final Integer SDLR = 1;
}
public static class WhCodeStatus {
// 采购计划
public static final Integer S_0 = 0;
// 销售计划
public static final Integer S_1 = 1;
}
}
......@@ -103,11 +103,11 @@ public class HGSqlConstant {
public static final String UPDATE_CONFIRM = MODULE_NAME + "updateConfirm";
}
public class HgCw003A {
public class HgCg003A {
/**
* 模块名称:HGCW003A
*/
private static final String MODULE_NAME = "HGCW003A.";
private static final String MODULE_NAME = "HGCG003A.";
public static final String UPDATE_IS_INVOICING = MODULE_NAME + "updateIsInvoicing";
}
......
......@@ -215,7 +215,7 @@ public class ServiceHGCW010 extends ServiceBase {
hgcw011.setMainId(hgcw010.getId());
hgcw011.setId(null);
// 反写金额
HGCWTools.HgCw008.deductionAmount(hgcw011.getSettlementNumber(),rowMap.get(hgcw011.getSettlementNumber()));
HGCWTools.HgCw008.deductionAmount(resultRows.get(0).get("contractNumber"), hgcw011.getSettlementNumber(),rowMap.get(hgcw011.getSettlementNumber()));
DaoUtils.insert(HGCW011.INSERT, hgcw011);
}
} else {
......@@ -231,7 +231,7 @@ public class ServiceHGCW010 extends ServiceBase {
for (HGCW011 hgcw011 : hgcw011List) {
hgcw011.setMainId(hgcw010.getId());
// 反写金额
HGCWTools.HgCw008.deductionAmount(hgcw011.getSettlementNumber(),rowMap.get(hgcw011.getSettlementNumber()));
HGCWTools.HgCw008.deductionAmount(resultRows.get(0).get("contractNumber"), hgcw011.getSettlementNumber(), rowMap.get(hgcw011.getSettlementNumber()));
this.addHGCW011(hgcw011);
}
List<HGCW011> hgcw011s = HGCWTools.HgCw011.getMainId(hgcw010.getId());
......
......@@ -278,7 +278,7 @@ public class ServiceHGCW012 extends ServiceBase {
}
catch (Exception e) {
LogUtils.setMsg(inInfo, e, "生成收款单失败");
LogUtils.setMsg(inInfo, e, "生成采购收票失败");
}
return inInfo;
}
......@@ -375,7 +375,7 @@ public class ServiceHGCW012 extends ServiceBase {
}
catch (Exception e) {
LogUtils.setMsg(inInfo, e, "生成收款单失败");
LogUtils.setMsg(inInfo, e, "生成采购收票失败");
}
return inInfo;
}
......@@ -473,7 +473,7 @@ public class ServiceHGCW012 extends ServiceBase {
}
catch (Exception e) {
LogUtils.setMsg(inInfo, e, "生成收款单失败");
LogUtils.setMsg(inInfo, e, "生成采购收票失败");
}
return inInfo;
}
......
......@@ -609,4 +609,15 @@
</isNotEqual>
ORDER BY a.CONTRACT_NUMBER
</select>
<update id="updateDeductionAmount">
UPDATE ${hggpSchema}.HGCW002
SET
REMAINING_AMOUNT = #remainingAmount#, <!-- 剩余金额-->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime# <!-- 记录修改时间 -->
WHERE
ID = #id#
</update>
</sqlMap>
......@@ -408,7 +408,7 @@
<update id="updateDeductionAmount">
UPDATE ${hggpSchema}.HGCW006
SET
REMAINING_AMOUNT = #remainingAmount#, <!-- 审核状态 -->
REMAINING_AMOUNT = #remainingAmount#, <!-- 剩余金额 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime# <!-- 记录修改时间 -->
......
......@@ -195,7 +195,7 @@
ON T1.PROJ_CODE = B.PROJ_CODE
AND T1.CONTRACT_NUMBER = B.CONTRACT_NUMBER
AND T1.COMPANY_CODE = B.COMPANY_CODE
WHERE 1=1 AND B.CONTRACT_TYPE = 1 AND T1.REMAINING_AMOUNT != 0
WHERE 1=1 AND B.CONTRACT_TYPE = 1 AND T1.REMAINING_AMOUNT != 0 AND T1.REVIEW_STATUS = '3'
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
......
<?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="HGCW010E">
<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="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractName">
CONTRACT_NAME = #contractName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyB">
PARTY_B = #partyB#
</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="totalQuantity">
TOTAL_QUANTITY = #totalQuantity#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyAName">
PARTY_A_NAME = #partyAName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyAPhoneNumber">
PARTY_A_PHONE_NUMBER = #partyAPhoneNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="alreadyName">
ALREADY_NAME = #alreadyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="alreadyPhoneNumber">
ALREADY_PHONE_NUMBER = #alreadyPhoneNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractStatus">
CONTRACT_STATUS = #contractStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="leaseStartDate">
LEASE_START_DATE = #leaseStartDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="leaseEndDate">
LEASE_END_DATE = #leaseEndDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="paymentMethod">
PAYMENT_METHOD = #paymentMethod#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="pricingMethod">
PRICING_METHOD = #pricingMethod#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="taxPoints">
TAX_POINTS = #taxPoints#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceExcluding">
TOTAL_CONTRACT_PRICE_EXCLUDING = #totalContractPriceExcluding#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="valueAddedTax">
VALUE_ADDED_TAX = #valueAddedTax#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceIncluding">
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reviewStatus">
REVIEW_STATUS = #reviewStatus#
</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>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remainingAmount">
REMAINING_AMOUNT > #remainingAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDateFrom">
SIGNING_DATE >= #signingDateFrom#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDateTo">
SIGNING_DATE &lt;= #signingDateTo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="supName">
PARTY_B like concat('%',#supName#,'%')
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cw.domain.HGCW006">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
CONTRACT_NUMBER as "contractNumber", <!-- 合同号 -->
CONTRACT_NAME as "contractName", <!-- 合同名称 -->
PARTY_A as "partyA", <!-- 甲方名称 -->
PARTY_B as "partyB", <!-- 乙方名称 -->
SIGNING_DATE as "signingDate", <!-- 签约日期 -->
TOTAL_QUANTITY as "totalQuantity", <!-- 总数量 -->
PARTY_A_NAME as "partyAName", <!-- 甲方联系人姓名 -->
PARTY_A_PHONE_NUMBER as "partyAPhoneNumber", <!-- 甲方联系人电话 -->
ALREADY_NAME as "alreadyName", <!-- 已方联系人姓名 -->
ALREADY_PHONE_NUMBER as "alreadyPhoneNumber", <!-- 已方联系人电话 -->
CONTRACT_STATUS as "contractStatus", <!-- 合同状态;1草签2签约 -->
LEASE_START_DATE as "leaseStartDate", <!-- 租赁开始日期 -->
LEASE_END_DATE as "leaseEndDate", <!-- 租赁结束日期 -->
PAYMENT_METHOD as "paymentMethod", <!-- 付款方式;1一次性付款2分期付款 -->
PRICING_METHOD as "pricingMethod", <!-- 计价方式;1固定单价合同2固定总价合同 -->
TAX_POINTS as "taxPoints", <!-- 税点 -->
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", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DEP_CODE as "depCode" <!-- 部门编码 -->
FROM ${hggpSchema}.HGCW006 WHERE 1=1 AND REMAINING_AMOUNT != 0 AND REVIEW_STATUS = '3'
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID desc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGCW006 WHERE 1=1
<include refid="condition" />
</select>
</sqlMap>
\ No newline at end of file
......@@ -95,6 +95,9 @@
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="settlementNumbers">
SETTLEMENT_NUMBER IN <iterate close=")" open="(" conjunction="," property="settlementNumbers">#settlementNumbers[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......
......@@ -311,6 +311,40 @@ public class HGCWTools {
});
return results.get(0);
}
public static void deductionAmount(String contractNumber, BigDecimal deductionAmount) {
AssertUtils.isNull(contractNumber, "合同不能为空!");
// if (deductionAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
// throw new PlatException("扣款金额不能小于等于0!");
// }
List<HGCW002> results = DaoBase.getInstance().query(HGCW002.QUERY,new HashMap<String,Object>(){
{put("contractNumber",contractNumber);}
});
if (CollectionUtils.isEmpty(results)) {
throw new PlatException("找不到对应的合同!");
}
BigDecimal totalAmount = HgCw011.sumSettlementNumber(Collections.singletonList(contractNumber)); //获取累计开票金额
DecimalFormat decimalFormat = new DecimalFormat("#.000");
HGCW002 hgcw002 = results.get(0);
BigDecimal remaining = hgcw002.getTotalContractPriceIncluding();
//获取销售合同金额和补充协议金额
List<HGCW002> hgcw002List = DaoBase.getInstance().query("HGCW010D.sumContractPrice",new HashMap<String,Object>(){
{put("contractNumber",contractNumber);}
});
//计算销售合同金额的20%的总金额 总金额=合同金额+合同金额的20%
remaining = hgcw002List.get(0).getTotalContractPriceIncluding().add(hgcw002List.get(0).getTotalContractPriceIncluding().multiply(new BigDecimal("0.2")));
//合同总金额-(累计开票金额+本次来票金额)
BigDecimal remainingAmount = new BigDecimal(decimalFormat.format(remaining.subtract(deductionAmount.add(totalAmount))));
if (remainingAmount.compareTo(new BigDecimal(BigInteger.ZERO)) < 0) {
throw new PlatException("本次开票金额加累计开票金额超出销售合同金额20%,超出20%需要业务新增补充协议!");
}
BigDecimal remainingCount = new BigDecimal(decimalFormat.format(hgcw002.getRemainingAmount().subtract(deductionAmount)));
hgcw002.setRemainingAmount(remainingCount);
DaoUtils.update("HGCW002.updateDeductionAmount", hgcw002);
}
}
public static class HgCw003{
......@@ -355,7 +389,7 @@ public class HGCWTools {
// if (deductionAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
// throw new PlatException("扣款金额不能小于等于0!");
// }
List<HGCW006> results = DaoBase.getInstance().query(HGCW008.QUERY,new HashMap<String,Object>(){
List<HGCW006> results = DaoBase.getInstance().query(HGCW006.QUERY,new HashMap<String,Object>(){
{put("contractNumber",settlementNumber);}
});
if (CollectionUtils.isEmpty(results)) {
......@@ -433,6 +467,55 @@ public class HGCWTools {
}
public static void deductionAmount(Object contractNumber, String settlementNumber, BigDecimal deductionAmount) {
AssertUtils.isNull(contractNumber, "合同不能为空!");
AssertUtils.isNull(settlementNumber, "结算单不能为空!");
// if (deductionAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
// throw new PlatException("扣款金额不能小于等于0!");
// }
List<HGCW008> hgcw008List = DaoBase.getInstance().query(HGCW008.QUERY,new HashMap<String,Object>(){
{put("settlementNumber",settlementNumber);}
});
if (CollectionUtils.isEmpty(hgcw008List)) {
throw new PlatException("找不到对应的结算单!");
}
List<HGCW002> hgcw002s = DaoBase.getInstance().query(HGCW002.QUERY,new HashMap<String,Object>(){
{put("contractNumber",contractNumber);}
});
if (CollectionUtils.isEmpty(hgcw002s)) {
throw new PlatException("找不到对应的合同!");
}
//获取当期项目所以的结算单
List<HGCW008> cw008List = DaoBase.getInstance().query(HGCW008.QUERY,new HashMap<String,Object>(){
{put("contractNumber",contractNumber);}
});
List<String> stringList = cw008List.stream().map(HGCW008::getSettlementNumber).collect(Collectors.toList());
BigDecimal totalAmount = HgCw011.sumSettlementNumber(stringList); //获取累计开票金额
DecimalFormat decimalFormat = new DecimalFormat("#.000");
HGCW002 hgcw002 = hgcw002s.get(0);
BigDecimal remaining = hgcw002.getTotalContractPriceIncluding();
//获取销售合同金额和补充协议金额
List<HGCW002> hgcw002List = DaoBase.getInstance().query("HGCW010D.sumContractPrice",new HashMap<String,Object>(){
{put("contractNumber",contractNumber);}
});
//计算销售合同金额的20%的总金额 总金额=合同金额+合同金额的20%
remaining = hgcw002List.get(0).getTotalContractPriceIncluding().add(hgcw002List.get(0).getTotalContractPriceIncluding().multiply(new BigDecimal("0.2")));
//合同总金额-(累计开票金额+本次来票金额)
BigDecimal remainingAmount = new BigDecimal(decimalFormat.format(remaining.subtract(deductionAmount.add(totalAmount))));
if (remainingAmount.compareTo(new BigDecimal(BigInteger.ZERO)) < 0) {
throw new PlatException("本次开票金额加累计开票金额超出销售合同金额20%,超出20%需要业务新增补充协议!");
}
HGCW008 hgcw008 = hgcw008List.get(0);
BigDecimal remainingCount = new BigDecimal(decimalFormat.format(hgcw008.getRemainingAmount().subtract(deductionAmount)));
if (remainingAmount.compareTo(new BigDecimal(BigInteger.ZERO)) < 0) {
throw new PlatException("扣款金额不能大于结算单剩余金额!");
}
hgcw008.setRemainingAmount(remainingCount);
DaoUtils.update("HGCW008.updateDeductionAmount", hgcw008);
}
}
......@@ -694,6 +777,24 @@ public class HGCWTools {
});
return results;
}
/**
* 根据来源单号获取总金额
* @param settlementNumber 来源单号
* @return
*/
public static BigDecimal sumSettlementNumber(List<String> settlementNumber) {
AssertUtils.isNull(settlementNumber, "来源单号不能为空!");
List<HGCW011> results = DaoBase.getInstance().query(HGCW011.QUERY,new HashMap<String,Object>(){
{put("settlementNumbers",settlementNumber);}
});
AssertUtils.isEmpty(results, "找不到对应的销售开票记录!");
BigDecimal totalAmount = new BigDecimal("0");
for (HGCW011 hgcw011: results) {
totalAmount = totalAmount.add(hgcw011.getTotalContractPriceIncluding());
}
return totalAmount;
}
}
/**
......
......@@ -109,6 +109,9 @@ public class ServiceHGKC001 extends ServiceBase {
String depositNo = fCg004.getDepositNo();
HGKC001 dbCg004 = dbCg004Map.get(depositNo);
AssertUtils.isNull(dbCg004, String.format("入库单[%s]不存在", depositNo));
if (fCg004.getSubmitStatus().equals(HGConstant.WhCodeStatus.S_1)){
AssertUtils.isTrue(true, String.format("入库单[%s]状态为已提交,不能修改", fCg004.getDepositNo()));
}
}
}
......
......@@ -268,6 +268,9 @@
FLOW_ID
)
VALUES (#id#, #accountCode#, #depCode#, #inventType#, #inventTypeDetail#, #inventCode#, #inventName#, #spec#, #length#, #width#, #thick#, #material#, #coefficient#, #unit#, #status#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#,#flowId#)
<selectKey resultClass="java.lang.Long" keyProperty="id">
SELECT MAX(ID) FROM ${hggpSchema}.HGPZ005
</selectKey>
</insert>
<delete id="delete">
......@@ -378,7 +381,8 @@
a.WIDTH as "width", <!-- 宽 -->
a.THICK as "thick", <!-- 厚 -->
b.PAR_INVENT_TYPE as "parInventType",
b.INVENT_TYPE_DETAIL as "inventTypeDetail"
b.INVENT_TYPE_DETAIL as "inventTypeDetail",
a.SPEC as "spec" <!-- 规格 -->
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
......
......@@ -240,8 +240,8 @@ public class HGPZTools {
Map queryMap = new HashMap();
queryMap.put("inventCode", inventCode);
List<HGPZ005> results = DaoBase.getInstance().query(HGPZ005.QUERY, queryMap);
AssertUtils.isEmpty(results, String.format("物料编码[%s]不存在", inventCode));
return results.get(0);
//AssertUtils.isEmpty(results, String.format("物料编码[%s]不存在", inventCode));
return results.size() == 0 ? null :results.get(0);
}
/**
......@@ -613,7 +613,10 @@ public class HGPZTools {
Map<String, Object> params = new HashMap<>();
params.put(HGPZ005.FIELD_INVENT_CODE, hgpz005.getInventCode());
List hgpz005s = DaoBase.getInstance().query(HGPZ005.QUERY, params);
AssertUtils.isNotEmpty(hgpz005s, String.format("存货编码[%s]已存在", hgpz005.getInventCode()));
if (CollectionUtils.isNotEmpty(hgpz005s)){
continue;
}
//AssertUtils.isNotEmpty(hgpz005s, String.format("存货编码[%s]已存在", hgpz005.getInventCode()));
//hgpz005.setInventCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.INVENT_CODE));
// 设置规格
if (StringUtils.isBlank(hgpz005.getSpec())) {
......
......@@ -40,6 +40,7 @@ public class HGSC004A extends DaoEPBase {
public static final String FIELD_product_name = "productName"; /* 产品名称*/
public static final String FIELD_product_type = "productType"; /* 产品type*/
public static final String FIELD_invent_type = "inventType"; /* 档案类型*/
public static final String FIELD_spec = "spec"; /* 规格*/
public static final String FIELD_length = "length"; /* 长*/
public static final String FIELD_width = "width"; /* 宽*/
public static final String FIELD_thick = "thick"; /* 厚*/
......@@ -56,6 +57,9 @@ public class HGSC004A extends DaoEPBase {
public static final String FIELD_updated_by = "updatedBy"; /* 更新人*/
public static final String FIELD_updated_name = "updatedName"; /* 修改人名称*/
public static final String FIELD_updated_time = "updatedTime"; /* 更新时间*/
public static final String FIELD_MATERIAL = "material"; /* 材质*/
public static final String FIELD_COEFFICIENT = "coefficient"; /* 系数*/
public static final String FIELD_UNIT = "unit"; /* 单位*/
public static final String COL_id = "id"; /* 主键*/
public static final String COL_company_code = "company_code"; /* 公司编码(预留)*/
......@@ -125,6 +129,7 @@ public class HGSC004A extends DaoEPBase {
private String productName = " "; /* 产品名称*/
private String productType = " "; /* 产品类型*/
private String inventType = " "; /* 档案类型*/
private String spec = " ";
private BigDecimal length = new BigDecimal("0"); /* 长*/
private BigDecimal width = new BigDecimal("0"); /* 宽*/
private BigDecimal thick = new BigDecimal("0"); /* 厚*/
......@@ -142,6 +147,9 @@ public class HGSC004A extends DaoEPBase {
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 更新时间*/
private String material = " "; /* 材质*/
private BigDecimal coefficient = new BigDecimal("0"); /* 系数*/
private String unit = " "; /* 单位*/
private Long techFlowId = new Long(0); /* 工艺流程id*/
private String finishDate = " "; /* 完工日期*/
......@@ -225,22 +233,27 @@ public class HGSC004A extends DaoEPBase {
eiColumn = new EiColumn(FIELD_product_code);
eiColumn.setFieldLength(32);
eiColumn.setDescName("产品编号");
eiColumn.setDescName("存货编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_name);
eiColumn.setFieldLength(50);
eiColumn.setDescName("产品名称");
eiColumn.setDescName("存货名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_type);
eiColumn.setFieldLength(32);
eiColumn.setDescName("产品类型");
eiColumn.setDescName("存货类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_invent_type);
eiColumn.setFieldLength(32);
eiColumn.setDescName("档案类型");
eiColumn.setDescName("存货类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_spec);
eiColumn.setFieldLength(96);
eiColumn.setDescName("规格");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_length);
......@@ -341,7 +354,20 @@ public class HGSC004A extends DaoEPBase {
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MATERIAL);
eiColumn.setDescName("材质");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COEFFICIENT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12);
eiColumn.setDescName("系数");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UNIT);
eiColumn.setDescName("单位");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -840,6 +866,38 @@ public class HGSC004A extends DaoEPBase {
this.thick = thick;
}
public String getSpec() {
return spec;
}
public void setSpec(String spec) {
this.spec = spec;
}
public String getMaterial() {
return material;
}
public void setMaterial(String material) {
this.material = material;
}
public BigDecimal getCoefficient() {
return coefficient;
}
public void setCoefficient(BigDecimal coefficient) {
this.coefficient = coefficient;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
/**
* get the value from Map.
*
......@@ -866,6 +924,7 @@ public class HGSC004A extends DaoEPBase {
setProductId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_product_id)), productId));
setProductType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_product_type)), productType));
setInventType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_invent_type)), inventType));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_spec)), spec));
setLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_length)), length));
setWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_width)), width));
setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_thick)), thick));
......@@ -882,6 +941,9 @@ public class HGSC004A extends DaoEPBase {
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_by)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_name)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_time)), updatedTime));
setMaterial(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MATERIAL)), material));
setCoefficient(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_COEFFICIENT)), coefficient));
setUnit(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UNIT)), unit));
}
/**
......@@ -909,6 +971,7 @@ public class HGSC004A extends DaoEPBase {
map.put(FIELD_product_id, StringUtils.toString(productId, eiMetadata.getMeta(FIELD_product_id)));
map.put(FIELD_product_type, StringUtils.toString(productType, eiMetadata.getMeta(FIELD_product_type)));
map.put(FIELD_invent_type, StringUtils.toString(inventType, eiMetadata.getMeta(FIELD_invent_type)));
map.put(FIELD_spec, StringUtils.toString(spec, eiMetadata.getMeta(FIELD_spec)));
map.put(FIELD_length, StringUtils.toString(length, eiMetadata.getMeta(FIELD_length)));
map.put(FIELD_width, StringUtils.toString(width, eiMetadata.getMeta(FIELD_width)));
map.put(FIELD_thick, StringUtils.toString(thick, eiMetadata.getMeta(FIELD_thick)));
......@@ -925,7 +988,9 @@ public class HGSC004A extends DaoEPBase {
map.put(FIELD_updated_by, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_updated_by)));
map.put(FIELD_updated_name, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_updated_name)));
map.put(FIELD_updated_time, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_updated_time)));
map.put(FIELD_MATERIAL, StringUtils.toString(material, eiMetadata.getMeta(FIELD_MATERIAL)));
map.put(FIELD_COEFFICIENT, StringUtils.toString(coefficient, eiMetadata.getMeta(FIELD_COEFFICIENT)));
map.put(FIELD_UNIT, StringUtils.toString(unit, eiMetadata.getMeta(FIELD_UNIT)));
return map;
}
}
......@@ -18,6 +18,7 @@
product_code as "productCode", <!-- 产品编号 -->
product_name as "productName", <!-- 产品名称 -->
invent_type as "inventType", <!-- 档案类型 -->
spec as "spec", <!-- 规格 -->
length as "length", <!-- 长 -->
width as "width", <!-- 宽 -->
thick as "thick", <!-- 厚 -->
......@@ -84,6 +85,9 @@
<isNotEmpty prepend=" AND " property="inventType">
invent_type = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="quantity">
quantity = #quantity#
</isNotEmpty>
......@@ -199,6 +203,7 @@
a.product_code as "productCode", <!-- 产品编号 -->
a.product_name as "productName", <!-- 产品名称 -->
a.invent_type as "inventType", <!-- 档案类型 -->
a.spec as "spec",
a.length as "length", <!-- 长 -->
a.width as "width", <!-- 宽 -->
a.thick as "thick", <!-- 厚 -->
......@@ -295,6 +300,7 @@
updated_by, <!-- 更新人 -->
updated_name, <!-- 修改人名称 -->
updated_time, <!-- 更新时间 -->
spec, <!-- 规格 -->
length, <!-- 长 -->
width, <!-- 宽 -->
thick <!-- 厚 -->
......@@ -303,7 +309,7 @@
#parentProdCode#, #parentProdName#,#leaf#,#sort#,#lv#, #materialId#, #productId#,#productType#,
#productCode#, #productName#,#inventType#, #productStatus#, #changeType#, #quantity#, #singleWeight#, #totalWeight#,
#approvalStatus#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
#updatedName#, #updatedTime#, #length#, #width#, #thick#)
#updatedName#, #updatedTime#, #spec#, #length#, #width#, #thick#)
<selectKey resultClass="java.lang.Long" keyProperty="id">
SELECT MAX(ID) FROM ${hggpSchema}.HGSC004A
</selectKey>
......@@ -333,6 +339,7 @@
product_code = #productCode#, <!-- 产品编号 -->
product_name = #productName#, <!-- 产品名称 -->
invent_type = #inventType#, <!-- 档案类型 -->
spec = #spec#,
length = #length#, <!-- 长 -->
width = #width#, <!-- 宽 -->
thick = #thick#, <!-- 厚 -->
......
......@@ -330,16 +330,12 @@ public class HGSCTools {
hgsc004a.setCompanyName(results.get(0).getCompanyName());
hgsc004a.setDepCode(results.get(0).getDepCode());
hgsc004a.setDepName(results.get(0).getDepName());
if (hgsc004a.getLv()==3){
if (hgsc004a.getParentProdCode().trim().isEmpty()){
hgsc004a.setParentProdCode(results.get(0).getProjCode());
hgsc004a.setParentProdName(results.get(0).getProjName());
hgsc004a.setMaterialId(results.get(0).getId());
checkSaveData(hgsc004a);
}else if (hgsc004a.getLv()==4){
if (hgsc004a.getParentProdCode().trim().length()==0){
AssertUtils.isTrue(true, "层级为4级,父节点-产品编号不能为空!");
}
hgsc004a.setLv(3);
}else{
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("companyCode", hgsc004a.getCompanyCode());
paramMap.put("projCode", hgsc004a.getProjCode());
......@@ -348,11 +344,9 @@ public class HGSCTools {
List<HGSC004A> hgsc004aList = list(paramMap);
AssertUtils.isEmpty(hgsc004aList, String.format("父节点-产品编号[%s]数据不存在,导入失败!",hgsc004a.getParentProdCode()));
hgsc004a.setMaterialId(results.get(0).getId());
checkSaveData(hgsc004a);
}else {
AssertUtils.isTrue(true, "层级不能为空!");
hgsc004a.setLv(4);
}
checkSaveData(hgsc004a);
addEntity(hgsc004a);
}
......@@ -378,16 +372,36 @@ public class HGSCTools {
AssertUtils.isTrue(true, "数量不能为0!");
}
hgsc004a.setTotalWeight(hgsc004a.getQuantity().multiply(hgsc004a.getSingleWeight()));
HGPZ005 hgpz005= HGPZTools.HgPz005.get(hgsc004a.getProductCode());
if (Objects.isNull(hgpz005)){
AssertUtils.isTrue(true, "产品编号不存在!");
HGPZ005 pz005= HGPZTools.HgPz005.get(hgsc004a.getProductCode());
if (pz005 == null){
List<HGPZ004> hgpz004s = DaoBase.getInstance().query(HGPZ004.QUERY, new HashMap<String, Object>(){{
put(HGPZ004.FIELD_STATUS, CommonConstant.YesNo.YES_1);
}});
Map parmap = hgpz004s.stream().collect(Collectors.toMap(HGPZ004::getInventTypeName, HGPZ004::getInventType,(v1, v2) -> v1));
String inventType = com.baosight.hggp.util.MapUtils.getString(parmap, com.baosight.hggp.util.StringUtils.trimToEmpty(hgsc004a.getInventType()));
AssertUtils.isEmpty(inventType, String.format("存货类型[%s]代码不存在,添加失败!", hgsc004a.getInventType()));
pz005 = new HGPZ005();
pz005.setInventType(inventType);
pz005.setInventCode(hgsc004a.getProductCode());
pz005.setInventName(hgsc004a.getProductName());
pz005.setSpec(hgsc004a.getSpec());
pz005.setInventTypeDetail(Integer.valueOf(hgsc004a.getProductType()));
pz005.setLength(hgsc004a.getLength());
pz005.setWidth(hgsc004a.getWidth());
pz005.setThick(hgsc004a.getThick());
pz005.setMaterial(hgsc004a.getMaterial());
pz005.setCoefficient(hgsc004a.getCoefficient());
pz005.setUnit(hgsc004a.getUnit());
pz005.setStatus(1); //默认启用
DaoUtils.insert(HGPZ005.INSERT,pz005);
}
hgsc004a.setProductId(hgpz005.getId());
hgsc004a.setInventType(hgpz005.getInventType()+"");
hgsc004a.setProductType(hgpz005.getInventTypeDetail()+"");
hgsc004a.setLength(hgpz005.getLength());
hgsc004a.setWidth(hgpz005.getWidth());
hgsc004a.setThick(hgpz005.getThick());
hgsc004a.setProductId(pz005.getId());
hgsc004a.setInventType(pz005.getInventType()+"");
hgsc004a.setProductType(pz005.getInventTypeDetail()+"");
hgsc004a.setLength(pz005.getLength());
hgsc004a.setWidth(pz005.getWidth());
hgsc004a.setThick(pz005.getThick());
DaoUtils.insert(HGSC004A.INSERT, hgsc004a);
//主表全部提交时需要有改变状态
/*if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.QBTJ){
......
......@@ -35,16 +35,16 @@ $(function () {
return dataItem["purUserName"];
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
inInfo.set("field", options.field);
EiCommunicator.send("HGSC001", "userByCompanyComboBox", inInfo, {
onSuccess: function (ei) {
userByCompany = ei.getBlock("userByCompany").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
// let inInfo = new EiInfo();
// inInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
// inInfo.set("field", options.field);
// EiCommunicator.send("HGSC001", "userByCompanyComboBox", inInfo, {
// onSuccess: function (ei) {
// userByCompany = ei.getBlock("userByCompany").getMappedRows();
// },
// onFail: function (ei) {
// }
// }, {async: false});
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
......
......@@ -50,8 +50,8 @@
filter="contains" required="true">
<EF:EFOptions blockId="sup_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="supName" cname="供应商名称" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="purUserName" cname="采购员" width="100" align="center" required="true"/>
<EF:EFColumn ename="supName" cname="供应商名称" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="purUserName" cname="采购员" width="120" align="center" required="true"/>
<EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N0}" enable="false"/>
<EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" enable="false"/>
<EF:EFColumn ename="receiveQty" cname="已收货数量" enable="false" width="120" align="right" format="{0:N0}"/>
......
......@@ -23,16 +23,16 @@ $(function () {
return dataItem["purUserName"];
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
inInfo.set("field", options.field);
EiCommunicator.send("HGSC001", "userByCompanyComboBox", inInfo, {
onSuccess: function (ei) {
userByCompany = ei.getBlock("userByCompany").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
// let inInfo = new EiInfo();
// inInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
// inInfo.set("field", options.field);
// EiCommunicator.send("HGSC001", "userByCompanyComboBox", inInfo, {
// onSuccess: function (ei) {
// userByCompany = ei.getBlock("userByCompany").getMappedRows();
// },
// onFail: function (ei) {
// }
// }, {async: false});
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
......
......@@ -51,16 +51,16 @@ $(function () {
return dataItem["purUserName"];
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
inInfo.set("field", options.field);
EiCommunicator.send("HGSC001", "userByCompanyComboBox", inInfo, {
onSuccess: function (ei) {
userByCompany = ei.getBlock("userByCompany").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
// let inInfo = new EiInfo();
// inInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
// inInfo.set("field", options.field);
// EiCommunicator.send("HGSC001", "userByCompanyComboBox", inInfo, {
// onSuccess: function (ei) {
// userByCompany = ei.getBlock("userByCompany").getMappedRows();
// },
// onFail: function (ei) {
// }
// }, {async: false});
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
......
......@@ -65,8 +65,8 @@
filter="contains" required="true">
<EF:EFOptions blockId="sup_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="supName" cname="供应商名称" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="purUserName" cname="采购员" width="100" align="center" required="true"/>
<EF:EFColumn ename="supName" cname="供应商名称" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="purUserName" cname="采购员" width="120" align="center" required="true"/>
<EF:EFColumn ename="receiveQty" cname="收货数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="deliverQty" cname="退货数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="depositQty" cname="入库数量" enable="false" width="120" align="right" format="{0:N0}"/>
......
......@@ -436,10 +436,10 @@ $(function() {
eiInfo.set("fileName", src);
EiCommunicator.send("HGCW002A", "importDate", eiInfo, {
onSuccess(ei) {
if (notIsExcelFile) {
/* if (notIsExcelFile) {
NotificationUtil("请导入xls或xlsx文件", "error");
return;
}
}*/
if (ei.status == "-1") {
NotificationUtil(
{msg: ei.msg, detailMsg: ei.detailMsg}, "error");
......
......@@ -368,10 +368,10 @@ $(function() {
eiInfo.set("fileName", src);
EiCommunicator.send("HGCW002A", "importDate", eiInfo, {
onSuccess(ei) {
if (notIsExcelFile) {
/*if (notIsExcelFile) {
NotificationUtil("请导入xls或xlsx文件", "error");
return;
}
}*/
if (ei.status == "-1") {
NotificationUtil(
{msg: ei.msg, detailMsg: ei.detailMsg}, "error");
......
......@@ -37,7 +37,8 @@
<EF:EFColumn ename="companyName" cname="所属公司" align="center" enable="false"/>
<EF:EFColumn ename="projCode" cname="项目编号" align="center" enable="false"/>
<EF:EFColumn ename="projName" cname="项目名称" align="center" enable="false"/>
<EF:EFColumn ename="signingDate" cname="签订日期" align="center" enable="false"/>
<EF:EFColumn ename="signingDate" cname="签订日期" align="center" enable="false"
editType="date" parseFormats="['yyyyMMdd']" parseFormat="yyyy-MM-dd"/>
<EF:EFColumn ename="contractNumber" cname="合同号" align="center" enable="false"/>
<EF:EFColumn ename="contractName" cname="合同名称" align="center" enable="false"/>
<EF:EFColumn ename="partyA" cname="甲方名称" align="center" enable="false"/>
......
......@@ -26,6 +26,8 @@ $(function() {
loadComplete: function (grid) {
//此grid对象
$("#SELECT_BILL").on("click",addFunc);
$("#SELECT_CONT").on("click",add1Func);
$("#SELECT_LEASE").on("click",add2Func);
$("#SUBMIT").on("click",submitFunc);
$("#BTN_BILL").on("click",billFunc);
$("#BII_SAVE").on("click",saveFunc);
......@@ -94,6 +96,24 @@ function addFunc() {
callbackName: windowCallback
});
}
function add1Func() {
JSColorbox.open({
href: "HGCW010D?methodName=initLoad&efParentFormEname=HGCW010",
title: "<div style='text-align: center;'>合同管理</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
function add2Func() {
JSColorbox.open({
href: "HGCW010E?methodName=initLoad&efParentFormEname=HGCW010",
title: "<div style='text-align: center;'>租赁合同</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
/**
* 保存
......
......@@ -56,7 +56,7 @@
<EF:EFColumn ename="signingDate" cname="开票日期" width="120" enable="false" readonly="true" align="center"
editType="date" parseFormats="['yyyyMMdd']" parseFormat="yyyy-MM-dd"/>
<EF:EFColumn ename="billNumber" cname="发票号" width="120" format="{0:N3}" align="center"/>
<EF:EFComboColumn ename="taxPoints" cname="税" width="120" align="center" required="true"
<EF:EFComboColumn ename="taxPoints" cname="税" width="120" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="true" >
<EF:EFCodeOption codeName="hggp.cw.taxPoints"/>
</EF:EFComboColumn>
......
......@@ -36,13 +36,13 @@
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="partyA" cname="客户名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="partyA" cname="客户名称" width="160" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编号" width="130" 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="contractDate" cname="结算日期" width="120" enable="false" readonly="true" align="center"
editType="date" parseFormats="['yyyyMMdd']" parseFormat="yyyy-MM-dd"/>
<EF:EFColumn ename="taxPoints" cname="税率(%)" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="taxPoints" cname="税率(%)" width="80" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisPriceTax" cname="结算价税合计金额" hidden="true"/>
<EF:EFColumn ename="thisSettlementTax" cname="结算税金" width="120" enable="false" readonly="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="15" required="false"
......
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
$("#cancel").on("click", function () {
cancelFunc();
});
$("#btn_save").on("click", function () {
saveFunc();
});
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 saveFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let reviewStatus= item.get("reviewStatus");
if((reviewStatus === "1")){
message("数据已审核");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
info.set("inqu_status-0-mainId",$("#inqu_status-0-mainId").val())
EiCommunicator.send("HGCW010D", "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);
}
});
}
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/5
Time: 15:27
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="合同选择">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="隐藏条件" ename="mainId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<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="true" checkMode="row" queryMethod="query">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="210" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="partyA" cname="客户名称" width="160" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编号" width="130" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="contractNumber" cname="合同号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="contractName" cname="合同名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="signingDate" cname="签订日期" width="120" enable="false" readonly="true" align="center"
editType="date" parseFormats="['yyyyMMdd']" parseFormat="yyyy-MM-dd"/>
<EF:EFColumn ename="taxPoints" cname="税率(%)" width="80" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="valueAddedTax" cname="税额" width="120" enable="false" readonly="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="15" required="false"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="totalContractPriceExcluding" cname="合同总价(不含税)" width="120" enable="false" readonly="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="15" required="false"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="合同总价(含税)" width="120" enable="false" readonly="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="15" required="false"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="thisAmount" cname="本次开票金额" width="120" enable="true" readonly="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="15" required="false"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="remainingAmount" cname="剩余开票金额" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="15" required="false"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
</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>
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
$("#cancel").on("click", function () {
cancelFunc();
});
$("#btn_save").on("click", function () {
saveFunc();
});
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 saveFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let reviewStatus= item.get("reviewStatus");
if((reviewStatus === "1")){
message("数据已审核");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
info.set("inqu_status-0-mainId",$("#inqu_status-0-mainId").val())
EiCommunicator.send("HGCW010E", "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);
}
});
}
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/5
Time: 15:28
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="租赁合同选择">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="隐藏条件" ename="mainId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<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="true" checkMode="row" queryMethod="query">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="210" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="partyA" cname="客户名称" width="160" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编号" width="130" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="contractNumber" cname="合同号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="contractName" cname="合同名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="signingDate" cname="签订日期" width="120" enable="false" readonly="true" align="center"
editType="date" parseFormats="['yyyyMMdd']" parseFormat="yyyy-MM-dd"/>
<EF:EFColumn ename="taxPoints" cname="税率(%)" width="80" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="valueAddedTax" cname="税额" width="120" enable="false" readonly="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="15" required="false"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="totalContractPriceExcluding" cname="合同总价(不含税)" width="120" enable="false" readonly="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="15" required="false"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="合同总价(含税)" width="120" enable="false" readonly="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="15" required="false"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="thisAmount" cname="本次开票金额" width="120" enable="true" readonly="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="15" required="false"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="remainingAmount" cname="剩余开票金额" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="15" required="false"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
</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>
......@@ -136,6 +136,10 @@ let save = function () {
message("勾选的第" + (i + 1) + "行仓库不能为空");
return;
}
if (rows[i]["submitStatus"] == 1){
message("第" + (i + 1) + "行数据已提交,不能保存");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
......
......@@ -126,10 +126,10 @@ $(function() {
eiInfo.set("fileName", src);
EiCommunicator.send("HGPZ005", "importDate", eiInfo, {
onSuccess(ei) {
if (notIsExcelFile) {
/*if (notIsExcelFile) {
NotificationUtil("请导入xls或xlsx文件", "error");
return;
}
}*/
if (ei.status == "-1") {
NotificationUtil(
{msg: ei.msg, detailMsg: ei.detailMsg}, "error");
......
......@@ -254,6 +254,7 @@ $(function () {
resultGrid.setCellValue(e.items[0],"width",productCodeBox[i]['param4Field']);
resultGrid.setCellValue(e.items[0],"thick",productCodeBox[i]['param5Field']);
resultGrid.setCellValue(e.items[0],"productType",productCodeBox[i]['param6Field']);
resultGrid.setCellValue(e.items[0],"spec",productCodeBox[i]['param7Field']);
}
}
}
......@@ -486,10 +487,10 @@ $(function () {
eiInfo.set("materialId", $("#inqu_status-0-materialId").val())
EiCommunicator.send("HGSC004A", "importDate", eiInfo, {
onSuccess(ei) {
if (notIsExcelFile) {
/*if (notIsExcelFile) {
NotificationUtil("请导入xls或xlsx文件", "error");
return;
}
}*/
if (ei.status == "-1") {
NotificationUtil(
{msg: ei.msg, detailMsg: ei.detailMsg}, "error");
......
......@@ -55,6 +55,7 @@
</EF:EFComboColumn>
<EF:EFColumn ename="productCode" required="true" cname="产品编号" />
<EF:EFColumn ename="productName" cname="产品名称" width="120" align="center" enable="false"/>
<EF:EFColumn ename="spec" cname="规格" width="100" align="right" format="{0:N2}" maxLength="10" enable="false"/>
<EF:EFColumn ename="length" cname="长(MM)" width="100" align="right" format="{0:N2}" maxLength="10" enable="false"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="100" align="right" format="{0:N2}" maxLength="10" enable="false"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="100" align="right" format="{0:N2}" maxLength="10" enable="false"/>
......
......@@ -189,10 +189,10 @@ $(function () {
eiInfo.set("fileName", src);
EiCommunicator.send("HGSC009", "importDate", eiInfo, {
onSuccess(ei) {
if (notIsExcelFile) {
/*if (notIsExcelFile) {
NotificationUtil("请导入xls或xlsx文件", "error");
return;
}
}*/
if (ei.status == "-1") {
NotificationUtil(
{msg: ei.msg, detailMsg: ei.detailMsg}, "error");
......
......@@ -216,10 +216,10 @@ $(function (){
eiInfo.set("fileName", src);
EiCommunicator.send("HGSJ003", "importDate", eiInfo, {
onSuccess(ei) {
if (notIsExcelFile) {
/*if (notIsExcelFile) {
NotificationUtil("请导入xls或xlsx文件", "error");
return;
}
}*/
if (ei.status == "-1") {
NotificationUtil(
{msg: ei.msg, detailMsg: ei.detailMsg}, "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