Commit cb2d4d4f by yukang

Merge branch 'dev' of http://git.pseer.com:8800/platform/hg-smart into dev

parents d5219066 8d7bbb35
package com.baosight.hggp.common;
/**
* @author wwl
* @version 1.0 2024/5/21
*/
public enum CheckTypeEnum {
PROCESS_CHECK(1,"工序质检单"),
POLLING_CHECK(2,"日常巡检单");
private Integer code;
private String value;
CheckTypeEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
public static CheckTypeEnum getEnumByCode(Integer code){
for (CheckTypeEnum en : CheckTypeEnum.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;
}
}
......@@ -108,6 +108,15 @@ public enum DdynamicEnum {
INVENT_ALL_BOX_BLOCK_ID("invent_all_box_block_id", "id", "spec", "material", "unit", "length", "width", "thick",
"coefficient","status", "HGPZ005.queryInventBoxAll"),
/**
* 模块:存货档案(ALL 不默认状态)
* 用途:存货档案下拉框
* 编写:
*/
INVENT_NAME_BOX_BLOCK_ID("invent_name_box_block_id", "inventCode", "inventText","inventName", "spec", "inventType", "length", "width", "thick",
"coefficient","id", "HGPZ005.queryInventNameBox"),
/**
* 模块:规格
* 用途:存货档案下拉框
......@@ -347,6 +356,8 @@ public enum DdynamicEnum {
private String param8;
private String param9;
private String param10;
/** 数据源 */
private final String dbSource;
......@@ -456,6 +467,22 @@ public enum DdynamicEnum {
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String param3, String param4,
String param5, String param6,String param7,String param8,String dbSource) {
this.blockId = blockId;
this.value = value;
this.text = text;
this.param1 = param1;
this.param2 = param2;
this.param3 = param3;
this.param4 = param4;
this.param5 = param5;
this.param6 = param6;
this.param7 = param7;
this.param8 = param8;
this.dbSource = dbSource;
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String param3, String param4,
String param5, String param6,String param7,String param8,String param9,String dbSource) {
this.blockId = blockId;
this.value = value;
......@@ -472,6 +499,7 @@ public enum DdynamicEnum {
this.dbSource = dbSource;
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String param3,
String param4, String param5, String param6, String param7, String param8, String param9,
String dbSource, Map paramMap) {
......@@ -594,6 +622,13 @@ public enum DdynamicEnum {
this.param9 = param9;
}
public String getParam10() {
return param10;
}
public void setParam10(String param10) {
this.param10 = param10;
}
public Map getParamMap() {
return paramMap;
}
......
......@@ -64,6 +64,9 @@ public class HGConstants {
public static final String PARAM9_FIELD = "param9Field";
/** 前后台交互下拉框字段 字段名 dzg */
public static final String PARAM10_FIELD = "param10Field";
/** 前后台交互下拉框字段 字段名 dzg */
public static final String VALUE_FIELD = "valueField";
public static final String PARAM_FILENAME = "fileName";
......
package com.baosight.hggp.common;
/**
* @author wwl
* @version 1.0 2024/5/21
*/
public enum HandleStatusEnum {
UNPROCESS(0,"待处理"),
PROCESSING(1,"处理中"),
PROCESSED(2,"已处理");
private Integer code;
private String value;
HandleStatusEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
public static HandleStatusEnum getEnumByCode(Integer code){
for (HandleStatusEnum en : HandleStatusEnum.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;
}
}
......@@ -122,6 +122,9 @@ public class HGConstant {
public static final String CW_COLLECTION_NO = "CW_COLLECTION_NO";
//材料计划订单号
public static final String PLAN_MATERIAL_CODE = "PLAN_MATERIAL_CODE";
}
/**
......@@ -260,6 +263,21 @@ public class HGConstant {
/**
*
* 数据来源
* @author:songx
* @date:2024/5/15,15:18
*/
public static class Source {
// 盘点
public static final Integer PD = 1;
// 调拨
public static final Integer DB = 2;
// 其他
public static final Integer QT = 3;
}
/**
*
* 物料变动状态
* @author:songx
* @date:2024/5/15,15:18
......@@ -275,4 +293,31 @@ public class HGConstant {
public static final Integer SC = 3;
}
/**
*
* 领料单类型
* @author:jianghesong
* @date:2024/5/15,15:18
*/
public static class ReceiveType {
// 默认
public static final Integer DEFAULT = 0;
// 正常
public static final Integer ZC = 1;
// 退库
public static final Integer TK = 2;
}
/**
* 文件类型*
*/
public static class FileBizType {
//项目人员
public static final String XMRY = "XMRY";
//质检问题照片
public static final String CHECK_DEFECT = "CHECK_DEFECT";
//质检问题处理照片
public static final String CHECK_HANDLE = "CHECK_HANDLE";
}
}
......@@ -5,8 +5,9 @@ package com.baosight.hggp.hg.constant;
* @date:2024/1/18,17:16
*/
public class HGSqlConstant {
/**
/**
* HGCG001 SQL 定义
*
* @author:songx
......@@ -534,7 +535,11 @@ public class HGSqlConstant {
// 更新完成数量
public static final String UPDATE_COMPLETE_NUM = "HPSC006.updateCompleteNum";
}
public class HGZL004 {
public static final String LOCK = "HGZL004.lock";
}
/**
* 用户
*
......
......@@ -92,7 +92,7 @@ public class HGCW010 extends DaoEPBase {
private String projName = " "; /* 项目名称*/
private String projCode = " "; /* 项目编号*/
private String settlementNumber = " "; /* 来源单号*/
private String billTybe = " "; /* 票据类型*/
private Integer billTybe; /* 票据类型*/
private String billNumber = " "; /* 发票号*/
private Integer billState; /* 开票状态*/
private String signingDate = " "; /* 开票日期*/
......@@ -100,7 +100,7 @@ public class HGCW010 extends DaoEPBase {
private Integer reviewStatus; /* 审批状态*/
private String thisSettlementTax = " "; /* 税额*/
private String thisSettlementAmount = " "; /* 不含税金额*/
private String taxPoints = " "; /* 税率*/
private Integer taxPoints ; /* 税率*/
private BigDecimal totalContractPriceIncluding = new BigDecimal("0"); /* 开票总额*/
private String createdBy = " "; /* 记录创建者*/
private String createdName = " "; /* 记录创建名称*/
......@@ -349,7 +349,7 @@ public class HGCW010 extends DaoEPBase {
* get the billTybe - 票据类型.
* @return the billTybe
*/
public String getBillTybe() {
public Integer getBillTybe() {
return this.billTybe;
}
......@@ -358,7 +358,7 @@ public class HGCW010 extends DaoEPBase {
*
* @param billTybe - 票据类型
*/
public void setBillTybe(String billTybe) {
public void setBillTybe(Integer billTybe) {
this.billTybe = billTybe;
}
/**
......@@ -477,7 +477,7 @@ public class HGCW010 extends DaoEPBase {
* get the taxPoints - 税率.
* @return the taxPoints
*/
public String getTaxPoints() {
public Integer getTaxPoints() {
return this.taxPoints;
}
......@@ -486,7 +486,7 @@ public class HGCW010 extends DaoEPBase {
*
* @param taxPoints - 税率
*/
public void setTaxPoints(String taxPoints) {
public void setTaxPoints(Integer taxPoints) {
this.taxPoints = taxPoints;
}
/**
......@@ -640,7 +640,7 @@ public class HGCW010 extends DaoEPBase {
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setSettlementNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SETTLEMENT_NUMBER)), settlementNumber));
setBillTybe(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BILL_TYBE)), billTybe));
setBillTybe(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_BILL_TYBE)), billTybe));
setBillNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BILL_NUMBER)), billNumber));
setBillState(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_BILL_STATE)), billState));
setSigningDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SIGNING_DATE)), signingDate));
......@@ -648,7 +648,7 @@ public class HGCW010 extends DaoEPBase {
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));
setTaxPoints(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_TAX_POINTS)), taxPoints));
setTotalContractPriceIncluding(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_TOTAL_CONTRACT_PRICE_INCLUDING)), totalContractPriceIncluding));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
......
......@@ -29,6 +29,7 @@ public class HGCW010A extends DaoEPBase {
public static final String FIELD_COMPANY_NAME = "companyName"; /* 公司名称*/
public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String FIELD_PARTY_A = "partyA"; /* 项目名称*/
public static final String FIELD_CONTRACT_NUMBER = "contractNumber"; /* 合同号*/
public static final String FIELD_CONTRACT_NAME = "contractName"; /* 合同名称*/
public static final String FIELD_SETTLEMENT_NUMBER = "settlementNumber"; /* 结算编号*/
......@@ -85,8 +86,8 @@ public class HGCW010A extends DaoEPBase {
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 记录修改时间*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String QUERY = "HGCW008.query";
public static final String COUNT = "HGCW008.count";
public static final String QUERY = "HGCW010A.query";
public static final String COUNT = "HGCW010A.count";
public static final String INSERT = "HGCW008.insert";
public static final String UPDATE = "HGCW008.update";
public static final String DELETE = "HGCW008.delete";
......@@ -97,6 +98,7 @@ public class HGCW010A extends DaoEPBase {
private String companyName = " "; /* 公司名称*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private String partyA = " "; /* 客户名称*/
private String contractNumber = " "; /* 合同号*/
private String contractName = " "; /* 合同名称*/
private String settlementNumber = " "; /* 结算编号*/
......@@ -160,6 +162,10 @@ public class HGCW010A extends DaoEPBase {
eiColumn.setDescName("合同名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PARTY_A);
eiColumn.setDescName("客户名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SETTLEMENT_NUMBER);
eiColumn.setDescName("结算编号");
eiMetadata.addMeta(eiColumn);
......@@ -375,6 +381,22 @@ public class HGCW010A extends DaoEPBase {
this.projName = projName;
}
/**
* get the partyA - 客户名称.
* @return the partyA
*/
public String getPartyA() {
return this.partyA;
}
/**
* set the partyA - 客户名称.
*
* @param partyA - 项目名称
*/
public void setPartyA(String partyA) {
this.partyA = partyA;
}
/**
* get the contractNumber - 合同号.
* @return the contractNumber
*/
......@@ -748,6 +770,7 @@ public class HGCW010A extends DaoEPBase {
setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_NAME)), companyName));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setPartyA(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_A)), partyA));
setContractNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_NUMBER)), contractNumber));
setContractName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_NAME)), contractName));
setSettlementNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SETTLEMENT_NUMBER)), settlementNumber));
......@@ -786,6 +809,7 @@ public class HGCW010A extends DaoEPBase {
map.put(FIELD_COMPANY_NAME, StringUtils.toString(companyName, eiMetadata.getMeta(FIELD_COMPANY_NAME)));
map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE)));
map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
map.put(FIELD_PARTY_A, StringUtils.toString(partyA, eiMetadata.getMeta(FIELD_PARTY_A)));
map.put(FIELD_CONTRACT_NUMBER, StringUtils.toString(contractNumber, eiMetadata.getMeta(FIELD_CONTRACT_NUMBER)));
map.put(FIELD_CONTRACT_NAME, StringUtils.toString(contractName, eiMetadata.getMeta(FIELD_CONTRACT_NAME)));
map.put(FIELD_SETTLEMENT_NUMBER, StringUtils.toString(settlementNumber, eiMetadata.getMeta(FIELD_SETTLEMENT_NUMBER)));
......
......@@ -17,7 +17,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-05-28 18:02:47 create
* @history 2024-06-04 8:23:50 create
*/
public class HGCW011 extends DaoEPBase {
......@@ -86,7 +86,7 @@ public class HGCW011 extends DaoEPBase {
private String partyA = " "; /* 客户名称*/
private String thisSettlementTax = " "; /* 税额*/
private String thisSettlementAmount = " "; /* 不含税金额*/
private Boolean taxPoints; /* 税率*/
private Integer taxPoints = new Integer(0); /* 税率*/
private BigDecimal totalContractPriceIncluding = new BigDecimal("0"); /* 开票总额*/
private String createdBy = " "; /* 记录创建者*/
private String createdName = " "; /* 记录创建名称*/
......@@ -396,7 +396,7 @@ public class HGCW011 extends DaoEPBase {
* get the taxPoints - 税率.
* @return the taxPoints
*/
public Boolean getTaxPoints() {
public Integer getTaxPoints() {
return this.taxPoints;
}
......@@ -405,7 +405,7 @@ public class HGCW011 extends DaoEPBase {
*
* @param taxPoints - 税率
*/
public void setTaxPoints(Boolean taxPoints) {
public void setTaxPoints(Integer taxPoints) {
this.taxPoints = taxPoints;
}
/**
......@@ -556,7 +556,7 @@ public class HGCW011 extends DaoEPBase {
setPartyA(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_A)), partyA));
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(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_TAX_POINTS)), taxPoints));
setTaxPoints(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_TAX_POINTS)), taxPoints));
setTotalContractPriceIncluding(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_TOTAL_CONTRACT_PRICE_INCLUDING)), totalContractPriceIncluding));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
......
......@@ -35,8 +35,30 @@
-->
<sqlMap namespace="HGCW010A">
<sql id="authCondition">
<!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode">
T1.DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(T1.CREATED_BY = #authOnlyPeople# OR T1.DEP_CODE IN <iterate close=")" open="(" conjunction=","
property="authDepCodes">#authDepCodes[]#</iterate>)
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
<isNotEmpty property="authOnlyPeople">
T1.CREATED_BY = #authOnlyPeople#
</isNotEmpty>
<isNotEmpty property="authDepCodes">
T1.DEP_CODE IN
<iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="id">
T1.ID = #id#
</isNotEmpty>
......@@ -55,6 +77,9 @@
<isNotEmpty prepend=" AND " property="projName">
T1.PROJ_NAME like ('%$projName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
B.PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
T1.CONTRACT_NUMBER like ('%$contractNumber$%')
</isNotEmpty>
......@@ -130,7 +155,7 @@
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cw.domain.HGCW008">
resultClass="com.baosight.hggp.hg.cw.domain.HGCW010A">
SELECT
T1.ID as "id",
T1.ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
......@@ -138,6 +163,7 @@
T1.COMPANY_NAME as "companyName", <!-- 公司名称 -->
T1.PROJ_CODE as "projCode", <!-- 项目编码 -->
T1.PROJ_NAME as "projName", <!-- 项目名称 -->
B.PARTY_A as "partyA",<!-- 客户名称 -->
T1.CONTRACT_NUMBER as "contractNumber", <!-- 合同号 -->
T1.CONTRACT_NAME as "contractName", <!-- 合同名称 -->
T1.SETTLEMENT_NUMBER as "settlementNumber", <!-- 结算编号 -->
......
<?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-23 9:08:57
Generate time : 2024-06-04 8:23:50
Version : 1.0
schema : hggp
tableName : HGCW011
ID BIGINT NOT NULL primarykey,
MAIN_ID BIGINT NOT NULL,
ACCOUNT_CODE VARCHAR,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
CONTRACT_NUMBER VARCHAR,
INCOME_NUMBER VARCHAR,
SIGNING_DATE VARCHAR,
PROJ_NAME VARCHAR,
PROJ_CODE VARCHAR,
SETTLEMENT_NUMBER VARCHAR,
BILL_NUMBER VARCHAR,
PARTY_A VARCHAR,
CANCEL_STATUS TINYINT,
REVIEW_STATUS TINYINT,
TOTAL_CONTRACT_PRICE_INCLUDING VARCHAR,
THIS_SETTLEMENT_TAX VARCHAR,
THIS_SETTLEMENT_AMOUNT VARCHAR,
TAX_POINTS INTEGER,
TOTAL_CONTRACT_PRICE_INCLUDING DECIMAL,
CREATED_BY VARCHAR NOT NULL,
CREATED_NAME VARCHAR NOT NULL,
CREATED_TIME VARCHAR NOT NULL,
......@@ -29,6 +32,9 @@
<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>
......@@ -38,23 +44,29 @@
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="incomeNumber">
INCOME_NUMBER = #incomeNumber#
<isNotEmpty prepend=" AND " property="settlementNumber">
SETTLEMENT_NUMBER = #settlementNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDate">
SIGNING_DATE = #signingDate#
<isNotEmpty prepend=" AND " property="billNumber">
BILL_NUMBER = #billNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="cancelStatus">
CANCEL_STATUS = #cancelStatus#
<isNotEmpty prepend=" AND " property="thisSettlementTax">
THIS_SETTLEMENT_TAX = #thisSettlementTax#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thisSettlementAmount">
THIS_SETTLEMENT_AMOUNT = #thisSettlementAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reviewStatus">
REVIEW_STATUS = #reviewStatus#
<isNotEmpty prepend=" AND " property="taxPoints">
TAX_POINTS = #taxPoints#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceIncluding">
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#
......@@ -86,16 +98,19 @@
resultClass="com.baosight.hggp.hg.cw.domain.HGCW011">
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", <!-- 来源单号 -->
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", <!-- 付款总额 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PROJ_CODE as "projCode", <!-- 项目编号 -->
SETTLEMENT_NUMBER as "settlementNumber", <!-- 来源单号 -->
BILL_NUMBER as "billNumber", <!-- 发票号 -->
PARTY_A as "partyA", <!-- 客户名称 -->
THIS_SETTLEMENT_TAX as "thisSettlementTax", <!-- 税额 -->
THIS_SETTLEMENT_AMOUNT as "thisSettlementAmount", <!-- 不含税金额 -->
TAX_POINTS as "taxPoints", <!-- 税率 -->
TOTAL_CONTRACT_PRICE_INCLUDING as "totalContractPriceIncluding", <!-- 开票总额 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
......@@ -125,6 +140,9 @@
<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>
......@@ -134,23 +152,29 @@
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="incomeNumber">
INCOME_NUMBER = #incomeNumber#
<isNotEmpty prepend=" AND " property="settlementNumber">
SETTLEMENT_NUMBER = #settlementNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDate">
SIGNING_DATE = #signingDate#
<isNotEmpty prepend=" AND " property="billNumber">
BILL_NUMBER = #billNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="cancelStatus">
CANCEL_STATUS = #cancelStatus#
<isNotEmpty prepend=" AND " property="thisSettlementTax">
THIS_SETTLEMENT_TAX = #thisSettlementTax#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thisSettlementAmount">
THIS_SETTLEMENT_AMOUNT = #thisSettlementAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reviewStatus">
REVIEW_STATUS = #reviewStatus#
<isNotEmpty prepend=" AND " property="taxPoints">
TAX_POINTS = #taxPoints#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceIncluding">
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#
......@@ -180,16 +204,19 @@
<insert id="insert">
INSERT INTO ${hggpSchema}.HGCW011 (ID,
MAIN_ID, <!-- 主表ID -->
ACCOUNT_CODE, <!-- 企业编码 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
CONTRACT_NUMBER, <!-- 来源单号 -->
INCOME_NUMBER, <!-- 单号 -->
SIGNING_DATE, <!-- 付款日期 -->
PARTY_A, <!-- 供应商名称 -->
CANCEL_STATUS, <!-- 核销状态 -->
REVIEW_STATUS, <!-- 审批状态 -->
TOTAL_CONTRACT_PRICE_INCLUDING, <!-- 付款总额 -->
PROJ_NAME, <!-- 项目名称 -->
PROJ_CODE, <!-- 项目编号 -->
SETTLEMENT_NUMBER, <!-- 来源单号 -->
BILL_NUMBER, <!-- 发票号 -->
PARTY_A, <!-- 客户名称 -->
THIS_SETTLEMENT_TAX, <!-- 税额 -->
THIS_SETTLEMENT_AMOUNT, <!-- 不含税金额 -->
TAX_POINTS, <!-- 税率 -->
TOTAL_CONTRACT_PRICE_INCLUDING, <!-- 开票总额 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
......@@ -198,7 +225,7 @@
UPDATED_TIME, <!-- 记录修改时间 -->
DEP_CODE <!-- 部门编码 -->
)
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #contractNumber#, #incomeNumber#, #signingDate#, #partyA#, #cancelStatus#, #reviewStatus#, #totalContractPriceIncluding#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
VALUES (#id#, #mainId#, #accountCode#, #companyCode#, #companyName#, #projName#, #projCode#, #settlementNumber#, #billNumber#, #partyA#, #thisSettlementTax#, #thisSettlementAmount#, #taxPoints#, #totalContractPriceIncluding#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
</insert>
<delete id="delete">
......@@ -209,16 +236,19 @@
<update id="update">
UPDATE ${hggpSchema}.HGCW011
SET
MAIN_ID = #mainId#, <!-- 主表ID -->
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
CONTRACT_NUMBER = #contractNumber#, <!-- 来源单号 -->
INCOME_NUMBER = #incomeNumber#, <!-- 单号 -->
SIGNING_DATE = #signingDate#, <!-- 付款日期 -->
PARTY_A = #partyA#, <!-- 供应商名称 -->
CANCEL_STATUS = #cancelStatus#, <!-- 核销状态 -->
REVIEW_STATUS = #reviewStatus#, <!-- 审批状态 -->
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#, <!-- 付款总额 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
PROJ_CODE = #projCode#, <!-- 项目编号 -->
SETTLEMENT_NUMBER = #settlementNumber#, <!-- 来源单号 -->
BILL_NUMBER = #billNumber#, <!-- 发票号 -->
PARTY_A = #partyA#, <!-- 客户名称 -->
THIS_SETTLEMENT_TAX = #thisSettlementTax#, <!-- 税额 -->
THIS_SETTLEMENT_AMOUNT = #thisSettlementAmount#, <!-- 不含税金额 -->
TAX_POINTS = #taxPoints#, <!-- 税率 -->
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#, <!-- 开票总额 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
......
......@@ -304,12 +304,31 @@ public class HGCWTools {
public static HGCW010 getId(String id) {
AssertUtils.isNull(id, "销售票据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 updateAmount(Long id) {
AssertUtils.isNull(id, "收款单ID不能为空!");
HGCW010 hgcw010 = HGCWTools.HgCw010.getId(id.toString());
List<HGCW011> hgcw011s = HGCWTools.HgCw011.getMainId(hgcw010.getId());
if (CollectionUtils.isNotEmpty(hgcw011s)) {
// 更新主表
BigDecimal totalContractPriceIncluding = BigDecimal.ZERO;
StringBuffer contractNumber = new StringBuffer();
for (HGCW011 hgcw011 : hgcw011s) {
totalContractPriceIncluding = totalContractPriceIncluding.add(hgcw011.getTotalContractPriceIncluding());
}
hgcw010.setTotalContractPriceIncluding(totalContractPriceIncluding);
hgcw010.setPartyA(hgcw011s.get(0).getPartyA());
hgcw010.setProjCode(hgcw011s.get(0).getProjCode());
hgcw010.setProjName(hgcw011s.get(0).getProjName());
DaoUtils.update("HGCW010.update", hgcw010);
}
}
public static void cutAmount(String settlementNumber, BigDecimal cutAmount) {
AssertUtils.isNull(settlementNumber, "来源单号不能为空!");
// if (cutAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
......@@ -334,23 +353,39 @@ public class HGCWTools {
}
public static class HgCw011 {
public static HGCW011 getId(Long id) {
AssertUtils.isNull(id, "销售开票单ID不能为空!");
List<HGCW011> results = DaoBase.getInstance().query(HGCW011.QUERY,new HashMap<String,Object>(){
{put("id",id);}
});
return results.get(0);
}
public static List<HGCW011> mapToList(List<Map> rows, Long mainId) {
List<HGCW011> hgcw011List = new ArrayList<>();
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));
HGCW011 HGCW011 = new HGCW011();
HGCW011.fromMap(row);
String settlementNumber = row.get("settlementNumber").toString();
String remainingAmount = row.get("thisAmount").toString();
HGCW011.setTotalContractPriceIncluding(new BigDecimal(remainingAmount));
HGCW011.setSettlementNumber(settlementNumber);
if (mainId != null) {
hgcw011.setMainId(mainId);
HGCW011.setMainId(mainId);
}
hgcw011List.add(hgcw011);
HGCW011List.add(HGCW011);
});
}
return hgcw011List;
return HGCW011List;
}
public static List<HGCW011> getMainId(Long mainId) {
AssertUtils.isNull(mainId, "主表ID不能为空!");
List<HGCW011> results = DaoBase.getInstance().query(HGCW011.QUERY,new HashMap<String,Object>(){
{put("mainId",mainId);}
});
return results;
}
}
......
......@@ -103,7 +103,7 @@ public class HGKC004A extends DaoEPBase {
private BigDecimal length = new BigDecimal("0"); /* 长*/
private BigDecimal width = new BigDecimal("0"); /* 宽*/
private BigDecimal thick = new BigDecimal("0"); /* 厚*/
private BigDecimal quantity = new BigDecimal(0.000); /* 数量*/
private BigDecimal quantity = new BigDecimal(0); /* 数量*/
private BigDecimal unitWeight = new BigDecimal(0.000); /* 单重*/
private BigDecimal weight = new BigDecimal(0.000); /* 重量*/
private Long parentId = new Long(0); /* 销售出库单ID*/
......@@ -208,7 +208,7 @@ public class HGKC004A extends DaoEPBase {
eiColumn = new EiColumn(FIELD_QUANTITY);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(20);
eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn);
......
......@@ -71,6 +71,7 @@ public class HGKC008 extends DaoEPBase {
public static final String DELETE = "HGKC008.delete";
public static final String BATCH_DELETE = "HGKC008.batchDelete";;
public static final String UPDATE_STATUS = "HGKC008.updateStatus";;
public static final String UPDATE_RECEIVE_TYPE = "HGKC008.updateReceiveType";;
private Long id = new Long(0); /* 主键id*/
private String accountCode = " "; /* 账套*/
......
......@@ -41,6 +41,7 @@ public class HGKC008A extends DaoEPBase {
public static final String FIELD_INVENT_TYPE = "inventType"; /* 存货类型*/
public static final String FIELD_INVENT_CODE = "inventCode"; /* 存货编码*/
public static final String FIELD_INVENT_NAME = "inventName"; /* 存货名称*/
public static final String FIELD_INV_SPEC_ID = "invSpecId"; /* 规格*/
public static final String FIELD_INV_SPEC = "invSpec"; /* 规格*/
public static final String FIELD_INV_LENGTH = "invLength"; /* 长度(MM)*/
public static final String FIELD_INV_WIDTH = "invWidth"; /* 宽度(MM)*/
......@@ -72,6 +73,7 @@ public class HGKC008A extends DaoEPBase {
public static final String COL_INVENT_TYPE = "INVENT_TYPE"; /* 存货类型*/
public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 存货编码*/
public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 存货名称*/
public static final String COL_INV_SPEC_ID = "invSpecId"; /* 规格Id*/
public static final String COL_INV_SPEC = "INV_SPEC"; /* 规格*/
public static final String COL_INV_LENGTH = "INV_LENGTH"; /* 长度(MM)*/
public static final String COL_INV_WIDTH = "INV_WIDTH"; /* 宽度(MM)*/
......@@ -110,6 +112,7 @@ public class HGKC008A extends DaoEPBase {
private String inventType = " "; /* 存货类型*/
private String inventCode = " "; /* 存货编码*/
private String inventName = " "; /* 存货名称*/
private Long invSpecId = new Long(0); /* 规格id*/
private String invSpec = " "; /* 规格*/
private BigDecimal invLength = new BigDecimal(0.000); /* 长度(MM)*/
private BigDecimal invWidth = new BigDecimal(0.000); /* 宽度(MM)*/
......@@ -204,6 +207,10 @@ public class HGKC008A extends DaoEPBase {
eiColumn.setDescName("存货名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INV_SPEC_ID);
eiColumn.setDescName("规格id");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INV_SPEC);
eiColumn.setDescName("规格");
eiMetadata.addMeta(eiColumn);
......@@ -747,6 +754,14 @@ public class HGKC008A extends DaoEPBase {
this.projName = projName;
}
public Long getInvSpecId() {
return invSpecId;
}
public void setInvSpecId(Long invSpecId) {
this.invSpecId = invSpecId;
}
/**
* get the value from Map.
*
......@@ -774,6 +789,7 @@ public class HGKC008A extends DaoEPBase {
setInventType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_TYPE)), inventType));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode));
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setInvSpecId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INV_SPEC_ID)), invSpecId));
setInvSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INV_SPEC)), invSpec));
setInvLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_INV_LENGTH)), invLength));
setInvWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_INV_WIDTH)), invWidth));
......@@ -813,6 +829,7 @@ public class HGKC008A extends DaoEPBase {
map.put(FIELD_INVENT_TYPE, StringUtils.toString(inventType, eiMetadata.getMeta(FIELD_INVENT_TYPE)));
map.put(FIELD_INVENT_CODE, StringUtils.toString(inventCode, eiMetadata.getMeta(FIELD_INVENT_CODE)));
map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME)));
map.put(FIELD_INV_SPEC_ID, StringUtils.toString(invSpecId, eiMetadata.getMeta(FIELD_INV_SPEC_ID)));
map.put(FIELD_INV_SPEC, StringUtils.toString(invSpec, eiMetadata.getMeta(FIELD_INV_SPEC)));
map.put(FIELD_INV_LENGTH, StringUtils.toString(invLength, eiMetadata.getMeta(FIELD_INV_LENGTH)));
map.put(FIELD_INV_WIDTH, StringUtils.toString(invWidth, eiMetadata.getMeta(FIELD_INV_WIDTH)));
......
......@@ -83,7 +83,7 @@ public class ServiceHGKC004 extends ServiceEPBase {
hgkc004.fromMap(resultRow);
if (hgkc004.getId() == null || hgkc004.getId() == 0) {
this.add(hgkc004);
List<HGKC004> list = this.dao.query(HGKC004A.QUERY,hgkc004);
List<HGKC004> list = this.dao.query("HGKC004.queryList",hgkc004.toMap());
if (CollectionUtils.isEmpty(list)){
throw new PlatException("保存失败,请刷新后重试!");
}
......
......@@ -10,6 +10,7 @@ import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.kc.domain.HGKC003;
import com.baosight.hggp.hg.kc.domain.HGKC006;
import com.baosight.hggp.hg.kc.domain.HGKC006;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.utils.HGUtils;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
......@@ -44,7 +45,11 @@ public class ServiceHGKC006 extends ServiceBase {
@OperationLogAnnotation(operModul = "其他入库单", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID));
Map map = new HashMap();
map.put(HGKC006.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.WH_RECORD_BLOCK_ID),map,false
);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC006().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
......@@ -89,7 +94,9 @@ public class ServiceHGKC006 extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) {
HGKC006 hgkc006 = new HGKC006();
hgkc006.fromMap(resultRows.get(i));
hgkc006.setOtherEnterDate(DateUtils.formatShort(hgkc006.getOtherEnterDate()));
if (hgkc006.getId() == null || hgkc006.getId() == 0) {
hgkc006.setSubmitStatus(HGConstant.ProductStatus.WTJ);
this.add(hgkc006);
} else {
this.modify(hgkc006);
......@@ -129,7 +136,7 @@ public class ServiceHGKC006 extends ServiceBase {
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
hgkc006.setCompanyCode(userVO.getUsercode());
hgkc006.setCompanyName(userVO.getUsername());
hgkc006.setSource(1);
hgkc006.setSource(HGConstant.Source.QT);
DaoUtils.insert(HGKC006.INSERT, hgkc006);
}
......
......@@ -124,7 +124,6 @@ public class ServiceHGKC006A extends ServiceBase {
*/
private void add(HGKC006A hgkc006A,HGKC006 hgkc006) throws Exception {
hgkc006A.setPrimaryId(hgkc006.getId());
hgkc006A.setSource(1);
hgkc006A.setOtherEnterNo(hgkc006.getOtherEnterNo());
DaoUtils.insert(HGKC006A.INSERT, hgkc006A);
// 更新库存数量
......
......@@ -3,6 +3,7 @@ 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.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
......@@ -10,6 +11,7 @@ import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.kc.domain.HGKC003;
import com.baosight.hggp.hg.kc.domain.HGKC007;
import com.baosight.hggp.hg.kc.domain.HGKC007;
import com.baosight.hggp.hg.kc.domain.HGKC007;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.utils.HGUtils;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
......@@ -22,6 +24,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -43,7 +46,11 @@ public class ServiceHGKC007 extends ServiceBase {
@OperationLogAnnotation(operModul = "其他出库单", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID));
Map map = new HashMap();
map.put(HGKC007.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.WH_RECORD_BLOCK_ID),map,false
);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC007().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
......@@ -88,7 +95,9 @@ public class ServiceHGKC007 extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) {
HGKC007 hgkc007 = new HGKC007();
hgkc007.fromMap(resultRows.get(i));
hgkc007.setOtherOutDate(DateUtils.formatShort(hgkc007.getOtherOutDate()));
if (hgkc007.getId() == null || hgkc007.getId() == 0) {
hgkc007.setSubmitStatus(HGConstant.ProductStatus.WTJ);
this.add(hgkc007);
} else {
this.modify(hgkc007);
......@@ -128,7 +137,7 @@ public class ServiceHGKC007 extends ServiceBase {
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
hgkc007.setCompanyCode(userVO.getUsercode());
hgkc007.setCompanyName(userVO.getUsername());
hgkc007.setSource(1);
hgkc007.setSource(HGConstant.Source.QT);
DaoUtils.insert(HGKC007.INSERT, hgkc007);
}
......
......@@ -126,7 +126,6 @@ public class ServiceHGKC007A extends ServiceBase {
*/
private void add(HGKC007A hgkc007A,HGKC007 hgkc007) throws Exception {
hgkc007A.setPrimaryId(hgkc007.getId());
hgkc007A.setSource(1);
hgkc007A.setOtherOutNo(hgkc007.getOtherOutNo());
DaoUtils.insert(HGKC007A.INSERT, hgkc007A);
// 更新库存数量
......
......@@ -3,15 +3,18 @@ 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.hg.kc.domain.HGKC008A;
import com.baosight.hggp.hg.sc.domain.HGSC003;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
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.math.BigDecimal;
import java.util.*;
......@@ -24,10 +27,12 @@ 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_RECORD_BOX_BLOCK_ID),map,false
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, "初始化失败");
......@@ -38,10 +43,12 @@ public class ServiceHGKC008A extends ServiceBase {
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_RECORD_BOX_BLOCK_ID),map,false
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) {
......@@ -57,6 +64,11 @@ public class ServiceHGKC008A extends ServiceBase {
// 蓝图ids
List<Long> ids = ObjectUtils.listKey(resultRows, HGKC008A.FIELD_ID);
DaoUtils.update(HGKC008A.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}});
String receiveId = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC008A.FIELD_RECEIVE_ID);
//查看明细是否都删除了,都删除了得修改主表信息
HGKCTools.HgKc008A.checkMainData(ids,Long.valueOf(receiveId));
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
......@@ -72,9 +84,9 @@ public class ServiceHGKC008A extends ServiceBase {
HGKC008A hgkc008a = new HGKC008A();
hgkc008a.fromMap(resultMap);
//查询领料单
HGKC008 hgkc008 = (HGKC008) super.dao.get(HGKC008.QUERY,HGKC008.FIELD_ID,hgkc008a.getReceiveId());
HGKC008 hgkc008 = HGKCTools.HgKc008.getById(hgkc008a.getReceiveId());
this.checkSaveData(hgkc008a,hgkc008);
this.setData(hgkc008a,hgkc008);
this.checkSaveData(hgkc008a);
if(Objects.nonNull(hgkc008a.getId())&&hgkc008a.getId()!=0){
DaoUtils.update(HGKC008A.UPDATE, hgkc008a);
}else {
......@@ -99,20 +111,34 @@ public class ServiceHGKC008A extends ServiceBase {
hgkc008a.setProjName(hgkc008.getProjName());
hgkc008a.setWhCode(hgkc008.getWhCode());
hgkc008a.setWhName(hgkc008.getWhName());
if(hgkc008.getReceiveType().compareTo(HGConstant.ReceiveType.DEFAULT) == 0){
//如果明细里面有负数的,主表就是退库
if(hgkc008a.getInvQty().compareTo(BigDecimal.ZERO) < 0){
hgkc008.setReceiveType(HGConstant.ReceiveType.TK);
}else{
hgkc008.setReceiveType(HGConstant.ReceiveType.ZC);
}
DaoUtils.update(HGKC008.UPDATE_RECEIVE_TYPE, hgkc008);
}
}
}
/**
* 校验保存的数据
*
* @param hgkc008a
* @param hgkc008
*/
private void checkSaveData(HGKC008A hgkc008) {
private void checkSaveData(HGKC008A hgkc008a, HGKC008 hgkc008) {
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(hgkc008.getCompanyCode(), "请选择公司!");
AssertUtils.isEmpty(hgkc008.getWhCode(), "请选择仓库信息!");
AssertUtils.isEmpty(hgkc008.getWhName(), "请选择仓库信息!");
AssertUtils.isNull(hgkc008a.getReceiveId(), "未获取到生产领料单ID信息");
if(hgkc008.getReceiveType().compareTo(HGConstant.ReceiveType.ZC) == 0){
AssertUtils.isTrue(hgkc008a.getInvQty().compareTo(BigDecimal.ZERO) < 0, "此生产领料单为正常类型,数量不能小于0");
}
if(hgkc008.getReceiveType().compareTo(HGConstant.ReceiveType.TK) == 0){
AssertUtils.isTrue(hgkc008a.getInvQty().compareTo(BigDecimal.ZERO) > 0, "此生产领料单为退库类型,数量不能大于0");
}
}
}
......
......@@ -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;
}
}
......@@ -35,10 +35,13 @@ public class ServiceHGKC013 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC013.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo,HGKC013.QUERY,new HGKC013());
inInfo.getBlock(EiConstant.resultBlock).setBlockMeta(new HGKC013().eiMetadata);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.WH_RECORD_BOX_BLOCK_ID));
inInfo.set(HGKC013.FIELD_COMPANY_CODE, userVO.getUsercode());
//inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC013.FIELD_COMPANY_CODE, userVO.getUsercode());
return inInfo;
}
......@@ -106,6 +109,8 @@ public class ServiceHGKC013 extends ServiceEPBase {
*/
public void add(HGKC013 hgkc013) {
hgkc013.setAllotNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.ALLOT_NO));
hgkc013.setCompanyCode(hgkc013.getCalloutCompanyCode());
hgkc013.setCompanyName(hgkc013.getCalloutCompanyName());
DaoUtils.insert(HGKC013.INSERT, hgkc013);
}
......@@ -143,7 +148,6 @@ public class ServiceHGKC013 extends ServiceEPBase {
public void addKC006(HGKC013 hgkc013, List<HGKC013A> hgkc013AList){
HGKC006 hgkc006 = new HGKC006();
hgkc006.setOtherEnterNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.OTHER_ENTER_NO));
//UserVO userVO = HGCWTools.HgCw002.getUserCompany();
hgkc006.setCompanyCode(hgkc013.getCallinCompanyCode());
hgkc006.setCompanyName(hgkc013.getCallinCompanyName());
hgkc006.setOtherEnterDate(DateUtils.formatShort(DateUtils.date()));
......
......@@ -254,6 +254,58 @@
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, PROJ_CODE, INVENT_CODE, SUB_INVENT_CODE,FACTORY_CODE,FACTORY_NAME
</select>
<select id="queryList" parameterClass="HashMap" resultClass="HGKC004">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGKC004 WHERE 1=1
<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="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="saleOutCode">
SALE_OUT_CODE = #saleOutCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
RECEIPT_DATE DESC,CREATED_TIME DESC
</isEmpty>
</dynamic>
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
......
......@@ -215,7 +215,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
CREATED_TIME desc
</isEmpty>
</dynamic>
......
......@@ -260,7 +260,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
CREATED_TIME desc
</isEmpty>
</dynamic>
......
......@@ -215,7 +215,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
CREATED_TIME desc
</isEmpty>
</dynamic>
......
......@@ -260,7 +260,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
CREATED_TIME desc
</isEmpty>
</dynamic>
......
......@@ -175,4 +175,14 @@
WHERE
ID = #id#
</update>
<update id="updateReceiveType">
UPDATE ${hggpSchema}.HGKC008
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
RECEIVE_TYPE = #receiveType# <!-- 领料单类型 0:正常,1:退库 -->
WHERE
ID = #id#
</update>
</sqlMap>
......@@ -60,6 +60,9 @@
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME like CONCAT('%',#inventName#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invSpecId">
INV_SPEC_ID = #invSpecId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invSpec">
INV_SPEC = #invSpec#
</isNotEmpty>
......@@ -93,6 +96,9 @@
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME like ('%$projName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="notIds">
id NOT IN <iterate close=")" open="(" conjunction="," property="notIds">#notIds[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......@@ -119,6 +125,7 @@
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
INV_SPEC_ID as "invSpecId", <!-- 规格Id -->
INV_SPEC as "invSpec", <!-- 规格 -->
INV_LENGTH as "invLength", <!-- 长度(MM) -->
INV_WIDTH as "invWidth", <!-- 宽度(MM) -->
......@@ -166,6 +173,7 @@
INVENT_TYPE, <!-- 存货类型 -->
INVENT_CODE, <!-- 存货编码 -->
INVENT_NAME, <!-- 存货名称 -->
INV_SPEC_ID, <!-- 规格id -->
INV_SPEC, <!-- 规格 -->
INV_LENGTH, <!-- 长度(MM) -->
INV_WIDTH, <!-- 宽度(MM) -->
......@@ -176,7 +184,7 @@
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#)
VALUES (#id#, #accountCode#,#projCode#, #projName#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #receiveId#, #companyCode#, #companyName#, #whCode#, #whName#, #inventRecordId#, #inventType#, #inventCode#, #inventName#, #invSpecId#,#invSpec#, #invLength#, #invWidth#, #invThick#, #invQty#, #invUnitWeight#, #invWeight#, #price#, #amount#)
</insert>
<delete id="delete">
......@@ -206,6 +214,7 @@
INVENT_TYPE = #inventType#, <!-- 存货类型 -->
INVENT_CODE = #inventCode#, <!-- 存货编码 -->
INVENT_NAME = #inventName#, <!-- 存货名称 -->
INV_SPEC_ID = #invSpecId#, <!-- 规格id -->
INV_SPEC = #invSpec#, <!-- 规格 -->
INV_LENGTH = #invLength#, <!-- 长度(MM) -->
INV_WIDTH = #invWidth#, <!-- 宽度(MM) -->
......
......@@ -150,7 +150,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
RECEIPT_DATE desc, ID asc
RECEIPT_DATE desc, CREATED_TIME desc, ID asc
</isEmpty>
</dynamic>
......
package com.baosight.hggp.hg.kc.tools;
import cn.hutool.core.collection.CollectionUtil;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
......@@ -315,6 +316,34 @@ public class HGKCTools {
}
}
public static class HgKc008 {
public static HGKC008 getById(Long id) {
AssertUtils.isEmpty(Collections.singleton(id), "ID为空!");
HGKC008 result = (HGKC008) DaoBase.getInstance().get(HGKC008.QUERY, HGKC008.FIELD_ID, id);
return result;
}
}
public static class HgKc008A {
public static void checkMainData(List<Long> ids,Long receiveId) {
Map paramMap = new HashMap();
paramMap.put("notIds", ids);
paramMap.put("receiveId", receiveId);
List<HGKC008A> results = DaoBase.getInstance().query(HGKC008A.QUERY, paramMap);
//明细都删除了,修改主表类型
if (CollectionUtil.isEmpty(results)){
HGKC008 hgkc008 = new HGKC008();
hgkc008.setId(receiveId);
hgkc008.setReceiveType(HGConstant.ReceiveType.DEFAULT);
DaoUtils.update(HGKC008.UPDATE_RECEIVE_TYPE, hgkc008);
}
}
}
/**
* HGKC010 工具类
*
......
......@@ -301,6 +301,18 @@ public class ServiceHGPZ005 extends ServiceBase {
return inInfo;
}
public EiInfo queryInventNameBox(EiInfo inInfo) {
try {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.INVENT_NAME_BOX_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询规格失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "存货档案",operType = "导入",operDesc = "导入操作")
public EiInfo importDate(EiInfo inInfo) {
try {
......
......@@ -386,6 +386,25 @@
<include refid="condition"/>
ORDER BY ID
</select>
<select id="queryInventNameBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
INVENT_CODE as "inventCode",
CONCAT('[',INVENT_CODE,']',INVENT_NAME,(CASE WHEN SPEC = '' THEN '无规格' ELSE SPEC END)) as "inventText",
INVENT_NAME as "inventName",
(CASE WHEN SPEC = '' THEN '无规格' ELSE SPEC END) AS "spec",
INVENT_TYPE as "inventType",
LENGTH AS "length" , <!-- 长 -->
WIDTH AS "width" , <!-- 宽 -->
THICK AS "thick" , <!-- 厚 -->
COEFFICIENT AS "coefficient", <!-- 系数 -->
ID AS "id"
FROM ${hggpSchema}.HGPZ005
WHERE DELETE_FLAG = 0
AND STATUS = 1
<include refid="condition"/>
ORDER BY INVENT_CODE
</select>
<!---->
<select id="queryInventBoxAll" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
......
......@@ -4,8 +4,10 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
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.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.domain.HGSC002;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.sc.util.HGSCUtil;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.*;
......@@ -53,14 +55,19 @@ public class ServiceHGSC002 extends ServiceBase {
return inInfo;
}
@Override
@OperationLogAnnotation(operModul = "项目人员", operType = "删除", operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 销售单号
List<Long> ids = ObjectUtils.listKey(resultRows, HGSC002.FIELD_id);
List<Long> ids = ObjectUtils.listKey(resultRows, HGSC002.FIELD_id).stream().map(id -> Long.parseLong(String.valueOf(id))).collect(Collectors.toList());
DaoUtils.update(HGSC002.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}});
ids.forEach( id -> {
HGSCTools.THGSC099.deleteByMatId(id, HGConstant.FileBizType.XMRY);
});
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
......
......@@ -25,6 +25,8 @@ public class ServiceHGSC005A extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
String planCode = inInfo.getCellStr(EiConstant.queryBlock,0,HGSC005A.FIELD_plan_code);
HGSC005 hgsc005 = HGSCTools.THGSC005.queryByPlanCode(planCode);
inInfo.setCell(EiConstant.queryBlock,0,HGSC005.FIELD_is_schedule,hgsc005.getIsSchedule());
inInfo = super.query(inInfo, HGSC005A.QUERY, new HGSC005A());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PLAN_PROCESS_BLOCK_ID), new HashMap<String, Object>(){{
put(HGSC005A.FIELD_plan_code,planCode);
......
package com.baosight.hggp.hg.sc.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.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.HGSC009;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.*;
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 com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.*;
/**
* @author ZhangJiHui
* @version 1.0 2024/5/28
*/
public class ServiceHGSC009 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
EiInfo outInfo = super.initLoad(inInfo,new HGSC009());
outInfo = super.query(inInfo, HGSC009.QUERY, new HGSC009());
Map qarma = new HashMap();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_RECORD_BOX_BLOCK_ID),qarma);
qarma.clear();
Map userCompany = HGSBTools.getUserCompany();
qarma.put(HGSC009.FIELD_COMPANY_CODE,userCompany.get(HGSC009.FIELD_COMPANY_CODE));
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID),qarma);
qarma.clear();
List<String> orgIds = HGSBTools.getOrgId();
qarma.put(Org.FIELD_ORG_ID,orgIds);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
return outInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
EiBlock block = inInfo.getBlock(EiConstant.queryBlock);
return super.query(inInfo, HGSC009.QUERY,new HGSC009());
}
@OperationLogAnnotation(operModul = "材料计划",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGSC009 hgsc009 = new HGSC009();
hgsc009.fromMap(resultRows.get(i));
// 校验是否提交
int count = hgsc009.getStatus();
if (count == 1) {
throw new PlatException(String.format("[%s]已提交清单,不可删除", hgsc009.getProjName()));
}
DaoUtils.update(HGSC009.DELETE, hgsc009);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
@Override
public EiInfo insert(EiInfo inInfo) {
return super.insert(inInfo);
}
/**
*保存操作
*/
@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++) {
HGSC009 hgsc009 = new HGSC009();
hgsc009.fromMap(resultRows.get(i));
if (hgsc009.getId() == null || hgsc009.getId() == 0) {
this.add(hgsc009);
} else {
this.modify(hgsc009);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HGSC009 hgsc009) {
// 校验数据
hgsc009.setPlanMaterialCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PLAN_MATERIAL_CODE));
DaoUtils.insert(HGSC009.INSERT, hgsc009);
}
/**
* 修改操作
*/
public void modify(HGSC009 hgsc009) {
DaoUtils.update(HGSC009.UPDATE, hgsc009);
}
@OperationLogAnnotation(operModul = "材料计划",operType = "修改",operDesc = "修改状态操作")
public EiInfo updateStatus(EiInfo inInfo){
int i = 0;
try {
HGSC009 hgsc009 = new HGSC009();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgsc009.fromMap(map);
DaoUtils.update(HGSC009.UPDATE_BLUEPRINT_STATUS, hgsc009);
}
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.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.AssignStatusEnum;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cg.domain.HGCG001;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.*;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
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 com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
*
* @author:
* @date:2024/1/15,11:20
*/
public class ServiceHGSC009A extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "材料计划详情", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BOX_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC009A().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "材料计划详情", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC009A.QUERY, new HGSC009A());
} 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();
// 数据校验
this.checkSaveData(resultRows);
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGSC009A hgsc009A = new HGSC009A();
hgsc009A.fromMap(resultRows.get(i));
if (hgsc009A.getId() == null || hgsc009A.getId() == 0) {
Map queryMap = new HashMap();
hgsc009A.setCompanyCode(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSC009A.FIELD_COMPANY_CODE));
hgsc009A.setCompanyName(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSC009A.FIELD_COMPANY_NAME));
hgsc009A.setPlanMaterialCode(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSC009A.FIELD_PLAN_MATERIAL_CODE));
hgsc009A.setPlanMaterialName(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSC009A.FIELD_PLAN_MATERIAL_NAME));
hgsc009A.setProjCode(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSC009A.FIELD_PROJ_CODE));
hgsc009A.setProjName(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSC009A.FIELD_PROJ_NAME));
add(hgsc009A);
} else {
this.modify(hgsc009A);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param resultRows
*/
private void checkSaveData(List<Map> resultRows) {
// 数据校验
for (int i = 0; i < resultRows.size(); i++) {
HGSC009A hgsc009A = new HGSC009A();
hgsc009A.fromMap(resultRows.get(i));
//AssertUtils.isNull(hgsc009A.s(), "是否启用不能为空");
}
}
/**
* 新增
*
* @param hgsc009A
* @throws Exception
*/
private void add(HGSC009A hgsc009A) throws Exception {
DaoUtils.insert(HGSC009A.INSERT, hgsc009A);
}
/**
* 修改数据
*
* @param hgsc009A
*/
private void modify(HGSC009A hgsc009A) {
DaoUtils.update(HGSC009A.UPDATE, hgsc009A);
}
/**
* 修改操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "材料计划详情", operType = "修改", operDesc = "修改操作")
public EiInfo update(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
for (int i = 0; i < resultRows.size(); i++) {
HGSC009A hppz009 = new HGSC009A();
hppz009.fromMap(resultRows.get(i));
DaoUtils.update(HGSC009A.UPDATE, hppz009);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@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++) {
HGSC009A hgsc009A = new HGSC009A();
hgsc009A.fromMap(resultRows.get(i));
// 校验企业下是否存在用户
int count = HGXSTools.XsUser.countByAccount(hgsc009A.getAccountCode());
if (count > 0) {
// throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", hgsc009A.getAccountName()));
}
DaoUtils.update(HGSC009A.DELETE, hgsc009A);
// 扣减库存
/*Map queryMap = new HashMap();
queryMap.put("id",inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSC009A.FIELD_PRIMARY_ID));
List<HGSC009> list = this.dao.query(HGSC009.QUERY,queryMap);
HGKCUtils.HgKc010.updateInv(list.get(0).getCompanyCode(), list.get(0).getWhCode(), hgsc009A.getInventRecordId(),
hgsc009A.getInvQty().negate(), hgsc009A.getInvWeight().negate());*/
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "采购计划", operType = "采购计划", operDesc = "采购计划")
public EiInfo insertcg(EiInfo inInfo) {
try {
String[] orderDetailIds = inInfo.getString("planMaterialCodes").split(",");
List<HGSC009A> hgsc009AList = HGSCTools.HGSC009.getById(orderDetailIds);
for (HGSC009A hgsc009 : hgsc009AList) {
// 写入子表数据
HGCG001 hgcg001 = new HGCG001();
BeanUtils.copyProperties(hgsc009,hgcg001);
hgcg001.setCompanyCode(hgsc009.getCompanyCode());
hgcg001.setCompanyName(hgsc009.getCompanyName());
hgcg001.setInventCode(hgsc009.getInventCode());
hgcg001.setInventName(hgsc009.getInventName());
//hgcg001.setInventName(hgsc009.getSpec()); //规格
hgcg001.setSpec(hgsc009.getSpec());
hgcg001.setLength(hgsc009.getLength());
hgcg001.setWidth(hgsc009.getWidth());
hgcg001.setThick(hgsc009.getThick());
hgcg001.setStatus(0);
hgcg001.setPlanDate(DateUtils.formatShort(DateUtils.date()));
hgcg001.setPlanUnitWeight(hgsc009.getSingleWeight());//总量
hgcg001.setPlanNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CG_PLAN_NO));
DaoUtils.insert(HGCG001.INSERT, hgcg001);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + orderDetailIds.length + "]条数据生成采购计划成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "生成采购计划失败");
}
return inInfo;
}
}
......@@ -4,6 +4,7 @@ import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.ds.domain.HGDS002;
import com.baosight.hggp.hg.sc.domain.HGSC099;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.FileUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ProjectInfo;
......@@ -97,7 +98,7 @@ public class ServiceHGSC099 extends ServiceEPBase {
hgsc099.fromMap(resultRows.get(i));
DaoUtils.update(HGSC099.DELETE, hgsc099);
if (!hgsc099.getDocId().isEmpty()) {
this.delectDoc(hgsc099.getDocId());
HGSCTools.THGSC099.delectDoc(hgsc099.getDocId());
}
}
inInfo = this.query(inInfo);
......@@ -109,43 +110,5 @@ public class ServiceHGSC099 extends ServiceEPBase {
return inInfo;
}
/**
* 删除文件
* @param docId 文件ID
*/
public void delectDoc(String docId){
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
List<HGDS002> list = this.dao.query(HGDS002.QUERY,map);
if (list.size() > 0) {
String realPath = list.get(0).getRealPath();
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
EiInfo queryInfo = new EiInfo();
queryInfo.set(HGSC099.FIELD_doc_id,list.get(0).getDocId());
//获取文档信息
queryInfo.set(EiConstant.serviceId,"S_EU_0102");
EiInfo docInfo = XServiceManager.call(queryInfo);
//数据库
Map docInfoMap = docInfo.getMap("docMap");
if (docInfoMap.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("data",docInfoMap.get("url")+"-"+0);
eiInfo.set(EiConstant.serviceId,"S_EU_0105");
//调用接口
EiInfo outInfo = XServiceManager.call(eiInfo);
if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){
LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败");
outInfo.setMsg("失败");
}
}
}else {
FileUtils.deleteFile(realPath);
}
this.dao.delete(HGDS002.DELETE,map);
}
}
}
......@@ -111,7 +111,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
id asc
id desc
</isEmpty>
</dynamic>
......
<?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-28 11:47:21
Version : 1.0
schema : hggp
tableName : HGSC009
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
PROJ_CODE VARCHAR,
PROJ_NAME VARCHAR,
PLAN_MATERIAL_CODE VARCHAR,
PLAN_MATERIAL_NAME VARCHAR,
STATUS TINYINT,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR
-->
<sqlMap namespace="HGSC009">
<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="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME LIKE CONCAT('%', #companyName# ,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME LIKE CONCAT('%', #projName# ,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planMaterialCode">
PLAN_MATERIAL_CODE = #planMaterialCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planMaterialName">
PLAN_MATERIAL_NAME = #planMaterialName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</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>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC009">
SELECT
ID as "id", <!-- 主键id -->
ACCOUNT_CODE as "accountCode", <!-- 账套 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PLAN_MATERIAL_CODE as "planMaterialCode", <!-- 材料计划编码 -->
PLAN_MATERIAL_NAME as "planMaterialName", <!-- 材料计划名称 -->
STATUS as "status", <!-- 提交状态 0-未提交 1-已提交 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime" <!-- 修改时间 -->
FROM ${hggpSchema}.HGSJ003 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}.HGSJ003 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="depCode">
DEP_CODE = #depCode#
</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="planMaterialCode">
PLAN_MATERIAL_CODE = #planMaterialCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planMaterialName">
PLAN_MATERIAL_NAME = #planMaterialName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</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>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSJ003 (ID, <!-- 主键id -->
ACCOUNT_CODE, <!-- 账套 -->
DEP_CODE, <!-- 部门编码 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
PLAN_MATERIAL_CODE, <!-- 材料计划编码 -->
PLAN_MATERIAL_NAME, <!-- 材料计划名称 -->
STATUS, <!-- 提交状态 0-未提交 1-已提交 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME <!-- 修改时间 -->
)
VALUES (#id#, #accountCode#, #depCode#, #companyCode#, #companyName#, #projCode#, #projName#, #planMaterialCode#, #planMaterialName#, #status#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSJ003 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGSJ003
SET
ACCOUNT_CODE = #accountCode#, <!-- 账套 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
PLAN_MATERIAL_CODE = #planMaterialCode#, <!-- 材料计划编码 -->
PLAN_MATERIAL_NAME = #planMaterialName#, <!-- 材料计划名称 -->
STATUS = #status#, <!-- 提交状态 0-未提交 1-已提交 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime# <!-- 修改时间 -->
WHERE
ID = #id#
</update>
<update id="updateBlueprintStatus">
UPDATE ${hggpSchema}.HGSJ003
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
STATUS = #status# <!-- 提交状态 0-未提交 1-已提交 -->
WHERE
ID = #id#
</update>
<select id="queryProcessComboBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT DISTINCT
PLAN_MATERIAL_CODE as "planMaterialCode",
PLAN_MATERIAL_NAME as "planMaterialName"
FROM ${hggpSchema}.HGSJ003
WHERE PLAN_MATERIAL_CODE = #planMaterialCode#
<isNotEmpty prepend=" AND " property="accountCode">
PLAN_MATERIAL_NAME = #planMaterialName#
</isNotEmpty>
ORDER BY planMaterialCode
</select>
</sqlMap>
package com.baosight.hggp.hg.sc.tools;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.lang.copier.SrcToDestCopier;
import com.baosight.hggp.common.AssignStatusEnum;
import com.baosight.hggp.common.CheckStatusEnum;
import com.baosight.hggp.common.ComputeTypeEnum;
......@@ -11,6 +12,7 @@ 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.constant.HGSqlConstant;
import com.baosight.hggp.hg.ds.domain.HGDS002;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.domain.HGPZ005A;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
......@@ -19,14 +21,14 @@ import com.baosight.hggp.hg.sj.domain.HGSJ001;
import com.baosight.hggp.hg.sj.tools.HGSJTools;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.zl.domain.HGZL002;
import com.baosight.hggp.hg.zl.domain.HGZL004;
import com.baosight.hggp.hg.zl.tools.HGZLTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.BeanUtils;
import com.baosight.hggp.util.DateUtil;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ProjectInfo;
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.soa.XServiceManager;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
......@@ -819,6 +821,112 @@ public class HGSCTools {
}
}
}
public static class THGSC099{
public static List<HGSC099> listByMatId(Long matId, String bizType) {
Map queryMap = new HashMap();
queryMap.put(HGSC099.FIELD_mat_id, matId);
queryMap.put(HGSC099.FIELD_biz_type, bizType);
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.projectEnv.RUN.equalsIgnoreCase(projectEnv)) {
return DaoBase.getInstance().query("HGSC099.queryRun", queryMap);
} else {
return DaoBase.getInstance().query("HGSC099.queryDev", queryMap);
}
}
public static void deleteByMatId(Long matId, String bizType){
List<HGSC099> hgsc099List = listByMatId(matId,bizType);
for (int i = 0; i < hgsc099List.size(); i++) {
HGSC099 hgsc099 = hgsc099List.get(i);
DaoUtils.update(HGSC099.DELETE, hgsc099);
if (!hgsc099.getDocId().isEmpty()) {
delectDoc(hgsc099.getDocId());
}
}
}
/**
* 删除文件
* @param docId 文件ID
*/
public static void delectDoc(String docId){
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
List<HGDS002> list = DaoBase.getInstance().query(HGDS002.QUERY,map);
if (list.size() > 0) {
String realPath = list.get(0).getRealPath();
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
EiInfo queryInfo = new EiInfo();
queryInfo.set(HGSC099.FIELD_doc_id,list.get(0).getDocId());
//获取文档信息
queryInfo.set(EiConstant.serviceId,"S_EU_0102");
EiInfo docInfo = XServiceManager.call(queryInfo);
//数据库
Map docInfoMap = docInfo.getMap("docMap");
if (docInfoMap.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("data",docInfoMap.get("url")+"-"+0);
eiInfo.set(EiConstant.serviceId,"S_EU_0105");
//调用接口
EiInfo outInfo = XServiceManager.call(eiInfo);
if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){
LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败");
outInfo.setMsg("失败");
}
}
}else {
FileUtils.deleteFile(realPath);
}
DaoBase.getInstance().delete(HGDS002.DELETE,map);
}
}
}
public static class HGSC009{
/* public static void generatorOrder(List<HGSC005> hgsc005List, List<HGSC005A> hgsc005AList){
Map<String, Optional<HGSC005>> hgsc005Map = hgsc005List.stream().collect(Collectors.groupingBy(HGSC005::getPlanCode,Collectors.maxBy(
Comparator.comparingLong(HGSC005::getId))));
Map<String,List<HGSC005A>> hgsc005aMap = hgsc005AList.stream().collect(Collectors.groupingBy(HGSC005A::getPlanCode));
hgsc005Map.forEach((k,v) -> {
HGSC005 hgsc005 = v.get();
HGSC006 hgsc006 = constructObj(hgsc005);
List<HGSC006A> hgsc006AList = THGSC006A.constructObj(hgsc006,hgsc005aMap.get(hgsc005.getPlanCode()));
DaoUtils.insert(HGSC006.INSERT,hgsc006);
DaoUtils.insert(HGSC006A.INSERT,hgsc006AList);
});
}*/
/*public static HGSC006 constructObj(HGSC005 hgsc005){
HGSC006 hgsc006 = new HGSC006();
hgsc006.setOrderCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGSC006_ORDER_CODE));
hgsc006.setMatId(hgsc005.getMatId());
hgsc006.setPlanId(hgsc005.getId());
hgsc006.setCompanyCode(hgsc005.getCompanyCode());
hgsc006.setCompanyName(hgsc005.getCompanyName());
hgsc006.setProjCode(hgsc005.getProjCode());
hgsc006.setProjName(hgsc005.getProjName());
hgsc006.setAssignStatus(UNASSIGN.getCode());
return hgsc006;
}*/
public static List<HGSC009A> getById(String[] orderDetailId){
AssertUtils.isTrue(Objects.isNull(orderDetailId)||orderDetailId.length<=0, "订单明细ID不能为空!");
Map map = new HashMap<>();
map.put("planMaterialCodes",orderDetailId);
List<HGSC009A> results = DaoBase.getInstance().query(HGSC009A.QUERYList, map);
AssertUtils.isEmpty(results,"材料明细不能为空!");
return results;
}
}
}
......@@ -52,8 +52,8 @@ public class HGZL002 extends DaoEPBase {
public static final String FIELD_work_by = "workBy"; /* 生产人*/
public static final String FIELD_work_name = "workName"; /* 生产人名称*/
public static final String FIELD_quantity = "quantity"; /* 数量*/
public static final String FIELD_passQuantity = "passquantity"; /* 合格数量*/
public static final String FIELD_unpassQuantity = "unpassquantity"; /* 不合格数量*/
public static final String FIELD_pass_quantity = "passQuantity"; /* 合格数量*/
public static final String FIELD_unpass_quantity = "unpassQuantity"; /* 不合格数量*/
public static final String FIELD_single_weight = "singleWeight"; /* 单重*/
public static final String FIELD_total_weight = "totalWeight"; /* 总重*/
public static final String FIELD_check_by = "checkBy"; /* 质检人*/
......@@ -97,8 +97,8 @@ public class HGZL002 extends DaoEPBase {
public static final String COL_work_by = "work_by"; /* 生产人*/
public static final String COL_work_name = "work_name"; /* 生产人名称*/
public static final String COL_quantity = "quantity"; /* 数量*/
public static final String COL_passQuantity = "passQuantity"; /* 合格数量*/
public static final String COL_unpassQuantity = "unpassQuantity"; /* 不合格数量*/
public static final String COL_pass_quantity = "pass_quantity"; /* 合格数量*/
public static final String COL_unpass_quantity = "unpass_quantity"; /* 不合格数量*/
public static final String COL_single_weight = "single_weight"; /* 单重*/
public static final String COL_total_weight = "total_weight"; /* 总重*/
public static final String COL_check_by = "check_by"; /* 质检人*/
......@@ -150,8 +150,8 @@ public class HGZL002 extends DaoEPBase {
private String workBy = " "; /* 生产人*/
private String workName = " "; /* 生产人名称*/
private Integer quantity = new Integer(0); /* 数量*/
private Integer passquantity = new Integer(0); /* 合格数量*/
private Integer unpassquantity = new Integer(0); /* 不合格数量*/
private Integer passQuantity = new Integer(0); /* 合格数量*/
private Integer unpassQuantity = new Integer(0); /* 不合格数量*/
private BigDecimal singleWeight = new BigDecimal("0"); /* 单重*/
private BigDecimal totalWeight = new BigDecimal("0"); /* 总重*/
private String checkBy = " "; /* 质检人*/
......@@ -289,11 +289,11 @@ public class HGZL002 extends DaoEPBase {
eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_passQuantity);
eiColumn = new EiColumn(FIELD_pass_quantity);
eiColumn.setDescName("合格数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_unpassQuantity);
eiColumn = new EiColumn(FIELD_unpass_quantity);
eiColumn.setDescName("不合格数量");
eiMetadata.addMeta(eiColumn);
......@@ -830,36 +830,36 @@ public class HGZL002 extends DaoEPBase {
this.quantity = quantity;
}
/**
* get the passquantity - 合格数量.
* @return the passquantity
* get the passQuantity - 合格数量.
* @return the passQuantity
*/
public Integer getPassquantity() {
return this.passquantity;
public Integer getPassQuantity() {
return this.passQuantity;
}
/**
* set the passquantity - 合格数量.
* set the passQuantity - 合格数量.
*
* @param passquantity - 合格数量
* @param passQuantity - 合格数量
*/
public void setPassquantity(Integer passquantity) {
this.passquantity = passquantity;
public void setPassQuantity(Integer passQuantity) {
this.passQuantity = passQuantity;
}
/**
* get the unpassquantity - 不合格数量.
* @return the unpassquantity
* get the unpassQuantity - 不合格数量.
* @return the unpassQuantity
*/
public Integer getUnpassquantity() {
return this.unpassquantity;
public Integer getUnpassQuantity() {
return this.unpassQuantity;
}
/**
* set the unpassquantity - 不合格数量.
* set the unpassQuantity - 不合格数量.
*
* @param unpassquantity - 不合格数量
* @param unpassQuantity - 不合格数量
*/
public void setUnpassquantity(Integer unpassquantity) {
this.unpassquantity = unpassquantity;
public void setUnpassQuantity(Integer unpassQuantity) {
this.unpassQuantity = unpassQuantity;
}
/**
* get the singleWeight - 单重.
......@@ -1106,8 +1106,8 @@ public class HGZL002 extends DaoEPBase {
setWorkBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_work_by)), workBy));
setWorkName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_work_name)), workName));
setQuantity(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_quantity)), quantity));
setPassquantity(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_passQuantity)), passquantity));
setUnpassquantity(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_unpassQuantity)), unpassquantity));
setPassQuantity(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_pass_quantity)), passQuantity));
setUnpassQuantity(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_unpass_quantity)), unpassQuantity));
setSingleWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_single_weight)), singleWeight));
setTotalWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_total_weight)), totalWeight));
setCheckBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_check_by)), checkBy));
......@@ -1159,8 +1159,8 @@ public class HGZL002 extends DaoEPBase {
map.put(FIELD_work_by, StringUtils.toString(workBy, eiMetadata.getMeta(FIELD_work_by)));
map.put(FIELD_work_name, StringUtils.toString(workName, eiMetadata.getMeta(FIELD_work_name)));
map.put(FIELD_quantity, StringUtils.toString(quantity, eiMetadata.getMeta(FIELD_quantity)));
map.put(FIELD_passQuantity, StringUtils.toString(passquantity, eiMetadata.getMeta(FIELD_passQuantity)));
map.put(FIELD_unpassQuantity, StringUtils.toString(unpassquantity, eiMetadata.getMeta(FIELD_unpassQuantity)));
map.put(FIELD_pass_quantity, StringUtils.toString(passQuantity, eiMetadata.getMeta(FIELD_pass_quantity)));
map.put(FIELD_unpass_quantity, StringUtils.toString(unpassQuantity, eiMetadata.getMeta(FIELD_unpass_quantity)));
map.put(FIELD_single_weight, StringUtils.toString(singleWeight, eiMetadata.getMeta(FIELD_single_weight)));
map.put(FIELD_total_weight, StringUtils.toString(totalWeight, eiMetadata.getMeta(FIELD_total_weight)));
map.put(FIELD_check_by, StringUtils.toString(checkBy, eiMetadata.getMeta(FIELD_check_by)));
......
package com.baosight.hggp.hg.zl.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.CheckStatusEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.zl.domain.HGZL002;
import com.baosight.hggp.hg.zl.tools.HGZLTools;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.List;
/**
* @author wwl
* @date 2025年05月29日 17:18
*/
public class ServiceHGZL002 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "工序质检单", operType = "查询", operDesc = "初始化查询")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGZL002.QUERY, new HGZL002());
EiInfoUtils.addBlock(inInfo,"userBlockId", UserSessionUtils.getUser(), User.class);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "工序质检单", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGZL002.QUERY, new HGZL002());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "工序质检单", operType = "保存", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<HGZL002> hgzl002List = MapUtils.toDaoEPBase(inInfo,HGZL002.class);
hgzl002List.forEach( o -> {
o.setCheckStatus(CheckStatusEnum.CHECKED.getCode());
DaoUtils.update(HGZL002.UPDATE,o);
HGZLTools.THGZL004.addByHGZL002(o);
});
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + hgzl002List.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.zl.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.HandleStatusEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sc.domain.HGSC004;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.zl.domain.HGZL004;
import com.baosight.hggp.hg.zl.tools.HGZLTools;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import org.apache.commons.lang.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author wwl
* @date 2025年05月29日 17:18
*/
public class ServiceHGZL004 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "整改通知单", operType = "查询", operDesc = "初始化查询")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGZL004.QUERY, new HGZL004());
EiInfoUtils.addBlock(inInfo,"userBlockId", UserSessionUtils.getUser(), User.class);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "整改通知单", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGZL004.QUERY, new HGZL004());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "整改通知单", operType = "保存", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<HGZL004> hgzl004List = MapUtils.toDaoEPBase(inInfo,HGZL004.class);
hgzl004List.forEach( o -> {
HGZL004 db004 = HGZLTools.THGZL004.get(o.getId());
HGZLTools.THGZL004.lock(o.getId());
HandleStatusEnum stat = HandleStatusEnum.getEnumByCode(db004.getHandleStatus());
switch (stat){
case UNPROCESS:
if(StringUtils.isNotBlank(o.getProcessSugges())||StringUtils.isNotBlank(o.getRectificatSugges())){
o.setHandleStatus(HandleStatusEnum.PROCESSING.getCode());
}
DaoUtils.update(HGZL004.UPDATE,o);
break;
case PROCESSING:
break;
case PROCESSED:
AssertUtils.isTrue(true,String.format("检查单号[%s]已处理完成,不能修改!"));
break;
default:
break;
}
});
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + hgzl004List.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "整改通知单", operType = "处理完成", operDesc = "处理完成")
public EiInfo complete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 销售单号
List<Long> ids = ObjectUtils.listKey(resultRows, "id");
DaoUtils.update(HGZL004.BATCH_COMPLETE, 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;
}
}
package com.baosight.hggp.hg.zl.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.zl.domain.HGZL004A;
import com.baosight.hggp.util.EiInfoUtils;
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.service.impl.ServiceBase;
import java.util.Map;
import java.util.Objects;
/**
* @author wwl
* @date 2025年05月29日 17:18
*/
public class ServiceHGZL004A extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "整改通知单-沟通记录", operType = "查询", operDesc = "初始化查询")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGZL004A.QUERY, new HGZL004A());
EiInfoUtils.addBlock(inInfo,"userBlockId", UserSessionUtils.getUser(), User.class);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "整改通知单-沟通记录", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGZL004A.QUERY, new HGZL004A());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "整改通知单-沟通记录", operType = "保存", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
Long informId = Long.valueOf(EiInfoUtils.getFirstRow(inInfo).get(HGZL004A.FIELD_inform_id).toString());
Map resultMap = EiInfoUtils.getFirstRow(inInfo, EiConstant.resultBlock);
HGZL004A hgzl004a = new HGZL004A();
hgzl004a.fromMap(resultMap);
hgzl004a.setInformId(informId);
if(Objects.nonNull(hgzl004a.getId())&&hgzl004a.getId()!=0){
DaoUtils.update(HGZL004A.UPDATE, hgzl004a);
}else {
DaoUtils.insert(HGZL004A.INSERT, hgzl004a);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
}
<?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-06-03 13:23:04
Version : 1.0
schema : hggp
tableName : HGZL004A
id BIGINT NOT NULL primarykey,
inform_id BIGINT NOT NULL,
content VARCHAR,
company_code VARCHAR NOT NULL,
company_name VARCHAR NOT NULL,
dep_code VARCHAR,
dep_name VARCHAR,
account_code VARCHAR NOT NULL,
created_by VARCHAR,
created_name VARCHAR,
created_time VARCHAR,
updated_by VARCHAR,
updated_name VARCHAR,
updated_time VARCHAR
-->
<sqlMap namespace="HGZL004A">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="informId">
inform_id = #informId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="content">
content like ('%$content$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
dep_name = #depName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
created_name like ('%$createdName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
date_format(created_time,'%Y-%m-%d') = #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>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.zl.domain.HGZL004A">
SELECT
id as "id",
inform_id as "informId", <!-- 整改通知单ID -->
content as "content", <!-- 沟通内容 -->
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编码 -->
dep_name as "depName", <!-- 部门名称 -->
account_code as "accountCode", <!-- 帐套 -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更新人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime" <!-- 更新时间 -->
FROM ${hggpSchema}.HGZL004A 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}.HGZL004A WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="informId">
inform_id = #informId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="content">
content = #content#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
dep_name = #depName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</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>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGZL004A (id,
inform_id, <!-- 整改通知单ID -->
content, <!-- 沟通内容 -->
company_code, <!-- 公司编码 -->
company_name, <!-- 公司名称 -->
dep_code, <!-- 部门编码 -->
dep_name, <!-- 部门名称 -->
account_code, <!-- 帐套 -->
created_by, <!-- 创建人 -->
created_name, <!-- 创建人名称 -->
created_time, <!-- 创建时间 -->
updated_by, <!-- 更新人 -->
updated_name, <!-- 修改人名称 -->
updated_time <!-- 更新时间 -->
)
VALUES (#id#, #informId#, #content#, #companyCode#, #companyName#, #depCode#, #depName#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGZL004A WHERE
id = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGZL004A
SET
inform_id = #informId#, <!-- 整改通知单ID -->
content = #content#, <!-- 沟通内容 -->
company_code = #companyCode#, <!-- 公司编码 -->
company_name = #companyName#, <!-- 公司名称 -->
dep_code = #depCode#, <!-- 部门编码 -->
dep_name = #depName#, <!-- 部门名称 -->
account_code = #accountCode#, <!-- 帐套 -->
created_by = #createdBy#, <!-- 创建人 -->
created_name = #createdName#, <!-- 创建人名称 -->
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 -->
WHERE
id = #id#
</update>
<delete id="delete_by_inform_ids">
DELETE FROM ${hggpSchema}.HGZL004A WHERE
inform_id IN <iterate close=")" open="(" conjunction="," property="informIds">#informIds[]#</iterate>
</delete>
</sqlMap>
package com.baosight.hggp.hg.zl.tools;
import com.baosight.hggp.common.CheckStatusEnum;
import com.baosight.hggp.common.CheckTypeEnum;
import com.baosight.hggp.common.HandleStatusEnum;
import com.baosight.hggp.core.dao.DaoBase;
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.sc.domain.HGSC006A;
import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.hg.zl.domain.HGZL002;
import com.baosight.hggp.hg.zl.domain.HGZL004;
import com.baosight.hggp.hg.zl.domain.HGZL004A;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
......@@ -17,6 +24,7 @@ import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
......@@ -84,9 +92,9 @@ public class HGZLTools {
public static class THGZL002 {
public static HGZL002 add(HGSC008 hgsc008){
public static HGZL002 add(HGSC008 hgsc008) {
HGZL002 hgzl002 = new HGZL002();
BeanUtils.copyProperties(hgsc008,hgzl002);
BeanUtils.copyProperties(hgsc008, hgzl002);
cleanBaseInfo(hgzl002);
hgzl002.setCheckStatus(CheckStatusEnum.CHECKING.getCode());
hgzl002.setWorkId(hgsc008.getId());
......@@ -94,11 +102,11 @@ public class HGZLTools {
hgzl002.setWorkBy(hgsc008.getCreatedBy());
hgzl002.setWorkName(hgsc008.getCreatedName());
hgzl002.setCheckCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGZL002_CHECK_CODE));
DaoUtils.insert(HGZL002.INSERT,hgzl002);
DaoUtils.insert(HGZL002.INSERT, hgzl002);
return hgzl002;
}
private static void cleanBaseInfo(HGZL002 hgzl002){
private static void cleanBaseInfo(HGZL002 hgzl002) {
hgzl002.setCreatedBy(null);
hgzl002.setCreatedName(null);
hgzl002.setCreatedTime(null);
......@@ -109,6 +117,7 @@ public class HGZLTools {
hgzl002.setDepName(null);
hgzl002.setId(null);
}
public static List<HGZL002> list(List<Long> workIds) {
if (CollectionUtils.isEmpty(workIds)) {
return null;
......@@ -119,7 +128,110 @@ public class HGZLTools {
}
public static void deleteByWorkIds(List<Long> workIds) {
DaoUtils.update(HGZL002.DELETE_BY_WORKS, new HashMap<String,Object>(){{put("workIds",workIds);}});
List<HGZL002> hgzl002s = list(workIds);
THGZL004.deleteByCheckIds(hgzl002s.stream().map(HGZL002::getId).collect(Collectors.toList()), CheckTypeEnum.PROCESS_CHECK);
DaoUtils.update(HGZL002.DELETE_BY_WORKS, new HashMap<String, Object>() {{
put("workIds", workIds);
}});
}
}
public static class THGZL004 {
/**
* 锁
*
* @param id
* @return
*/
public static void lock(Long id) {
if (Objects.isNull(id)||id<=0) {
return;
}
Map queryMap = new HashMap();
queryMap.put(HGZL004.FIELD_id, id);
DaoBase.getInstance().update(HGSqlConstant.HGZL004.LOCK, queryMap);
}
public static void addByHGZL002(HGZL002 hgzl002) {
List<HGZL004> hgzl004DbList = listByCheckId(hgzl002.getId(),CheckTypeEnum.PROCESS_CHECK.getCode());
if(hgzl002.getUnpassQuantity()>0&&CollectionUtils.isEmpty(hgzl004DbList)) {
HGZL004 hgzl004 = new HGZL004();
BeanUtils.copyProperties(hgzl002, hgzl004);
cleanBaseInfo(hgzl004);
hgzl004.setCheckId(hgzl002.getId());
hgzl004.setCheckType(CheckTypeEnum.PROCESS_CHECK.getCode());
hgzl004.setHandleStatus(HandleStatusEnum.UNPROCESS.getCode());
hgzl004.setCheckCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGZL002_CHECK_CODE));
DaoUtils.insert(HGZL004.INSERT, hgzl004);
}
//修改质检单问题数量为0的情况下,删除通知单,并删除相应附件照片
// if(hgzl002.getUnpassQuantity()==0&&CollectionUtils.isNotEmpty(hgzl004DbList)){
// List<Long> ids = hgzl004DbList.stream().map(HGZL004::getId).collect(Collectors.toList());
// DaoUtils.update(HGZL004.DELETE_BY_IDS,new HashMap<String,Object>(){{put("ids",ids);}});
// ids.forEach( id -> {
// HGSCTools.THGSC099.deleteByMatId(id,HGConstant.FileBizType.CHECK_DEFECT);
// HGSCTools.THGSC099.deleteByMatId(id,HGConstant.FileBizType.CHECK_HANDLE);
// });
// }
}
public static void deleteByCheckIds(List<Long> checkIds,CheckTypeEnum checkType){
List<HGZL004> hgzl004List = listByCheckIds(checkIds,checkType.getCode());
List<Long> ids = hgzl004List.stream().map(HGZL004::getId).collect(Collectors.toList());
DaoUtils.update(HGZL004.DELETE_BY_IDS,new HashMap<String,Object>(){{put("ids",ids);}});
// THGZL004A.deleteByInformIds(ids);
ids.forEach( id -> {
HGSCTools.THGSC099.deleteByMatId(id,HGConstant.FileBizType.CHECK_DEFECT);
HGSCTools.THGSC099.deleteByMatId(id,HGConstant.FileBizType.CHECK_HANDLE);
});
}
private static void cleanBaseInfo(HGZL004 hgzl004) {
hgzl004.setCreatedBy(null);
hgzl004.setCreatedName(null);
hgzl004.setCreatedTime(null);
hgzl004.setUpdatedBy(null);
hgzl004.setUpdatedName(null);
hgzl004.setUpdatedTime(null);
hgzl004.setDepCode(null);
hgzl004.setDepName(null);
hgzl004.setId(null);
}
public static List<HGZL004> listByCheckIds(List<Long> checkIds, Integer checkType) {
Map queryMap = new HashMap();
queryMap.put("checkIds", checkIds);
queryMap.put(HGZL004.FIELD_check_type, checkType);
return DaoBase.getInstance().query(HGZL004.QUERY, queryMap);
}
public static List<HGZL004> listByCheckId(Long checkId, Integer checkType) {
Map queryMap = new HashMap();
queryMap.put(HGZL004.FIELD_check_id, checkId);
queryMap.put(HGZL004.FIELD_check_type, checkType);
return DaoBase.getInstance().query(HGZL004.QUERY, queryMap);
}
/**
* @param id
*/
public static HGZL004 get(Long id) {
AssertUtils.isNull(id, "ID不能为空");
Map paramMap = new HashMap();
paramMap.put(HGZL004.FIELD_id, id);
List<HGZL004> results = DaoBase.getInstance().query(HGZL004.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
}
public static class THGZL004A {
public static void deleteByInformIds(List<Long> informIds){
AssertUtils.isEmpty(informIds, "通知单ID不能为空");
DaoUtils.update(HGZL004A.DELETE_BY_INFORM_IDS,new HashMap<String,Object>(){{put("informIds",informIds);}});
}
}
}
\ No newline at end of file
......@@ -105,6 +105,7 @@ public class CommonMethod {
row.put(HGConstants.PARAM7_FIELD, (tryValue.get(tableParam.getValue()) + HGConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getParam7())));
row.put(HGConstants.PARAM8_FIELD, (tryValue.get(tableParam.getValue()) + HGConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getParam8())));
row.put(HGConstants.PARAM9_FIELD, (tryValue.get(tableParam.getValue()) + HGConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getParam9())));
row.put(HGConstants.PARAM10_FIELD, (tryValue.get(tableParam.getValue()) + HGConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getParam10())));
} else {
row.put(HGConstants.TEXT_FIELD, String.valueOf(tryValue.get(tableParam.getText())));
row.put(HGConstants.PARAM1_FIELD, String.valueOf(tryValue.get(tableParam.getParam1())));
......@@ -116,6 +117,7 @@ public class CommonMethod {
row.put(HGConstants.PARAM7_FIELD, String.valueOf(tryValue.get(tableParam.getParam7())));
row.put(HGConstants.PARAM8_FIELD, String.valueOf(tryValue.get(tableParam.getParam8())));
row.put(HGConstants.PARAM9_FIELD, String.valueOf(tryValue.get(tableParam.getParam9())));
row.put(HGConstants.PARAM10_FIELD, String.valueOf(tryValue.get(tableParam.getParam10())));
}
resultRows.add(row);
}
......
......@@ -53,6 +53,7 @@
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW007.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW008.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW009.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW010A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW014.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW015.xml"/>
......
......@@ -83,7 +83,7 @@ function updateFunc() {
}
JSColorbox.open({
href: "HGCW010B?methodName=initLoad&id=" + rows[0].id + "&efParentFormEname=HGCW010",
title: "<div style='text-align: center;'>修改合同</div>",
title: "<div style='text-align: center;'>修改销售开票单据</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
......
......@@ -59,17 +59,17 @@ function btnSaveFunc() {
return;
}
if (parseFloat(thisAmount) > parseFloat(remainingAmount)) {
message("第" + (i + 1) + "行本次开票金额不能大于剩余开票金额");
message("第" + (i + 1) + "行本次开票金额不能大于剩余结算金额");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成销售票据吗? ", {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成销售开票单吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCW010", "select",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
// parent.JSColorbox.setValueCallback();
parent.JSColorbox.setValueCallback();
}
}
);
......@@ -77,3 +77,4 @@ function btnSaveFunc() {
});
}
......@@ -26,7 +26,8 @@
<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="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="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"/>
......@@ -35,6 +36,7 @@
<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="thisAmount" cname="本次结算金额" width="120" align="center"/>
<EF:EFColumn ename="remainingAmount" cname="剩余开票金额" width="120" enable="false" readonly="true" align="center"/>
......
......@@ -10,14 +10,14 @@
<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>
......@@ -28,11 +28,10 @@
<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="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="partyA" 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"/>
......
......@@ -13,7 +13,7 @@ $(function () {
+ 'onclick="showDetail(' + item.id + ', ' + item.status + ')" >销售出库单详情</a>';
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateStatus(' + item.id + ',1)" >提交</a>';
'onclick="updateStatus(' + item.id + ',1)" >提交</a>';
} else if (auditStatus == -1) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateStatus(' + item.id + ',0)" >未提交</a>';
......
......@@ -69,20 +69,6 @@ $(function() {
template: function (options) {
return options.thick == 0 ? "-" : options.thick;
}
}, {
field: "price",
template: function (options) {
options.amount = options.quantity*options.price;
return options.price
}
}, {
field: "amount",
template: function (options) {
if (options.quantity != 0){
options.price = options.amount/options.quantity;
}
return options.amount;
}
}],
loadComplete: function(grid) {
// 此 grid 对象
......@@ -90,7 +76,8 @@ $(function() {
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field == "price") {
loadChange(grid,e,"amount");
let amount = e.items[0].quantity*e.items[0].price;
resultGrid.setCellValue(e.items[0],"amount",amount);
}else if (e.field == "amount") {
if (e.items[0].price==0){
loadChange(grid,e,"price");
......
......@@ -49,7 +49,7 @@
<EF:EFColumn ename="length" cname="长度(MM)" enable="true" readonly="true" width="100" align="right" format="{0:N2}" maxLength="10"/>
<EF:EFColumn ename="width" cname="宽度(MM)" enable="true" readonly="true" width="100" align="right" format="{0:N2}" maxLength="10"/>
<EF:EFColumn ename="thick" cname="厚度(MM)" enable="true" readonly="true" width="100" align="right" format="{0:N2}" maxLength="10"/>
<EF:EFColumn ename="quantity" cname="数量" enable="true" readonly="true" width="100" format="{0:N3}" editType="text"
<EF:EFColumn ename="quantity" cname="数量" enable="true" readonly="true" width="100" format="{0:N0}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
......@@ -65,7 +65,7 @@
displayType="0.000" sort="true" align="right" maxLength="17" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
<EF:EFColumn ename="amount" cname="金额" width="100" enable="true" format="{0:N3}" editType="text"
<EF:EFColumn ename="amount" cname="金额" width="100" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
......
let whNameGlobalData = [];
$(function () {
var companyCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
......@@ -25,6 +25,17 @@ $(function () {
return template;
}
},{
field: "companyCode",
template: function (dataItem) {
for (let i = 0; i < companyCodes.length; i++) {
if (companyCodes[i]['valueField'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodes[i]['textField']
return companyCodes[i]['textField'];
}
}
return dataItem["companyCode"];
}
},{
field: "otherEnterDate",
attributes: {
class: "i-input-readonly"
......
......@@ -38,15 +38,25 @@
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="otherEnterDate" cname="单据日期" enable="false" width="100" align="center" editType="date"
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="otherEnterDate" cname="单据日期" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="otherEnterNo" cname="其他入库单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true"/>
<EF:EFColumn ename="whName" cname="仓库名称" hidden="true"/>
<EF:EFComboColumn cname="状态" ename="submitStatus" width="90" align="center" required="true" defaultValue="0">
<EF:EFComboColumn cname="状态" ename="submitStatus" width="90" align="center" enable="false">
<EF:EFCodeOption codeName="hggp.hpkc.submitStatus"/>
</EF:EFComboColumn>
<EF:EFComboColumn cname="数据来源" ename="source" width="90" align="center" enable="false">
<EF:EFCodeOption codeName="hggp.hpkc.source"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
......
......@@ -17,7 +17,7 @@ $(function () {
template: function (dataItem) {
for (let i = 0; i < InventNameGlobalData.length; i++) {
if (InventNameGlobalData[i]['valueField'] === dataItem['inventCode']) {
dataItem['inventName'] = InventNameGlobalData[i]['textField'];
dataItem['inventName'] = InventNameGlobalData[i]['param1Field'];
return InventNameGlobalData[i]['textField'];
}
}
......@@ -25,35 +25,10 @@ $(function () {
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventType", options.model["inventType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HGPZ005");
inInfo.set("methodName", "queryComboBox");
inInfo.set("blockId", "invent_record_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
},{
field: "inventRecordId",
filter: function (options) {
return _.filter(inventAllGlobalData, function (item) {
return item["param7Field"]=="true";
})
},
template: function (dataItem) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return inventAllGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventCode", options.model["inventCode"]);
inInfo.set("serviceName", "HGPZ005");
inInfo.set("methodName", "queryInventBoxAll");
inInfo.set("blockId", "invent_all_box_block_id");
inInfo.set("methodName", "queryInventNameBox");
inInfo.set("blockId", "invent_name_box_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
......@@ -96,31 +71,23 @@ $(function () {
loadComplete: function (grid) {
// 此grid对象
grid.dataSource.bind("change", function(e) {
if (e.field === "inventCode"){
loadChange(grid,e,"inventRecordId");
}
else if (e.field == "inventRecordId") {
if (e.field == "inventCode") {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === item.inventRecordId) {
resultGrid.setCellValue(item, 'partLength', inventAllGlobalData[i]['param3Field'])
resultGrid.setCellValue(item, 'partWidth', inventAllGlobalData[i]['param4Field'])
resultGrid.setCellValue(item, 'partThick', inventAllGlobalData[i]['param5Field'])
if (inventAllGlobalData[i]['valueField'] === item.inventCode) {
resultGrid.setCellValue(item, 'partSpec', inventAllGlobalData[i]['param2Field'])
resultGrid.setCellValue(item, 'inventType', inventAllGlobalData[i]['param3Field'])
resultGrid.setCellValue(item, 'partLength', inventAllGlobalData[i]['param4Field'])
resultGrid.setCellValue(item, 'partWidth', inventAllGlobalData[i]['param5Field'])
resultGrid.setCellValue(item, 'partThick', inventAllGlobalData[i]['param6Field'])
resultGrid.setCellValue(item, 'coefficient', inventAllGlobalData[i]['param7Field'])
resultGrid.setCellValue(item, 'inventRecordId', inventAllGlobalData[i]['param8Field'])
calUnitWeight(item,inventAllGlobalData[i]['param4Field'],inventAllGlobalData[i]['param5Field'],inventAllGlobalData[i]['param6Field'],inventAllGlobalData[i]['param7Field']);
}
}
}
/* if (e.field == "invQty") {
loadChange(grid,e,"invWeight");
loadChange(grid,e,"amount");
}
if (e.field == "invUnitWeight") {
loadChange(grid,e,"invWeight");
}
if (e.field == "price") {
loadChange(grid,e,"amount");
}*/
});
},
onSave: function (e) {
......@@ -192,9 +159,9 @@ let initSpec = function () {
let inInfo = new EiInfo();
//inInfo.set("inqu_status-0-inventTypes", [1, 2]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HGPZ005", "queryInventBoxAll", inInfo, {
EiCommunicator.send("HGPZ005", "queryInventNameBox", inInfo, {
onSuccess: function (ei) {
inventAllGlobalData = ei.getBlock("invent_all_box_block_id").getMappedRows();
inventAllGlobalData = ei.getBlock("invent_name_box_block_id").getMappedRows();
},
onFail: function (ei) {
}
......@@ -223,6 +190,13 @@ let selectTaskCallback = function () {
JSColorbox.close();
}
let calUnitWeight = function (item,length,width,thick,coefficient) {
if(length && width && thick && coefficient){
let amount = length * width * thick * coefficient/1000000;
//item['amount'] = amount.toString();
resultGrid.setCellValue(item, 'invUnitWeight', amount);
}
}
/**
* 保存
......@@ -248,11 +222,6 @@ let save = function () {
flag = false;
return false;
}
if(isBlank(inventRecordId)){
message("选中的第"+(index+1)+"行\"规格\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
......
......@@ -32,15 +32,17 @@
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" hidden="true"/>
<EF:EFColumn ename="inventRecordId" cname="规格" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="partSpec" cname="规格" width="120" align="center" required="true" enable="false"/>
<EF:EFColumn ename="inventRecordId" cname="规格id" width="120" align="center" required="true" enable="false" hidden="true"/>
<EF:EFColumn ename="partLength" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="partWidth" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="partThick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="coefficient" cname="系数" width="80" align="right" format="{0:N2}" maxLength="10" enable="false" hidden="true"/>
<EF:EFColumn ename="invQty" cname="数量" width="120" align="right" format="{0:N0}"
defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
......
let whNameGlobalData = [];
$(function () {
var companyCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
......@@ -25,6 +25,17 @@ $(function () {
return template;
}
},{
field: "companyCode",
template: function (dataItem) {
for (let i = 0; i < companyCodes.length; i++) {
if (companyCodes[i]['valueField'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodes[i]['textField']
return companyCodes[i]['textField'];
}
}
return dataItem["companyCode"];
}
},{
field: "otherOutDate",
attributes: {
class: "i-input-readonly"
......
......@@ -39,16 +39,25 @@
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="otherOutDate" cname="单据日期" enable="false" width="100" align="center" editType="date"
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="otherOutDate" cname="单据日期" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="otherOutNo" cname="其他入库单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true" />
<EF:EFColumn ename="whName" cname="仓库名称" hidden="true"/>
<EF:EFComboColumn cname="状态" ename="submitStatus" width="90" align="center" required="true" defaultValue="0">
<EF:EFComboColumn cname="状态" ename="submitStatus" width="90" align="center" enable="false" >
<EF:EFCodeOption codeName="hggp.hpkc.submitStatus"/>
</EF:EFComboColumn>
<EF:EFComboColumn cname="数据来源" ename="source" width="90" align="center" enable="false">
<EF:EFCodeOption codeName="hggp.hpkc.source"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
......
......@@ -17,7 +17,7 @@ $(function () {
template: function (dataItem) {
for (let i = 0; i < InventNameGlobalData.length; i++) {
if (InventNameGlobalData[i]['valueField'] === dataItem['inventCode']) {
dataItem['inventName'] = InventNameGlobalData[i]['textField'];
dataItem['inventName'] = InventNameGlobalData[i]['param1Field'];
return InventNameGlobalData[i]['textField'];
}
}
......@@ -25,35 +25,10 @@ $(function () {
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventType", options.model["inventType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HGPZ005");
inInfo.set("methodName", "queryComboBox");
inInfo.set("blockId", "invent_record_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
},{
field: "inventRecordId",
filter: function (options) {
return _.filter(inventAllGlobalData, function (item) {
return item["param7Field"]=="true";
})
},
template: function (dataItem) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return inventAllGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventCode", options.model["inventCode"]);
inInfo.set("serviceName", "HGPZ005");
inInfo.set("methodName", "queryInventBoxAll");
inInfo.set("blockId", "invent_all_box_block_id");
inInfo.set("methodName", "queryInventNameBox");
inInfo.set("blockId", "invent_name_box_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
......@@ -96,31 +71,23 @@ $(function () {
loadComplete: function (grid) {
// 此grid对象
grid.dataSource.bind("change", function(e) {
if (e.field === "inventCode"){
loadChange(grid,e,"inventRecordId");
}
else if (e.field == "inventRecordId") {
if (e.field == "inventCode") {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === item.inventRecordId) {
resultGrid.setCellValue(item, 'partLength', inventAllGlobalData[i]['param3Field'])
resultGrid.setCellValue(item, 'partWidth', inventAllGlobalData[i]['param4Field'])
resultGrid.setCellValue(item, 'partThick', inventAllGlobalData[i]['param5Field'])
if (inventAllGlobalData[i]['valueField'] === item.inventCode) {
resultGrid.setCellValue(item, 'partSpec', inventAllGlobalData[i]['param2Field'])
resultGrid.setCellValue(item, 'inventType', inventAllGlobalData[i]['param3Field'])
resultGrid.setCellValue(item, 'partLength', inventAllGlobalData[i]['param4Field'])
resultGrid.setCellValue(item, 'partWidth', inventAllGlobalData[i]['param5Field'])
resultGrid.setCellValue(item, 'partThick', inventAllGlobalData[i]['param6Field'])
resultGrid.setCellValue(item, 'coefficient', inventAllGlobalData[i]['param7Field'])
resultGrid.setCellValue(item, 'inventRecordId', inventAllGlobalData[i]['param8Field'])
calUnitWeight(item,inventAllGlobalData[i]['param4Field'],inventAllGlobalData[i]['param5Field'],inventAllGlobalData[i]['param6Field'],inventAllGlobalData[i]['param7Field']);
}
}
}
/* if (e.field == "invQty") {
loadChange(grid,e,"invWeight");
loadChange(grid,e,"amount");
}
if (e.field == "invUnitWeight") {
loadChange(grid,e,"invWeight");
}
if (e.field == "price") {
loadChange(grid,e,"amount");
}*/
});
},
onSave: function (e) {
......@@ -192,9 +159,9 @@ let initSpec = function () {
let inInfo = new EiInfo();
//inInfo.set("inqu_status-0-inventTypes", [1, 2]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HGPZ005", "queryInventBoxAll", inInfo, {
EiCommunicator.send("HGPZ005", "queryInventNameBox", inInfo, {
onSuccess: function (ei) {
inventAllGlobalData = ei.getBlock("invent_all_box_block_id").getMappedRows();
inventAllGlobalData = ei.getBlock("invent_name_box_block_id").getMappedRows();
},
onFail: function (ei) {
}
......@@ -224,7 +191,13 @@ let selectTaskCallback = function () {
JSColorbox.close();
}
let calUnitWeight = function (item,length,width,thick,coefficient) {
if(length && width && thick && coefficient){
let amount = length * width * thick * coefficient/1000000;
//item['amount'] = amount.toString();
resultGrid.setCellValue(item, 'invUnitWeight', amount);
}
}
/**
* 保存
......@@ -250,11 +223,6 @@ let save = function () {
flag = false;
return false;
}
if(isBlank(inventRecordId)){
message("选中的第"+(index+1)+"行\"规格\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
......
......@@ -24,12 +24,13 @@
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" hidden="true"/>
<EF:EFColumn ename="inventRecordId" cname="规格" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="partSpec" cname="规格" width="120" align="center" enable="false"/>
<EF:EFColumn ename="inventRecordId" cname="规格id" width="120" align="center" required="true" enable="false" hidden="true"/>
<EF:EFColumn ename="partLength" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="partWidth" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="partThick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
......
......@@ -30,7 +30,7 @@ $(function (){
let template = '';
if (item.id){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id +')" >领料详情</a>';
+ 'onclick="showDetail(' + item.id +',\''+item.whCode+'\')" >领料详情</a>';
if (status == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="updateStatus(' + item.id + ',1)" >提交</a>';
......@@ -136,6 +136,9 @@ $(function (){
e.items[0].projName = "";
e.items[0].whCode = "";
e.items[0].whName = "";
loadChange(grid,e,"projName");
loadChange(grid,e,"whCode");
loadChange(grid,e,"whName");
loadChange(grid,e,"projCode");
}
if (e.field == "whCode") {
......@@ -221,9 +224,9 @@ function updateStatus(id,status) {
/**
* 显示详情
*/
function showDetail(id) {
function showDetail(id,whCode) {
JSColorbox.open({
href: "HGKC008A?methodName=initLoad&inqu_status-0-receiveId=" + id,
href: "HGKC008A?methodName=initLoad&inqu_status-0-receiveId=" + id+"&inqu_status-0-whCode="+whCode,
title: "<div style='text-align: center;'>领料详情</div>",
width: "80%",
height: "80%",
......
......@@ -35,7 +35,7 @@
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="true" width="120" align="center" required="true"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="true" width="130" align="center" required="true"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" align="center" enable="false" required="true"/>
<EF:EFColumn ename="applyCode" cname="生产领料单号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" width="120" align="center" editType="date"
......
......@@ -13,18 +13,21 @@
<EF:EFPage title="生产领料详情">
<EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput ename="inqu_status-0-receiveId" cname="领料单id" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-whCode" cname="仓库编码" colWidth="3" type="hidden"/>
<div class="row">
<EF:EFSelect cname="存货类型" ename="inqu_status-0-inventType" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_type_box_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput ename="inqu_status-0-inventCode" cname="存货编码" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-inventName" cname="存货名称" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="receiveId" cname="领料单id" hidden="true"/>
<EF:EFColumn ename="whCode" cname="仓库编码" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
......@@ -32,25 +35,25 @@
</EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="true" width="120" align="center" required="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" enable="false" required="true"/>
<EF:EFColumn ename="invSpec" cname="规格" width="120" align="center" enable="false" />
<EF:EFColumn ename="invSpecId" cname="规格id" hidden="true"/>
<EF:EFColumn ename="invSpec" cname="规格" width="120" align="center" required="true" />
<EF:EFColumn ename="invLength" cname="长度(MM)" width="120" align="center" enable="false"/>
<EF:EFColumn ename="invWidth" cname="宽度(MM)" width="120" align="center" enable="false"/>
<EF:EFColumn ename="invThick" cname="厚度(MM)" width="120" align="center" enable="false"/>
<EF:EFColumn ename="invQty" cname="数量" enable="false" width="120" align="right" format="{0:N0}"
hidden="true"/>
<EF:EFColumn ename="invUnitWeight" cname="单重" width="100" enable="true" readonly="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="false" defaultValue="0"
<EF:EFColumn ename="invQty" cname="数量" width="120" align="right" format="{0:N0}" enable="true" required="true" />
<EF:EFColumn ename="invUnitWeight" cname="单重" width="100" enable="false" readonly="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
<EF:EFColumn ename="invWeight" cname="重量" width="100" enable="true" readonly="true" format="{0:N3}" editType="text"
<EF:EFColumn ename="invWeight" cname="重量" width="100" enable="false" readonly="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
<EF:EFColumn ename="price" cname="单价" width="100" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="false" defaultValue="0"
displayType="0.000" sort="true" align="right" maxLength="17" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
<EF:EFColumn ename="amount" cname="金额" width="100" enable="true" format="{0:N3}" editType="text"
<EF:EFColumn ename="amount" cname="金额" width="100" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
......
$(function () {
$(".row").children().attr("class", "col-md-3");
var companyCode = __eiInfo.get("companyCode");
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var whCodeBox = __eiInfo.getBlock("wh_record_box_block_id").getMappedRows();
......@@ -26,34 +27,19 @@ $(function () {
return template;
}
}, {
field: "companyCode",
title: "公司名称",
template: function (item) {
let companyCode = item.companyCode;
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCode === companyCodeBox[i]['valueField']) {
item['companyName'] = companyCodeBox[i]['textField'];
return companyCodeBox[i]['textField'];
}
}
return companyCode;
}
}, {
field: "receiptDate",
defaultValue: currShortDate()
}, {
field: "calloutCompanyCode",
title: "调出公司名称",
/*filter: function (options) {
let allotType = options.model["allotType"];
let companyCode = options.model["companyCode"];
if (allotType === "1" && companyCode){
filter: function (options) {
if (companyCode){
return _.filter(options.values, function (item) {
return item["valueField"]===companyCode;
})
}
return options.values;
},*/
},
template: function (item) {
let calloutCompanyCode = item.calloutCompanyCode;
for (let i = 0; i < companyCodeBox.length; i++) {
......@@ -217,18 +203,18 @@ let save = function () {
}
let flag = true;
$.each(rows, function(index, item) {
let companyCode= item.get("companyCode");
//let companyCode= item.get("companyCode");
let allotType= item.get("allotType");
let receiptDate= item.get("receiptDate");
let calloutCompanyCode= item.get("calloutCompanyCode");
let calloutWhCode= item.get("calloutWhCode");
let callinCompanyCode= item.get("callinCompanyCode");
let callinWhCode= item.get("callinWhCode");
if(isBlank(companyCode)){
/*if(isBlank(companyCode)){
message("选中的第"+(index+1)+"行\"公司名称\",不能为空!");
flag = false;
return false;
}
}*/
if(isBlank(allotType)){
message("选中的第"+(index+1)+"行\"调拨类型\",不能为空!");
flag = false;
......
......@@ -17,16 +17,8 @@
<div class="row">
<EF:EFDatePicker blockId="inqu_status" row="0" ename="receiptDate" cname="单据日期" colWidth="3" format="yyyy-MM-dd"/>
<EF:EFInput blockId="inqu_status" row="0" ename="allotNo" cname="调拨单号" colWidth="3" placeholder="模糊查询"/>
<EF:EFInput blockId="inqu_status" row="0" ename="calloutWhName" cname="调入仓库名称" colWidth="3" placeholder="模糊查询"/>
<EF:EFInput blockId="inqu_status" row="0" ename="callinWhName" cname="调出仓库名称" colWidth="3" placeholder="模糊查询"/>
<%--<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgkc.status"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>--%>
<EF:EFInput blockId="inqu_status" row="0" ename="calloutWhName" cname="调出仓库名称" colWidth="3" placeholder="模糊查询"/>
<EF:EFInput blockId="inqu_status" row="0" ename="callinWhName" cname="调入仓库名称" colWidth="3" placeholder="模糊查询"/>
</div>
</EF:EFRegion>
......@@ -34,10 +26,10 @@
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="150" align="center"/>
<EF:EFComboColumn ename="companyCode" enable="true" cname="公司名称" width="110" align="center"
<%--<EF:EFComboColumn ename="companyCode" enable="true" cname="公司名称" width="110" align="center"
filter="contains" readonly="true" required="true">
<EF:EFOptions blockId="companyBox_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
</EF:EFComboColumn>--%>
<EF:EFComboColumn ename="allotType" cname="调拨类型" width="80" align="center" enable="true" required="true">
<EF:EFCodeOption codeName="hggp.hgkc.allotType"/>
</EF:EFComboColumn>
......@@ -53,7 +45,7 @@
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFComboColumn ename="callinCompanyCode" enable="true" cname="调入公司名称" width="110" align="center"
filter="contains" readonly="true" required="true">
filter="contains" readonly="false" required="true">
<EF:EFOptions blockId="companyBox_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="callinWhCode" cname="调入仓库名称" enable="true" width="120" align="center" required="true"
......
......@@ -11,7 +11,7 @@ $(function() {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSize: 10,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [{
......@@ -104,37 +104,25 @@ $(function() {
e.items[0]["width"] = specIdBox[i]['param2Field'];
e.items[0]["thick"] = specIdBox[i]['param3Field'];
e.items[0]["quantity"] = specIdBox[i]['param4Field'];
e.items[0]["unitWeight"] = specIdBox[i]['param5Field'];
e.items[0]["weight"] = specIdBox[i]['param6Field'];
resultGrid.setCellValue(e.items[0],"unitWeight",specIdBox[i]['param5Field']);
resultGrid.setCellValue(e.items[0],"weight",specIdBox[i]['param6Field']);
//e.items[0]["unitWeight"] = specIdBox[i]['param5Field'];
//e.items[0]["weight"] = specIdBox[i]['param6Field'];
}
}
loadChange(grid,e,"length");
loadChange(grid,e,"width");
loadChange(grid,e,"thick");
loadChange(grid,e,"unitWeight");
loadChange(grid,e,"weight");
//loadChange(grid,e,"unitWeight");
//loadChange(grid,e,"weight");
loadChange(grid,e,"quantity");
}else if (e.field === "quantity"){
if (e.items[0].quantity != 0 && e.items[0].unitWeight > 0){
e.items[0].weight = e.items[0].unitWeight*e.items[0].quantity;
loadChange(grid,e,"weight");
}else if (e.items[0].unitWeight == 0){
loadChange(grid,e,"unitWeight");
}
}else if (e.field === "unitWeight"){
if (e.items[0].unitWeight != 0){
e.items[0].weight = e.items[0].quantity*e.items[0].unitWeight;
loadChange(grid,e,"weight");
}
}else if (e.field === "weight"){
if (e.items[0].quantity != 0){
e.items[0].unitWeight = e.items[0].weight/e.items[0].quantity;
loadChange(grid,e,"unitWeight");
resultGrid.setCellValue(e.items[0],"weight",e.items[0].unitWeight*e.items[0].quantity);
}
}else if (e.field === "inventCode"){
loadChange(grid,e,"spec");
}else if (e.field === "inventRecordId"){
loadChange(grid,e,"spec");
}
});
},
......@@ -211,7 +199,7 @@ let save = function () {
flag = false;
return false;
}
if(isBlank(unitWeight) || parseFloat(unitWeight) <= 0){
/*if(isBlank(unitWeight) || parseFloat(unitWeight) <= 0){
message("选中的第" + (index + 1) + "行\"单重\",必须是数值并且数量必须大于0!");
flag = false;
return false;
......@@ -220,7 +208,7 @@ let save = function () {
message("选中的第" + (index + 1) + "行\"重量\",必须是数值!");
flag = false;
return false;
}
}*/
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
......
......@@ -54,11 +54,11 @@
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,20}([.][0-9]{1,3})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="unitWeight" cname="单重" width="120" enable="true" format="{0:N3}" editType="text"
<EF:EFColumn ename="unitWeight" cname="单重" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="weight" cname="重量" width="120" enable="true" format="{0:N3}" editType="text"
<EF:EFColumn ename="weight" cname="重量" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
......
......@@ -148,7 +148,7 @@ function showUploadFile(id) {
JSColorbox.open({
href: "HGSC099?methodName=initLoad&inqu_status-0-bizType=XMRY&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件详情</div>",
width: "80%",
width: "85%",
height: "80%",
});
}
......
......@@ -21,7 +21,7 @@
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="single">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="createdBy" cname="创建人" hidden="true"/>
<EF:EFColumn ename="updatedBy" cname="修改人" hidden="true"/>
......
......@@ -238,7 +238,7 @@ function showUploadFile(id) {
JSColorbox.open({
href: "HGSC099?methodName=initLoad&inqu_status-0-bizType=LTQD&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件详情</div>",
width: "80%",
width: "85%",
height: "80%",
});
}
......
......@@ -53,7 +53,7 @@ function showUploadFile(id) {
JSColorbox.open({
href: "HGSC004D?methodName=initLoad&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件详情</div>",
width: "80%",
width: "85%",
height: "80%",
});
}
......
......@@ -28,28 +28,35 @@ $(function () {
function schedule() {
var planCode = $("#inqu_status-0-planCode").val();
var inInfo=new EiInfo();
inInfo.set("inqu_status-0-planCode",planCode);
IPLAT.confirm({
title:'提交',
message:'自动排产将覆盖原排产数据,且只能执行一次,请谨慎操作,确认对当前数据进行排产?',
okFn:function () {
var inInfo=new EiInfo();
inInfo.set("inqu_status-0-planCode",planCode);
EiCommunicator.send("HGSC005A","schedule",inInfo,{
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
NotificationUtil(ei);
resultGrid.dataSource.query();
} else {
NotificationUtil(ei, "error");
var isSchedule = $("#inqu_status-0-isSchedule").val();
if(isSchedule&&isSchedule==='1'){
message("当前计划已排产,请手动调整计划!");
return;
}else {
var inInfo = new EiInfo();
inInfo.set("inqu_status-0-planCode", planCode);
IPLAT.confirm({
title: '提交',
message: '自动排产将覆盖原排产数据,且只能执行一次,请谨慎操作,确认对当前数据进行排产?',
okFn: function () {
var inInfo = new EiInfo();
inInfo.set("inqu_status-0-planCode", planCode);
EiCommunicator.send("HGSC005A", "schedule", inInfo, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
$("#inqu_status-0-isSchedule").val('1');
NotificationUtil(ei);
resultGrid.dataSource.query();
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
})
});
}
});
}
}
......@@ -14,6 +14,7 @@
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput ename="inqu_status-0-planCode" cname="计划编码" type="hidden"/>
<EF:EFInput ename="inqu_status-0-isSchedule" cname="是否排产" type="hidden"/>
<EF:EFInput ename="inqu_status-0-productName" cname="产品名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect cname="工序" ename="inqu_status-0-processName" colWidth="3" filter="contains">
<EF:EFOptions blockId="plan_process_block_id" valueField="valueField" textField="textField"/>
......
......@@ -51,7 +51,7 @@ function showUploadFile(id) {
JSColorbox.open({
href: "HGSC004D?methodName=initLoad&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件详情</div>",
width: "80%",
width: "85%",
height: "80%",
});
}
......
......@@ -45,7 +45,7 @@ function showUploadFile(id) {
JSColorbox.open({
href: "HGSC004D?methodName=initLoad&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
width: "85%",
height: "80%",
});
}
......
$(function () {
var companyCodeBox = __eiInfo.getBlock("company_record_box_block_id").getMappedRows();
var groupCodeBox = __eiInfo.getBlock("proj_record_block_id").getMappedRows();
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1);
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [
{
field: "operator",
template: function (item) {
let auditStatus = item.status;
let template = '';
if (item.companyCode && item.projCode) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(\'' + item.companyCode + '\',\'' + item.companyName + '\',\'' + item.projCode + '\',\'' + item.projName + '\'' +
',\'' + item.planMaterialCode + '\',\'' + item.planMaterialName + '\')" >计划详情</a>';
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateStatus(' + item.id + ',1)" >提交</a>';
} else if (auditStatus == 1) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateStatus(' + item.id + ',1)" >已提交</a>';
}
}
return template;
}
}, {
field: "companyCode",
title: "公司名称",
template: function (dataItem) {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['valueField'] === dataItem['companyCode']) {
dataItem['companyName'] = companyCodeBox[i]['textField']
return companyCodeBox[i]['textField'];
}
}
return dataItem["companyCode"];
}
}, {
field: "projCode",
title: "项目编码",
template: function (dataItem) {
for (let i = 0; i < groupCodeBox.length; i++) {
if (groupCodeBox[i]['valueField'] === dataItem['projCode']) {
dataItem['projName'] = groupCodeBox[i]['textField']
return groupCodeBox[i]['valueField'];
}
}
return dataItem["projCode"];
}
},
{
field: "projName",
title: "项目名称",
template: function (dataItem) {
for (let i = 0; i < groupCodeBox.length; i++) {
if (groupCodeBox[i]['textField'] === dataItem['projName']) {
dataItem['projCode'] = groupCodeBox[i]['valueField']
return groupCodeBox[i]['textField'];
}
}
return dataItem["projName"];
}
}, {
field: "createdTime",
attributes: {
class: "i-input-readonly"
},
defaultValue: function () {
return currShortDate();
}
},
],
loadComplete: function (grid) {
$("#INSERTCG").on("click", INSERTCG);
grid.dataSource.bind("change", function (e) {
// 判断父级节点是否发生变化
if (e.field == "projCode") {
loadChange(grid, e, "projName");
loadChange(grid, e, "planMaterialName");
} else if (e.field == "projName") {
loadChange(grid, e, "projCode");
loadChange(grid, e, "planMaterialName");
}
});
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
}
}
let query = function () {
resultGrid.dataSource.page(1);
}
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function (index, item) {
let companyName = item.get("companyName");
let createdTime = item.get("createdTime");
if (isBlank(companyName)) {
message("选中的第" + (index + 1) + "行\"公司\",不能为空!");
flag = false;
return false;
}
if (isBlank(createdTime)) {
message("选中的第" + (index + 1) + "行\"创建时间\",不能为空!");
flag = false;
return false;
}
});
if (flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC009", "save", true);
btnNode.attr("disabled", false);
}
});
}
};
});
/**
* 显示附件详情
*
* @param id
*/
function showUploadFile(companyCode,companyName,projCode,projName,planMaterialCode,planMaterialName) {
JSColorbox.open({
href: "HGSC009A?methodName=initLoad&" +
"inqu_status-0-companyCode=" + companyCode +
"&inqu_status-0-companyName=" + companyName +
"&inqu_status-0-planMaterialCode=" + planMaterialCode +
"&inqu_status-0-planMaterialName="+ planMaterialName +
"&inqu_status-0-projCode=" + projCode +
"&inqu_status-0-projName=" + projName ,
title: "<div style='text-align: center;'>材料计划清单</div>",
width: "80%",
height: "80%",
});
}
function updateStatus(id,status) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-status", status);
EiCommunicator.send('HGSC009', 'updateStatus', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
query();
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
}
);
}
function INSERTCG() {
let inEiInfo = new EiInfo();
//重置全局变量
ids = [];
let rows = resultGrid.getCheckedRows()
if (rows.length < 1) {
message("请至少选择一条需要分派的数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
if (item.get("status")==0){
message("未提交,无法选中!");
return false;
}
ids.push(item.planMaterialCode)
});
inEiInfo.set("planMaterialCodes",ids.join(','));
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
EiCommunicator.send('HGSC009A', 'insertcg', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
query();
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
}
);
}
});
inEiInfo.set("planMaterialCodes", ids.join(','));
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/5/6
Time: 16:24
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="材料计划">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput blockId="inqu_status" row="0" ename="companyName" cname="公司名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="projName" cname="项目名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="提交状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="150" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="projCode" cname="项目编码"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="proj_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="projName" cname="项目名称" width="100" enable="true" readonly="true" align="center">
</EF:EFComboColumn>
<EF:EFColumn ename="createdTime" cname="材料计划日期" width="120" enable="true" readonly="false" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="planMaterialCode" cname="材料计划编码" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="planMaterialName" cname="材料计划名称" width="120" enable="true" readonly="false" align="center"/>
<EF:EFComboColumn ename="status" cname="提交状态" width="80" enable="true" readonly="false" align="center" required="true" defaultValue="1">
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
let InventNameGlobalData = [];
let inventAllGlobalData = [];
$(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200],
},
columns: [{
field: "inventCode",
filter: function (options) {
return _.filter(InventNameGlobalData, function (item) {
return item["param1Field"] == "true";
})
},
template: function (dataItem) {
for (let i = 0; i < InventNameGlobalData.length; i++) {
if (InventNameGlobalData[i]['valueField'] === dataItem['inventCode']) {
dataItem['inventName'] = InventNameGlobalData[i]['textField'];
return InventNameGlobalData[i]['textField'];
}
}
return dataItem['inventCode'];
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-isSplicingSymbol", true);
inInfo.set("serviceName", "HGPZ005");
inInfo.set("methodName", "queryComboBox");
inInfo.set("blockId", "invent_record_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
}, {
field: "spec",
filter: function (options) {
return _.filter(inventAllGlobalData, function (item) {
return item["param7Field"] == "true";
})
},
template: function (dataItem) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === dataItem['spec']) {
return inventAllGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventCode", options.model["inventCode"]);
inInfo.set("serviceName", "HGPZ005");
inInfo.set("methodName", "queryInventBoxAll");
inInfo.set("blockId", "invent_all_box_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
}],
loadComplete: function (grid) {
// 此grid对象
grid.dataSource.bind("change", function (e) {
//数量发生变化进行计算
if(e.field === "quantity"){
if(e.items[0].singleWeight != null){
let grossAmount = e.items[0].quantity * e.items[0].singleWeight;
resultGrid.setCellValue(e.items[0], 'grossAmount', grossAmount);
}
}
if(e.field === "singleWeight"){
if(e.items[0].quantity != null){
let grossAmount = e.items[0].quantity * e.items[0].singleWeight;
resultGrid.setCellValue(e.items[0], 'grossAmount', grossAmount);
}
}
if (e.field === "inventCode") {
for (let i = 0; i < InventNameGlobalData.length; i++) {
if (InventNameGlobalData[i]['valueField'] === e.items[0].inventCode) {
resultGrid.setCellValue(e.items[0], 'inventName', InventNameGlobalData[i]['textField'])
}
}
loadChange(grid, e, "spec");
} else if (e.field == "spec") {
var tr, index;
// 获取此model元素信息
var item = e.items[0];
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === item.spec) {
resultGrid.setCellValue(item, 'material', inventAllGlobalData[i]['param1Field'])
resultGrid.setCellValue(item, 'length', inventAllGlobalData[i]['param3Field'])
resultGrid.setCellValue(item, 'width', inventAllGlobalData[i]['param4Field'])
resultGrid.setCellValue(item, 'thick', inventAllGlobalData[i]['param5Field'])
}
}
}
})
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
}
}
});
/**
* 页面加载时执行
*/
$(window).load(function () {
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
initInvent();
initSpec();
}
/**
* 初始化存货
*/
let initInvent = function () {
let inInfo = new EiInfo();
EiCommunicator.send("HGPZ005", "queryInventCodeBox", inInfo, {
onSuccess: function (ei) {
InventNameGlobalData = ei.getBlock("invent_record_box_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
/**
* 初始化规格
*/
let initSpec = function () {
let inInfo = new EiInfo();
//inInfo.set("inqu_status-0-inventTypes", [1, 2]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HGPZ005", "queryInventBoxAll", inInfo, {
onSuccess: function (ei) {
inventAllGlobalData = ei.getBlock("invent_all_box_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let inventCode= item.get("inventCode");
let spec= item.get("spec");
if(isBlank(inventCode)){
message("选中的第"+(index+1)+"行\"存货编号\",不能为空!");
flag = false;
return false;
}
if(isBlank(spec)){
message("选中的第"+(index+1)+"行\"规格\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC009A", "save", true);
}
});
}
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC009A", "delete", true);
}
});
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="材料计划详情">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<%-- <EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3" filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_record_box_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>--%>
<EF:EFInput cname="公司编码" ename="companyCode" blockId="inqu_status" row="0" readonly="true" type="hidden" colWidth="3" />
<EF:EFInput cname="公司名称" ename="companyName" blockId="inqu_status" row="0" readonly="true" type="hidden" colWidth="3" />
<EF:EFInput cname="计划编号" ename="planMaterialCode" blockId="inqu_status" row="0" readonly="true" colWidth="3" />
<EF:EFInput cname="计划名称" ename="planMaterialName" blockId="inqu_status" row="0" readonly="true" colWidth="3"/>
<EF:EFInput cname="项目编码" ename="projCode" blockId="inqu_status" row="0" readonly="true" type="hidden" colWidth="3" />
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" readonly="true" type="hidden" colWidth="3" />
</div>
<%-- <div class="row">
<EF:EFDateSpan startCname="创建日期(从)" endCname="至" blockId="inqu_status"
startName="createdDateFrom" endName="createdDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
</div>--%>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<%--<EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>--%>
<EF:EFComboColumn ename="inventCode" cname="存货编码" width="120" align="center" required="true"
blockName="invent_record_block_id" textField="valueField" valueField="valueField"
columnTemplate="#=valueField#" itemTemplate="#=valueField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" enable="false" readonly="true" required="true"/>
<EF:EFColumn ename="material" cname="材质" width="120" align="center" enable="false" readonly="true" required="true"/>
<EF:EFColumn ename="spec" cname="规格" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="length" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="quantity" cname="数量" width="120" align="right" format="{0:N0}"
defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
<EF:EFColumn ename="singleWeight" cname="单重" width="120" align="right" format="{0:N3}"
defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
<EF:EFColumn ename="grossAmount" cname="总重" width="120" align="right" enable="false" format="{0:N3}"/>
<EF:EFColumn ename="prdtCode" cname="部件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="partCode" cname="零件编码" enable="false" width="120" align="center" hidden="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
var loginUser = __eiInfo.getBlock("userBlockId").getMappedRows();
IPLATUI.EFGrid = {
"result": {
pageable: {
input: true,
numeric: false,
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [{
field: "unpassQuantity",
template: function (item) {
let template = "";
if (item.unpassQuantity&&isNumber(item.unpassQuantity)) {
item['passQuantity'] = item['quantity'] - item.unpassQuantity;
}
return item.unpassQuantity;
}
},{
field: "passQuantity",
template: function (item) {
let template = "";
if (item.passQuantity&&isNumber(item.passQuantity)) {
item['unpassQuantity'] = item['quantity'] - item.passQuantity;
}
return item.passQuantity;
}
}],
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
},
loadComplete: function(grid) {
// 此 grid 对象
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field == "unpassQuantity") {
loadChange(grid,e,"passQuantity");
}
// 判断父级节点是否发生变化
if (e.field == "passQuantity") {
loadChange(grid,e,"unpassQuantity");
}
});
},
onCheckRow: function (e){
if(e.checked){
if(e.model.checkStatus === '0') {
var now = new Date()
resultGrid.setCellValue(e.row, "checkDate", now.getFullYear() + "-" + now.getMonth() + "-" + now.getDay());
}
resultGrid.setCellValue(e.row, "checkBy", loginUser[0].userId);
resultGrid.setCellValue(e.row, "checkName", loginUser[0].userName);
}
// else{
// if(e.model.checkStatus === '0'){
// resultGrid.setCellValue(e.row,"checkDate","");
// }
//
// }
},
onSave: function(e){
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
}
}
}
// 查询
$("#QUERY").on("click", query);
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 提交操作
*
* @param id
* @param checkNo
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let passQuantity = rows[i]['passQuantity'];
let unpassQuantity = rows[i]['unpassQuantity'];
let quantity = rows[i]['quantity'];
if (!isNumber(passQuantity)||!isNumber(unpassQuantity)) {
message("第" + (i + 1) + "行合格数量与不合格数量必须是大于等于0的数字!");
return;
}
if (passQuantity > quantity) {
message("第" + (i + 1) + "行合格数量不能大于报工数量!");
return;
}
if (unpassQuantity > quantity) {
message("第" + (i + 1) + "行不合格数量不能大于报工数量!");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做质检完成操作吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGZL002", "save", true);
}
});
}
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