Commit 67529a31 by 宋祥

Merge branch 'dev' of ssh://10.70.33.7:32359/smart/hp-smart into dev-sx

parents 954212e0 dd94ca94
......@@ -235,21 +235,43 @@ public enum DdynamicEnum {
* 用途:用户查询
* 编写:ly
*/
USER_ID_BLOCK_ID("user_id_block_id","userId","userName","factoryCode","groupCode","HPXS001.queryUserId"),
USER_ID_BLOCK_ID("user_id_block_id","userId","userName","factoryCode","groupCode", "HPSC008.queryUserId"),
/**
* 模块:系统管理
* 用途:生产组查询
* 编写:ly
*/
GROUP_CODE_BLOCK_ID("group_code_block_id","groupCode","groupName","factoryCode","HPXS001.queryGroupCode"),
GROUP_CODE_BLOCK_ID("group_code_block_id","groupCode","groupName","factoryCode", "HPSC008.queryGroupCode"),
/**
* 模块:系统管理
* 用途:厂区查询
* 编写:ly
*/
FACTORY_CODE_BLOCK_ID("factory_code_block_id","factoryCode","factoryName","HPXS001.queryFactoryCode"),
FACTORY_CODE_BLOCK_ID("factory_code_block_id","factoryCode","factoryName","HPSC008.queryFactoryCode"),
/**
* 模块:系统管理
* 用途:用户查询
* 编写:ly
*/
USER_ID1_BLOCK_ID("user_id1_block_id","userId","userName","factoryCode","groupCode", "HPSC008.queryUserId"),
/**
* 模块:系统管理
* 用途:生产组查询
* 编写:ly
*/
GROUP_CODE1_BLOCK_ID("group_code1_block_id","groupCode","groupName","factoryCode", "HPSC008.queryGroupCode"),
/**
* 模块:系统管理
* 用途:厂区查询
* 编写:ly
*/
FACTORY_CODE1_BLOCK_ID("factory_code1_block_id","factoryCode","factoryName", "HPSC008.queryFactoryCode"),
/**
* 模块:巡检填报APP下拉
......
......@@ -71,5 +71,4 @@ public class CommonConstant {
// ROOT
public static final String ROOT = "root";
}
}
package com.baosight.hpjx.hp.ds.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.ds.domain.HPDS002;
import com.baosight.hpjx.hp.sc.domain.HPSC002A;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
......@@ -51,12 +54,15 @@ public class ServiceHPDS002 extends ServiceEPBase {
EiBlock block = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < block.getRowCount(); i++) {
Map<String, Object> map = new HashMap<String, Object>(1);
map.put("docId", block.getCellStr(i, HPDS002.FIELD_DOC_ID));
List<Map<String, Object>> list = this.dao.query("EUDM02.query", map);
map.put(HPSC002A.FIELD_DOC_ID, block.getCellStr(i, HPDS002.FIELD_DOC_ID));
//List<Map<String, Object>> list = this.dao.query("EUDM02.query", map);
HPDS002 hpds002 = new HPDS002();
hpds002.fromMap(block.getRow(i));
hpds002.setChgName(list.get(0).get("chgName").toString());
hpds002.setDirId(list.get(0).get("dirId").toString());
/*if (list.size() > 0) {
hpds002.setChgName(list.get(0).get("chgName").toString());
hpds002.setDirId(list.get(0).get("dirId").toString());
}*/
DaoUtils.insert(HPDS002.INSERT, hpds002);
}
......
......@@ -5,6 +5,7 @@ import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC002;
import com.baosight.hpjx.hp.kc.domain.HPKC010;
......@@ -48,12 +49,15 @@ public class ServiceHPKC002B extends ServiceEPBase {
try {
Map queryMap = new HashMap();
queryMap.put("inventTypes", DEFAULT_INVENT_CODE);
Map queryMap2 = new HashMap();
queryMap2.put("companyCode", UserSessionUtils.getCompanyCode());
queryMap2.put("status", 1);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), queryMap2, false);
String hpsc006Id = inInfo.getString("inqu_status-0-hpsc006Id");
if (StringUtils.isNotBlank(hpsc006Id)) {
inInfo.set("inqu_result-0-hpsc006Id", hpsc006Id);
......
......@@ -57,6 +57,8 @@ public class ServiceHPKC003A extends ServiceEPBase {
Map queryMap = new HashMap();
queryMap.put("inventTypes", new String[]{"2","3"});
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC005B().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
......
......@@ -5,6 +5,7 @@ import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC002;
import com.baosight.hpjx.hp.kc.domain.HPKC004;
......@@ -25,7 +26,7 @@ import java.util.List;
import java.util.Map;
/**
* 生产领料挑选库存
* 耗材挑选库存
*
* @author:songx
* @date:2022/7/11,11:08
......@@ -48,12 +49,15 @@ public class ServiceHPKC004B extends ServiceEPBase {
try {
Map queryMap = new HashMap();
queryMap.put("inventTypes", DEFAULT_INVENT_CODE);
Map queryMap2 = new HashMap();
queryMap2.put("companyCode", UserSessionUtils.getCompanyCode());
queryMap2.put("status", 1);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), queryMap2, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC010().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
......
......@@ -126,7 +126,7 @@
$order$
</isNotEmpty>
<isEmpty property="order">
ID asc
ID desc
</isEmpty>
</dynamic>
</sql>
......
......@@ -8,10 +8,7 @@ import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.zl.domain.HPZL001;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.*;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
......@@ -20,10 +17,10 @@ import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.MapUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* 鸿鹏机械APP移动端接口调用处
......@@ -56,26 +53,96 @@ public class ServiceHPMT001 extends ServiceBase {
Map sqlMap = new HashMap();
sqlMap.put("queryMonth", queryMonth);
sqlMap.put("companyCode", companyCode);
List<Map> row1 = this.dao.query("HPMT001.pmOverview1", sqlMap);
List<Map> row2 = this.dao.query("HPMT001.pmOverview2", sqlMap);
List<Map> row1 = this.dao.query("HPMT001.pmOverview1", sqlMap);//目标
List<Map> row2 = this.dao.query("HPMT001.pmOverview2", sqlMap);//实际
List<Map> rows = new ArrayList<>();
Map resultMap = new HashMap();
if (BeanUtil.isEmpty(row1.get(0))) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMM");
try {
Date parse = sdf.parse(queryMonth);
Calendar instance = Calendar.getInstance();
instance.setTime(parse);
instance.add(Calendar.MONTH,-1);
String newnewDate = sdf.format(instance.getTime());//上月
Map sqlMap2 = new HashMap();
sqlMap2.put("queryMonth", newnewDate);
sqlMap2.put("companyCode", companyCode);
List<Map> row3 = this.dao.query("HPMT001.pmOverview1", sqlMap2);//上月目标
List<Map> row4 = this.dao.query("HPMT001.pmOverview2", sqlMap2);//上月实际
Calendar instance2 = Calendar.getInstance();
instance2.setTime(parse);
instance2.add(Calendar.YEAR,-1);
String newnewDate2 = sdf.format(instance2.getTime());//同年
Map sqlMap3 = new HashMap();
sqlMap3.put("queryMonth", newnewDate2);
sqlMap3.put("companyCode", companyCode);
List<Map> row5 = this.dao.query("HPMT001.pmOverview1", sqlMap3);//去年目标
List<Map> row6 = this.dao.query("HPMT001.pmOverview2", sqlMap3);//去年实际
//目标本月row1-targetWt 实际本月row2-actualWt
if (row1.get(0).get("targetWt")==null) {
resultMap.put("targetWt", 0);
} else {
resultMap.put("targetWt", row1.get(0).get("targetWt"));
}
if (BeanUtil.isEmpty(row2.get(0))) {
if (row2.get(0).get("actualWt")==null) {
resultMap.put("actualWt", 0);
} else {
resultMap.put("actualWt", row2.get(0).get("actualWt"));
}
//环比 目标上月row3-targetWt 实际上月row4-actualWt
if (row3.get(0).get("targetWt")==null) {
resultMap.put("targetWt_s", 0);//目标环比值
resultMap.put("target_s_qoq", 0);//目标环比
} else {
resultMap.put("targetWt_s", row3.get(0).get("targetWt"));
BigDecimal targetWt = (BigDecimal) row1.get(0).get("targetWt");
BigDecimal targetWt2 = (BigDecimal) row3.get(0).get("targetWt");
resultMap.put("target_s_qoq", targetWt.subtract(targetWt2).divide(targetWt2,BigDecimal.ROUND_UP).
multiply(new BigDecimal(100)).doubleValue());
}
if (row4.get(0).get("actualWt")==null) {
resultMap.put("actualWt_s", 0);//实际环比值
resultMap.put("actualWt_s_qoq", 0);//实际环比
} else {
resultMap.put("actualWt_s", row4.get(0).get("actualWt"));
BigDecimal actualWt = (BigDecimal) row2.get(0).get("actualWt");
BigDecimal actualWt2 = (BigDecimal) row4.get(0).get("actualWt");
resultMap.put("actualWt_s_qoq",actualWt.subtract(actualWt2).divide(actualWt2,BigDecimal.ROUND_UP).
multiply(new BigDecimal(100)).doubleValue());
}
//同比 目标同期row5-targetWt 实际同期row6-actualWt
if (row5.get(0).get("targetWt")==null) {
resultMap.put("targetWt_h", 0);//目标同期值
resultMap.put("target_h_qoq", 0);//目标同期
} else {
resultMap.put("targetWt_h", row5.get(0).get("targetWt"));
BigDecimal targetWt = (BigDecimal) row1.get(0).get("targetWt");
BigDecimal targetWt2 = (BigDecimal) row5.get(0).get("targetWt");
resultMap.put("target_h_qoq", targetWt.subtract(targetWt2).divide(targetWt2,BigDecimal.ROUND_UP).
multiply(new BigDecimal(100)).doubleValue());
}
if (row6.get(0).get("actualWt")==null) {
resultMap.put("actualWt_h", 0);//实际同比值
resultMap.put("actualWt_h_yoy", 0);//实际同比
} else {
resultMap.put("actualWt_h", row6.get(0).get("actualWt"));
BigDecimal actualWt = (BigDecimal) row2.get(0).get("actualWt");
BigDecimal actualWt2 = (BigDecimal) row6.get(0).get("actualWt");
resultMap.put("actualWt_h_yoy", actualWt.subtract(actualWt2).divide(actualWt2,BigDecimal.ROUND_UP).
multiply(new BigDecimal(100)).doubleValue());
}
rows.add(resultMap);
EiInfo outInfo = new EiInfo();
EiBlock eiBlock = new EiBlock(EiConstant.resultBlock);
eiBlock.setRows(rows);
outInfo.setBlock(eiBlock);
return outInfo;
} catch (ParseException e) {
e.printStackTrace();
return inInfo;
}
}
/**
......
......@@ -179,8 +179,8 @@ public class ServiceHPMT002 extends ServiceBase {
}
Map Map = new HashMap();
Map.put("checkId", id);
Map.put("docType", "XJ_WC");
List<HPZL001A> docIdlist = this.dao.query("HPZL001A.query", Map);
Map.put("docType",CommonConstant.YesNo.NO_0);
List<HPZL001A> docIdlist = this.dao.query("HPZL001A.queryDev", Map);
List<String> imgList = new ArrayList<>();
for (int i = 0; i < docIdlist.size(); i++) {
Map dirId = new HashMap();
......@@ -193,6 +193,23 @@ public class ServiceHPMT002 extends ServiceBase {
String imgBase64 = UploadUtils.imageToBase64(bf);
imgList.add(imgBase64);
}
//处理的文件
Map Map2 = new HashMap();
Map2.put("checkId", id);
Map2.put("docType",CommonConstant.YesNo.NO_0);
List<HPZL001A> docIdlist2 = this.dao.query("HPZL001A.queryDev", Map);
List<String> imgList2 = new ArrayList<>();
for (int i = 0; i < docIdlist2.size(); i++) {
Map dirId = new HashMap();
HPZL001A hpzl001A = docIdlist.get(i);
String docId = hpzl001A.getDocId();
dirId.put("docId", docId);
List<Map> query = this.dao.query("HPMT002.queryFile", dirId);
File file = new File(UploadUtils.ROOT_PATH + "/A/" + query.get(0).get("CHG_NAME"));
BufferedImage bf = ImageIO.read(file);
String imgBase64 = UploadUtils.imageToBase64(bf);
imgList2.add(imgBase64);
}
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
sqlMap.put("id", id);
......@@ -201,6 +218,7 @@ public class ServiceHPMT002 extends ServiceBase {
eiBlock.setRows(rows);
outInfo.setBlock(eiBlock);
outInfo.set("img",imgList);
outInfo.set("img2",imgList2);
} catch (Exception e){
outInfo.setMsg("账号异常");
}
......
......@@ -93,7 +93,7 @@
SUB_INVENT_CODE as "subInventCode", <!-- 零件编码 -->
SUB_INVENT_NAME as "subInventName", <!-- 零件名称 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
FACTORY_NAME as "factoryName", <!-- 工厂 -->
ORG_NO as "orgNo", <!-- 生产组编码 -->
ORG_NAME as "orgName", <!-- 生产组名称 -->
POOR_TYPE as "poorType", <!-- 不良品类 -->
......@@ -137,7 +137,7 @@
SUB_INVENT_CODE as "subInventCode", <!-- 零件编码 -->
SUB_INVENT_NAME as "subInventName", <!-- 零件名称 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
FACTORY_NAME as "factoryName", <!-- 工厂 -->
ORG_NO as "orgNo", <!-- 生产组编码 -->
ORG_NAME as "orgName", <!-- 生产组名称 -->
POOR_TYPE as "poorType", <!-- 不良品类 -->
......@@ -173,7 +173,7 @@
SUB_INVENT_CODE, <!-- 零件编码 -->
SUB_INVENT_NAME, <!-- 零件名称 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
FACTORY_NAME as "factoryName", <!-- 工厂 -->
ORG_NO, <!-- 生产组编码 -->
ORG_NAME, <!-- 生产组名称 -->
POOR_TYPE, <!-- 不良品类 -->
......
......@@ -30,7 +30,7 @@ public class HPPZ011 extends DaoEPBase {
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_FACTORY_CODE = "factoryCode"; /* 厂区编码*/
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 厂区名称*/
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 工厂*/
public static final String FIELD_GROUP_CODE = "groupCode"; /* 生产组编码*/
public static final String FIELD_GROUP_NAME = "groupName"; /* 生产组名称*/
public static final String FIELD_GROUP_TYPE = "groupType"; /* 组类型*/
......@@ -46,7 +46,7 @@ public class HPPZ011 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_FACTORY_CODE = "FACTORY_CODE"; /* 厂区编码*/
public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 厂区名称*/
public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 工厂*/
public static final String COL_GROUP_CODE = "GROUP_CODE"; /* 生产组编码*/
public static final String COL_GROUP_NAME = "GROUP_NAME"; /* 生产组名称*/
public static final String COL_GROUP_TYPE = "GROUP_TYPE"; /* 组类型*/
......@@ -70,7 +70,7 @@ public class HPPZ011 extends DaoEPBase {
private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/
private String factoryCode = " "; /* 厂区编码*/
private String factoryName = " "; /* 厂区名称*/
private String factoryName = " "; /* 工厂*/
private String groupCode = " "; /* 生产组编码*/
private String groupName = " "; /* 生产组名称*/
private String groupType = " "; /* 组类型*/
......@@ -131,7 +131,7 @@ public class HPPZ011 extends DaoEPBase {
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_NAME);
eiColumn.setDescName("厂区名称");
eiColumn.setDescName("工厂");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_GROUP_CODE);
......
......@@ -121,7 +121,7 @@ public class ServiceHPPZ011 extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) {
HPPZ011 fPz011 = new HPPZ011();
fPz011.fromMap(resultRows.get(i));
AssertUtils.isEmpty(fPz011.getFactoryName(), "厂区名称不能为空");
AssertUtils.isEmpty(fPz011.getFactoryName(), "工厂不能为空");
AssertUtils.isEmpty(fPz011.getGroupCode(), "生产组名不能为空");
}
}
......
......@@ -140,7 +140,7 @@ public class ServiceHPPZ013 extends ServiceBase {
* @param fPz01301
*/
private void setBaseInfo(HPPZ01301 fPz01301) {
// 厂区名称
// 工厂
fPz01301.setFactoryName(HPXSTools.XsOrg.get(fPz01301.getFactoryCode()).getOrgCname());
// 组名称
fPz01301.setGroupName(HPXSTools.XsOrg.get(fPz01301.getGroupCode()).getOrgCname());
......
......@@ -156,7 +156,7 @@ public class ServiceHPPZ014 extends ServiceBase {
* @param fPz014
*/
private void setBaseInfo(HPPZ014 fPz014) {
// 厂区名称
// 工厂
fPz014.setFactoryName(HPXSTools.XsOrg.get(fPz014.getFactoryCode()).getOrgCname());
// 组名称
fPz014.setGroupName(HPXSTools.XsOrg.get(fPz014.getGroupCode()).getOrgCname());
......
......@@ -58,36 +58,54 @@ public class ServiceHPPZ015 extends ServiceBase {
}
/**
* 查询操作.
*/
@OperationLogAnnotation(operModul = "产品模板",operType = "查询",operDesc = "查询")
public EiInfo count(EiInfo inInfo) {
HashMap map = new HashMap();
map.put("id",inInfo.getString("id"));
List<HPPZ015> query = this.dao.query("HPPZ015.query", map);
if (query.size() > 0) {
inInfo.setStatus(1);
inInfo.set("tempName",query.get(0).getTemplateName());
}else{
inInfo.setStatus(0);
}
return inInfo;
}
/**
* 新增操作.
*/
@OperationLogAnnotation(operModul = "产品模板",operType = "新增",operDesc = "新增")
@Override
public EiInfo insert(EiInfo inInfo) {
HashMap map = new HashMap();
map.put("projCode",inInfo.getString("projCode"));
map.put("id",inInfo.getString("id"));
List<HPPZ015> query = this.dao.query("HPPZ015.query", map);
HPSC001 hpsc001 = HPSCTools.HpSc001.getId(inInfo.getString("id"));
if (query.size() > 0) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("该产品模板已存在,生成失败!");
logError("生成产品模板失败","该产品模板已存在");
return inInfo;
dao.delete("HPPZ015.delete",map);
dao.delete("HPPZ015A.delete",hpsc001.toMap());
}
HPSC001 hpsc001 = HPSCTools.HpSc001.get(inInfo.getString("projCode"));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
HPPZ015 HPPZ015 = new HPPZ015();
HPPZ015.setId(hpsc001.getId());
HPPZ015.setProjCode(inInfo.getString("projCode"));
HPPZ015.setId(Long.parseLong(inInfo.getString("id")));
HPPZ015.setProjCode(hpsc001.getProjCode());
HPPZ015.setTemplateName(inInfo.getString("templateName"));
HPPZ015.setCreatedBy(UserSession.getUserId());
HPPZ015.setCompanyCode(UserSession.getUserId());
HPPZ015.setCreatedName(UserSession.getLoginName());
HPPZ015.setCreatedName(UserSession.getUserId()+"-"+UserSession.getLoginCName());
HPPZ015.setCreatedTime(sdf.format(new Date()));
HPPZ015.setUpdatedBy(null);
HPPZ015.setUpdatedTime(null);
this.dao.insert("HPPZ015.insert", HPPZ015.toMap());
//模板物料清单
map.put("companyCode", UserSessionUtils.getCompanyCode());
map.put("templateName", inInfo.getString("templateName"));
map.put("projCode", hpsc001.getProjCode());
this.dao.insert("HPPZ015A.insertMb", map);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("生成产品模板成功!");
......@@ -119,7 +137,12 @@ public class ServiceHPPZ015 extends ServiceBase {
return inInfo;
}
//生成清单
HPPZTools.HpPz015A.chekParentId(hppz015AList);
HPSC001 hpsc001New = HPSCTools.HpSc001.get(inInfo.getString("projCodeNew"));
HashMap hashMap = new HashMap();
hashMap.put("leaf",0 );
hashMap.put("projCode",hpsc001New.getProjCode());
this.dao.update("HPSC002.updateTreeNodeLeaf2",hashMap);
HPPZTools.HpPz015A.chekParentId(hppz015AList,hpsc001New);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("生成物料清单成功!");
} catch (PlatException e) {
......
......@@ -8,6 +8,7 @@ import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.ds.domain.HPDS002;
import com.baosight.hpjx.hp.pz.domain.HPPZ015;
import com.baosight.hpjx.hp.pz.domain.HPPZ015A;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.domain.*;
......@@ -19,12 +20,14 @@ 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.core.util.NumberUtils;
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.lang.StringUtils;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
......@@ -127,6 +130,12 @@ public class ServiceHPPZ015A extends ServiceBase {
if (!HPPZ015A.getParentId().equals("root")) {
this.checkTreeNodeLeaf(HPPZ015A.getParentId());
}
HPPZ015 byPrdt = HPPZTools.HpPz015.getByPrdt(HPPZ015A.getProjCode());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
byPrdt.setUpdatedBy(UserSession.getUserId());
byPrdt.setUpdatedName(UserSession.getUserId()+"-"+UserSession.getLoginCName());
byPrdt.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPPZ015.update", byPrdt.toMap());
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
} catch (PlatException e) {
......@@ -148,6 +157,12 @@ public class ServiceHPPZ015A extends ServiceBase {
EiInfo inInfo = new EiInfo();
try {
this.updateHPPZ015A(HPPZ015A);
HPPZ015 byPrdt = HPPZTools.HpPz015.getByPrdt(HPPZ015A.getProjCode());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
byPrdt.setUpdatedBy(UserSession.getUserId());
byPrdt.setUpdatedName(UserSession.getUserId()+"-"+UserSession.getLoginCName());
byPrdt.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPPZ015.update", byPrdt.toMap());
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
} catch (PlatException e) {
......@@ -194,6 +209,12 @@ public class ServiceHPPZ015A extends ServiceBase {
//处理项目管理中物料状态
HPSCTools.updateProjStatus(hppz002.getProjCode());
}
HPPZ015 byPrdt = HPPZTools.HpPz015.getByPrdt(hppz002.getProjCode());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
byPrdt.setUpdatedBy(UserSession.getUserId());
byPrdt.setUpdatedName(UserSession.getUserId()+"-"+UserSession.getLoginCName());
byPrdt.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPPZ015.update", byPrdt.toMap());
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
......@@ -221,7 +242,13 @@ public class ServiceHPPZ015A extends ServiceBase {
hppz002.fromMap(map);
this.updateHPPZ015A(hppz002);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
HPPZ015 byPrdt = HPPZTools.HpPz015.getByPrdt(hppz002.getProjCode());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
byPrdt.setUpdatedBy(UserSession.getUserId());
byPrdt.setUpdatedName(UserSession.getUserId()+"-"+UserSession.getLoginCName());
byPrdt.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPPZ015.update", byPrdt.toMap());
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
} catch (PlatException e) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
......@@ -259,6 +286,7 @@ public class ServiceHPPZ015A extends ServiceBase {
AssertUtils.isNotEmpty(dbSc002s, String.format("部件[%s]已存在子节点不能删除", fSc002.getPrdtName()));
}
// 删除数据
String projCode=null;
for (Map resultRow : resultRows) {
HPPZ015A fSc002 = new HPPZ015A();
fSc002.fromMap(resultRow);
......@@ -270,8 +298,14 @@ public class ServiceHPPZ015A extends ServiceBase {
this.checkTreeNodeLeaf(fSc002.getParentId());
// 修改节点状态是叶子节点或非叶子节点
this.checkTreeNodeLeaf(fSc002.getId().toString());
projCode=fSc002.getProjCode();
}
HPPZ015 byPrdt = HPPZTools.HpPz015.getByPrdt(projCode);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
byPrdt.setUpdatedBy(UserSession.getUserId());
byPrdt.setUpdatedName(UserSession.getUserId()+"-"+UserSession.getLoginCName());
byPrdt.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPPZ015.update", byPrdt.toMap());
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
......@@ -333,9 +367,9 @@ public class ServiceHPPZ015A extends ServiceBase {
if (projId != null) {
Map map = new HashMap();
map.put("id", projId);
List list = dao.query("HPSC001.queryDomainById", map);
List list = dao.query("HPPZ015.queryDomainById", map);
if (list.size() > 0) {
String projCode = ((HPSC001)list.get(0)).getProjCode();
String projCode = ((HPPZ015)list.get(0)).getProjCode();
queryMap.put("projCode", projCode);
}
}
......
......@@ -13,7 +13,7 @@
A.UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
A.UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
A.FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
A.FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
A.FACTORY_NAME as "factoryName", <!-- 工厂 -->
A.GROUP_CODE as "groupCode", <!-- 生产组编码 -->
A.GROUP_TYPE as "groupType", <!-- 组类型 -->
B.ORG_CNAME as "groupName" <!-- 生产组名称 -->
......@@ -30,7 +30,7 @@
A.UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
A.UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
A.FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
A.FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
A.FACTORY_NAME as "factoryName", <!-- 工厂 -->
A.GROUP_CODE as "groupCode", <!-- 生产组编码 -->
A.GROUP_TYPE as "groupType", <!-- 组类型 -->
A.GROUP_NAME as "groupName" <!-- 生产组名称 -->
......@@ -144,7 +144,7 @@
COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 预留 -->
FACTORY_CODE, <!-- 厂区编码 -->
FACTORY_NAME, <!-- 厂区名称 -->
FACTORY_NAME, <!-- 工厂 -->
GROUP_CODE, <!-- 生产组编码 -->
GROUP_NAME, <!-- 生产组名称 -->
GROUP_TYPE, <!-- 组类型 -->
......@@ -167,7 +167,7 @@
UPDATE ${hpjxSchema}.T_HPPZ011
SET
FACTORY_CODE = #factoryCode#, <!-- 厂区编码 -->
FACTORY_NAME = #factoryName#, <!-- 厂区名称 -->
FACTORY_NAME = #factoryName#, <!-- 工厂 -->
GROUP_CODE = #groupCode#, <!-- 组编码 -->
GROUP_NAME = #groupName#, <!-- 组名称 -->
GROUP_TYPE = #groupType#, <!-- 组类型 -->
......@@ -181,7 +181,7 @@
<select id="queryComboBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName" <!-- 厂区名称 -->
FACTORY_NAME as "factoryName" <!-- 工厂 -->
FROM ${hpjxSchema}.T_HPPZ011
WHERE DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="companyCode">
......@@ -213,7 +213,7 @@
<select id="queryComboBoxAll" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
A.FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
A.FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
A.FACTORY_NAME as "factoryName", <!-- 工厂 -->
A.GROUP_CODE as "groupCode", <!-- 组编码 -->
B.ORG_CNAME as "groupName" <!-- 组名称 -->
FROM ${hpjxSchema}.T_HPPZ011 A, ${platSchema}.TXSOG01 B
......
......@@ -190,4 +190,28 @@
ID = #id#
</update>
<select id="queryDomainById" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ015">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
TEMPLATE_CODE as "templateCode", <!-- 产品代码 -->
TEMPLATE_NAME as "templateName", <!-- 产品名称 -->
REMARK as "remark", <!-- 备注 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0:否1.是 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_TIME as "updatedTime", <!-- 修改人名称 -->
UPDATED_NAME as "updatedName" <!-- 修改时间 -->
FROM ${hpjxSchema}.T_HPPZ015 WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
</select>
</sqlMap>
......@@ -217,14 +217,76 @@
</insert>
<insert id="insertMb" parameterClass="java.util.HashMap">
INSERT INTO hpjx.t_hppz015a (
SELECT * FROM hpjx.t_hpsc002 WHERE PROJ_CODE=#projCode# AND COMPANY_CODE=#companyCode#
INSERT INTO hpjx.t_hppz015a(
ID,
COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 预留 -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
PARENT_ID, <!-- 父节点-部件编码 -->
PARENT_PRDT_NAME, <!-- 父节点-部件名称 -->
TYPE, <!-- 类别 -->
LEAF, <!-- 是否有叶子节点 -->
SORT, <!-- 排序字段 -->
ICON, <!-- 图片地址 -->
PRDT_TYPE,
PRDT_CODE, <!-- 部件编码 -->
PRDT_NAME, <!-- 部件名称 -->
INVENT_RECORD_ID, <!-- 存货档案ID -->
NUM, <!-- 数量 -->
UNIT_WT, <!-- 单重 -->
TOTAL_WT, <!-- 总重 -->
STATUS, <!-- 状态 0-未提交,1-已提交 -->
DEL_STATUS, <!-- 状态 1未删除,0已删除 -->
CREATED_BY, <!-- 创建人 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_TIME, <!-- 更新时间 -->
REMARK, <!-- 备注 -->
LV,
SPEC,
LENGTH, <!-- 长 -->
WIDTH, <!-- 宽 -->
THICK <!-- 厚 -->
)(
SELECT
ID,
COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 预留 -->
PROJ_CODE, <!-- 项目编码 -->
#templateName# as PROJ_NAME, <!-- 项目名称 -->
PARENT_ID, <!-- 父节点-部件编码 -->
CASE WHEN LEAF='0' THEN #templateName# ELSE PARENT_PRDT_NAME END as PARENT_PRDT_NAME, <!-- 父节点-部件名称 -->
TYPE, <!-- 类别 -->
LEAF, <!-- 是否有叶子节点 -->
SORT, <!-- 排序字段 -->
ICON, <!-- 图片地址 -->
PRDT_TYPE,
PRDT_CODE, <!-- 部件编码 -->
CASE WHEN PRDT_CODE=PROJ_CODE THEN #templateName# ELSE PRDT_NAME END as PRDT_NAME, <!-- 部件名称 -->
INVENT_RECORD_ID, <!-- 存货档案ID -->
NUM, <!-- 数量 -->
UNIT_WT, <!-- 单重 -->
TOTAL_WT, <!-- 总重 -->
STATUS, <!-- 状态 0-未提交,1-已提交 -->
DEL_STATUS, <!-- 状态 1未删除,0已删除 -->
CREATED_BY, <!-- 创建人 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_TIME, <!-- 更新时间 -->
REMARK, <!-- 备注 -->
LV,
SPEC,
LENGTH, <!-- 长 -->
WIDTH, <!-- 宽 -->
THICK <!-- 厚 -->
FROM hpjx.t_hpsc002 WHERE PROJ_CODE=#projCode# AND COMPANY_CODE=#companyCode#
)
</insert>
<!-- 删除 -->
<delete id="delete">
DELETE FROM hpjx.t_hppz015a WHERE ID = #id#
DELETE FROM hpjx.t_hppz015a WHERE PROJ_CODE = #projCode#
</delete>
<update id="update">
......@@ -390,6 +452,7 @@
<select id="queryById" parameterClass="java.util.HashMap" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ015A">
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
......@@ -409,7 +472,7 @@
WIDTH as "width", <!-- 宽 -->
THICK as "thick" <!-- 厚 -->
FROM hpjx.t_hppz015a
WHERE 1=1 AND PROJ_CODE=#projCode#
WHERE 1=1 AND PROJ_CODE=#projCode# AND PARENT_ID NOT IN('root')
</select>
</sqlMap>
......@@ -7,6 +7,7 @@ import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.pz.domain.*;
import com.baosight.hpjx.hp.sc.domain.HPSC001;
import com.baosight.hpjx.hp.sc.domain.HPSC002;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.hp.pz.domain.*;
......@@ -70,7 +71,7 @@ public class HPPZTools {
* @return
*/
public static HPPZ011 getByName(String factoryName) {
AssertUtils.isEmpty(factoryName, "厂区名称不能为空");
AssertUtils.isEmpty(factoryName, "工厂不能为空");
Map queryMap = new HashMap();
queryMap.put("factoryName", factoryName);
List<HPPZ011> dbPz011s = DaoBase.getInstance().query(HPSqlConstant.HPPZ011.GET, queryMap);
......@@ -78,7 +79,7 @@ public class HPPZTools {
}
/**
* 查询厂区名称
* 查询工厂
*
* @param factoryCode
* @return
......@@ -606,6 +607,24 @@ public class HPPZTools {
}
}
public static class HpPz015 {
/**
* 查询
*
* @param prdtCode
* @return
*/
public static HPPZ015 getByPrdt(String prdtCode) {
AssertUtils.isEmpty(prdtCode, "部件编码不能为空");
Map queryMap = new HashMap();
queryMap.put("prdtCode", prdtCode);
List<HPPZ015> results = DaoBase.getInstance().query("HPPZ015.query", queryMap);
AssertUtils.isNull(results, String.format("部件编码[%s]信息不存在", prdtCode));
return results.get(0);
}
}
/**
* HPSC002公共DAO定义
*
......@@ -670,48 +689,47 @@ public class HPPZTools {
* @param hppz015AList
* @return
*/
public static void chekParentId(List<HPPZ015A> hppz015AList) {
public static void chekParentId(List<HPPZ015A> hppz015AList,HPSC001 hpsc001) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
Long root = null;
Long prdtId = null;
Long prdtId_new = null;
//处理root
for (int i = 0; i<hppz015AList.size(); i++) {
if(hppz015AList.get(i).getLv().equals("1")){
HPSC002 hpsc002 = new HPSC002();
hpsc002.fromMap(hppz015AList.get(i).toMap());
hpsc002.setCreatedName(UserSession.getUserId());
hpsc002.setUpdatedTime(sdf.format(new Date()));
hpsc002.setStatus(CommonConstant.YesNo.NO_0);
hpsc002.setDelStatus(CommonConstant.YesNo.NO_0);
DaoBase.getInstance().insert("HPSC002.insert", hpsc002);
HPSC002 byProjCode = HPSCTools.HpSc002.getByProjCode(hpsc002.getProjCode());
root=byProjCode.getId();
break;
}
}
HPSC002 hpsc002ById = HPSCTools.HpSc002.getByTree3(hpsc001.getProjCode(),null);
root=hpsc002ById.getId();
//处理部件
for (int i = 0; i<hppz015AList.size(); i++) {
if(hppz015AList.get(i).getLv().equals("2")){
if(hppz015AList.get(i).getLv()==2){
prdtId=hppz015AList.get(i).getId();//旧
HPSC002 hpsc002 = new HPSC002();
hpsc002.setParentId(root.toString());
hpsc002.fromMap(hppz015AList.get(i).toMap());
hpsc002.setId(null);
hpsc002.setParentId(root.toString());
hpsc002.setCreatedName(UserSession.getUserId());
hpsc002.setUpdatedTime(sdf.format(new Date()));
hpsc002.setCreatedTime(sdf.format(new Date()));
hpsc002.setProjCode(hpsc001.getProjCode());
hpsc002.setProjName(hpsc001.getProjName());
hpsc002.setParentPrdtName(hpsc001.getProjName());
hpsc002.setStatus(CommonConstant.YesNo.NO_0);
hpsc002.setDelStatus(CommonConstant.YesNo.NO_0);
DaoBase.getInstance().insert("HPSC002.insert", hpsc002);
HPSC002 byProjCode = HPSCTools.HpSc002.getByProjCode(hpsc002.getProjCode());
HPSC002 byProjCode;
if (prdtId_new!=null)
byProjCode = HPSCTools.HpSc002.getByTree2(hpsc002.getProjCode(), prdtId_new.toString());
else byProjCode = HPSCTools.HpSc002.getByTree2(hpsc002.getProjCode(), null);
prdtId_new=byProjCode.getId();
for (int j = 0; j<hppz015AList.size(); j++) {
if(hppz015AList.get(i).getLv().equals("3")) {
if(hppz015AList.get(j).getParentId().equals(prdtId)){
if(hppz015AList.get(j).getLv()==3) {
if(Long.parseLong(hppz015AList.get(j).getParentId())==prdtId){
HPSC002 hpsc002_lv = new HPSC002();
hpsc002_lv.fromMap(hppz015AList.get(j).toMap());
hpsc002_lv.setId(null);
hpsc002_lv.setParentId(prdtId_new.toString());
hpsc002_lv.fromMap(hppz015AList.get(i).toMap());
hpsc002_lv.setCreatedName(UserSession.getUserId());
hpsc002_lv.setUpdatedTime(sdf.format(new Date()));
hpsc002_lv.setProjCode(hpsc001.getProjCode());
hpsc002_lv.setProjName(hpsc001.getProjName());
hpsc002_lv.setCreatedTime(sdf.format(new Date()));
hpsc002_lv.setStatus(CommonConstant.YesNo.NO_0);
hpsc002_lv.setDelStatus(CommonConstant.YesNo.NO_0);
DaoBase.getInstance().insert("HPSC002.insert", hpsc002_lv);
......
......@@ -51,7 +51,7 @@ public class HPSC005 extends DaoEPBase {
public static final String FIELD_UNASSIGNED_NUM = "unassignedNum"; /* 待派工数量*/
public static final String FIELD_STATUS = "status"; /* 状态:0.计划中,1.不分派工,2.全部派工*/
public static final String FIELD_FACTORY_CODE = "factoryCode"; /* 厂区编码*/
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 厂区名称*/
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 工厂*/
public static final String FIELD_ORG_NO = "orgNo"; /* 生产组编码*/
public static final String FIELD_ORG_NAME = "orgName"; /* 生产组名称*/
public static final String FIELD_DOCUMENT_TYPE = "documentType"; /* 单据类型 0-非子母单;1-子母单*/
......@@ -100,7 +100,7 @@ public class HPSC005 extends DaoEPBase {
public static final String COL_UNASSIGNED_NUM = "UNASSIGNED_NUM"; /* 待派工数量*/
public static final String COL_STATUS = "STATUS"; /* 状态:0.计划中,1.不分派工,2.全部派工*/
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 厂区编码*/
public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 厂区名称*/
public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 工厂*/
public static final String COL_ORG_NO = "ORG_NO"; /* 生产组编码*/
public static final String COL_ORG_NAME = "ORG_NAME"; /* 生产组名称*/
public static final String COL_DOCUMENT_TYPE = "DOCUMENT_TYPE"; /* 单据类型 0-非子母单;1-子母单*/
......@@ -153,7 +153,7 @@ public class HPSC005 extends DaoEPBase {
private BigDecimal unassignedNum = new BigDecimal("0"); /* 待派工数量*/
private Integer status; /* 状态:0.计划中,1.不分派工,2.全部派工*/
private String factoryCode = " "; /* 厂区编码*/
private String factoryName = " "; /* 厂区名称*/
private String factoryName = " "; /* 工厂*/
private String orgNo = " "; /* 生产组编码*/
private String orgName = " "; /* 生产组名称*/
private Integer documentType; /* 单据类型 0-非子母单;1-子母单*/
......@@ -326,7 +326,7 @@ public class HPSC005 extends DaoEPBase {
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_NAME);
eiColumn.setDescName("厂区名称");
eiColumn.setDescName("工厂");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ORG_NO);
......@@ -858,7 +858,7 @@ public class HPSC005 extends DaoEPBase {
this.factoryCode = factoryCode;
}
/**
* get the factoryName - 厂区名称.
* get the factoryName - 工厂.
* @return the factoryName
*/
public String getFactoryName() {
......@@ -866,9 +866,9 @@ public class HPSC005 extends DaoEPBase {
}
/**
* set the factoryName - 厂区名称.
* set the factoryName - 工厂.
*
* @param factoryName - 厂区名称
* @param factoryName - 工厂
*/
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
......
......@@ -33,7 +33,7 @@ public class HPSC005A extends DaoEPBase {
public static final String FIELD_ORG_NO = "orgNo"; /* 生产组编码*/
public static final String FIELD_ORG_NAME = "orgName"; /* 生产组名称*/
public static final String FIELD_FACTORY_CODE = "factoryCode"; /* 厂区编码*/
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 厂区名称*/
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 工厂*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
......@@ -52,7 +52,7 @@ public class HPSC005A extends DaoEPBase {
public static final String COL_ORG_NO = "ORG_NO"; /* 生产组编码*/
public static final String COL_ORG_NAME = "ORG_NAME"; /* 生产组名称*/
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 厂区编码*/
public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 厂区名称*/
public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 工厂*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
......@@ -77,7 +77,7 @@ public class HPSC005A extends DaoEPBase {
private String orgNo = " "; /* 生产组编码*/
private String orgName = " "; /* 生产组名称*/
private String factoryCode = " "; /* 厂区编码*/
private String factoryName = " "; /* 厂区名称*/
private String factoryName = " "; /* 工厂*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
......@@ -146,7 +146,7 @@ public class HPSC005A extends DaoEPBase {
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_NAME);
eiColumn.setDescName("厂区名称");
eiColumn.setDescName("工厂");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
......@@ -360,7 +360,7 @@ public class HPSC005A extends DaoEPBase {
this.factoryCode = factoryCode;
}
/**
* get the factoryName - 厂区名称.
* get the factoryName - 工厂.
* @return the factoryName
*/
public String getFactoryName() {
......@@ -368,9 +368,9 @@ public class HPSC005A extends DaoEPBase {
}
/**
* set the factoryName - 厂区名称.
* set the factoryName - 工厂.
*
* @param factoryName - 厂区名称
* @param factoryName - 工厂
*/
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
......
......@@ -51,7 +51,7 @@ public class HPSC005C extends DaoEPBase {
public static final String FIELD_UNASSIGNED_NUM = "unassignedNum"; /* 待派工数量*/
public static final String FIELD_STATUS = "status"; /* 状态:0.计划中,1.不分派工,2.全部派工*/
public static final String FIELD_FACTORY_CODE = "factoryCode"; /* 厂区编码*/
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 厂区名称*/
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 工厂*/
public static final String FIELD_ORG_NO = "orgNo"; /* 生产组编码*/
public static final String FIELD_ORG_NAME = "orgName"; /* 生产组名称*/
public static final String FIELD_DOCUMENT_TYPE = "documentType"; /* 单据类型 0-非子母单;1-子母单*/
......@@ -102,7 +102,7 @@ public class HPSC005C extends DaoEPBase {
public static final String COL_UNASSIGNED_NUM = "UNASSIGNED_NUM"; /* 待派工数量*/
public static final String COL_STATUS = "STATUS"; /* 状态:0.计划中,1.不分派工,2.全部派工*/
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 厂区编码*/
public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 厂区名称*/
public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 工厂*/
public static final String COL_ORG_NO = "ORG_NO"; /* 生产组编码*/
public static final String COL_ORG_NAME = "ORG_NAME"; /* 生产组名称*/
public static final String COL_DOCUMENT_TYPE = "DOCUMENT_TYPE"; /* 单据类型 0-非子母单;1-子母单*/
......@@ -155,7 +155,7 @@ public class HPSC005C extends DaoEPBase {
private BigDecimal unassignedNum = new BigDecimal("0"); /* 待派工数量*/
private Integer status; /* 状态:0.计划中,1.不分派工,2.全部派工*/
private String factoryCode = " "; /* 厂区编码*/
private String factoryName = " "; /* 厂区名称*/
private String factoryName = " "; /* 工厂*/
private String orgNo = " "; /* 生产组编码*/
private String orgName = " "; /* 生产组名称*/
private Boolean documentType; /* 单据类型 0-非子母单;1-子母单*/
......@@ -331,7 +331,7 @@ public class HPSC005C extends DaoEPBase {
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_NAME);
eiColumn.setDescName("厂区名称");
eiColumn.setDescName("工厂");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ORG_NO);
......@@ -884,7 +884,7 @@ public class HPSC005C extends DaoEPBase {
this.factoryCode = factoryCode;
}
/**
* get the factoryName - 厂区名称.
* get the factoryName - 工厂.
* @return the factoryName
*/
public String getFactoryName() {
......@@ -892,9 +892,9 @@ public class HPSC005C extends DaoEPBase {
}
/**
* set the factoryName - 厂区名称.
* set the factoryName - 工厂.
*
* @param factoryName - 厂区名称
* @param factoryName - 工厂
*/
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
......
......@@ -45,7 +45,7 @@ public class HPSC006 extends DaoEPBase {
public static final String FIELD_ORG_NO = "orgNo"; /* 生产组编码*/
public static final String FIELD_ORG_NAME = "orgName"; /* 生产组名称*/
public static final String FIELD_FACTORY_CODE = "factoryCode"; /* 厂区编码*/
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 厂区名称*/
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 工厂*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 更新人*/
......@@ -87,7 +87,7 @@ public class HPSC006 extends DaoEPBase {
public static final String COL_ORG_NO = "ORG_NO"; /* 生产组编码*/
public static final String COL_ORG_NAME = "ORG_NAME"; /* 生产组名称*/
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 厂区编码*/
public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 厂区名称*/
public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 工厂*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/
......@@ -133,7 +133,7 @@ public class HPSC006 extends DaoEPBase {
private String orgNo = " "; /* 生产组编码*/
private String orgName = " "; /* 生产组名称*/
private String factoryCode = " "; /* 厂区编码*/
private String factoryName = " "; /* 厂区名称*/
private String factoryName = " "; /* 工厂*/
private String createdBy = " "; /* 创建人*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
......@@ -273,7 +273,7 @@ public class HPSC006 extends DaoEPBase {
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_NAME);
eiColumn.setDescName("厂区名称");
eiColumn.setDescName("工厂");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
......@@ -705,7 +705,7 @@ public class HPSC006 extends DaoEPBase {
this.factoryCode = factoryCode;
}
/**
* get the factoryName - 厂区名称.
* get the factoryName - 工厂.
* @return the factoryName
*/
public String getFactoryName() {
......@@ -713,9 +713,9 @@ public class HPSC006 extends DaoEPBase {
}
/**
* set the factoryName - 厂区名称.
* set the factoryName - 工厂.
*
* @param factoryName - 厂区名称
* @param factoryName - 工厂
*/
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
......
package com.baosight.hpjx.hp.xs.domain;
package com.baosight.hpjx.hp.sc.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal;
......@@ -18,7 +18,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
* @version 1.0
* @history 2024-03-07 17:21:17 create
*/
public class HPXS001 extends DaoEPBase {
public class HPSC008 extends DaoEPBase {
private static final long serialVersionUID = 1L;
......@@ -62,11 +62,11 @@ public class HPXS001 extends DaoEPBase {
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 修改人名称*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 修改时间*/
public static final String QUERY = "HPXS001.query";
public static final String COUNT = "HPXS001.count";
public static final String INSERT = "HPXS001.insert";
public static final String UPDATE = "HPXS001.update";
public static final String DELETE = "HPXS001.delete";
public static final String QUERY = "HPSC008.query";
public static final String COUNT = "HPSC008.count";
public static final String INSERT = "HPSC008.insert";
public static final String UPDATE = "HPSC008.update";
public static final String DELETE = "HPSC008.delete";
private Long id = new Long(0); /* ID*/
private String companyCode = " "; /* 企业编码 预留*/
......@@ -180,7 +180,7 @@ public class HPXS001 extends DaoEPBase {
/**
* the constructor.
*/
public HPXS001() {
public HPSC008() {
initMetaData();
}
......
......@@ -11,7 +11,7 @@ import java.util.Map;
public class HPSC098 extends DaoEPBase {
private String factoryCode = " "; /* 厂区编码*/
private String factoryName = " "; /* 厂区名称*/
private String factoryName = " "; /* 工厂*/
private String groupCode = " "; /* 组织编码*/
private String groupName = " "; /* 组织名称 */
/**
......@@ -24,7 +24,7 @@ public class HPSC098 extends DaoEPBase {
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("factoryName");
eiColumn.setDescName("厂区名称");
eiColumn.setDescName("工厂");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("groupCode");
......
......@@ -3,20 +3,24 @@ package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.ds.domain.HPDS002;
import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.hp.pz.domain.HPPZ015;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.domain.*;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.util.*;
import com.baosight.iplat4j.core.ProjectInfo;
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.service.impl.ServiceBase;
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;
......@@ -75,6 +79,28 @@ public class ServiceHPSC002 extends ServiceBase {
}
/**
* 查询操作物料清单选择校验.
*/
@OperationLogAnnotation(operModul = "物料清单",operType = "查询",operDesc = "查询")
public EiInfo count(EiInfo inInfo) {
try {
HashMap map = new HashMap();
HPSC001 hpsc001 = HPSCTools.HpSc001.getId(inInfo.getString("id"));
map.put("projCode",hpsc001.getProjCode());
List<HPSC002> results = this.dao.query("HPSC002.queryTree", map);
if (results.size()>1){
inInfo.setStatus(0);
}else{
inInfo.setStatus(1);
inInfo.set("projCode",hpsc001.getProjCode());
}
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
......@@ -633,7 +659,7 @@ public class ServiceHPSC002 extends ServiceBase {
DaoUtils.update("HPSC002.check",map2);
//处理项目管理中物料状态
HPSCTools.updateProjStatus(hppz002.getProjCode());
HPSCTools.updateProjStatus(THPSC002.getProjCode());
}
} catch (PlatException e) {
......@@ -758,7 +784,31 @@ public class ServiceHPSC002 extends ServiceBase {
if (list.size() > 0) {
for (HPDS002 hpds002: list) {
String realPath = hpds002.getRealPath();
FileUtils.deleteFile(realPath);
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
EiInfo queryInfo = new EiInfo();
queryInfo.set(HPSC002A.FIELD_DOC_ID,hpds002.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(HPDS002.DELETE,map);
}
......
......@@ -16,6 +16,7 @@ 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.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import org.apache.commons.collections.CollectionUtils;
import java.io.File;
......@@ -146,7 +147,31 @@ public class ServiceHPSC002A extends ServiceEPBase {
List<HPDS002> list = this.dao.query(HPDS002.QUERY,map);
if (list.size() > 0) {
String realPath = list.get(0).getRealPath();
FileUtils.deleteFile(realPath);
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
EiInfo queryInfo = new EiInfo();
queryInfo.set(HPSC002A.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(HPDS002.DELETE,map);
}
......
......@@ -269,7 +269,7 @@ public class ServiceHPSC005A extends ServiceBase {
* @param fSc005a
*/
private void setBaseInfo(HPSC005A fSc005a) {
// 厂区名称
// 工厂
fSc005a.setFactoryName(HPXSTools.XsOrg.get(fSc005a.getFactoryCode()).getOrgCname());
// 生产组名称
fSc005a.setOrgName(HPXSTools.XsOrg.get(fSc005a.getOrgNo()).getOrgCname());
......
......@@ -17,11 +17,13 @@ import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.hp.xs.domain.Org;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.*;
import com.baosight.iplat4j.core.ProjectInfo;
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.service.impl.ServiceBase;
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.lang.StringUtils;
......@@ -326,7 +328,31 @@ public class ServiceHPSC006 extends ServiceBase {
if (list.size() > 0) {
for (HPDS002 hpds002: list) {
String realPath = hpds002.getRealPath();
FileUtils.deleteFile(realPath);
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
EiInfo queryInfo = new EiInfo();
queryInfo.set(HPSC002A.FIELD_DOC_ID,hpds002.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(HPDS002.DELETE,map);
}
......
package com.baosight.hpjx.hp.xs.service;
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.sc.domain.HPSC003;
import com.baosight.hpjx.hp.xs.domain.HPXS001;
import com.baosight.hpjx.hp.pz.domain.HPPZ013;
import com.baosight.hpjx.hp.sc.domain.HPSC008;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants;
......@@ -15,10 +15,8 @@ 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.ServiceEPBase;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
......@@ -27,17 +25,24 @@ import java.util.Map;
* @author LiuYang
* @version 1.0 2024/3/7
*/
public class ServiceHPXS001 extends ServiceEPBase {
public class ServiceHPSC008 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
final EiInfo outEiInfo = super.initLoad(inInfo, new HPXS001());
final EiInfo outEiInfo = super.query(inInfo, HPSC008.QUERY, new HPSC008());
final String companyCode = UserSessionUtils.getCompanyCode();
CommonMethod.initBlock(outEiInfo,
Arrays.asList(DdynamicEnum.USER_ID_BLOCK_ID,DdynamicEnum.GROUP_CODE_BLOCK_ID,DdynamicEnum.FACTORY_CODE_BLOCK_ID),
new HashMap<String,Object>(){{put("companyCode",companyCode);}});
outEiInfo.getBlock(EiConstant.resultBlock).getRows().clear();
new HashMap<String,Object>(){{put(HPSC008.FIELD_COMPANY_CODE,companyCode);}}
);
CommonMethod.initBlock(outEiInfo,
Arrays.asList(DdynamicEnum.USER_ID1_BLOCK_ID,DdynamicEnum.GROUP_CODE1_BLOCK_ID,DdynamicEnum.FACTORY_CODE1_BLOCK_ID),
new HashMap<String,Object>(){{
put(HPSC008.FIELD_COMPANY_CODE,companyCode);
put(HPSC008.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
}}
);
//outEiInfo.getBlock(EiConstant.resultBlock).getRows().clear();
return outEiInfo;
}
......@@ -52,32 +57,32 @@ public class ServiceHPXS001 extends ServiceEPBase {
if (!startDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"createdDateFrom",StringUtil.removeHorizontalLine(startDate));
}
return super.query(inInfo,HPXS001.QUERY,new HPXS001());
return super.query(inInfo, HPSC008.QUERY,new HPSC008());
}
@OperationLogAnnotation(operModul = "报工管理",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
return super.delete(inInfo,HPXS001.DELETE);
return super.delete(inInfo, HPSC008.DELETE);
}
@OperationLogAnnotation(operModul = "报工管理",operType = "修改",operDesc = "修改操作")
@Override
public EiInfo update(EiInfo inInfo) {
return super.update(inInfo,HPXS001.UPDATE);
return super.update(inInfo, HPSC008.UPDATE);
}
@OperationLogAnnotation(operModul = "报工管理",operType = "新增",operDesc = "新增操作")
@Override
public EiInfo insert(EiInfo inInfo) {
try {
HPXS001 hpxs001 = new HPXS001();
HPSC008 hpxs001 = new HPSC008();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs001.fromMap(map);
hpxs001.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPXS001.INSERT, hpxs001.toMap());
DaoUtils.insert(HPSC008.INSERT, hpxs001.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
......@@ -96,20 +101,27 @@ public class ServiceHPXS001 extends ServiceEPBase {
public EiInfo queryFactoryCode(EiInfo inInfo) {
final String companyCode = UserSessionUtils.getCompanyCode();
String factoryCode = inInfo.getString("factoryCode");
String factoryCode = inInfo.getString(HPPZ013.FIELD_FACTORY_CODE);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.GROUP_CODE_BLOCK_ID),
new HashMap<String,Object>(){{put("companyCode",companyCode);put("factoryCode",factoryCode);}});
new HashMap<String,Object>(){{
put(HPSC008.FIELD_COMPANY_CODE,companyCode);
put(HPSC008.FIELD_FACTORY_CODE,factoryCode);
}});
return inInfo;
}
public EiInfo queryGroupCode(EiInfo inInfo) {
final String companyCode = UserSessionUtils.getCompanyCode();
String factoryCode = inInfo.getString("factoryCode");
String groupCode = inInfo.getString("groupCode");
String factoryCode = inInfo.getString(HPPZ013.FIELD_FACTORY_CODE);
String groupCode = inInfo.getString(HPSC008.FIELD_GROUP_CODE);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.USER_ID_BLOCK_ID),
new HashMap<String,Object>(){{put("companyCode",companyCode);put("factoryCode",factoryCode);put("groupCode",groupCode);}});
new HashMap<String,Object>(){{
put(HPSC008.FIELD_COMPANY_CODE,companyCode);
put(HPSC008.FIELD_FACTORY_CODE,factoryCode);
put(HPSC008.FIELD_GROUP_CODE,groupCode);
}});
return inInfo;
}
}
......@@ -197,13 +197,27 @@
<select id="queryProjCode" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC001">
SELECT
PROJ_CODE as "projCode"
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
PROJ_TYPE as "projType", <!-- 项目类型 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PRINC1 as "princ1", <!-- 本公司项目负责人 -->
PRINC2 as "princ2", <!-- 客户项目负责人 -->
STATUS as "status", <!-- 状态 0-未提交,1-已提交 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
REMARK as "remark", <!-- 备注 -->
MATERIAL_STATUS as "materialStatus"
FROM hpjx.t_hpsc001 WHERE 1=1
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
</select>
......
......@@ -137,6 +137,12 @@
<isNotEmpty prepend=" AND " property="lv">
A.LV = #lv#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
A.PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
</sql>
<sql id="order">
......@@ -218,6 +224,12 @@
DELETE FROM hpjx.t_hpsc002 WHERE ID = #id#
</delete>
<!-- 删除 -->
<delete id="deleteByPro">
DELETE FROM hpjx.t_hpsc002 WHERE PROJ_CODE = #projCode#
</delete>
<update id="update">
UPDATE hpjx.t_hpsc002
SET
......@@ -290,6 +302,73 @@
ORDER BY CREATED_TIME DESC
</select>
<select id="queryTree2" resultClass="com.baosight.hpjx.hp.sc.domain.HPSC002" >
SELECT
ID as "id",
PRDT_TYPE as "prdtType",
PRDT_CODE as "prdtCode", <!-- 项目编码 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PRDT_name as "prdtName", <!-- 项目编码 -->
PROJ_NAME as "projName",<!-- 项目名称 -->
ID as "label", <!-- 名部件编码-->
PRDT_NAME as "text", <!-- 部件名称 -->
INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID -->
PARENT_ID as "pId", <!-- 父节点编码 -->
TYPE as "type", <!-- 类别 -->
LEAF as "leaf", <!-- 是否有叶子节点 -->
SORT as "sort", <!-- 排序字段 -->
ICON as "icon", <!-- 图片地址 -->
LV as "lv",
SPEC as "spec"
FROM
hpjx.t_hpsc002
WHERE
1=1 AND PARENT_ID NOT IN ('root') AND LV != 3
<isNotEmpty prepend=" AND " property="pEname">
PARENT_ID = #pEname#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="id">
ID != #id#
</isNotEmpty>
ORDER BY CREATED_TIME DESC
</select>
<select id="queryTree3" resultClass="com.baosight.hpjx.hp.sc.domain.HPSC002" >
SELECT
ID as "id",
PRDT_TYPE as "prdtType",
PRDT_CODE as "prdtCode", <!-- 项目编码 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PRDT_name as "prdtName", <!-- 项目编码 -->
PROJ_NAME as "projName",<!-- 项目名称 -->
ID as "label", <!-- 名部件编码-->
PRDT_NAME as "text", <!-- 部件名称 -->
INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID -->
PARENT_ID as "pId", <!-- 父节点编码 -->
TYPE as "type", <!-- 类别 -->
LEAF as "leaf", <!-- 是否有叶子节点 -->
SORT as "sort", <!-- 排序字段 -->
ICON as "icon", <!-- 图片地址 -->
LV as "lv",
SPEC as "spec"
FROM
hpjx.t_hpsc002
WHERE
1=1
<isNotEmpty prepend=" AND " property="pEname">
PARENT_ID = #pEname#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
ORDER BY CREATED_TIME DESC
</select>
<!-- 根据父级ID查询 -->
<select id="queryTreeNodeByParentPrtdCode" resultClass="java.util.HashMap">
SELECT
......@@ -322,6 +401,10 @@
UPDATE hpjx.t_hpsc002 SET LEAF = #leaf# WHERE ID = #id#
</update>
<update id="updateTreeNodeLeaf2">
UPDATE hpjx.t_hpsc002 SET LEAF = #leaf# WHERE PROJ_CODE = #projCode#
</update>
<update id="check">
UPDATE hpjx.t_hpsc002 SET status = #status# WHERE ID = #id#
</update>
......
......@@ -28,7 +28,7 @@
PRDT_CODE LIKE ('%$prdtCode$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtName">
PRDT_NAME = #prdtName#
PRDT_NAME LIKE ('%$prdtName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planCompletionDate">
PLAN_COMPLETION_DATE = #planCompletionDate#
......@@ -106,7 +106,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
STATUS,CREATED_TIME asc
STATUS,CREATED_TIME DESC
</isEmpty>
</dynamic>
......
......@@ -193,7 +193,7 @@
$order$
</isNotEmpty>
<isEmpty property="order">
ID asc
ID DESC
</isEmpty>
</dynamic>
</sql>
......
......@@ -32,7 +32,7 @@
UNASSIGNED_NUM as "unassignedNum", <!-- 待派工数量 -->
STATUS as "status", <!-- 状态:0.计划中,1.不分派工,2.全部派工 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
FACTORY_NAME as "factoryName", <!-- 工厂 -->
ORG_NO as "orgNo", <!-- 生产组编码 -->
ORG_NAME as "orgName", <!-- 生产组名称 -->
DOCUMENT_TYPE as "documentType", <!-- 单据类型 0-非子母单;1-子母单 -->
......@@ -187,7 +187,7 @@
UNASSIGNED_NUM, <!-- 待派工数量 -->
STATUS, <!-- 状态:0.计划中,1.不分派工,2.全部派工 -->
FACTORY_CODE, <!-- 厂区编码 -->
FACTORY_NAME, <!-- 厂区名称 -->
FACTORY_NAME, <!-- 工厂 -->
ORG_NO, <!-- 生产组编码 -->
ORG_NAME, <!-- 生产组名称 -->
DOCUMENT_TYPE, <!-- 单据类型 0-非子母单;1-子母单 -->
......@@ -249,7 +249,7 @@
UNASSIGNED_NUM = #unassignedNum#, <!-- 待派工数量 -->
STATUS = #status#, <!-- 状态:0.计划中,1.不分派工,2.全部派工 -->
FACTORY_CODE = #factoryCode#, <!-- 厂区编码 -->
FACTORY_NAME = #factoryName#, <!-- 厂区名称 -->
FACTORY_NAME = #factoryName#, <!-- 工厂 -->
ORG_NO = #orgNo#, <!-- 生产组编码 -->
ORG_NAME = #orgName#, <!-- 生产组名称 -->
DOCUMENT_TYPE = #documentType#, <!-- 单据类型 0-非子母单;1-子母单 -->
......@@ -274,7 +274,7 @@
STATUS = #status#, <!-- 状态 0-未派工,1-已派工 -->
ORG_NO = #orgNo#, <!-- 生产组编码 -->
FACTORY_CODE = #factoryCode#, <!-- 厂区编码 -->
FACTORY_NAME = #factoryName#, <!-- 厂区名称 -->
FACTORY_NAME = #factoryName#, <!-- 工厂 -->
<include refid="updateRevise"/>
WHERE ID = #id#
</update>
......
......@@ -14,7 +14,7 @@
ORG_NO as "orgNo", <!-- 生产组编码 -->
ORG_NAME as "orgName", <!-- 生产组名称 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
FACTORY_NAME as "factoryName", <!-- 工厂 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
......@@ -90,7 +90,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="order">
ID asc
ID DESC
</isEmpty>
</dynamic>
</sql>
......@@ -123,7 +123,7 @@
ORG_NO, <!-- 生产组编码 -->
ORG_NAME, <!-- 生产组名称 -->
FACTORY_CODE, <!-- 厂区编码 -->
FACTORY_NAME, <!-- 厂区名称 -->
FACTORY_NAME, <!-- 工厂 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME <!-- 创建时间 -->
......
......@@ -32,7 +32,7 @@
B.COMPLETE_NUM as "completeNum", <!-- 完成数量 -->
(B.NUM - B.COMPLETE_NUM) as "unCompleteNum", <!-- 剩余数量 -->
B.FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
B.FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
B.FACTORY_NAME as "factoryName", <!-- 工厂 -->
B.ORG_NO as "orgNo",
B.ORG_NAME as "orgName",
C.PROD_TASK_NO as "zlprodTaskNo"
......
......@@ -42,7 +42,7 @@
PART_WIDTH as "partWidth", <!-- 宽 -->
PART_THICK as "partThick", <!-- 厚 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
FACTORY_NAME as "factoryName", <!-- 工厂 -->
ASSIGNED_NUM as "assignedNum", <!-- 已派工数量 -->
UNASSIGNED_NUM as "unassignedNum", <!-- 待派工数量 -->
DOCUMENT_TYPE as "documentType" <!-- 单据类型 0-非子母单;1-子母单 -->
......@@ -88,7 +88,7 @@
A.PART_WIDTH as "partWidth", <!-- 宽 -->
A.PART_THICK as "partThick", <!-- 厚 -->
A.FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
A.FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
A.FACTORY_NAME as "factoryName", <!-- 工厂 -->
A.ASSIGNED_NUM as "assignedNum", <!-- 已派工数量 -->
A.UNASSIGNED_NUM as "unassignedNum", <!-- 待派工数量 -->
A.DOCUMENT_TYPE as "documentType", <!-- 单据类型 0-非子母单;1-子母单 -->
......@@ -201,7 +201,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
ID DESC
</isEmpty>
</dynamic>
......
......@@ -62,7 +62,7 @@
ORG_NO as "orgNo", <!-- 生产组编码 -->
ORG_NAME as "orgName", <!-- 生产组名称 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
FACTORY_NAME as "factoryName", <!-- 工厂 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
......@@ -178,7 +178,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME asc
CREATED_TIME DESC
</isEmpty>
</dynamic>
</sql>
......@@ -231,7 +231,7 @@
ORG_NO, <!-- 生产组编码 -->
ORG_NAME, <!-- 生产组名称 -->
FACTORY_CODE, <!-- 厂区编码 -->
FACTORY_NAME, <!-- 厂区名称 -->
FACTORY_NAME, <!-- 工厂 -->
CREATED_BY, <!-- 创建人 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
......@@ -279,7 +279,7 @@
ORG_NO = #orgNo#, <!-- 生产组编码 -->
ORG_NAME = #orgName#, <!-- 生产组名称 -->
FACTORY_CODE = #factoryCode#, <!-- 厂区编码 -->
FACTORY_NAME = #factoryName#, <!-- 厂区名称 -->
FACTORY_NAME = #factoryName#, <!-- 工厂 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
......@@ -299,7 +299,7 @@
ORG_NO = #orgNo#, <!-- 生产组编码 -->
ORG_NAME = #orgName#,
FACTORY_CODE = #factoryCode#, <!-- 厂区编码 -->
FACTORY_NAME = #factoryName#, <!-- 厂区名称 -->
FACTORY_NAME = #factoryName#, <!-- 工厂 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE
......
......@@ -62,7 +62,7 @@
ORG_NO as "orgNo", <!-- 生产组编码 -->
ORG_NAME as "orgName", <!-- 生产组名称 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
FACTORY_NAME as "factoryName", <!-- 工厂 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
......@@ -102,7 +102,7 @@
A.ORG_NO as "orgNo", <!-- 生产组编码 -->
A.ORG_NAME as "orgName", <!-- 生产组名称 -->
A.FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
A.FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
A.FACTORY_NAME as "factoryName", <!-- 工厂 -->
A.CREATED_BY as "createdBy", <!-- 创建人 -->
A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 更新人 -->
......@@ -223,7 +223,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
ID DESC
</isEmpty>
</dynamic>
</sql>
......@@ -270,7 +270,7 @@
ORG_NO, <!-- 生产组编码 -->
ORG_NAME, <!-- 生产组名称 -->
FACTORY_CODE, <!-- 厂区编码 -->
FACTORY_NAME, <!-- 厂区名称 -->
FACTORY_NAME, <!-- 工厂 -->
CREATED_BY, <!-- 创建人 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
......@@ -318,7 +318,7 @@
ORG_NO = #orgNo#, <!-- 生产组编码 -->
ORG_NAME = #orgName#, <!-- 生产组名称 -->
FACTORY_CODE = #factoryCode#, <!-- 厂区编码 -->
FACTORY_NAME = #factoryName#, <!-- 厂区名称 -->
FACTORY_NAME = #factoryName#, <!-- 工厂 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
......@@ -338,7 +338,7 @@
ORG_NO = #orgNo#, <!-- 生产组编码 -->
ORG_NAME = #orgName#,
FACTORY_CODE = #factoryCode#, <!-- 厂区编码 -->
FACTORY_NAME = #factoryName#, <!-- 厂区名称 -->
FACTORY_NAME = #factoryName#, <!-- 工厂 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE
......
......@@ -90,7 +90,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
ID DESC
</isEmpty>
</dynamic>
......
......@@ -25,7 +25,7 @@
UPDATED_TIME VARCHAR,
UPDATED_NAME VARCHAR
-->
<sqlMap namespace="HPXS001">
<sqlMap namespace="HPSC008">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
......@@ -94,7 +94,7 @@
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.xs.domain.HPXS001">
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC008">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
......@@ -122,7 +122,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
CREATED_TIME desc
</isEmpty>
</dynamic>
......@@ -265,6 +265,9 @@
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
......@@ -288,6 +291,15 @@
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isEmpty prepend=" AND " property="groupType">
GROUP_TYPE = 'prodGroup'
</isEmpty>
<isNotEmpty prepend=" AND " property="groupType">
GROUP_TYPE = #groupType#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
......@@ -315,6 +327,15 @@
<isNotEmpty prepend=" AND " property="groupCode">
GROUP_CODE = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isEmpty prepend=" AND " property="groupType">
GROUP_TYPE = 'prodGroup'
</isEmpty>
<isNotEmpty prepend=" AND " property="groupType">
GROUP_TYPE = #groupType#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
......
......@@ -263,6 +263,54 @@ public class HPSCTools {
AssertUtils.isNull(results, String.format("项目编码[%s]信息不存在", projCode));
return results.get(0);
}
/**
* 查询
*
* @param projCode
* @return
*/
public static HPSC002 getByTree(String projCode) {
AssertUtils.isEmpty(projCode, "项目编码不能为空");
Map queryMap = new HashMap();
queryMap.put("projCode", projCode);
List<HPSC002> results = DaoBase.getInstance().query("HPSC002.queryTree", queryMap);
AssertUtils.isNull(results, String.format("项目编码[%s]信息不存在", projCode));
return results.get(0);
}
/**
* 查询
*
* @param projCode
* @return
*/
public static HPSC002 getByTree2(String projCode,String id) {
AssertUtils.isEmpty(projCode, "项目编码不能为空");
Map queryMap = new HashMap();
queryMap.put("projCode", projCode);
queryMap.put("id", id);
List<HPSC002> results = DaoBase.getInstance().query("HPSC002.queryTree2", queryMap);
AssertUtils.isNull(results, String.format("项目编码[%s]信息不存在", projCode));
return results.get(0);
}
/**
* 查询
*
* @param projCode
* @return
*/
public static HPSC002 getByTree3(String projCode,String id) {
AssertUtils.isEmpty(projCode, "项目编码不能为空");
Map queryMap = new HashMap();
queryMap.put("projCode", projCode);
queryMap.put("id", id);
List<HPSC002> results = DaoBase.getInstance().query("HPSC002.queryTree3", queryMap);
AssertUtils.isNull(results, String.format("项目编码[%s]信息不存在", projCode));
return results.get(0);
}
/**
* 查询节点
......
......@@ -127,8 +127,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
A.COMPANY_CODE asc,
A.CREATED_TIME asc
A.CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
......
......@@ -118,7 +118,7 @@
<!-- 查询子集组信息,包括生产组和下料组(递归) -->
<select id="queryGroupComboBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
T2.LEVEL AS "level", T3.ORG_ID AS "orgId", T3.ORG_CNAME AS "orgCname",
T2.LEVEL AS "level", T3.ORG_ID AS "orgId", CONCAT('[',T5.FACTORY_NAME,']',T3.ORG_CNAME) AS "orgCname",
T3.FACTORY_CODE AS "factoryCode", T5.FACTORY_NAME AS "factoryName"
FROM (
SELECT
......
......@@ -49,7 +49,7 @@ public class HPZL001 extends DaoEPBase {
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除*/
public static final String FIELD_FACTORY_CODE = "factoryCode"; /* 厂区编码*/
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 厂区名称*/
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 工厂*/
public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
......@@ -79,7 +79,7 @@ public class HPZL001 extends DaoEPBase {
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除*/
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 厂区编码*/
public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 厂区名称*/
public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 工厂*/
public static final String QUERY = "HPZL001.query";
public static final String COUNT = "HPZL001.count";
......@@ -115,7 +115,7 @@ public class HPZL001 extends DaoEPBase {
private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag; /* 是否删除*/
private String factoryCode = " "; /* 厂区编码*/
private String factoryName = " "; /* 厂区名称*/
private String factoryName = " "; /* 工厂*/
/**
* initialize the metadata.
......@@ -237,7 +237,7 @@ public class HPZL001 extends DaoEPBase {
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_NAME);
eiColumn.setDescName("厂区名称");
eiColumn.setDescName("工厂");
eiMetadata.addMeta(eiColumn);
......@@ -699,7 +699,7 @@ public class HPZL001 extends DaoEPBase {
this.factoryCode = factoryCode;
}
/**
* get the factoryName - 厂区名称.
* get the factoryName - 工厂.
* @return the factoryName
*/
public String getFactoryName() {
......@@ -707,9 +707,9 @@ public class HPZL001 extends DaoEPBase {
}
/**
* set the factoryName - 厂区名称.
* set the factoryName - 工厂.
*
* @param factoryName - 厂区名称
* @param factoryName - 工厂
*/
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
......
......@@ -13,7 +13,7 @@
PROJ_CODE as "projCode", <!-- 项目号 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
FACTORY_NAME as "factoryName", <!-- 工厂 -->
INVENT_CODE as "inventCode", <!-- 部件编码 -->
INVENT_NAME as "inventName", <!-- 部件名称 -->
SUB_INVENT_CODE as "subInventCode", <!-- 零件编码 -->
......@@ -141,7 +141,7 @@
SUB_INVENT_CODE, <!-- 零件编码 -->
SUB_INVENT_NAME, <!-- 零件名称 -->
FACTORY_CODE, <!-- 厂区编码 -->
FACTORY_NAME, <!-- 厂区名称 -->
FACTORY_NAME, <!-- 工厂 -->
ORG_NO, <!-- 生产组编码 -->
ORG_NAME, <!-- 生产组名称 -->
POOR_TYPE, <!-- 不良品类 -->
......
......@@ -29,9 +29,9 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFInput ename="inqu_result-0-hpsc006Id" type="hidden"/>
<EF:EFGrid blockId="result" autoDraw="override" autoFit="true" checkMode="row">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="id" cname="库存ID" enable="false" width="60" align="center" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="10" align="center">
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="100" align="center">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" />
</EF:EFComboColumn>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="100" align="center"
......@@ -42,7 +42,7 @@
blockName="invent_name_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventRecordId" cname="规格" enable="false" width="100" align="center"
<EF:EFComboColumn ename="inventRecordId" cname="规格" enable="false" width="150" align="center"
blockName="invent_spec_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
......@@ -51,7 +51,7 @@
<EF:EFOptions blockId="proj_record_block_id" valueField="valueField" textField="textField" />
</EF:EFComboColumn>
<EF:EFColumn ename="applyAmount" cname="申请数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFColumn ename="applyRemark" cname="申请说明" width="300" editType="textarea" copy="true"/>
<EF:EFColumn ename="applyRemark" cname="申请说明" width="200" editType="textarea" copy="true"/>
<EF:EFColumn ename="amount" cname="库存数量" enable="false" width="120" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="unitWeight" cname="单量(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
......
......@@ -42,7 +42,7 @@
blockName="invent_name_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventRecordId" cname="规格(MM)" enable="false" width="100" align="center"
<EF:EFComboColumn ename="inventRecordId" cname="规格(MM)" enable="false" width="150" align="center"
blockName="invent_spec_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
......@@ -53,7 +53,7 @@
<EF:EFColumn ename="unitWeight" cname="单量(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="库存重量(KG)" enable="false" width="120" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150" type="hidden"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -11,18 +11,21 @@
<div class="row">
<%-- <EF:EFInput cname="生产订单号" ename="prodOrderNo" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="生产任务号" ename="prodTaskNo" blockId="inqu_status" row="0" colWidth="3"/>--%>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="部件名称" ename="prdtName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="零件名称" ename="partName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" enable="false" width="110" align="center">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="4"/>
<EF:EFInput cname="部件名称" ename="prdtName" blockId="inqu_status" row="0" colWidth="4"/>
<EF:EFInput cname="零件名称" ename="partName" blockId="inqu_status" row="0" colWidth="4"/>
</div>
<div class="row">
<EF:EFSelect cname="工厂" blockId="inqu_status" ename="factoryCode" row="0" colWidth="4" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<%--<EF:EFInput cname="生产组名称" ename="orgName" blockId="inqu_status" row="0" colWidth="3"/>--%>
<EF:EFComboColumn ename="groupCode" cname="生产组" enable="false" width="110" align="center">
<EF:EFOptions blockId="group_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFSelect cname="生产组" blockId="inqu_status" ename="groupCode" row="0" colWidth="4" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</div>
</EF:EFRegion>
......@@ -47,7 +50,7 @@
<EF:EFColumn ename="unCompleteNum" cname="待入库数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="num" cname="任务数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="totalWt" cname="任务重量(T)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="factoryName" cname="厂区名称" enable="false" width="150" align="center"/>
<EF:EFColumn ename="factoryName" cname="工厂" enable="false" width="150" align="center"/>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" width="150" align="center"/>
<%-- <EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
<EF:EFColumn ename="projCode" cname="项目号" enable="false" width="140" align="center"/>
......
......@@ -24,7 +24,7 @@
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" autoFit="true" checkMode="row">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="id" cname="库存ID" enable="false" width="60" align="center" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="100" align="center">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('2')"/>
......@@ -37,7 +37,7 @@
blockName="invent_name_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventRecordId" cname="规格" enable="false" width="120" align="center"
<EF:EFComboColumn ename="inventRecordId" cname="规格" enable="false" width="150" align="center"
blockName="invent_spec_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
......@@ -46,13 +46,13 @@
<EF:EFOptions blockId="proj_record_block_id" valueField="valueField" textField="textField" />
</EF:EFComboColumn>
<EF:EFColumn ename="applyAmount" cname="申请数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFColumn ename="applyRemark" cname="申请说明" width="150" editType="textarea" copy="true"/>
<EF:EFColumn ename="applyRemark" cname="申请说明" width="200" editType="textarea" copy="true"/>
<EF:EFColumn ename="amount" cname="库存数量" enable="false" width="120" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="unitWeight" cname="单量(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="库存重量(KG)" enable="false" width="120" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150" hidden="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -52,7 +52,7 @@ $(function () {
* 页面加载时执行
*/
$(window).load(function () {
// 厂区名称
// 工厂
let inInfo = new EiInfo();
EiCommunicator.send("HPPZ011", "queryComboBox", inInfo, {
onSuccess: function (ei) {
......@@ -87,7 +87,7 @@ let save = function () {
let groupCode= item.get("groupCode");
let groupType= item.get("groupType");
if(factoryName===""){
message("选中的第"+(index+1)+"行\"厂区名称\",不能为空!");
message("选中的第"+(index+1)+"行\"工厂\",不能为空!");
flag = false;
return false;
}
......
......@@ -8,7 +8,7 @@
<EF:EFPage title="厂区管理">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="厂区名称" ename="factoryName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="工厂" ename="factoryName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect cname="生产组名称" ename="groupCode" blockId="inqu_status" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/>
......@@ -20,11 +20,11 @@
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="factoryCode" cname="厂区编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="factoryName" cname="厂区名称" width="120" align="center" required="true"/>
<%-- <EF:EFPopupColumn ename="factoryName" cname="厂区名称" width="120" popupType="ServiceGrid"--%>
<EF:EFColumn ename="factoryName" cname="工厂" width="120" align="center" required="true"/>
<%-- <EF:EFPopupColumn ename="factoryName" cname="工厂" width="120" popupType="ServiceGrid"--%>
<%-- popupTitle="厂区列表" serviceName="HPPZ011" methodName="queryComboBox"--%>
<%-- resultId="factory_record_block_id"--%>
<%-- columnEnames="valueField,textField" columnCnames="厂区代码,厂区名称"--%>
<%-- columnEnames="valueField,textField" columnCnames="厂区代码,工厂"--%>
<%-- backFillColumnIds="valueField,textField" backFillFieldIds="factoryCode,factoryName"--%>
<%-- valueField="textField" textField="textField" required="true"/>--%>
<EF:EFComboColumn ename="groupCode" cname="生产组名称" width="120" align="center"
......
......@@ -22,10 +22,10 @@
<EF:EFColumn ename="projCode" cname="项目编码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="120" align="center"/>
<EF:EFColumn ename="templateName" cname="模板名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="createdBy" enable="false" cname="创建人"/>
<EF:EFColumn ename="createdTime" dateFormat="yyyy-MM-dd HH:mm:ss" enable="false" cname="创建时间"/>
<EF:EFColumn ename="updatedBy" enable="false" cname="修改人"/>
<EF:EFColumn ename="updatedTime" dateFormat="yyyy-MM-dd HH:mm:ss" enable="false" cname="修改时间"/>
<EF:EFColumn ename="createdName" enable="false" align="center" cname="创建人"/>
<EF:EFColumn ename="createdTime" dateFormat="yyyy-MM-dd HH:mm:ss" enable="false" align="center" cname="创建时间"/>
<EF:EFColumn ename="updatedName" enable="false" cname="修改人"/>
<EF:EFColumn ename="updatedTime" dateFormat="yyyy-MM-dd HH:mm:ss" enable="false" align="center" cname="修改时间"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......
......@@ -14,7 +14,7 @@ if (url.indexOf("?") != -1) { //判断是否有参数
$(function () {
IPLATUI.EFTree = {
"materialTree": {
ROOT: "root:项目列表",
ROOT: "root:产品列表",
/**
* 树加载完成后的回调函数
* @param options: 树的配置项
......@@ -135,15 +135,26 @@ $(function () {
* e.preventDefault 阻止事件发生
*/
beforeAdd: function (e) {
var lv = IPLATUI.EFTree.materialTree.selectTreeNode.lv;
var logic = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId ? false : true;
if (logic) { // 通过业务逻辑判断, 控制是否进行新增
if (lv === '3') {
IPLAT.alert({
message: '<b>请选择项目列表</b>',
message: '<b>不能在零件下进行新增</b>',
okFn: function (e) {
},
title: '提示'
});
e.preventDefault();
} else {
if (logic) { // 通过业务逻辑判断, 控制是否进行新增
IPLAT.alert({
message: '<b>请选择项目列表</b>',
okFn: function (e) {
},
title: '提示'
});
e.preventDefault();
}
}
},
/**
......
......@@ -135,9 +135,9 @@ $(function () {
* e.preventDefault 阻止事件发生
*/
beforeAdd: function (e) {
var lv = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId.lv;
var lv = IPLATUI.EFTree.materialTree.selectTreeNode.lv;
var logic = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId ? false : true;
if (lv === 3) {
if (lv === '3') {
IPLAT.alert({
message: '<b>不能在零件下进行新增</b>',
okFn: function (e) {
......@@ -363,17 +363,28 @@ $(function () {
* 导入
*/
$("#IMPORT").on("click", function (e) {
var lv = IPLATUI.EFTree.materialTree.selectTreeNode.lv;
var logic = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId ? false : true;
if (logic) { // 通过业务逻辑判断, 控制是否进行新增
if (lv === '3') {
IPLAT.alert({
message: '<b>请选择项目列表</b>',
message: '<b>不能在零件下进行导入</b>',
okFn: function (e) {
},
title: '提示'
});
e.preventDefault();
} else {
openFileWindow.open();
if (logic) { // 通过业务逻辑判断, 控制是否进行新增
IPLAT.alert({
message: '<b>请选择项目列表</b>',
okFn: function (e) {
},
title: '提示'
});
e.preventDefault();
} else {
openFileWindow.open();
}
}
});
IPLATUI.EFUpload = {
......@@ -436,33 +447,56 @@ $(function () {
*/
$("#GENERATE").on("click", function () {
var projCode = IPLATUI.EFTree.materialTree.selectTreeNode.projCode;
if (projCode === undefined) {
IPLAT.alert({
message: '<b>请选择项目列表</b>',
okFn: function (e) {
},
title: '提示'
});
}else {
IPLAT.confirm({
message: '<b>模板名称:<red>*<red></b> <input id="generateName" name="generateName" ' +
'class="k-textbox" with="30px" required="true" />',
okFn: function (e) {
var generateName = $("#generateName").val();
if (generateName === "") {
message("模板名称不能为空!");
} else {
generateMode(projCode, generateName);
}
},
cancelFn: function (e) {
IPLAT.NotificationUtil('取消该操作');
},
title: '生成物料清单模板确认',
minWidth: 300
});
}
var projCode=strs[1];
var info = new EiInfo()
info.set("id", projCode);
EiCommunicator.send("HPPZ015", "count", info, {
onSuccess: function (ei) {
if (ei["status"] == 1) {
//处理存在产品模板
var generateName= ei["extAttr"]["tempName"];
IPLAT.confirm({
message: '<b>模板名称:<red>*<red></b> <input id="generateName" type="text" name="generateName" ' +
'class="k-textbox" with="30px" required="true" value=" '+generateName+'"/>',
okFn: function (e) {
var generateName = $("#generateName").val();
if (generateName === "") {
message("模板名称不能为空!");
} else {
generateMode(projCode, generateName);
}
},
cancelFn: function (e) {
IPLAT.NotificationUtil('取消该操作');
},
title: '该产品模板已经存在,是否覆盖',
minWidth: 300
});
} else {
IPLAT.confirm({
message: '<b>模板名称:<red>*<red></b> <input id="generateName" name="generateName" ' +
'class="k-textbox" with="30px" required="true" />',
okFn: function (e) {
var generateName = $("#generateName").val();
if (generateName === "") {
message("模板名称不能为空!");
} else {
generateMode(projCode, generateName);
}
},
cancelFn: function (e) {
IPLAT.NotificationUtil('取消该操作');
},
title: '生成物料清单模板确认',
minWidth: 300
});
}
}, onFail: function (ei) {
}
}, {async: false});
});
// 模板选择
......@@ -472,16 +506,14 @@ $(function () {
* 物料生成
*/
function assign() {
var projCode = IPLATUI.EFTree.materialTree.selectTreeNode.projCode;
if (projCode === undefined) {
IPLAT.alert({
message: '<b>请选择项目列表</b>',
okFn: function (e) {
},
title: '提示'
});
}else {
JSColorbox.open({
var projCode=strs[1];
var info = new EiInfo()
info.set("id", projCode);
EiCommunicator.send("HPSC002", "count", info, {
onSuccess: function (ei) {
if (ei["status"] == 1) {
var projCodeNew=ei["extAttr"]["projCode"];
JSColorbox.open({
href: "HPSC002C?methodName=initLoad",
title: "<div style='text-align: center;'>选择产品模板</div>",
width: "70%",
......@@ -490,7 +522,8 @@ $(function () {
var info = new EiInfo()
info.set("id", row.id);
info.set("projCode", row.projCode);
/* EiCommunicator.send("HPPZ015", "assign", info, {
info.set("projCodeNew", projCodeNew);
EiCommunicator.send("HPPZ015", "assign", info, {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
......@@ -498,6 +531,9 @@ $(function () {
NotificationUtil({
msg: ei.msg
});
//刷新树
var tree = $("#materialTree").data("kendoTreeView");
tree.reload("root");//更新树
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
......@@ -505,15 +541,25 @@ $(function () {
}
}, onFail: function (ei) {
}
}, {async: false});*/
}, {async: false});
}
});
}
}else {
IPLAT.alert({
message: '<b>该项目下已有物料清单!</b>',
okFn: function (e) {
},
title: '提示'
});
}
}, onFail: function (ei) {
}
}, {async: false});
}
function generateMode(projCode,generateName) {
const inEiInfo = new EiInfo();
inEiInfo.set("projCode", projCode);
inEiInfo.set("id", projCode);
inEiInfo.set("templateName", generateName);
EiCommunicator.send('HPPZ015', 'insert', inEiInfo, {
onSuccess(response) {
......
......@@ -26,7 +26,7 @@ $(function () {
parent.JSColorbox.setValueCallback(row);
return;
};
JSUtils.confirm("确定选择模板吗? ", {
JSUtils.confirm("确定选择模板吗? ", {
ok: function () {
parent.JSColorbox.setValueCallback(row);
}
......
......@@ -349,6 +349,7 @@ function saveDetail(btn) {
JSUtils.submitGridsData("detail", "HPSC003", "updatePlanDetail", true);
//释放禁用按钮
btn.attr("disabled", false);
query();
}
});
}
......
......@@ -41,7 +41,7 @@
filter="contains" readonly="true">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="factoryName" cname="厂区名称" enable="false" align="center" hidden="true"/>
<EF:EFColumn ename="factoryName" cname="工厂" enable="false" align="center" hidden="true"/>
<EF:EFColumn ename="orgNo" cname="生产组" width="110" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" align="center" hidden="true"/>
<%--<EF:EFColumn ename="orgNo" cname="生产组代码" enable="false" hidden="true"/>--%>
......
......@@ -15,7 +15,7 @@
<EF:EFInput cname="零件名称" ename="partName" blockId="inqu_status" row="0" colWidth="3"/>
</div>
<div class="row">
<EF:EFSelect cname="厂区名称" ename="factoryCode" blockId="inqu_status" row="0" colWidth="3" filter="contains">
<EF:EFSelect cname="工厂" ename="factoryCode" blockId="inqu_status" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
......@@ -43,7 +43,7 @@
<EF:EFColumn ename="unCompleteNum" cname="剩余数量" enable="false" width="100" align="right" format="{0:N0}"/>
<EF:EFColumn ename="num" cname="数量" enable="false" width="100" align="right" format="{0:N0}"/>
<EF:EFColumn ename="totalWt" cname="总重(T)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="factoryName" cname="厂区名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="factoryName" cname="工厂" enable="false" width="140" align="center"/>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prodOrderNo" cname="生产订单号" enable="false" width="140" align="center" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目号" enable="false" width="140" align="center" hidden="true"/>
......
......@@ -84,7 +84,7 @@
<EF:EFInput cname="剩余数量" blockId="result" ename="unCompleteNum" row="0" colWidth="4" readonly="true"/>
<EF:EFDatePicker cname="计划完成日期" blockId="result" ename="planCompletionDate" row="0" colWidth="4"
format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="厂区名称" blockId="result" ename="factoryName" row="0" colWidth="4" readonly="true"/>
<EF:EFInput cname="工厂" blockId="result" ename="factoryName" row="0" colWidth="4" readonly="true"/>
<EF:EFInput cname="生产组名称" blockId="result" ename="orgName" row="0" colWidth="4" readonly="true"/>
</div>
</EF:EFRegion>
......
......@@ -360,7 +360,25 @@ function checkIn(id) {
});
}
checkInCallback = function () {
var block = detailGrid.getEiBlock();
var result = resultGrid.getCheckedRows()
if (rows.length < 1) {
message("请选择数据");
return;
}
if (block != null) {
block.setRows([]);
detailGrid.setEiBlock(block);
}
var info = new EiInfo()
var productionOrderNo = result[0]['prodOrderNo'];
info.set("productionOrderNo",productionOrderNo);
EiCommunicator.send("HPSC006","queryDetail",info,{
onSuccess:function(ei){//返回结果集
detailGrid.setEiInfo(ei);
},onFail:function(ei){}
},{async:false});
}
let selectStock = function (id) {
JSColorbox.open({
......
......@@ -78,12 +78,13 @@
data-regex="/^-?[0-9]{1,9}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置9位整数和3位小数!"/>
<EF:EFColumn enable="false" format="{0:N3}" ename="totalWt" width="80" maxLength="12" displayType="0.000" cname="总重(T)"/>
<EF:EFColumn ename="planCompletionDate" required='true' cname="计划完成时间" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" width="120"/>
<EF:EFComboColumn ename="factoryCode" cname="厂区" width="110" align="center" defaultValue=""
filter="contains" readonly="true">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="factoryName" cname="厂区名称" enable="false" align="center" hidden="true"/>
<EF:EFColumn ename="factoryName" cname="工厂" enable="false" align="center" hidden="true"/>
<EF:EFColumn ename="orgNo" cname="下料组" width="110" align="center" readonly="true"/>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" align="center" hidden="true"/>
......@@ -92,12 +93,11 @@
<%-- <EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>--%>
<%-- </EF:EFComboColumn>--%>
<%-- <EF:EFColumn ename="orgNo" cname="下料组" width="110" align="center" readonly="true"/>--%>
<EF:EFColumn ename="planCompletionDate" required='true' cname="计划完成时间" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" width="120"/>
<EF:EFColumn ename="actualCompletionDate" cname="实际完成时间" editType="date"
<EF:EFColumn ename="actualCompletionDate" cname="完成时间" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" width="120" enable="false"/>
<EF:EFColumn enable="false" ename="actualCompletionNum" cname="实际完工数量" width="100" readonly="true"/>
<EF:EFColumn enable="false" ename="actualCompletionTotalWt" cname="实际完工重量(T)" width="100" readonly="true"/>
<EF:EFColumn enable="false" ename="actualCompletionNum" cname="完工数量" width="100" readonly="true"/>
<EF:EFColumn enable="false" ename="actualCompletionTotalWt" cname="完工重量(T)" width="100" readonly="true"/>
<EF:EFComboColumn enable="false" align="center" ename="status" width="80" cname="状态">
<EF:EFOption label="计划中" value="0"/>
<EF:EFOption label="生产中" value="1"/>
......
......@@ -37,7 +37,7 @@
<EF:EFColumn enable="false" ename="reqNum" cname="领料记录" width="80" align="center" readonly="true"/>
<EF:EFColumn ename="productionOrderNo" cname="生产订单号" enable="false" width="150" align="center" hidden="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="factoryName" cname="厂区名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="factoryName" cname="工厂" enable="false" width="100" align="center"/>
<EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="partName" cname="零件名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="inventName" cname="材料名称" enable="false" width="100" align="center"/>
......
......@@ -64,7 +64,7 @@
<EF:EFInput ename="detail-0-prdtName" cname="产品名称" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-factoryName" cname="厂区名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-factoryName" cname="工厂" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-orgName" cname="下料组" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-partName" cname="零件名称" colWidth="4" readonly="true"/>
......
......@@ -7,12 +7,12 @@ $(function () {
pageSizes: [10, 20, 50, 70, 100],
},
columns:[{
field:"actualCompletionDate",
field: "actualCompletionDate",
attributes: {
class: "i-input-readonly",
class: "i-input-readonly"
},
defaultValue: function () {
return currDate();
return currShortDate();
}
}],
onDelete: function (e) {
......
$(function () {
var factoryCodes = __eiInfo.getBlock("factory_code_block_id").getMappedRows();
var groupCodes = __eiInfo.getBlock("group_code_block_id").getMappedRows();
var userIds = __eiInfo.getBlock("user_id_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
......@@ -40,6 +43,17 @@ $(function () {
return currShortDate();
}
},{
field: "factoryCode",
title: "工厂",
template: function (dataItem) {
for (let i = 0; i < factoryCodes.length; i++) {
if (factoryCodes[i]['valueField'] === dataItem['factoryCode']) {
return factoryCodes[i]['textField'];
}
}
return dataItem["factoryCode"];
}
},{
field: "groupCode",
title: "生产组",
filter: function (options) {
......@@ -53,6 +67,14 @@ $(function () {
} else {
return [];
}
},
template: function (dataItem) {
for (let i = 0; i < groupCodes.length; i++) {
if (groupCodes[i]['valueField'] === dataItem['groupCode']) {
return groupCodes[i]['textField'];
}
}
return dataItem["groupCode"];
}
},{
field: "userId",
......@@ -69,6 +91,14 @@ $(function () {
} else {
return [];
}
},
template: function (dataItem) {
for (let i = 0; i < userIds.length; i++) {
if (userIds[i]['valueField'] === dataItem['userId']) {
return userIds[i]['textField'];
}
}
return dataItem["userId"];
}
}],
loadComplete: function(grid) {
......@@ -84,6 +114,16 @@ $(function () {
}
});
},
onAdd: function (e) {
//e.sender.dataSource.options.fields[4].values = factoryCode;
//e.sender.dataSource.options.fields[5].values = groupCode
//e.sender.dataSource.options.fields[6].values = userId;
// 动态设置默认邮箱
/*$.each(e.items, function(index, item){
item['prdtName'] = "demo"+ index + "@baosight.com";
});*/
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
//e.preventDefault();
......@@ -93,6 +133,7 @@ $(function () {
//saveResult(btnNode);
},
onSuccess: function (e) {
console.log("onSuccess:"+e)
if (e.eiInfo.extAttr.methodName == 'update'
|| e.eiInfo.extAttr.methodName == 'insert') {
query();
......@@ -122,10 +163,10 @@ $(function () {
var inInfo=new EiInfo();
var factoryCode=$("#inqu_status-0-factoryCode").val();
inInfo.set("factoryCode",factoryCode);
EiCommunicator.send("HPXS001", "queryFactoryCode", inInfo, {
EiCommunicator.send("HPSC008", "queryFactoryCode", inInfo, {
onSuccess: function (ei) {
var input=$("#inqu_status-0-groupCode");
dataEdition=ei.getBlock("group_code_block_id").getMappedRows();
let dataEdition=ei.getBlock("group_code_block_id").getMappedRows();
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
......@@ -145,10 +186,10 @@ $(function () {
inInfo.set("factoryCode",factoryCode);
var groupCode=$("#inqu_status-0-groupCode").val();
inInfo.set("groupCode",groupCode);
EiCommunicator.send("HPXS001", "queryGroupCode", inInfo, {
EiCommunicator.send("HPSC008", "queryGroupCode", inInfo, {
onSuccess: function (ei) {
var input=$("#inqu_status-0-userId");
dataEdition=ei.getBlock("user_id_block_id").getMappedRows();
let dataEdition=ei.getBlock("user_id_block_id").getMappedRows();
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
......
......@@ -48,19 +48,19 @@
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="registerDate" cname="登记日期" width="160" align="center" editType="date" readonly="true"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_code_block_id"
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_code1_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="生产组" blockName="group_code_block_id"
<EF:EFComboColumn ename="groupCode" cname="生产组" blockName="group_code1_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="userId" cname="员工" blockName="user_id_block_id"
<EF:EFComboColumn ename="userId" cname="员工" blockName="user_id1_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="100" required="true"
......
......@@ -9,15 +9,15 @@
<EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput cname="组类型" ename="orgType" blockId="inqu_status" row="0" type="hidden"/>
<div class="row">
<%-- <EF:EFInput cname="厂区名称" ename="factoryName" blockId="inqu_status" row="0" colWidth="3"/>--%>
<%-- <EF:EFInput cname="工厂" ename="factoryName" blockId="inqu_status" row="0" colWidth="3"/>--%>
<%-- <EF:EFInput cname="组织名称" ename="groupName" blockId="inqu_status" row="0" colWidth="3"/>--%>
<EF:EFSelect ename="inqu_status-0-factoryCode" cname="厂区名称" colWidth="2" filter="contains"
<EF:EFSelect ename="inqu_status-0-factoryCode" cname="工厂" colWidth="3" filter="contains"
template="#=textField#" valueTemplate="#=textField#">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-groupCode" cname="组织名称" filter="contains" required="false" colWidth="2"
<EF:EFSelect ename="inqu_status-0-groupCode" cname="工作组" filter="contains" required="false" colWidth="3"
template="#=textField#" valueTemplate="#=valueField#" defaultValue="请选择">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/>
......@@ -28,9 +28,9 @@
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="single,row">
<EF:EFColumn ename="factoryCode" cname="厂区编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="factoryName" cname="厂区名称" enable="false" width="120" align="center" />
<EF:EFColumn ename="factoryName" cname="工厂" enable="false" width="120" align="center" />
<EF:EFColumn ename="groupCode" cname="组织编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="groupName" cname="组织名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="groupName" cname="工作组" enable="false" width="120" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -43,10 +43,10 @@ $(function () {
field: "docName",
title: "文件名称",
template: function (item) {
let docId = item.docId;
let docName = item.docName
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + IPLATUI.CONTEXT_PATH + '/EU/DM/EUDM06.jsp?docId=' + item.docId
+ '" >'+docName+'</a>';
+ 'href="' + downloadHref(docId) + '" target="_blank">'+docName+'</a>';
return template;
}
}],
......@@ -119,11 +119,14 @@ $(function () {
NotificationUtil("请至少选中一条数据", "info");
} else {
for (let i = 0, length = checkedRows.length; i < length; i++) {
docId += checkedRows[i]["docId"];
docId += ","
downloadHref(checkedRows[i]["docId"])
//docId += checkedRows[i]["docId"];
//docId += ","
}
docId = docId.substr(0, docId.lastIndexOf(','));
window.location.href = IPLATUI.CONTEXT_PATH + '/EU/DM/EUDM14.jsp?docIds=' + docId
//docId = docId.substr(0, docId.lastIndexOf(','));
//window.location.href = IPLATUI.CONTEXT_PATH + '/EU/DM/EUDM14.jsp?docIds=' + docId
}
})
......
......@@ -15,15 +15,12 @@
<EF:EFPage title="设计图管理">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<%--<EF:EFAutoComplete ename="inqu_status-0-node_ename" dataField="node_ename" cname="项目名称" queryMethod="queryA"
serviceName="EEDM6001" resultId="blockA">
</EF:EFAutoComplete>--%>
<EF:EFSelect cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3"
<%--<EF:EFSelect cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3"
filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="proj_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<%--<EF:EFInput cname="项目名称" blockId="inqu_status" ename="projName" row="0" colWidth="3"/>--%>
</EF:EFSelect>--%>
<EF:EFInput cname="项目名称" blockId="inqu_status" ename="projName" row="0" colWidth="3"/>
<EF:EFSelect cname="产品类型" ename="inqu_status-0-prdtType" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<%--<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>--%>
......@@ -35,10 +32,6 @@
startName="createdDateFrom" endName="createdDateTo" row="0" role="date"
format="yyyy-MM-dd" satrtRatio="4:8" endRatio="4:8">
</EF:EFDateSpan>
<%--<EF:EFSelect cname="是否删除" ename="deleteFlag" blockId="inqu_status" row="0" colWidth="3" defaultValue="0">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.deleteFlag"/>
</EF:EFSelect>--%>
</div>
</EF:EFRegion>
......
......@@ -35,7 +35,7 @@
<EF:EFColumn ename="completeNum" cname="已入库数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="num" cname="任务数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="totalWt" cname="任务重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="factoryName" cname="厂区名称" enable="false" width="150" align="center"/>
<EF:EFColumn ename="factoryName" cname="工厂" enable="false" width="150" align="center"/>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" width="150" align="center"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
<EF:EFColumn ename="projCode" cname="项目号" enable="false" width="140" align="center"/>
......
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