Commit 21d71108 by liuyang

2024-10-09 物料清单生成模板

parent 25e4cd81
......@@ -2,8 +2,6 @@ package com.baosight.hggp.common;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import java.util.HashMap;
import java.util.Map;
......@@ -31,6 +29,31 @@ public enum DdynamicEnum {
PROJ_TYPE_BLOCK_ID("proj_type_block_id", "natCode", "natName", "HGPZ008.queryComboBox"),
/**
* 模块:供应商档案
* 用途:供应商档案下拉框
* 编写:wwl
*/
SUPPLIER_RECORD_BLOCK_ID("supplier_record_block_id","custCode","custName","HGPZ002.queryComboBox"),
/**
* 模块:存货名称
* 用途:存货名称下拉框
* 编写:wwl
*/
INVENT_NAME_BLOCK_ID("invent_name_block_id","inventType","inventTypeName","HGPZ004.queryComboBox"),
/**
* 模块:物料清单
* 用途:物料清单部件类型 耗材 零件 部件
* 编写:ly
*/
CODESET_CODE_BLOCK_ID("codeset_code_block_id","itemCode","itemCname","HGSC002.querySmallCode"),
/**
* 模块:客户类型
* 用途:客户类型下拉框
* 编写:
......@@ -294,7 +317,6 @@ public enum DdynamicEnum {
*/
GROUP_CODE_BOX_BLOCK_ID("groupCodeBox_block_id","orgEname","orgCname","factoryCode","factoryName","companyCode","companyName","HGSB001.queryGroupCodeBox",
new HashMap<String,Object>(){{
put(HGSB001.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode());
//put(HGSB001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
put("orgTypes",new String[]{OrgTypeEnum.COMPANY.getCode(),OrgTypeEnum.FACTORY.getCode()});
}}
......
......@@ -23,7 +23,7 @@ public class HGPZ015 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id"; /* ID*/
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业编码 预留*/
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码 预留*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码 预留*/
public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/
public static final String FIELD_TEMPLATE_CODE = "templateCode"; /* 产品代码*/
......@@ -38,7 +38,7 @@ public class HGPZ015 extends DaoEPBase {
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 修改时间*/
public static final String COL_ID = "ID"; /* ID*/
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码 预留*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码 预留*/
public static final String COL_PROJ_CODE = "PROJ_CODE"; /* 项目编码*/
public static final String COL_TEMPLATE_CODE = "TEMPLATE_CODE"; /* 产品代码*/
......@@ -59,13 +59,13 @@ public class HGPZ015 extends DaoEPBase {
public static final String DELETE = "HGPZ015.delete";
private Long id = new Long(0); /* ID*/
private String companyCode = " "; /* 企业编码 预留*/
private String accountCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码 预留*/
private String projCode = " "; /* 项目编码*/
private String templateCode = " "; /* 产品代码*/
private String templateName = " "; /* 产品名称*/
private String remark = " "; /* 备注*/
private Boolean deleteFlag; /* 是否删除0:否1.是*/
private Integer deleteFlag = 0; /* 是否删除0:否1.是*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
......@@ -84,8 +84,8 @@ public class HGPZ015 extends DaoEPBase {
eiColumn.setDescName("ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("企业编码 预留");
eiColumn = new EiColumn(FIELD_ACCOUNT_CODE);
eiColumn.setDescName("账套");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
......@@ -166,18 +166,14 @@ public class HGPZ015 extends DaoEPBase {
* get the companyCode - 企业编码 预留.
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
public String getAccountCode() {
return accountCode;
}
/**
* set the companyCode - 企业编码 预留.
*
* @param companyCode - 企业编码 预留
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
public void setAccountCode(String accountCode) {
this.accountCode = accountCode;
}
/**
* get the depCode - 部门编码 预留.
* @return the depCode
......@@ -262,7 +258,7 @@ public class HGPZ015 extends DaoEPBase {
* get the deleteFlag - 是否删除0:否1.是.
* @return the deleteFlag
*/
public Boolean getDeleteFlag() {
public Integer getDeleteFlag() {
return this.deleteFlag;
}
......@@ -271,7 +267,7 @@ public class HGPZ015 extends DaoEPBase {
*
* @param deleteFlag - 是否删除0:否1.是
*/
public void setDeleteFlag(Boolean deleteFlag) {
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
......@@ -379,13 +375,13 @@ public class HGPZ015 extends DaoEPBase {
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setTemplateCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_TEMPLATE_CODE)), templateCode));
setTemplateName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_TEMPLATE_NAME)), templateName));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
setDeleteFlag(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
......@@ -402,7 +398,7 @@ public class HGPZ015 extends DaoEPBase {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE)));
map.put(FIELD_TEMPLATE_CODE, StringUtils.toString(templateCode, eiMetadata.getMeta(FIELD_TEMPLATE_CODE)));
......
......@@ -24,7 +24,7 @@ public class HGPZ015A extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业编码 预留*/
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码 预留*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码 预留*/
public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
......@@ -64,7 +64,7 @@ public class HGPZ015A extends DaoEPBase {
public static final String FIELD_LV = "lv"; /* 树的层级*/
public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码 预留*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码 预留*/
public static final String COL_PROJ_CODE = "PROJ_CODE"; /* 项目编码*/
public static final String COL_PROJ_NAME = "PROJ_NAME"; /* 项目名称*/
......@@ -110,7 +110,7 @@ public class HGPZ015A extends DaoEPBase {
public static final String DELETE = "HPSC002.delete";
private Long id;
private String companyCode = " "; /* 企业编码 预留*/
private String accountCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码 预留*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
......@@ -160,8 +160,8 @@ public class HGPZ015A extends DaoEPBase {
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("企业编码 预留");
eiColumn = new EiColumn(FIELD_ACCOUNT_CODE);
eiColumn.setDescName("账套");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
......@@ -354,18 +354,14 @@ public class HGPZ015A extends DaoEPBase {
* get the companyCode - 企业编码 预留.
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
public String getAccountCode() {
return accountCode;
}
/**
* set the companyCode - 企业编码 预留.
*
* @param companyCode - 企业编码 预留
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
public void setAccountCode(String accountCode) {
this.accountCode = accountCode;
}
/**
* get the depCode - 部门编码 预留.
* @return the depCode
......@@ -954,7 +950,7 @@ public class HGPZ015A extends DaoEPBase {
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
......@@ -1001,7 +997,7 @@ public class HGPZ015A extends DaoEPBase {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE)));
map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
......
package com.baosight.hggp.hg.pz.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ015;
import com.baosight.hggp.hg.pz.domain.HGPZ015A;
......@@ -31,6 +33,7 @@ public class ServiceHGPZ015 extends ServiceBase {
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "产品模板",operType = "查询",operDesc = "初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
HGPZ015 hppz015 = new HGPZ015();
EiInfo outInfo = super.initLoad(inInfo, hppz015);
......@@ -58,7 +61,7 @@ public class ServiceHGPZ015 extends ServiceBase {
public EiInfo count(EiInfo inInfo) {
HashMap map = new HashMap();
map.put("id",inInfo.getString("id"));
List<HGPZ015> query = this.dao.query("HPPZ015.query", map);
List<HGPZ015> query = DaoBase.getInstance().query("HPPZ015.query", map);
if (query.size() > 0) {
inInfo.setStatus(1);
inInfo.set("tempName",query.get(0).getTemplateName());
......@@ -77,7 +80,7 @@ public class ServiceHGPZ015 extends ServiceBase {
public EiInfo insert(EiInfo inInfo) {
HashMap map = new HashMap();
map.put("id",inInfo.getString("id"));
List<HGPZ015> query = this.dao.query("HGPZ015.query", map);
List<HGPZ015> query = DaoBase.getInstance().query("HGPZ015.query", map);
HGSC001 hpsc001 = HGSCTools.Hgsc001.getByCode(inInfo.getString("id"));
if (query.size() > 0) {
dao.delete("HGPZ015.delete",map);
......@@ -89,18 +92,16 @@ public class ServiceHGPZ015 extends ServiceBase {
// hgpz015.setId(Long.parseLong(inInfo.getString("id")));
hgpz015.setProjCode(hpsc001.getProjCode());
hgpz015.setTemplateName(inInfo.getString("templateName"));
hgpz015.setCreatedBy(UserSession.getUserId());
hgpz015.setCompanyCode(UserSessionUtils.getAccountCode());
hgpz015.setCreatedName(UserSession.getUserId()+"-"+UserSession.getLoginCName());
hgpz015.setCreatedTime(sdf.format(new Date()));
hgpz015.setUpdatedBy(null);
hgpz015.setUpdatedTime(null);
this.dao.insert("HGPZ015.insert", hgpz015.toMap());
DaoUtils.insert("HGPZ015.insert", hgpz015.toMap());
//模板物料清单
map.put("companyCode", UserSessionUtils.getAccountCode());
map.put("templateName", inInfo.getString("templateName"));
map.put("projCode", hpsc001.getProjCode());
this.dao.insert("HGPZ015A.insertMb", map);
List<HGPZ015A> hppz015AList = DaoBase.getInstance().query("HGPZ015A.queryMb", map);
if (hppz015AList.size() > 0){
hppz015AList.forEach(hgpz015A -> DaoUtils.insert("HGPZ015A.insert", hgpz015A.toMap()));
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("生成产品模板成功!");
} catch (PlatException e) {
......@@ -123,7 +124,7 @@ public class ServiceHGPZ015 extends ServiceBase {
map.put("projCode",inInfo.getString("projCode"));
try {
//模板清单
List<HGPZ015A> hppz015AList = this.dao.query("HGPZ015A.queryById",map);
List<HGPZ015A> hppz015AList = DaoBase.getInstance().query("HGPZ015A.queryById",map);
if (hppz015AList.size()==0) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("生成物料清单失败!该模板物料清单不存在!");
......@@ -134,7 +135,7 @@ public class ServiceHGPZ015 extends ServiceBase {
HashMap hashMap = new HashMap();
hashMap.put("leaf",0 );
hashMap.put("projCode",hpsc001New.getProjCode());
this.dao.update("HGSC004A.updateTreeNodeLeaf2",hashMap);
DaoUtils.update("HGSC004A.updateTreeNodeLeaf2",hashMap);
HGPZTools.HgPz015A.chekParentId(hppz015AList,hpsc001New);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("生成物料清单成功!");
......@@ -154,6 +155,7 @@ public class ServiceHGPZ015 extends ServiceBase {
* 修改操作.
*/
@OperationLogAnnotation(operModul = "产品模板",operType = "修改",operDesc = "修改")
@Override
public EiInfo update(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
......@@ -164,7 +166,7 @@ public class ServiceHGPZ015 extends ServiceBase {
hgpz015.fromMap(map);
hgpz015.setUpdatedBy(UserSession.getUserId());
hgpz015.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HGPZ015.update", hgpz015.toMap());
DaoUtils.update("HGPZ015.update", hgpz015.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
......@@ -182,6 +184,7 @@ public class ServiceHGPZ015 extends ServiceBase {
* 删除操作.
*/
@OperationLogAnnotation(operModul = "产品模板",operType = "删除",operDesc = "删除")
@Override
public EiInfo delete(EiInfo eiInfo) {
HGPZ015 HPPZ015 = new HGPZ015();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
......@@ -190,7 +193,7 @@ public class ServiceHGPZ015 extends ServiceBase {
Map<?, ?> map = eiBlock.getRow(i);
HPPZ015.fromMap(map);
this.dao.delete("HPPZ015.delete", HPPZ015.toMap());
DaoUtils.update("HPPZ015.delete", HPPZ015.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
......
......@@ -22,8 +22,8 @@
<sqlMap namespace="HGPZ015">
<sql id="authCondition">
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
......@@ -38,8 +38,8 @@
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
......@@ -83,7 +83,7 @@
resultClass="com.baosight.hggp.hg.pz.domain.HGPZ015">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
ACCOUNT_CODE as "accountCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
TEMPLATE_CODE as "templateCode", <!-- 产品代码 -->
......@@ -103,7 +103,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
ID desc
</isEmpty>
</dynamic>
......@@ -161,7 +161,7 @@
<insert id="insert">
INSERT INTO ${hggpSchema}.HGPZ015 (ID, <!-- ID -->
COMPANY_CODE, <!-- 企业编码 预留 -->
ACCOUNT_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 预留 -->
PROJ_CODE, <!-- 项目编码 -->
TEMPLATE_CODE, <!-- 产品代码 -->
......@@ -175,7 +175,7 @@
UPDATED_TIME, <!-- 修改人名称 -->
UPDATED_NAME <!-- 修改时间 -->
)
VALUES (#id#, #companyCode#, #depCode#, #projCode#, #templateCode#, #templateName#, #remark#, #deleteFlag#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedTime#, #updatedName#)
VALUES (#id#, #accountCode#, #depCode#, #projCode#, #templateCode#, #templateName#, #remark#, #deleteFlag#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedTime#, #updatedName#)
</insert>
<delete id="delete">
......@@ -186,7 +186,7 @@
<update id="update">
UPDATE ${hggpSchema}.HGPZ015
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 -->
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 预留 -->
DEP_CODE = #depCode#, <!-- 部门编码 预留 -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
TEMPLATE_CODE = #templateCode#, <!-- 产品代码 -->
......@@ -208,7 +208,7 @@
resultClass="com.baosight.hggp.hg.pz.domain.HGPZ015">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
ACCOUNT_CODE as "accountCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
TEMPLATE_CODE as "templateCode", <!-- 产品代码 -->
......
......@@ -4,7 +4,7 @@
<sql id="column">
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
ACCOUNT_CODE as "accountCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
......@@ -42,7 +42,7 @@
<sql id="column1">
A.ID as "id",
A.COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
A.ACCOUNT_CODE as "accountCode", <!-- 企业编码 预留 -->
A.DEP_CODE as "depCode", <!-- 部门编码 预留 -->
A.PROJ_CODE as "projCode", <!-- 项目编码 -->
A.PROJ_NAME as "projName", <!-- 项目名称 -->
......@@ -80,8 +80,8 @@
</sql>
<sql id="authCondition">
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
......@@ -123,8 +123,8 @@
</sql>
<sql id="authCondition1">
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
<isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
A.DEP_CODE = #depCode#
......@@ -191,6 +191,34 @@
<include refid="order"/>
</select>
<select id="queryMb" parameterClass="java.util.HashMap" resultClass="com.baosight.hggp.hg.pz.domain.HGPZ015A">
SELECT
PROJ_CODE,
PARENT_PROD_CODE,
CASE WHEN LEAF = #templateName# THEN '' ELSE PARENT_PROD_NAME END as PARENT_PRDT_NAME,
LEAF,
SORT,
PRODUCT_TYPE,
PRODUCT_CODE,
PRODUCT_NAME,
MATERIAL_ID,
quantity,
single_weight,
total_weight,
APPROVAL_STATUS,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME,
LV,
SPEC,
LENGTH,
WIDTH,
THICK
FROM ${hggpSchema}.hgsc004a
where ACCOUNT_CODE=#accountCode# AND PROJ_CODE=#projCode#
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.hgpz015a WHERE 1=1
AND PARENT_ID NOT IN ('root')
......@@ -200,7 +228,7 @@
<insert id="insert">
INSERT INTO ${hggpSchema}.hgpz015a (ID,
COMPANY_CODE, <!-- 企业编码 预留 -->
ACCOUNT_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 预留 -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
......@@ -235,7 +263,7 @@
WIDTH, <!-- 宽 -->
THICK <!-- 厚 -->
)
VALUES (#id#, #companyCode#, #depCode#, #projCode#, #projName#, #parentId#, #parentPrdtName#,
VALUES (#id#, #accountCode#, #depCode#, #projCode#, #projName#, #parentId#, #parentPrdtName#,
#type#, #leaf#, #sort#, #icon#, #prdtType#, #prdtCode#, #prdtName#, #inventRecordId#, #num#,
#unitWt#, #totalWt#, #filePath1#, #filePath2#, #filePath3#, #filePath4#, #filePath5#, #status#,
#delStatus#, #createdBy#, #createdTime#, #updatedBy#, #updatedTime#, #remark#, #lv#, #spec#,
......@@ -245,7 +273,7 @@
<insert id="insertMb" parameterClass="java.util.HashMap">
INSERT INTO ${hggpSchema}.hgpz015a(
ID,
COMPANY_CODE,
ACCOUNT_CODE,
DEP_CODE,
PROJ_CODE,
PROJ_NAME,
......@@ -272,7 +300,7 @@
THICK
)(
SELECT a.ID,
a.COMPANY_CODE,
a.ACCOUNT_CODE,
a.DEP_CODE,
a.PROJ_CODE,
a.PARENT_PROD_CODE,
......@@ -296,8 +324,8 @@
a.LENGTH,
a.WIDTH,
a.THICK
FROM hggp.hgsc004a a
where PROJ_CODE=#projCode# AND COMPANY_CODE=#companyCode#
FROM ${hggpSchema}.hgsc004a a
where PROJ_CODE=#projCode# AND ACCOUNT_CODE=#accountCode#
)
</insert>
......@@ -309,7 +337,7 @@
<update id="update">
UPDATE ${hggpSchema}.hppz015a
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 -->
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 预留 -->
DEP_CODE = #depCode#, <!-- 部门编码 预留 -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
......@@ -367,8 +395,10 @@
SPEC as "spec"
FROM
${hggpSchema}.hppz015a
WHERE
1=1
WHERE 1=1
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="pEname">
PARENT_ID = #pEname#
</isNotEmpty>
......@@ -384,6 +414,9 @@
<include refid="column"/>
FROM ${hggpSchema}.hgpz015a
WHERE 1 = 1
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="id">
PARENT_ID = #id#
</isNotEmpty>
......@@ -393,11 +426,14 @@
</select>
<!-- 根据父级ID查询 -->
<select id="queryEntityByParentPrtdCode" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ015A">
<select id="queryEntityByParentPrtdCode" resultClass="com.baosight.hggp.hg.pz.domain.HGPZ015A">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.hgpz015a
WHERE 1 = 1
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
......@@ -467,10 +503,10 @@
</isNotEmpty>
</select>
<select id="queryById" parameterClass="java.util.HashMap" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ015A">
<select id="queryById" parameterClass="java.util.HashMap" resultClass="com.baosight.hggp.hg.pz.domain.HGPZ015A">
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
ACCOUNT_CODE as "accountCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
......@@ -490,6 +526,9 @@
THICK as "thick" <!-- 厚 -->
FROM ${hggpSchema}.hgpz015a
WHERE 1=1 AND PROJ_CODE=#projCode# AND PARENT_ID NOT IN('root')
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
</select>
</sqlMap>
package com.baosight.hggp.hg.sc.service;
import cn.hutool.core.bean.BeanUtil;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoBase;
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.HGSC003;
import com.baosight.hggp.hg.sc.domain.HGSC004;
import com.baosight.hggp.hg.sc.domain.HGSC004A;
......@@ -189,6 +192,22 @@ public class ServiceHGSC004 extends ServiceBase {
DaoUtils.insert(HGSC004A.INSERT, projectHgsc004A);
}
@OperationLogAnnotation(operModul = "物料清单",operType = "查询",operDesc = "查询")
public EiInfo count(EiInfo inInfo) {
try {
HashMap map = new HashMap();
map.put(HGSC004.FIELD_proj_code, inInfo.getString("id"));
List<HGSC004> results = DaoBase.getInstance().query("HGSC004.query", map);
if (results.size() > 1) {
inInfo.setStatus(0);
} else {
inInfo.setStatus(1);
inInfo.set(HGSC004.FIELD_proj_code, inInfo.getString("id"));
}
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
......@@ -22,7 +22,7 @@ $(function () {
$("#GENERATE").on("click", function () {
var projCode = $("#inqu_status-0-projCode").val();
var info = new EiInfo()
info.set("id", $("#inqu_status-0-projCode").val());
info.set("id", projCode);
EiCommunicator.send("HGPZ015", "count", info, {
onSuccess: function (ei) {
if (ei["status"] == 1) {
......@@ -77,10 +77,10 @@ $(function () {
* 物料生成
*/
function assign() {
var projCode = $("#inqu_status-0-projId").val();
var projCode = $("#inqu_status-0-projCode").val();
var info = new EiInfo()
info.set("id", projCode);
EiCommunicator.send("HGSC002", "count", info, {
EiCommunicator.send("HGSC004", "count", info, {
onSuccess: function (ei) {
if (ei["status"] == 1) {
var projCodeNew=ei["extAttr"]["projCode"];
......
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