Commit b96107cd by wuwenlong

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

parents ca516ba6 f4242a56
......@@ -221,6 +221,8 @@ public enum DdynamicEnum {
put("orgType", OrgTypeEnum.COMPANY.getCode());
}}),
USER_ID_BOX_BLOCK_ID("user_block_id","loginName","userName","XSOG0801.queryUserByOrgIdBack"),
/**
* 模块:工序编码
* 用途:工序编码下拉框
......
......@@ -36,6 +36,7 @@ public class HGPZ004 extends DaoEPBase {
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除0.否1.是*/
public static final String FIELD_INVENT_TYPE_DETAIL = "inventTypeDetail"; /*存货类型明细*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 帐套编码*/
......@@ -52,6 +53,7 @@ public class HGPZ004 extends DaoEPBase {
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除0.否1.是*/
public static final String COL_INVENT_TYPE_DETAIL = "INVENT_TYPE_DETAIL"; /*存货类型明细*/
public static final String QUERY = "HGPZ004.query";
public static final String COUNT = "HGPZ004.count";
......@@ -74,6 +76,7 @@ public class HGPZ004 extends DaoEPBase {
private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag = 0; /* 是否删除0.否1.是*/
private Integer inventTypeDetail = 0; /*存货类型明细 1:构建 2:零件*/
/**
* initialize the metadata.
......@@ -142,6 +145,10 @@ public class HGPZ004 extends DaoEPBase {
eiColumn.setDescName("是否删除0.否1.是");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_TYPE_DETAIL);
eiColumn.setDescName("存货类型明细");
eiMetadata.addMeta(eiColumn);
}
......@@ -392,6 +399,15 @@ public class HGPZ004 extends DaoEPBase {
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
public Integer getInventTypeDetail() {
return inventTypeDetail;
}
public void setInventTypeDetail(Integer inventTypeDetail) {
this.inventTypeDetail = inventTypeDetail;
}
/**
* get the value from Map.
*
......@@ -415,6 +431,7 @@ public class HGPZ004 extends DaoEPBase {
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setInventTypeDetail(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_INVENT_TYPE_DETAIL)), inventTypeDetail));
}
/**
......@@ -439,6 +456,7 @@ public class HGPZ004 extends DaoEPBase {
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_INVENT_TYPE_DETAIL,StringUtils.toString(inventTypeDetail, eiMetadata.getMeta(FIELD_INVENT_TYPE_DETAIL)));
return map;
}
......
......@@ -2,14 +2,23 @@ package com.baosight.hggp.hg.pz.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sj.domain.HGSJ002;
import com.baosight.hggp.hg.sj.domain.HGSJ002A;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import org.apache.commons.collections.CollectionUtils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
......@@ -21,8 +30,22 @@ public class ServiceHGPZ005B extends ServiceEPBase {
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ002.FIELD_STATUS, CommonConstant.YesNo.YES_1);
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isNotEmpty(orgList)){
Org org = orgList.get(0);
if (!org.getOrgType().equals("company")) {
//如果不是公司公司,则找到上一级
Org org1 = HGXSTools.XsOrg.queryCompany(org.getOrgId());
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ002.FIELD_FACTORY_CODE, org1.getOrgId());
}else {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ002.FIELD_FACTORY_CODE, org.getOrgId());
}
}
String userId = "admin".equals(UserSessionUtils.getUserId())?"":UserSessionUtils.getUserId();
inInfo = super.query(inInfo, HGSJ002.QUERY, new HGSJ002());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),null);
Map qarma = new HashMap();
qarma.put(User.FIELD_USER_ID,userId);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),qarma);
return inInfo;
}
......
......@@ -68,6 +68,9 @@
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypeDetail">
INVENT_TYPE_DETAIL = #inventTypeDetail#
</isNotEmpty>
</sql>
<sql id="authCondition">
......@@ -107,7 +110,8 @@
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag" <!-- 是否删除0.否1.是 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 -->
INVENT_TYPE_DETAIL as "inventTypeDetail"
FROM ${hggpSchema}.HGPZ004 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<include refid="authCondition" />
......@@ -191,9 +195,10 @@
UPDATED_BY, <!-- 更新人 -->
UPDATED_NAME, <!-- 更新人名称 -->
UPDATED_TIME, <!-- 更新时间 -->
DELETE_FLAG <!-- 是否删除0.否1.是 -->
DELETE_FLAG, <!-- 是否删除0.否1.是 -->
INVENT_TYPE_DETAIL
)
VALUES (#id#, #accountCode#, #depCode#, #inventType#, #inventTypeName#, #parInventType#, #parInventTypeName#, #status#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#)
VALUES (#id#, #accountCode#, #depCode#, #inventType#, #inventTypeName#, #parInventType#, #parInventTypeName#, #status#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #inventTypeDetail#)
</insert>
<delete id="delete">
......@@ -216,7 +221,8 @@
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DELETE_FLAG = #deleteFlag# <!-- 是否删除0.否1.是 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0.否1.是 -->
INVENT_TYPE_DETAIL = #inventTypeDetail#
WHERE
ID = #id#
</update>
......
......@@ -359,6 +359,9 @@
<isNotEmpty prepend=" AND " property="parInventType">
b.PAR_INVENT_TYPE = #parInventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
a.INVENT_NAME = #inventName#
</isNotEmpty>
ORDER BY INVENT_CODE
</select>
......
......@@ -39,6 +39,7 @@ public class HGSC004A extends DaoEPBase {
public static final String FIELD_product_code = "productCode"; /* 产品编号*/
public static final String FIELD_product_name = "productName"; /* 产品名称*/
public static final String FIELD_product_type = "productType"; /* 产品type*/
public static final String FIELD_invent_type = "inventType"; /* 档案类型*/
public static final String FIELD_product_status = "productStatus"; /* 产品状态 0:未提交,1:已提交*/
public static final String FIELD_change_type = "changeType"; /* 变更类型:默认0,1:增加,2:替换,3:删除*/
public static final String FIELD_quantity = "quantity"; /* 数量*/
......@@ -70,6 +71,7 @@ public class HGSC004A extends DaoEPBase {
public static final String COL_product_code = "product_code"; /* 产品编号*/
public static final String COL_product_name = "product_name"; /* 产品名称*/
public static final String COL_product_type = "product_type"; /* 产品类型*/
public static final String COL_invent_type = "invent_type"; /* 档案类型*/
public static final String COL_product_status = "product_status"; /* 产品状态 0:未提交,1:已提交*/
public static final String COL_change_type = "change_type"; /* 变更类型:默认0,1:增加,2:替换,3:删除*/
public static final String COL_quantity = "quantity"; /* 数量*/
......@@ -116,6 +118,7 @@ public class HGSC004A extends DaoEPBase {
private String productCode = " "; /* 产品编号*/
private String productName = " "; /* 产品名称*/
private String productType = " "; /* 产品id*/
private String inventType = " "; /* 档案类型*/
private Integer productStatus = new Integer(0); /* 产品状态 0:未提交,1:已提交*/
private Integer changeType = new Integer(0); /* 变更类型:默认0,1:增加,2:替换,3:删除*/
private Integer quantity = new Integer(0); /* 数量*/
......@@ -226,6 +229,11 @@ public class HGSC004A extends DaoEPBase {
eiColumn.setDescName("产品类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_invent_type);
eiColumn.setFieldLength(32);
eiColumn.setDescName("档案类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_status);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
......@@ -770,6 +778,14 @@ public class HGSC004A extends DaoEPBase {
this.finishDate = finishDate;
}
public String getInventType() {
return inventType;
}
public void setInventType(String inventType) {
this.inventType = inventType;
}
/**
* get the value from Map.
*
......@@ -795,6 +811,7 @@ public class HGSC004A extends DaoEPBase {
setProductName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_product_name)), productName));
setProductId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_product_id)), productId));
setProductType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_product_type)), productType));
setInventType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_invent_type)), inventType));
setProductStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_product_status)), productStatus));
setChangeType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_change_type)), changeType));
setQuantity(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_quantity)), quantity));
......@@ -833,7 +850,8 @@ public class HGSC004A extends DaoEPBase {
map.put(FIELD_product_code, StringUtils.toString(productCode, eiMetadata.getMeta(FIELD_product_code)));
map.put(FIELD_product_name, StringUtils.toString(productName, eiMetadata.getMeta(FIELD_product_name)));
map.put(FIELD_product_id, StringUtils.toString(productId, eiMetadata.getMeta(FIELD_product_id)));
map.put(FIELD_product_type, StringUtils.toString(productName, eiMetadata.getMeta(FIELD_product_type)));
map.put(FIELD_product_type, StringUtils.toString(productType, eiMetadata.getMeta(FIELD_product_type)));
map.put(FIELD_invent_type, StringUtils.toString(inventType, eiMetadata.getMeta(FIELD_invent_type)));
map.put(FIELD_product_status, StringUtils.toString(productStatus, eiMetadata.getMeta(FIELD_product_status)));
map.put(FIELD_change_type, StringUtils.toString(changeType, eiMetadata.getMeta(FIELD_change_type)));
map.put(FIELD_quantity, StringUtils.toString(quantity, eiMetadata.getMeta(FIELD_quantity)));
......
......@@ -130,49 +130,30 @@ public class ServiceHGSC004A extends ServiceBase {
hgsc004a.setLeaf(1);
}
this.checkSaveData(hgsc004a,hgsc003);
//蓝图信息,用于蓝图状态校验
HGSC004A flowHGSC004A = (HGSC004A) super.dao.get(HGSC004A.QUERY_TECHFLOW_ID_BY_PRODUCTID,HGSC004A.FIELD_product_id,hgsc004a.getProductId());
if(Objects.nonNull(hgsc004a.getId())&&hgsc004a.getId()!=0){
if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.QBTJ){
hgsc004a.setChangeType(HGConstant.ChangeType.TH);
if(hgsc004a.getLv().intValue() == 3){
hgsc004a.setProductType(ProductTypeEnum.STRUCT.getCode().toString());
}else{
hgsc004a.setProductType(ProductTypeEnum.PART.getCode().toString());
}
}
DaoUtils.update(HGSC004A.UPDATE, hgsc004a);
//子表
HGSC005A hgsc005a = new HGSC005A();
BeanUtil.copyProperties(hgsc004a,hgsc005a,"id","productType");
hgsc005a.setMatDetailId(hgsc004a.getId());
hgsc005a.setMatId(hgsc004.getId());
hgsc005a.setTechFlowId(flowHGSC004A.getTechFlowId());
hgsc005a.setFinishDate(hgsc004.getFinishDate());
if(hgsc004a.getLv().intValue() == 3){
hgsc005a.setProductType(ProductTypeEnum.STRUCT.getCode());
}else{
hgsc005a.setProductType(ProductTypeEnum.PART.getCode());
}
HGSCTools.THGSC005A.update(hgsc005a);
}else {
if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.QBTJ){
hgsc004a.setChangeType(HGConstant.ChangeType.ZJ);
}
}else {
hgsc004a.setProductStatus(HGConstant.ProductStatus.WTJ);
Map<String,Object> mapA = new HashMap<>();
Long maxID = (Long) dao.query(HGSC004A.MAX_ID,mapA, 0, -999999).get(0);
hgsc004a.setId(maxID+1);
DaoUtils.insert(HGSC004A.INSERT, hgsc004a);
//子表
HGSC005A hgsc005a = new HGSC005A();
BeanUtil.copyProperties(hgsc004a,hgsc005a,"id","productType");
hgsc005a.setMatDetailId(hgsc004a.getId());
hgsc005a.setMatId(hgsc004.getId());
hgsc005a.setTechFlowId(flowHGSC004A.getTechFlowId());
hgsc005a.setFinishDate(flowHGSC004A.getFinishDate());
if(hgsc004a.getLv().intValue() == 3){
hgsc005a.setProductType(ProductTypeEnum.STRUCT.getCode());
}else{
hgsc005a.setProductType(ProductTypeEnum.PART.getCode());
if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.QBTJ){
if(hgsc004a.getLv().intValue() == 3){
hgsc004a.setProductType(ProductTypeEnum.STRUCT.getCode().toString());
}else{
hgsc004a.setProductType(ProductTypeEnum.PART.getCode().toString());
}
}
HGSCTools.THGSC005A.save(hgsc005a);
DaoUtils.insert(HGSC004A.INSERT, hgsc004a);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
......@@ -92,7 +92,7 @@
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime" <!-- 更新时间 -->
FROM ${hggpSchema}.HGSC004
WHERE 1=1
WHERE 1=1 AND del_status = 0
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
......
......@@ -17,6 +17,7 @@
product_type as "productType", <!-- 产品类别 -->
product_code as "productCode", <!-- 产品编号 -->
product_name as "productName", <!-- 产品名称 -->
invent_type as "inventType", <!-- 档案类型 -->
product_status as "productStatus", <!-- 产品状态 0:未提交,1:已提交 -->
change_type as "changeType", <!-- 变更类型:默认0,1:增加,2:替换,3:删除 -->
quantity as "quantity", <!-- 数量 -->
......@@ -77,6 +78,9 @@
<isNotEmpty prepend=" AND " property="changeType">
change_type = #changeType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
invent_type = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="quantity">
quantity = #quantity#
</isNotEmpty>
......@@ -173,6 +177,7 @@
a.product_type as "productType", <!-- 产品类别 -->
a.product_code as "productCode", <!-- 产品编号 -->
a.product_name as "productName", <!-- 产品名称 -->
a.invent_type as "inventType", <!-- 档案类型 -->
a.product_status as "productStatus", <!-- 产品状态 0:未提交,1:已提交 -->
a.change_type as "changeType", <!-- 变更类型:默认0,1:增加,2:替换,3:删除 -->
a.quantity as "quantity", <!-- 数量 -->
......@@ -249,6 +254,7 @@
product_type, <!-- 产品类别 -->
product_code, <!-- 产品编号 -->
product_name, <!-- 产品名称 -->
invent_type, <!-- 档案类型 -->
product_status, <!-- 产品状态 0:未提交,1:已提交 -->
change_type, <!-- 变更类型:默认0,1:增加,2:替换,3:删除 -->
quantity, <!-- 数量 -->
......@@ -265,7 +271,7 @@
)
VALUES (#id#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#,
#parentProdCode#, #parentProdName#,#leaf#,#sort#,#lv#, #materialId#, #productId#,#productType#,
#productCode#, #productName#, #productStatus#, #changeType#, #quantity#, #singleWeight#, #totalWeight#,
#productCode#, #productName#,#inventType#, #productStatus#, #changeType#, #quantity#, #singleWeight#, #totalWeight#,
#approvalStatus#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
#updatedName#, #updatedTime#)
</insert>
......@@ -293,6 +299,7 @@
product_type = #productType#, <!-- 产品类别 -->
product_code = #productCode#, <!-- 产品编号 -->
product_name = #productName#, <!-- 产品名称 -->
invent_type = #inventType#, <!-- 档案类型 -->
product_status = #productStatus#, <!-- 产品状态 0:未提交,1:已提交 -->
change_type = #changeType#, <!-- 变更类型:默认0,1:增加,2:替换,3:删除 -->
quantity = #quantity#, <!-- 数量 -->
......@@ -330,6 +337,7 @@
SELECT
PRODUCT_CODE as "nodeId",
product_id as "productId", <!-- 产品id -->
invent_type as "inventType", <!-- 档案类型 -->
product_type as "productType", <!-- 产品类别 -->
PRODUCT_CODE as "productCode", <!-- 产品编码 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
......
......@@ -4,8 +4,13 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sj.domain.HGSJ001;
import com.baosight.hggp.hg.sj.domain.HGSJ002A;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
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;
......@@ -15,11 +20,9 @@ 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 org.apache.commons.collections.CollectionUtils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @author LiuYang
......@@ -31,9 +34,14 @@ public class ServiceHGSJ001 extends ServiceEPBase {
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ001.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGSJ001.QUERY, new HGSJ001());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.USER_BLOCK_ID),null
);
Map qarma = new HashMap();
String userId = "admin".equals(UserSessionUtils.getUserId())?"":UserSessionUtils.getUserId();
qarma.put(User.FIELD_USER_ID,userId);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),qarma);
qarma.clear();
List orgIds = getOrgId();
qarma.put(Org.FIELD_ORG_ID,orgIds);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
return inInfo;
}
......@@ -139,8 +147,33 @@ public class ServiceHGSJ001 extends ServiceEPBase {
public void queryDeviceCode(HGSJ001 hgsj001){
Map<String,Object> map = new HashMap<>();
map.put(HGSJ001.FIELD_PROCESS_NAME,hgsj001.getProcessName().trim());
map.put(HGSJ001.FIELD_FACTORY_CODE,hgsj001.getFactoryCode());
map.put(HGSJ001.FIELD_DELETE_FLAG,hgsj001.getDeleteFlag());
List<HGSJ001> hgsj001s = this.dao.query(HGSJ001.QUERY,map);
AssertUtils.isNotEmpty(hgsj001s, String.format("工序名称[%s]已存在,添加失败!", hgsj001.getProcessName()));
AssertUtils.isNotEmpty(hgsj001s, String.format("公司名称[%s]-工序名称[%s]已存在,添加失败!", hgsj001.getFactoryName(),hgsj001.getProcessName()));
}
public List<String> getOrgId(){
Map<String, Object> orgMap = new HashMap();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isNotEmpty(orgList)){
Org org = orgList.get(0);
if (!org.getOrgType().equals("company")) {
//如果不是公司公司,则找到上一级
Org org1 = HGXSTools.XsOrg.queryCompany(org.getOrgId());
orgMap.put("orgId",org.getParentOrgId());
}else {
orgMap.put("orgId", org.getParentOrgId());
}
}
List<HashMap<String, Object>> orgIdChildList = this.dao.query("XSOG01.queryOrgChild", orgMap);
List<String> strList = new ArrayList();
Iterator var6 = orgIdChildList.iterator();
while (var6.hasNext()) {
HashMap map = (HashMap) var6.next();
strList.add(map.get("ORG_ID").toString());
}
return strList;
}
}
......@@ -5,8 +5,10 @@ import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sj.domain.HGSJ002;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils;
......@@ -34,7 +36,10 @@ public class ServiceHGSJ002 extends ServiceEPBase {
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGSJ002.QUERY, new HGSJ002());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),null);
Map qarma = new HashMap();
String userId = "admin".equals(UserSessionUtils.getUserId())?"":UserSessionUtils.getUserId();
qarma.put(User.FIELD_USER_ID,userId);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),qarma);
return inInfo;
}
......
......@@ -35,7 +35,10 @@ public class ServiceHGSJ002A extends ServiceEPBase {
//inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HGPZ002A.FIELD_FLOW_CODE,inInfo.get("inqu_status-0-flowCode"));
String factoryCode = inInfo.getCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HGSJ002A.FIELD_FACTORY_CODE).toString();
inInfo = super.query(inInfo, HGSJ002A.QUERY, new HGSJ002A());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROCESS_CODE_BLOCK_ID),null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROCESS_CODE_BLOCK_ID),
new HashMap<String,Object>(){{
put(HGSJ002A.FIELD_FACTORY_CODE,factoryCode);
}});
return inInfo;
}
......
......@@ -7,8 +7,12 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sj.domain.HGSJ002;
import com.baosight.hggp.hg.sj.domain.HGSJ002A;
import com.baosight.hggp.hg.sj.domain.HGSJ003;
import com.baosight.hggp.hg.sj.tools.HGSJTools;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
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;
......@@ -20,6 +24,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.util.DateUtils;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.*;
......@@ -34,7 +39,24 @@ public class ServiceHGSJ003 extends ServiceEPBase {
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ003.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGSJ003.QUERY, new HGSJ003());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROCESS_CODE_BLOCK_ID),null);
List asList = new ArrayList<>();
Map qarma = new HashMap();
String userId = "admin".equals(UserSessionUtils.getUserId())?"":UserSessionUtils.getUserId();
qarma.put(User.FIELD_USER_ID,userId);
asList.add(DdynamicEnum.COMPANY_BOX_BLOCK_ID);
asList.add(DdynamicEnum.PROCESS_CODE_BLOCK_ID);
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isNotEmpty(orgList)){
Org org = orgList.get(0);
if (!org.getOrgType().equals("company")) {
//如果不是公司公司,则找到上一级
Org org1 = HGXSTools.XsOrg.queryCompany(org.getOrgId());
qarma.put(HGSJ002A.FIELD_FACTORY_CODE,org1.getOrgId());
}else {
qarma.put(HGSJ002A.FIELD_FACTORY_CODE,org.getOrgId());
}
}
CommonMethod.initBlock(inInfo, asList, qarma);
return inInfo;
}
......
......@@ -223,7 +223,8 @@
A.ORG_TYPE AS "orgType",
A.ACCOUNT_CODE AS "accounCcode",
A.FACTORY_CODE AS "factoryCode",
A.COMPANY_CODE AS "companyCode"
A.COMPANY_CODE AS "companyCode",
A.PARENT_ORG_ID as "parentOrgId"
FROM ${platSchema}.TXSOG01 A, ${platSchema}.TXSOG02 B, ${platSchema}.XS_USER C
WHERE 1=1
AND A.ORG_ID = B.ORG_ID
......
......@@ -20,6 +20,9 @@
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn cname="类型编码" ename="inventType" enable="false" width="120" align="center"/>
<EF:EFColumn cname="存货类型" ename="inventTypeName" width="140" align="center" required="true"/>
<EF:EFComboColumn ename="inventTypeDetail" cname="存货类型明细" width="80" align="center" readonly="false" required="true">
<EF:EFCodeOption codeName="hggp.hgpz.inventTypeDetail"/>
</EF:EFComboColumn>
<EF:EFColumn cname="上级名称" ename="parInventType" width="80" align="center" required="true"/>
<EF:EFColumn cname="上级名称" ename="parInventTypeName" width="80" align="center" hidden="true" />
<EF:EFComboColumn cname="状态" ename="status" width="90" align="center" required="true" defaultValue="1">
......
......@@ -160,10 +160,7 @@ let save = function (btnNode) {
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC003", "save", true,
function (e) {
query();
});
JSUtils.submitGridsData("result", "HGSC003", "save", true);
btnNode.attr("disabled", false);
}
});
......
......@@ -103,7 +103,8 @@ let save = function (btnNode) {
if(flag) {
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGrid("result", "HGSC003A", "save",{onSuccessCallback:saveCallBack} );
JSUtils.submitGridsData("result", "HGSC003A", "save", true);
btnNode.attr("disabled", false);
}
});
}
......@@ -136,7 +137,7 @@ function showUploadFile(id) {
JSColorbox.open({
href: "HGSC003B?methodName=initLoad&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件详情</div>",
width: "80%",
width: "90%",
height: "80%",
});
}
......@@ -54,8 +54,8 @@ function uploadFile(id) {
JSColorbox.open({
href: "HGSC003C?methodName=initLoad&inqu_status-0-matId="+$("#inqu_status-0-matId").val(),
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
width: "90%",
height: "80%",
callbackName: uploadFileCallback
});
}
......
......@@ -204,10 +204,7 @@ let save = function (btnNode) {
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC004", "save", true,
function (e) {
query();
});
JSUtils.submitGridsData("result", "HGSC004", "save", true);
btnNode.attr("disabled", false);
}
});
......
......@@ -62,7 +62,7 @@ $(function () {
if (nodeData.lv == 2) {
eiInfo.set("inqu_status-0-parInventType", "root");
} else if (nodeData.lv == 3) {
eiInfo.set("inqu_status-0-parInventType", nodeData.productType);
eiInfo.set("inqu_status-0-parInventType", nodeData.inventType);
}
var dataSource;
EiCommunicator.send("HGSC004A", "queryProductComboBox", eiInfo, {
......@@ -122,7 +122,7 @@ $(function () {
if(item.productCode === productCodeBox[i]['valueField']){
item['productName'] = productCodeBox[i]['textField'];
item['productId'] = productCodeBox[i]['param1Field'];
item['productType'] = productCodeBox[i]['param2Field'];
item['inventType'] = productCodeBox[i]['param2Field'];
console.log(item)
template = productCodeBox[i]['valueField'];
}
......@@ -137,10 +137,10 @@ $(function () {
if (nodeData.lv == 2) {
inInfo.set("inqu_status-0-parInventType", "root");
} else if (nodeData.lv == 3) {
inInfo.set("inqu_status-0-parInventType", nodeData.productType);
inInfo.set("inqu_status-0-parInventType", nodeData.inventType);
}else if (nodeData.lv == 4) {
//上方刷新过树结构了
inInfo.set("inqu_status-0-parInventType", nodeData.productType);
inInfo.set("inqu_status-0-parInventType", nodeData.inventType);
}
inInfo.set("field", options.field);
let dataSource = inventNameGlobalData;
......@@ -188,7 +188,7 @@ $(function () {
// 判断父级节点是否发生变化
if (e.field == "productCode") {
loadChange(grid,e,"productId");
loadChange(grid,e,"productType");
loadChange(grid,e,"inventType");
loadChange(grid,e,"productName");
}
});
......@@ -479,7 +479,7 @@ let setTreeNodeValue = function (nodeData) {
IPLATUI.EFTree.materialTree.selectTreeNode.nodeId = nodeData.nodeId;
IPLATUI.EFTree.materialTree.selectTreeNode.pId = nodeData.pId;
IPLATUI.EFTree.materialTree.selectTreeNode.pName = nodeData.pName;
IPLATUI.EFTree.materialTree.selectTreeNode.productType = nodeData.productType;
IPLATUI.EFTree.materialTree.selectTreeNode.inventType = nodeData.inventType;
IPLATUI.EFTree.materialTree.selectTreeNode.productCode = nodeData.productCode;
IPLATUI.EFTree.materialTree.selectTreeNode.productName = nodeData.productName;
IPLATUI.EFTree.materialTree.selectTreeNode.projCode = nodeData.projCode;
......@@ -500,10 +500,7 @@ let save = function (btnNode) {
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC004A", "save", true,
function (e) {
query();
});
JSUtils.submitGridsData("result", "HGSC004A", "save", true);
btnNode.attr("disabled", false);
}
});
......
......@@ -43,6 +43,7 @@
<EF:EFColumn enable="false" ename="parentProdName" hidden="true" cname="上级产品名称"/>
<EF:EFColumn enable="false" ename="productId" hidden="true" cname="产品id"/>
<EF:EFColumn enable="false" ename="productType" hidden="true" cname="产品类型"/>
<EF:EFColumn enable="false" ename="inventType" hidden="true" cname="库存类型"/>
<EF:EFColumn ename="operator" cname="操作" width="140" enable="false" readonly="false"/>
<EF:EFComboColumn cname="变更类型" ename="changeType" width="90" align="center" enable="false" required="false">
<EF:EFCodeOption codeName="hggp.sc.changeType" />
......
......@@ -9,8 +9,13 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<EF:EFPage title="工序设置">
<EF:EFRegion id="inqu" title="查询条件">
......@@ -59,7 +64,7 @@
<EF:EFComboColumn ename="computeType" cname="计算类型" width="80" enable="true" align="center" required="true">
<EF:EFCodeOption codeName="hggp.hgsj.computeType"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="princ" cname="负责人"
<EF:EFComboColumn ename="princ" cname="负责人" defaultValue="${loginName}"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="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