Commit 34e3e974 by yukang

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

# Conflicts:
#	src/main/java/com/baosight/hggp/common/DdynamicEnum.java
parents 8b94713d e2a30dfe
......@@ -29,21 +29,21 @@ public enum DdynamicEnum {
* 编写:wwl
*/
PROJ_TYPE_BLOCK_ID("proj_type_block_id", "natCode", "natName", "HGPZ008.queryComboBox"),
/**
* 模块:客户类型
* 用途:客户类型下拉框
* 编写:
*/
CUSTOMER_TYPE_BLOCK_ID("customer_type_block_id", "custType", "custTypeName", "HGPZ001.queryComboBox"),
/**
* 模块:客户档案
* 用途:客户档案下拉框
* 编写:wwl
*/
CUSTOMER_RECORD_BLOCK_ID("customer_record_block_id", "custCode", "custName", "HGPZ002.queryComboBox"),
/**
* 模块:供应商档案
* 用途:供应商档案下拉框
......@@ -73,6 +73,12 @@ public enum DdynamicEnum {
INVENT_RECORD_BLOCK_ID("invent_record_block_id","inventCode","inventName","HGPZ005.queryComboBox"),
/**
* 模块:存货档案
* 用途:存货档案下拉框,带id名称等信息
* 编写:
*/
PRODUCT_BLOCK_ID("product_block_id","inventCode","inventName","id","inventType","HGPZ005.queryProductComboBox"),
/**
* 模块:存货档案(ALL)
* 用途:存货档案下拉框
* 编写:
......@@ -85,37 +91,37 @@ public enum DdynamicEnum {
* 编写:
*/
SPEC_RECORD_BLOCK_ID("spec_record_block_id", "id", "spec", "HGPZ005.queryComboBoxAll"),
/**
* 模块:规格(无ID)
* 用途:存货档案下拉框
* 编写:
*/
SPEC_NAME_BLOCK_ID("spec_name_block_id", "spec", "spec", "HGPZ005.queryComboBoxSpecName"),
/**
* 模块:仓库类型
* 用途:仓库类型下拉框
* 编写:
*/
WH_TYPE_BLOCK_ID("wh_type_block_id", "whType", "whTypeName", "HGPZ006.queryComboBox"),
/**
* 模块:仓库档案
* 用途:仓库档案下拉框
* 编写:
*/
WH_RECORD_BLOCK_ID("wh_record_block_id", "whCode", "whName", "HGPZ007.queryComboBox"),
/**
* 模块:厂区管理
* 用途:厂区管理下拉框
* 编写:songx
*/
FACTORY_RECORD_BLOCK_ID("factory_record_block_id", "orgId", "orgCname", "HGXSOrg.queryFactoryComboBox"),
/**
* 模块:组管理
* 用途:组管理下拉框
......@@ -143,7 +149,7 @@ public enum DdynamicEnum {
* 编写:yk
*/
USER_BLOCK_ID("user_block_id","loginName","userName","HGXSUser.queryComboBox"),
/**
* 模块:系统管理
* 用途:部门
......@@ -153,7 +159,7 @@ public enum DdynamicEnum {
"companyName", "HGXSOrg.queryAll", new HashMap() {{
put("orgType", OrgTypeEnum.DEPT.getCode());
}}),
/**
* 模块:系统管理
* 用途:厂区查询
......@@ -163,7 +169,7 @@ public enum DdynamicEnum {
"companyName", "HGXSOrg.queryAll", new HashMap() {{
put("orgType", OrgTypeEnum.FACTORY.getCode());
}}),
/**
* 模块:系统管理
* 用途:公司查询
......@@ -174,7 +180,7 @@ public enum DdynamicEnum {
put("orgType", OrgTypeEnum.COMPANY.getCode());
}}
),
/**
* 模块:公司名称
* 用途:工序设计下拉框
......@@ -190,7 +196,7 @@ public enum DdynamicEnum {
* 用途:工序编码下拉框
* 编写:ly
*/
PROCESS_CODE_BLOCK_ID("processCode_block_id","processCode","processName","factoryCode","factoryName","unit","HGSJ001.queryProcessCode"),
PROCESS_CODE_BLOCK_ID("processCode_block_id","processCode","processName","factoryCode","factoryName","unit", "status","deleteFlag","HGSJ001.queryProcessCode"),
/**
* 模块:设备台账编码
* 用途:设备区域下拉框
......@@ -209,7 +215,7 @@ public enum DdynamicEnum {
* 用途:设备名称下拉框
* 编写:ly
*/
DEVICE_CODE_BOX_BLOCK_ID("deviceCodeBox_block_id","deviceCode","deviceName","deviceType", "companyCode","HGSB001.queryDeviceCodeBox"),
DEVICE_CODE_BOX_BLOCK_ID("deviceCodeBox_block_id","deviceCode","deviceName","deviceType", "companyCode","deviceStatus","HGSB001.queryDeviceCodeBox"),
//------------------------------------- 生产管理---------------------------------------------------
/**
......@@ -219,9 +225,23 @@ public enum DdynamicEnum {
*/
PROJ_RECORD_BLOCK_ID("proj_record_block_id", "projCode", "projName", "HGSC001.queryComboBox"),
/**
* 模块:蓝图
* 用途:蓝图下拉框
* 编写:jhs
*/
BLUEPRINT_BOX_BLOCK_ID("blueprint_box_block_id", "blueprintCode", "blueprintName", "HGSC003.queryComboBox"),
ITEM_CODE_BOX_BLOCK_ID("item_code_box_block_id", "itemCode", "itemCname", "HGPZ005A.queryEdcm01"),
/**
* 模块:生产计划详情
* 用途:工序下拉框
* 编写:wwl
*/
PLAN_PROCESS_BLOCK_ID("plan_process_block_id", "processName", "processName", "HGSC005A.queryProcessComboBox")
/**
*
*/
PROJECT_CODE_BOX_BLOCK_ID("projectCodeBox_block_id","projCode","projName","HGSC001.queryProjectCodeBox"),
......@@ -246,7 +266,7 @@ public enum DdynamicEnum {
private String param4;
private String param5;
private String param6;
private String param7;
......@@ -258,7 +278,7 @@ public enum DdynamicEnum {
private final String dbSource;
private Map paramMap;
DdynamicEnum(String blockId, String value, String text, String param1, String dbSource) {
this.blockId = blockId;
this.value = value;
......@@ -275,7 +295,7 @@ public enum DdynamicEnum {
this.param2 = param2;
this.dbSource = dbSource;
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String dbSource,
Map paramMap) {
this.blockId = blockId;
......@@ -286,7 +306,7 @@ public enum DdynamicEnum {
this.dbSource = dbSource;
this.paramMap = paramMap;
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String param3, String dbSource) {
this.blockId = blockId;
this.value = value;
......@@ -307,7 +327,7 @@ public enum DdynamicEnum {
this.param4 = param4;
this.dbSource = dbSource;
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String param3,
String param4, String dbSource, Map paramMap) {
this.blockId = blockId;
......@@ -320,7 +340,7 @@ public enum DdynamicEnum {
this.dbSource = dbSource;
this.paramMap = paramMap;
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String param3, String param4, String param5, String dbSource) {
this.blockId = blockId;
this.value = value;
......@@ -332,7 +352,7 @@ public enum DdynamicEnum {
this.param5 = param5;
this.dbSource = dbSource;
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String param3, String param4,
String param5, String param6,String dbSource) {
this.blockId = blockId;
......@@ -363,7 +383,7 @@ public enum DdynamicEnum {
this.param9 = param9;
this.dbSource = dbSource;
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String param3,
String param4, String param5, String param6, String param7, String param8, String param9,
String dbSource, Map paramMap) {
......@@ -382,14 +402,14 @@ public enum DdynamicEnum {
this.dbSource = dbSource;
this.paramMap = paramMap;
}
DdynamicEnum(String blockId, String value, String text, String dbSource){
this.blockId = blockId;
this.value = value;
this.text = text;
this.dbSource = dbSource;
}
DdynamicEnum(String blockId, String value, String text, String dbSource, Map paramMap) {
this.blockId = blockId;
this.value = value;
......@@ -397,7 +417,7 @@ public enum DdynamicEnum {
this.dbSource = dbSource;
this.paramMap = paramMap;
}
public String getDbSource() {
return dbSource;
}
......@@ -453,11 +473,11 @@ public enum DdynamicEnum {
public void setParam5(String param5) {
this.param5 = param5;
}
public String getParam6() {
return param6;
}
public void setParam6(String param6) {
this.param6 = param6;
}
......@@ -485,7 +505,7 @@ public enum DdynamicEnum {
public void setParam9(String param9) {
this.param9 = param9;
}
public Map getParamMap() {
return paramMap;
}
......
package com.baosight.hggp.common;
import com.baosight.iplat4j.core.ei.EiBlock;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public enum ProductTypeEnum {
STRUCT(1,"构建"),
PART(2,"零件");
private Integer code;
private String value;
ProductTypeEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
public static EiBlock generatorEiBlock() {
EiBlock block = new EiBlock("product_type_block_id");
List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>() {{
add(new HashMap<String, Object>() {{
put(HGConstants.TEXT_FIELD, STRUCT.code + "-" + STRUCT.value);
put(HGConstants.VALUE_FIELD, STRUCT.code);
}});
add(new HashMap<String, Object>() {{
put(HGConstants.TEXT_FIELD, PART.code + "-" + PART.value);
put(HGConstants.VALUE_FIELD, PART.code);
}});
}};
block.setRows(rows);
return block;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
......@@ -12,6 +12,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils;
import java.util.Collection;
import java.util.List;
import java.util.Map;
......@@ -23,7 +24,7 @@ import lombok.extern.slf4j.Slf4j;
*/
@Slf4j
public class DaoUtils {
/**
* count 查询
*
......@@ -36,7 +37,7 @@ public class DaoUtils {
List<Integer> countMaps = DaoBase.getInstance().query(sqlName, paramMap);
return CollectionUtils.isEmpty(countMaps) ? 0 : countMaps.get(0).intValue();
}
/**
* insert method.
*
......@@ -56,7 +57,7 @@ public class DaoUtils {
}
DaoBase.getInstance().insert(sql, obj);
}
/**
* update method.
*
......@@ -71,7 +72,24 @@ public class DaoUtils {
}
return DaoBase.getInstance().update(sql, obj);
}
/**
* update method.
*
* @param sql
* @param parameters
*/
public static int updateBatch(String sql, Collection parameters) {
parameters.forEach(obj->{
if (obj instanceof DaoEPBase) {
setRevisor((DaoEPBase) obj, true);
} else if (obj instanceof Map) {
setRevisor((Map) obj, true);
}
});
return DaoBase.getInstance().updateBatch(sql, parameters);
}
/**
* 创建人工号 创建人姓名 创建人岗号 创建时刻
*
......@@ -136,7 +154,7 @@ public class DaoUtils {
log.error("写入创建时刻失败:{}", e.getMessage(), e);
}
}
/**
* 创建人工号 创建人姓名 创建时刻.
*
......@@ -197,7 +215,7 @@ public class DaoUtils {
log.warn("写入创建时刻失败", e);
}
}
/**
* 修改人工号 修改人姓名 修改人岗号 修改时刻 记录修改代理人工号 记录修改代理人姓名.
*
......@@ -232,7 +250,7 @@ public class DaoUtils {
log.warn("写入修改时刻失败", e);
}
}
/**
* 修改人工号 修改人姓名 修改人岗号 修改时刻 记录修改代理人工号 记录修改代理人姓名.
*
......@@ -264,5 +282,5 @@ public class DaoUtils {
// 修改时间
map.put("updatedTime", DateUtils.shortDateTime());
}
}
......@@ -227,7 +227,7 @@
SET
STATUS = #status#,
DELIVER_QTY = #deliverQty#, <!-- 退货数量 -->
DEPOSIT_QTY = #depositQty#, <!-- 退货数量 -->
DEPOSIT_QTY = #depositQty#, <!-- 入库数量 -->
<include refid="updateRevise"/>
WHERE RECEIVE_NO = #receiveNo#
</update>
......
......@@ -6,9 +6,9 @@ import com.baosight.hggp.hg.cg.domain.HGCG001;
import com.baosight.hggp.hg.cg.domain.HGCG002;
import com.baosight.hggp.hg.cg.domain.HGCG002A;
import com.baosight.hggp.hg.cg.domain.HGCG003;
import com.baosight.hggp.hg.kc.domain.HGKC001;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.util.AssertUtils;
import org.apache.commons.collections.CollectionUtils;
......@@ -234,6 +234,22 @@ public class HGCGTools {
paramMap.put("status", status);
DaoUtils.update(HGSqlConstant.HgCg003.UPDATE_STATUS, paramMap);
}
/**
* 修改状态
*
* @param zl001
*/
public static void updateCheck(HGZL001 zl001) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HGCG003.FIELD_RECEIVE_NO, zl001.getReceiveNo());
paramMap.put(HGCG003.FIELD_STATUS, HGConstant.CgReceiveStatus.S_4);
paramMap.put(HGCG003.FIELD_DELIVER_QTY, zl001.getUnqualifyQty());
paramMap.put(HGCG003.FIELD_DEPOSIT_QTY, zl001.getQualifyQty());
DaoUtils.update(HGSqlConstant.HgCg003.UPDATE_CONFIRM, paramMap);
}
}
}
......@@ -213,4 +213,32 @@ public class HGConstant {
public static final Integer YS = 2;
}
/**
*
* 物料提交状态
* @author:songx
* @date:2024/5/15,15:18
*/
public static class MaterialStatus {
// 未提交
public static final Integer WTJ = 0;
// 部分提交
public static final Integer BFTJ = 1;
// 全部提交
public static final Integer QBTJ = 2;
}
/**
*
* 物料提交状态
* @author:songx
* @date:2024/5/15,15:18
*/
public static class ProductStatus {
// 未提交
public static final Integer WTJ = 0;
// 已提交
public static final Integer YTJ = 1;
}
}
......@@ -64,7 +64,7 @@ public class HGSqlConstant {
public static final String UPDATE_STATUS = MODULE_NAME + "updateStatus";
// 修改数量
public static final String UPDATE_QTY = MODULE_NAME + "updateQty";
// 修改数量
// 收货完成
public static final String UPDATE_CONFIRM = MODULE_NAME + "updateConfirm";
}
......@@ -147,6 +147,22 @@ public class HGSqlConstant {
}
/**
* HGZL001 SQL 定义
*
* @author:songx
* @date:2024/5/18,15:13
*/
public class HgZl001 {
// 模块名称
private static final String MODULE_NAME = "HGZL001.";
// 锁
public static final String LOCK = MODULE_NAME + "lock";
// 已处理
public static final String PROCESS = MODULE_NAME + "process";
}
/**
* HPKC001 SQL 定义
*
* @author:songx
......@@ -519,21 +535,6 @@ public class HGSqlConstant {
}
/**
* 质量巡检单
*
* @author:songx
* @date:2024/2/2,14:23
*/
public class HPZL001 {
// 已处理
public static final String DO_PROCESS = "HPZL001.doProcess";
// 已处理
public static final String DO_PROCESS2 = "HPZL001.doProcess2";
}
/**
* 用户
*
* @author:songx
......
......@@ -315,6 +315,30 @@
ORDER BY INVENT_CODE
</select>
<select id="queryProductComboBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT DISTINCT
a.ID as "id",
a.INVENT_TYPE as "inventType",
a.INVENT_CODE as "inventCode",
a.INVENT_NAME as "inventName",
b.PAR_INVENT_TYPE as "parInventType"
FROM ${hggpSchema}.HGPZ005 a
left join ${hggpSchema}.hgpz004 b on a.INVENT_TYPE = b.INVENT_TYPE and b.STATUS=1 and b.DELETE_FLAG = 0
WHERE a.DELETE_FLAG = 0
AND a.STATUS=1
<isNotEmpty prepend=" AND " property="accountCode">
a.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
a.INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parInventType">
b.PAR_INVENT_TYPE = #parInventType#
</isNotEmpty>
ORDER BY INVENT_CODE
</select>
<!-- 缺省下拉框 -->
<select id="queryComboBoxAll" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
......
......@@ -2,6 +2,7 @@ package com.baosight.hggp.hg.sb.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.hg.sb.domain.HGSB004;
import com.baosight.hggp.hg.sb.domain.HGSB006;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.contants.ACConstants;
......@@ -21,6 +22,7 @@ public class ServiceHGSB006 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB006.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB004.FIELD_CHECK_STATUS, CommonConstant.YesNo.YES_1);
inInfo = super.query(inInfo, HGSB006.QUERY, new HGSB006());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),null
......@@ -31,6 +33,7 @@ public class ServiceHGSB006 extends ServiceEPBase {
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB006.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB004.FIELD_CHECK_STATUS, CommonConstant.YesNo.YES_1);
return super.query(inInfo,HGSB006.QUERY,new HGSB006());
}
}
......@@ -2,6 +2,8 @@ package com.baosight.hggp.hg.sb.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.hg.sb.domain.HGSB004;
import com.baosight.hggp.hg.sb.domain.HGSB005;
import com.baosight.hggp.hg.sb.domain.HGSB007;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.contants.ACConstants;
......@@ -21,6 +23,7 @@ public class ServiceHGSB007 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB007.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB005.FIELD_CHECK_STATUS, CommonConstant.YesNo.YES_1);
inInfo = super.query(inInfo, HGSB007.QUERY, new HGSB007(),false, new EiBlockMeta(), EiConstant.queryBlock, CommonConstant.Field.DETAIL, CommonConstant.Field.DETAIL);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),null
......@@ -31,6 +34,7 @@ public class ServiceHGSB007 extends ServiceEPBase {
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB007.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB005.FIELD_CHECK_STATUS, CommonConstant.YesNo.YES_1);
return super.query(inInfo,HGSB007.QUERY,new HGSB007(),false, new EiBlockMeta(), EiConstant.queryBlock, CommonConstant.Field.DETAIL, CommonConstant.Field.DETAIL);
}
}
......@@ -373,7 +373,8 @@
DEVICE_CODE as "deviceCode", <!-- 设备编码 -->
DEVICE_NAME as "deviceName", <!-- 设备名称 -->
DEVICE_TYPE as "deviceType", <!-- 设备类型 -->
COMPANY_CODE as "companyCode"
COMPANY_CODE as "companyCode",
DEVICE_STATUS as "deviceStatus"
FROM ${hggpSchema}.HGSB001 WHERE 1=1
<include refid="condition" />
</select>
......
......@@ -256,7 +256,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
B.INSPEC_DATE,A.CREATED_TIME desc, A.ID asc
B.INSPEC_DATE desc,A.CREATED_TIME desc, A.ID asc
</isEmpty>
</dynamic>
......@@ -279,7 +279,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
B.UPKEEP_DATE,A.CREATED_TIME desc, A.ID asc
B.UPKEEP_DATE desc,A.CREATED_TIME desc, A.ID asc
</isEmpty>
</dynamic>
......
......@@ -125,7 +125,7 @@
UPKEEP_CODE = #upkeepCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planCode">
PLAN_CODE = #planCode#
PLAN_CODE LIKE CONCAT('%', #planCode#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planStartDate">
PLAN_START_DATE = #planStartDate#
......
......@@ -128,12 +128,15 @@
<isNotEmpty prepend=" AND " property="docId">
A.DOC_ID = #docId#
</isNotEmpty>
<isEqual prepend=" AND " property="checkStatus" compareValue="1">
trim(A.DOC_ID) ='' and trim(A.CHECK_RESULT) = ''
</isEqual>
<isEqual prepend=" AND " property="checkStatus" compareValue="2">
(trim(A.DOC_ID) !='' or trim(A.CHECK_RESULT) != '')
</isEqual>
<isNotEmpty prepend=" AND " property="checkStatus">
B.CHECK_STATUS = #checkStatus#
</isNotEmpty>
<!--<isEqual prepend=" AND " property="checkStatus" compareValue="1">
trim(A.DOC_ID) ='' and trim(A.CHECK_RESULT) = ''
</isEqual>
<isEqual prepend=" AND " property="checkStatus" compareValue="2">
(trim(A.DOC_ID) !='' or trim(A.CHECK_RESULT) != '')
</isEqual>-->
</sql>
<select id="query" parameterClass="HashMap" resultClass="HGSB006">
......
......@@ -134,12 +134,15 @@
<isNotEmpty prepend=" AND " property="docId">
A.DOC_ID = #docId#
</isNotEmpty>
<isEqual prepend=" AND " property="upkeepStatus" compareValue="1">
<isNotEmpty prepend=" AND " property="checkStatus">
B.CHECK_STATUS = #checkStatus#
</isNotEmpty>
<!--<isEqual prepend=" AND " property="upkeepStatus" compareValue="1">
trim(A.DOC_ID) ='' and trim(A.CHECK_RESULT) = ''
</isEqual>
<isEqual prepend=" AND " property="upkeepStatus" compareValue="2">
(trim(A.DOC_ID) !='' or trim(A.CHECK_RESULT) != '')
</isEqual>
</isEqual>-->
</sql>
<select id="query" parameterClass="HashMap" resultClass="HGSB007">
......
......@@ -32,7 +32,8 @@ public class HGSC005 extends DaoEPBase {
public static final String FIELD_plan_code = "planCode"; /* 计划编码*/
public static final String FIELD_commit_status = "commitStatus"; /* 提交状态 0:未提交;2:已提交*/
public static final String FIELD_finish_date = "finishDate"; /* 完工日期*/
public static final String FIELD_finish_rate = "finishRate"; /* 完工进度*/
public static final String FIELD_finish_rate = "finish_rate"; /* 完工进度*/
public static final String FIELD_is_schedule = "is_schedule"; /* 是否排产 0,否 1,是*/
public static final String FIELD_account_code = "accountCode"; /* 帐套*/
public static final String FIELD_dep_code = "depCode"; /* 部门编码*/
public static final String FIELD_dep_name = "depName"; /* 部门名称*/
......@@ -52,7 +53,8 @@ public class HGSC005 extends DaoEPBase {
public static final String COL_plan_code = "plan_code"; /* 计划编码*/
public static final String COL_commit_status = "commit_status"; /* 提交状态 0:未提交;2:已提交*/
public static final String COL_finish_date = "finish_date"; /* 完工日期*/
public static final String COL_finish_rate = "finishRate"; /* 完工进度*/
public static final String COL_is_schedule = "is_schedule"; /* 是否排产 0,否 1,是*/
// public static final String COL_finish_rate = "finish_rate"; /* 完工进度*/
public static final String COL_account_code = "account_code"; /* 帐套*/
public static final String COL_dep_code = "dep_code"; /* 部门编码*/
public static final String COL_dep_name = "dep_name"; /* 部门名称*/
......@@ -78,6 +80,7 @@ public class HGSC005 extends DaoEPBase {
private String planCode = " "; /* 计划编码*/
private Integer commitStatus = new Integer(0); /* 提交状态 0:未提交;2:已提交*/
private String finishDate = " "; /* 完工日期*/
public Integer isSchedule = new Integer(0); /* 是否排产 0,否 1,是*/
private Double finishRate = new Double(0);
private String accountCode = " "; /* 帐套*/
private String depCode = " "; /* 部门编码*/
......@@ -134,6 +137,10 @@ public class HGSC005 extends DaoEPBase {
eiColumn.setDescName("完工日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_is_schedule);
eiColumn.setDescName("是否排产");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_finish_rate);
eiColumn.setDescName("完工进度");
eiMetadata.addMeta(eiColumn);
......@@ -329,6 +336,14 @@ public class HGSC005 extends DaoEPBase {
this.finishDate = finishDate;
}
public Integer getIsSchedule() {
return isSchedule;
}
public void setIsSchedule(Integer isSchedule) {
this.isSchedule = isSchedule;
}
public Double getFinishRate() {
return finishRate;
}
......@@ -507,6 +522,7 @@ public class HGSC005 extends DaoEPBase {
setPlanCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_plan_code)), planCode));
setCommitStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_commit_status)), commitStatus));
setFinishDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_finish_date)), finishDate));
setIsSchedule(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_is_schedule)), isSchedule));
setFinishRate(NumberUtils.toDouble(StringUtils.toString(map.get(FIELD_finish_rate)), finishRate));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_account_code)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_dep_code)), depCode));
......@@ -535,6 +551,7 @@ public class HGSC005 extends DaoEPBase {
map.put(FIELD_plan_code, StringUtils.toString(planCode, eiMetadata.getMeta(FIELD_plan_code)));
map.put(FIELD_commit_status, StringUtils.toString(commitStatus, eiMetadata.getMeta(FIELD_commit_status)));
map.put(FIELD_finish_date, StringUtils.toString(finishDate, eiMetadata.getMeta(FIELD_finish_date)));
map.put(FIELD_is_schedule, StringUtils.toString(isSchedule, eiMetadata.getMeta(FIELD_is_schedule)));
map.put(FIELD_finish_rate,StringUtils.toString(finishRate, eiMetadata.getMeta(FIELD_finish_rate)));
map.put(FIELD_account_code, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_account_code)));
map.put(FIELD_dep_code, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_dep_code)));
......
......@@ -19,7 +19,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
*/
public class HGSC005A extends DaoEPBase {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
public static final String FIELD_id = "id";
public static final String FIELD_mat_id = "matId"; /* 物料清单ID*/
......@@ -88,6 +88,7 @@ public class HGSC005A extends DaoEPBase {
public static final String INSERT = "HGSC005A.insert";
public static final String UPDATE = "HGSC005A.update";
public static final String DELETE = "HGSC005A.delete";
public static final String UPDATE_PLAN_DATE = "HGSC005A.update_plan_date";
private Long id = new Long(0);
private Long matId = new Long(0); /* 物料清单ID*/
......
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
......@@ -30,6 +31,7 @@ import java.util.*;
*/
public class ServiceHGSC001 extends ServiceBase {
@OperationLogAnnotation(operModul = "项目立项", operType = "查询", operDesc = "初始化页面")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC001.QUERY, new HGSC001());
......@@ -42,6 +44,7 @@ public class ServiceHGSC001 extends ServiceBase {
return inInfo;
}
@OperationLogAnnotation(operModul = "项目立项", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC001.QUERY, new HGSC001());
......@@ -56,6 +59,7 @@ public class ServiceHGSC001 extends ServiceBase {
}
@Override
@OperationLogAnnotation(operModul = "项目立项", operType = "删除", operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
......@@ -72,6 +76,7 @@ public class ServiceHGSC001 extends ServiceBase {
return inInfo;
}
@OperationLogAnnotation(operModul = "项目立项", operType = "完工", operDesc = "完工")
public EiInfo complete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
......@@ -87,6 +92,7 @@ public class ServiceHGSC001 extends ServiceBase {
return inInfo;
}
@OperationLogAnnotation(operModul = "项目立项", operType = "提交", operDesc = "提交")
public EiInfo commit(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
......@@ -102,6 +108,7 @@ public class ServiceHGSC001 extends ServiceBase {
return inInfo;
}
@OperationLogAnnotation(operModul = "项目立项", operType = "保存", operDesc = "保存")
public EiInfo save(EiInfo inInfo){
try {
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
......
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
......@@ -23,6 +24,7 @@ import java.util.stream.Collectors;
*/
public class ServiceHGSC002 extends ServiceBase {
@OperationLogAnnotation(operModul = "项目人员", operType = "查询", operDesc = "初始化页面")
public EiInfo initLoad(EiInfo inInfo) {
try {
List<Company> companyList = UserSessionUtils.getRoleCompany();
......@@ -40,6 +42,7 @@ public class ServiceHGSC002 extends ServiceBase {
return inInfo;
}
@OperationLogAnnotation(operModul = "项目人员", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC002.QUERY, new HGSC002());
......@@ -51,6 +54,7 @@ public class ServiceHGSC002 extends ServiceBase {
}
@Override
@OperationLogAnnotation(operModul = "项目人员", operType = "删除", operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
......@@ -66,6 +70,7 @@ public class ServiceHGSC002 extends ServiceBase {
return inInfo;
}
@OperationLogAnnotation(operModul = "项目人员", operType = "新增", operDesc = "新增")
public EiInfo save(EiInfo inInfo){
try {
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
......
......@@ -60,7 +60,6 @@ public class ServiceHGSC003 extends ServiceBase {
// 蓝图ids
List<Long> ids = ObjectUtils.listKey(resultRows, HGSC003.FIELD_id);
DaoUtils.update(HGSC003.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}});
// HGSCTools.THGSC003A.deleteByProIds(ids);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
......@@ -121,7 +120,11 @@ public class ServiceHGSC003 extends ServiceBase {
map.put("projCode",hgsc003.getProjCode());
List<HGSC003> oldHgsc003List = this.dao.query(HGSC003.QUERY,map);
for(HGSC003 o : oldHgsc003List){
AssertUtils.isTrue(!(o.getId().intValue() == hgsc003.getId().intValue()),"已存在此项目号的蓝图!");
if(Objects.nonNull(hgsc003.getId())&&hgsc003.getId()>0){
AssertUtils.isTrue(!(o.getId().intValue() == hgsc003.getId().intValue()),"已存在此项目号的蓝图!");
}else{
AssertUtils.isTrue(Objects.nonNull(o),"已存在此项目号的蓝图!");
}
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
......@@ -178,5 +181,22 @@ public class ServiceHGSC003 extends ServiceBase {
}
/**
* 蓝图查询下拉框
* @param inInfo
* @return
*/
public EiInfo blueprintComboBox(EiInfo inInfo){
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String companyCode = MapUtils.getString(queryMap, HGSC003.FIELD_company_code);
String blueprintStatus = MapUtils.getString(queryMap, HGSC003.FIELD_blueprint_status);
Map map = new HashMap();
map.put(HGSC003.FIELD_account_code, UserSessionUtils.getAccountCode());
map.put(HGSC003.FIELD_company_code, companyCode);
map.put(HGSC003.FIELD_blueprint_status, blueprintStatus);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.BLUEPRINT_BOX_BLOCK_ID), map,false);
return inInfo;
}
}
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.HGSC003;
import com.baosight.hggp.hg.sc.domain.HGSC003A;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.*;
/**
* @Author jhs
* @Date 2024/5/14 14:46
*/
public class ServiceHGSC003A extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC003A.QUERY, new HGSC003A());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC003A.QUERY, new HGSC003A());
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 蓝图ids
List<Long> ids = ObjectUtils.listKey(resultRows, HGSC003A.FIELD_id);
DaoUtils.update(HGSC003A.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}});
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
public EiInfo save(EiInfo inInfo){
try {
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
HGSC003A hgsc003a = new HGSC003A();
hgsc003a.fromMap(resultMap);
//查询蓝图
HGSC003 hgsc003 = (HGSC003) super.dao.get(HGSC003.QUERY,HGSC003.FIELD_id,hgsc003a.getBlueprintId());
//复制蓝图基本信息
hgsc003a.setCompanyCode(hgsc003.getCompanyCode());
hgsc003a.setCompanyName(hgsc003.getCompanyName());
hgsc003a.setDepCode(hgsc003.getDepCode());
hgsc003a.setDepName(hgsc003.getDepName());
hgsc003a.setProjCode(hgsc003.getProjCode());
hgsc003a.setProjName(hgsc003.getProjName());
this.checkSaveData(hgsc003a,hgsc003);
if(Objects.nonNull(hgsc003a.getId())&&hgsc003a.getId()!=0){
DaoUtils.update(HGSC003A.UPDATE, hgsc003a);
}else {
DaoUtils.insert(HGSC003A.INSERT, hgsc003a);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param hgsc003a
*/
private void checkSaveData(HGSC003A hgsc003a,HGSC003 hgsc003) {
if(Objects.nonNull(hgsc003a.getId())&&hgsc003a.getId()>0){
AssertUtils.isTrue(hgsc003.getBlueprintStatus().compareTo(HGConstant.EnablingStatus.TY) == 0,"蓝图已停用不可修改!");
}
AssertUtils.isEmpty(hgsc003a.getDrawingCode(), "请填写图号!");
AssertUtils.isEmpty(hgsc003a.getDrawingName(), "请填写图纸名称!");
Map<String,Object> map = new HashMap<>();
map.put("blueprintId",hgsc003a.getBlueprintId());
map.put("drawingCode",hgsc003a.getDrawingCode());
List<HGSC003A> oldhgsc003aList = this.dao.query(HGSC003A.QUERY,map);
for(HGSC003A o : oldhgsc003aList){
AssertUtils.isTrue(!(o.getId().intValue() == hgsc003a.getId().intValue()),"当前图号已存在!");
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(hgsc003a.getCompanyCode(), "请选择公司!");
AssertUtils.isEmpty(hgsc003a.getProjCode(), "请填写项目编号!");
AssertUtils.isEmpty(hgsc003a.getProjName(), "请填写项目名称!");
AssertUtils.isEmpty(hgsc003a.getBlueprintName(), "请填写蓝图名称!");
}
}
package com.baosight.hggp.hg.sc.service;
import cn.hutool.core.bean.BeanUtil;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.HGSC003;
import com.baosight.hggp.hg.sc.domain.HGSC004;
import com.baosight.hggp.hg.sc.domain.HGSC004A;
import com.baosight.hggp.util.*;
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 org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Author jhs
* @Date 2024/5/14 14:46
*/
public class ServiceHGSC004 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC004.QUERY, new HGSC004());
Map map = new HashMap();
map.put(HGSC004.FIELD_account_code, UserSessionUtils.getAccountCode());
map.put(HGSC003.FIELD_blueprint_status, HGConstant.EnablingStatus.QY);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID,DdynamicEnum.BLUEPRINT_BOX_BLOCK_ID),map,false
);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC004.QUERY, new HGSC004());
Map map = new HashMap();
map.put(HGSC004.FIELD_account_code, UserSessionUtils.getAccountCode());
map.put(HGSC003.FIELD_blueprint_status, HGConstant.EnablingStatus.QY);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID,DdynamicEnum.BLUEPRINT_BOX_BLOCK_ID),map,false
);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 蓝图ids
List<Long> ids = ObjectUtils.listKey(resultRows, HGSC004.FIELD_id);
//变更清单里面的公司、项目信息
Map<String,Object> map = new HashMap<>();
map.put("ids",ids);
List<HGSC004> hgsc004List = this.dao.query(HGSC004.QUERY,map, 0, -999999);
for(HGSC004 hgsc004 : hgsc004List){
//如果
if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.WTJ.intValue()){
//变更清单里面的公司、项目信息
Map<String,Object> mapA = new HashMap<>();
mapA.put("materialIds",ids);
List<HGSC004A> hgsc004AList = dao.query(HGSC004A.QUERY_ALL,mapA, 0, -999999);
if(!CollectionUtils.isEmpty(hgsc004AList)){
List<Long> detailIds = hgsc004AList.stream().map(HGSC004A::getId).collect(Collectors.toList());
DaoUtils.update(HGSC004A.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",detailIds);}});
}
DaoUtils.update(HGSC004.DELETE, hgsc004);
}else{
DaoUtils.update(HGSC004.UPDATE_DEL, hgsc004);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
public EiInfo save(EiInfo inInfo){
try {
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
HGSC004 hgsc004 = new HGSC004();
hgsc004.fromMap(resultMap);
HGSC003 hgsc003 = (HGSC003) super.dao.get(HGSC003.QUERY,HGSC004.FIELD_blueprint_code,hgsc004.getBlueprintCode());
hgsc004.setBlueprintId(hgsc003.getId());
this.checkSaveData(hgsc004,hgsc003);
if(Objects.nonNull(hgsc004.getId())&&hgsc004.getId()!=0){
DaoUtils.update(HGSC004.UPDATE, hgsc004);
//变更清单里面的公司、项目信息
Map<String,Object> map = new HashMap<>();
map.put("materialId",hgsc004.getId());
List<HGSC004A> hgsc004AList = dao.query(HGSC004A.QUERY_ALL,map, 0, -999999);
hgsc004AList.forEach(o->{
o.setProjCode(hgsc004.getProjCode());
o.setProjName(hgsc004.getProjName());
o.setCompanyCode(hgsc004.getCompanyCode());
o.setCompanyName(hgsc004.getCompanyName());
});
DaoUtils.updateBatch(HGSC004A.UPDATE, hgsc004AList);
}else {
hgsc004.setMaterialStatus(HGConstant.MaterialStatus.WTJ);
DaoUtils.insert(HGSC004.INSERT, hgsc004);
this.insertTree(hgsc004);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param hgsc004
*/
private void checkSaveData(HGSC004 hgsc004,HGSC003 hgsc003) {
if(Objects.nonNull(hgsc004.getId())&&hgsc004.getId()>0){
AssertUtils.isTrue(hgsc004.getMaterialStatus().compareTo(HGConstant.MaterialStatus.WTJ) > 0,"非未提交不可修改!");
AssertUtils.isTrue(hgsc003.getBlueprintStatus().compareTo(HGConstant.EnablingStatus.TY) == 0,"蓝图已停用不可修改!");
}
Map<String,Object> map = new HashMap<>();
map.put("blueprintId",hgsc004.getBlueprintId());
List<HGSC004> hgsc004List = this.dao.query(HGSC004.QUERY,map);
for(HGSC004 o : hgsc004List){
if(Objects.nonNull(hgsc004.getId())&&hgsc004.getId()>0){
AssertUtils.isTrue(!(o.getId().intValue() == hgsc004.getId().intValue()),"当前蓝图已存在!");
}else{
AssertUtils.isTrue(Objects.nonNull(o),"当前蓝图已存在!");
}
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(hgsc004.getCompanyCode(), "请选择公司!");
AssertUtils.isEmpty(hgsc004.getProjCode(), "请填写项目编号!");
AssertUtils.isEmpty(hgsc004.getProjName(), "请填写项目名称!");
AssertUtils.isEmpty(hgsc004.getBlueprintName(), "请填写蓝图名称!");
}
/**
* 录入树结构
*
* @param hgsc004
*/
private void insertTree(HGSC004 hgsc004) {
//变更清单里面的公司、项目信息
Map<String,Object> map = new HashMap<>();
map.put("companyCode",hgsc004.getCompanyCode());
map.put("projCode",hgsc004.getProjCode());
List<HGSC004A> hgsc004AList = dao.query(HGSC004A.QUERY_ALL,map, 0, -999999);
if(CollectionUtils.isEmpty(hgsc004AList)){
//录入树结构,公司
HGSC004A rootHgsc004A = new HGSC004A();
BeanUtil.copyProperties(hgsc004,rootHgsc004A,"id");
//因为获取不到id,所以根据公司编号+项目编号得到树结构
rootHgsc004A.setMaterialId(hgsc004.getId());
rootHgsc004A.setParentProdCode("root");
rootHgsc004A.setParentProdName(hgsc004.getCompanyName());
rootHgsc004A.setLeaf(2);//有叶子节点
rootHgsc004A.setLv(1);
rootHgsc004A.setSort(1);
rootHgsc004A.setProductCode(hgsc004.getCompanyCode());
rootHgsc004A.setProductName(hgsc004.getCompanyName());
DaoUtils.insert(HGSC004A.INSERT, rootHgsc004A);
//录入2级目录,项目
HGSC004A projectHgsc004A = new HGSC004A();
BeanUtil.copyProperties(hgsc004,projectHgsc004A,"id");
projectHgsc004A.setMaterialId(hgsc004.getId());
projectHgsc004A.setParentProdCode(rootHgsc004A.getProductCode());
projectHgsc004A.setParentProdName(rootHgsc004A.getProductName());
projectHgsc004A.setLeaf(2);//有叶子节点
projectHgsc004A.setLv(2);
projectHgsc004A.setSort(1);
projectHgsc004A.setProductCode(hgsc004.getProjCode());
projectHgsc004A.setProductName(hgsc004.getProjName());
DaoUtils.insert(HGSC004A.INSERT, projectHgsc004A);
}
}
}
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ005A;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.domain.HGSC003;
import com.baosight.hggp.hg.sc.domain.HGSC004;
import com.baosight.hggp.hg.sc.domain.HGSC004A;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.util.StringUtils;
import org.springframework.util.CollectionUtils;
import java.util.*;
/**
* @Author jhs
* @Date 2024/5/14 14:46
*/
public class ServiceHGSC004A extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC004A.QUERY, new HGSC004A());
Map map = new HashMap();
map.put(HGSC004A.FIELD_account_code, UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.PRODUCT_BLOCK_ID),map,false
);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC004A.QUERY, new HGSC004A());
Map map = new HashMap();
map.put(HGSC004A.FIELD_account_code, UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.PRODUCT_BLOCK_ID),map,false
);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 蓝图ids
List<Long> ids = ObjectUtils.listKey(resultRows, HGSC004A.FIELD_id);
DaoUtils.update(HGSC004A.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}});
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
public EiInfo save(EiInfo inInfo){
try {
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
HGSC004A hgsc004a = new HGSC004A();
hgsc004a.fromMap(resultMap);
//蓝图信息,用于蓝图状态校验
HGSC003 hgsc003 = (HGSC003) super.dao.get(HGSC003.QUERY,HGSC004A.FIELD_id,hgsc004a.getId());
//主表信息,用于取值
Long materialId = Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSC004A.FIELD_material_id));
HGSC004 hgsc004 = (HGSC004) super.dao.get(HGSC004.QUERY,HGSC004A.FIELD_id,materialId);
if(Objects.nonNull(hgsc004)){
hgsc004a.setCompanyCode(hgsc004.getCompanyCode());
hgsc004a.setCompanyName(hgsc004.getCompanyName());
hgsc004a.setProjCode(hgsc004.getProjCode());
hgsc004a.setProjName(hgsc004.getProjName());
hgsc004a.setDepCode(hgsc004.getDepCode());
hgsc004a.setDepName(hgsc004.getDepName());
hgsc004a.setMaterialId(hgsc004.getId());
hgsc004a.setLv(hgsc004a.getLv() + 1);
//不为4级都有叶子节点
if(hgsc004a.getLv().intValue() <= 4){
hgsc004a.setLeaf(2);
}else{
hgsc004a.setLeaf(1);
}
}
this.checkSaveData(hgsc004a,hgsc003);
if(Objects.nonNull(hgsc004a.getId())&&hgsc004a.getId()!=0){
DaoUtils.update(HGSC004A.UPDATE, hgsc004a);
}else {
hgsc004a.setProductStatus(HGConstant.ProductStatus.WTJ);
DaoUtils.insert(HGSC004A.INSERT, hgsc004a);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param hgsc004a
*/
private void checkSaveData(HGSC004A hgsc004a,HGSC003 hgsc003) {
if(Objects.nonNull(hgsc004a.getId())&&hgsc004a.getId()>0){
AssertUtils.isTrue(hgsc003.getBlueprintStatus().compareTo(HGConstant.EnablingStatus.TY) == 0,"蓝图已停用不可修改!");
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(hgsc004a.getCompanyCode(), "请选择公司!");
AssertUtils.isEmpty(hgsc004a.getProjCode(), "请填写项目编号!");
AssertUtils.isEmpty(hgsc004a.getProjName(), "请填写项目名称!");
}
//树查询服务
public EiInfo queryTreeNode(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String node = MapUtils.getString(queryRow, "node");
//获取物料详情数据
String projCode = StringUtils.toString(inInfo.get("projCode"));
String companyCode = StringUtils.toString(inInfo.get("companyCode"));
Map queryMap = new HashMap();
queryMap.put("companyCode", com.baosight.hggp.util.StringUtils.isNotBlank(companyCode) ? companyCode : "null");
queryMap.put("projCode", com.baosight.hggp.util.StringUtils.isNotBlank(projCode) ? projCode : "null");
queryMap.put("pEname", "$".equals(node) ? "root" : node);
//2 查询节点
List rows = dao.query("HGSC004A.queryTree", queryMap);
//3 增加节点block块
EiInfo outInfo = new EiInfo();
EiBlock outBlock = outInfo.addBlock(node);
outBlock.addRows(rows);
return outInfo;
}
/**
* 下拉框
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "存货档案",operType = "查询",operDesc = "下拉框")
public EiInfo queryProductComboBox(EiInfo inInfo) {
try {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.PRODUCT_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询存货档案失败");
}
return inInfo;
}
/**
* 修改提交状态
* @param inInfo
* @return
*/
public EiInfo updateProductStatus(EiInfo inInfo){
int i = 0;
try {
HGSC004A hgsc004a = new HGSC004A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgsc004a.fromMap(map);
DaoUtils.update(HGSC004A.UPDATE_PRODUCT_STATUS, hgsc004a);
}
HGSC004 hgsc004 = (HGSC004) super.dao.get(HGSC004.QUERY,HGSC001.FIELD_id,hgsc004a.getMaterialId());
if(Objects.nonNull(hgsc004)){
if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.WTJ.intValue()){
//如果是未提交则修改为部分提交
hgsc004.setMaterialStatus(HGConstant.MaterialStatus.BFTJ);
DaoUtils.update(HGSC004.UPDATE_MATERIAL_STATUS, hgsc004);
}else if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.BFTJ.intValue()){
//如果不存在未提交的,就标记主表为全部提交
Map<String,Object> mapA = new HashMap<>();
mapA.put("materialId",hgsc004a.getMaterialId());
mapA.put("productStatus",HGConstant.ProductStatus.WTJ);
mapA.put("notId",hgsc004a.getId());
List<HGSC004A> hgsc004AList = dao.query(HGSC004A.QUERY_ALL,mapA, 0, -999999);
if(!CollectionUtils.isEmpty(hgsc004AList)){
hgsc004.setMaterialStatus(HGConstant.MaterialStatus.QBTJ);
DaoUtils.update(HGSC004.UPDATE_MATERIAL_STATUS, hgsc004);
}
}
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleUpdateException(inInfo,i,e);
logError("修改失败", e.getMessage());
return inInfo;
}
return inInfo;
}
}
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.hg.sc.domain.HGSC005;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.*;
......@@ -18,6 +19,7 @@ import java.util.*;
*/
public class ServiceHGSC005 extends ServiceBase {
@OperationLogAnnotation(operModul = "生产计划", operType = "查询", operDesc = "初始化页面")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC005.QUERY, new HGSC005());
......@@ -32,6 +34,7 @@ public class ServiceHGSC005 extends ServiceBase {
return inInfo;
}
@OperationLogAnnotation(operModul = "生产计划", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC005.QUERY, new HGSC005());
......
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cg.domain.HGCG002;
import com.baosight.hggp.hg.cg.domain.HGCG002A;
import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.domain.HGSC001A;
import com.baosight.hggp.hg.sc.domain.HGSC005A;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.*;
/**
* @Author wwl
* @Date 2024/5/6 19:48
*/
public class ServiceHGSC005A extends ServiceBase {
@OperationLogAnnotation(operModul = "生产计划详情", operType = "查询", operDesc = "初始化页面")
public EiInfo initLoad(EiInfo inInfo) {
try {
String planCode = inInfo.getCellStr(EiConstant.queryBlock,0,HGSC005A.FIELD_plan_code);
inInfo = super.query(inInfo, HGSC005A.QUERY, new HGSC005A());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PLAN_PROCESS_BLOCK_ID), new HashMap<String, Object>(){{
put(HGSC005A.FIELD_plan_code,planCode);
}},false);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "生产计划详情", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC005A.QUERY, new HGSC005A());
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "生产计划详情", operType = "保存", operDesc = "保存计划详情")
public EiInfo save(EiInfo inInfo){
try {
List<HGSC005A> hgsc005AList = MapUtils.toDaoEPBase(inInfo, HGSC005A.class);
// 数据校验
this.checkSaveData(hgsc005AList);
// 保存数据
this.saveData(hgsc005AList);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + hgsc005AList.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
private void saveData(List<HGSC005A> hgsc005AList) {
for (HGSC005A hgsc005a : hgsc005AList) {
DaoUtils.update(HGSC005A.UPDATE_PLAN_DATE, hgsc005a);
}
}
private void checkSaveData(List<HGSC005A> hgsc005AList) {
for (HGSC005A hgsc005a : hgsc005AList) {
AssertUtils.isEmpty(hgsc005a.getPlanStartDate(), String.format("产品[%s]计划开工日期为空!", hgsc005a.getProductName()));
AssertUtils.isEmpty(hgsc005a.getPlanEndDate(), String.format("产品[%s]计划开始完工日期为空!", hgsc005a.getProductName()));
}
}
}
......@@ -114,31 +114,30 @@
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSC003 WHERE
DELETE FROM ${hggpSchema}.HGSC003 WHERE id = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGSC003
SET
id = #id#, <!-- 主键 -->
company_code = #companyCode#, <!-- 公司编码 -->
company_name = #companyName#, <!-- 公司名称 -->
dep_code = #depCode#, <!-- 部门编码 -->
dep_name = #depName#, <!-- 部门名称 -->
blueprint_code = #blueprintCode#, <!-- 蓝图编号 -->
blueprint_name = #blueprintName#, <!-- 蓝图名称 -->
proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 -->
blueprint_status = #blueprintStatus#, <!-- 蓝图状态 0:停用,1:启用 -->
approval_status = #approvalStatus#, <!-- 审批状态 0:待审;1:审核中;2:已审 -->
account_code = #accountCode#, <!-- 帐套 -->
created_by = #createdBy#, <!-- 创建人 -->
created_name = #createdName#, <!-- 创建人名称 -->
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 -->
WHERE
company_code = #companyCode#, <!-- 公司编码 -->
company_name = #companyName#, <!-- 公司名称 -->
dep_code = #depCode#, <!-- 部门编码 -->
dep_name = #depName#, <!-- 部门名称 -->
blueprint_code = #blueprintCode#, <!-- 蓝图编号 -->
blueprint_name = #blueprintName#, <!-- 蓝图名称 -->
proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 -->
blueprint_status = #blueprintStatus#, <!-- 蓝图状态 0:停用,1:启用 -->
approval_status = #approvalStatus#, <!-- 审批状态 0:待审;1:审核中;2:已审 -->
account_code = #accountCode#, <!-- 帐套 -->
created_by = #createdBy#, <!-- 创建人 -->
created_name = #createdName#, <!-- 创建人名称 -->
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 -->
WHERE id = #id#
</update>
<delete id="batchDelete">
......@@ -167,4 +166,30 @@
WHERE
ID = #id#
</update>
<select id="queryComboBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT DISTINCT
BLUEPRINT_CODE as "blueprintCode", <!-- 蓝图编号 -->
BLUEPRINT_NAME as "blueprintName" <!-- 蓝图名称 -->
FROM ${hggpSchema}.HGSC003
WHERE 1=1
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintStatus">
BLUEPRINT_STATUS = #blueprintStatus#
</isNotEmpty>
ORDER BY BLUEPRINT_CODE
</select>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HGSC003A">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
dep_name = #depName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintId">
blueprint_id = #blueprintId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintCode">
blueprint_code = #blueprintCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintName">
blueprint_name = #blueprintName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="drawingCode">
drawing_code like ('%$drawingCode$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="drawingName">
drawing_name like ('%$drawingName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
created_name = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
updated_name = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC003A">
SELECT
id as "id", <!-- 主键 -->
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编号 -->
dep_name as "depName", <!-- 部门名称 -->
blueprint_id as "blueprintId", <!-- 蓝图id -->
blueprint_code as "blueprintCode", <!-- 蓝图编号 -->
blueprint_name as "blueprintName", <!-- 蓝图名称 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
drawing_code as "drawingCode", <!-- 图号 -->
drawing_name as "drawingName", <!-- 图纸名称 -->
account_code as "accountCode", <!-- 帐套 -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更新人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime" <!-- 更新时间 -->
FROM ${hggpSchema}.HGSC003A WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC003A WHERE 1=1
<include refid="condition" />
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSC003A (id, <!-- 主键 -->
company_code, <!-- 公司编码 -->
company_name, <!-- 公司名称 -->
dep_code, <!-- 部门编号 -->
dep_name, <!-- 部门名称 -->
blueprint_id, <!-- 蓝图id -->
blueprint_code, <!-- 蓝图编号 -->
blueprint_name, <!-- 蓝图名称 -->
proj_code, <!-- 项目编码 -->
proj_name, <!-- 项目名称 -->
drawing_code, <!-- 图号 -->
drawing_name, <!-- 图纸名称 -->
account_code, <!-- 帐套 -->
created_by, <!-- 创建人 -->
created_name, <!-- 创建人名称 -->
created_time, <!-- 创建时间 -->
updated_by, <!-- 更新人 -->
updated_name, <!-- 修改人名称 -->
updated_time <!-- 更新时间 -->
)
VALUES (#id#, #companyCode#, #companyName#, #depCode#, #depName#, #blueprintId#, #blueprintCode#, #blueprintName#, #projCode#, #projName#, #drawingCode#, #drawingName#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSC003A WHERE id = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGSC003A
SET
company_code = #companyCode#, <!-- 公司编码 -->
company_name = #companyName#, <!-- 公司名称 -->
dep_code = #depCode#, <!-- 部门编号 -->
dep_name = #depName#, <!-- 部门名称 -->
blueprint_id = #blueprintId#, <!-- 蓝图id -->
blueprint_code = #blueprintCode#, <!-- 蓝图编号 -->
blueprint_name = #blueprintName#, <!-- 蓝图名称 -->
proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 -->
drawing_code = #drawingCode#, <!-- 图号 -->
drawing_name = #drawingName#, <!-- 图纸名称 -->
account_code = #accountCode#, <!-- 帐套 -->
created_by = #createdBy#, <!-- 创建人 -->
created_name = #createdName#, <!-- 创建人名称 -->
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 -->
WHERE id = #id#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HGSC004">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintId">
blueprint_id = #blueprintId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name like ('%$companyName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
dep_name = #depName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintCode">
blueprint_code = #blueprintCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintName">
blueprint_name like ('%$blueprintName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name like ('%$projName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="materialStatus">
material_status = #materialStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="approvalStatus">
approval_status = #approvalStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
created_name = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
updated_name = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="delStatus">
del_status = #delStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC004">
SELECT
id as "id", <!-- 主键 -->
blueprint_id as "blueprintId", <!-- 蓝图id -->
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编号 -->
dep_name as "depName", <!-- 部门名称 -->
blueprint_code as "blueprintCode", <!-- 蓝图编号 -->
blueprint_name as "blueprintName", <!-- 蓝图名称 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
material_status as "materialStatus", <!-- 物料状态 0:未提交,1:部分提交,2:全部提交 -->
approval_status as "approvalStatus", <!-- 审批状态 0:待审;1:审核中;2:已审 -->
del_status as "delStatus", <!-- 数据状态 0:保存,1:删除 -->
account_code as "accountCode", <!-- 帐套 -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更新人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime" <!-- 更新时间 -->
FROM ${hggpSchema}.HGSC004 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC004 WHERE 1=1
<include refid="condition" />
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSC004 (id, <!-- 主键 -->
blueprint_id, <!-- 蓝图id -->
company_code, <!-- 公司编码 -->
company_name, <!-- 公司名称 -->
dep_code, <!-- 部门编号 -->
dep_name, <!-- 部门名称 -->
blueprint_code, <!-- 蓝图编号 -->
blueprint_name, <!-- 蓝图名称 -->
proj_code, <!-- 项目编码 -->
proj_name, <!-- 项目名称 -->
material_status, <!-- 物料状态 0:未提交,1:部分提交,2:全部提交 -->
del_status, <!-- 数据状态 0:保存,1:删除 -->
approval_status, <!-- 审批状态 0:待审;1:审核中;2:已审 -->
account_code, <!-- 帐套 -->
created_by, <!-- 创建人 -->
created_name, <!-- 创建人名称 -->
created_time, <!-- 创建时间 -->
updated_by, <!-- 更新人 -->
updated_name, <!-- 修改人名称 -->
updated_time <!-- 更新时间 -->
)
VALUES (#id#, #blueprintId#, #companyCode#, #companyName#, #depCode#, #depName#, #blueprintCode#, #blueprintName#, #projCode#, #projName#, #materialStatus#, #delStatus#, #approvalStatus#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSC004 WHERE id = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGSC004
SET
blueprint_id = #blueprintId#, <!-- 蓝图id -->
company_code = #companyCode#, <!-- 公司编码 -->
company_name = #companyName#, <!-- 公司名称 -->
dep_code = #depCode#, <!-- 部门编号 -->
dep_name = #depName#, <!-- 部门名称 -->
blueprint_code = #blueprintCode#, <!-- 蓝图编号 -->
blueprint_name = #blueprintName#, <!-- 蓝图名称 -->
proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 -->
material_status = #materialStatus#, <!-- 物料状态 0:未提交,1:部分提交,2:全部提交 -->
del_status = #delStatus#, <!-- 数据状态 0:保存,1:删除 -->
approval_status = #approvalStatus#, <!-- 审批状态 0:待审;1:审核中;2:已审 -->
account_code = #accountCode#, <!-- 帐套 -->
created_by = #createdBy#, <!-- 创建人 -->
created_name = #createdName#, <!-- 创建人名称 -->
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 -->
WHERE id = #id#
</update>
<delete id="batchDelete">
DELETE FROM ${hggpSchema}.HGSC004 WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete>
<update id="updateDel">
UPDATE ${hggpSchema}.HGSC004
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DEL_STATUS = 1 <!-- 数据状态 0:保存,1:删除 -->
WHERE
ID = #id#
</update>
<update id="updateMaterialStatus">
UPDATE ${hggpSchema}.HGSC004
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
MATERIAL_STATUS = #materialStatus#
WHERE
ID = #id#
</update>
</sqlMap>
......@@ -26,6 +26,8 @@
<sqlMap namespace="HGSC005">
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
......@@ -36,16 +38,16 @@
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name = #companyName#
company_name like ('%$companyName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
proj_name like ('%projName%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planCode">
plan_code = #planCode#
plan_code = like ('%planCode%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="commitStatus">
commit_status = #commitStatus#
......@@ -53,6 +55,9 @@
<isNotEmpty prepend=" AND " property="finishDate">
finish_date = #finishDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="isSchedule">
is_schedule = #isSchedule#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
......@@ -93,6 +98,7 @@
proj_name as "projName", <!-- 项目名称 -->
plan_code as "planCode", <!-- 计划编码 -->
commit_status as "commitStatus", <!-- 提交状态 0:未提交;2:已提交 -->
is_schedule as "isSchedule", <!-- 是否排产 0:否;1:是 -->
finish_date as "finishDate", <!-- 完工日期 -->
account_code as "accountCode", <!-- 帐套 -->
dep_code as "depCode", <!-- 部门编码 -->
......@@ -188,6 +194,7 @@
plan_code, <!-- 计划编码 -->
commit_status, <!-- 提交状态 0:未提交;2:已提交 -->
finish_date, <!-- 完工日期 -->
is_schedule, <!-- 是否排产 0:否;1:是 -->
account_code, <!-- 帐套 -->
dep_code, <!-- 部门编码 -->
dep_name, <!-- 部门名称 -->
......@@ -198,7 +205,7 @@
updated_name, <!-- 修改人名称 -->
updated_time <!-- 更新时间 -->
)
VALUES (#id#, #matId#, #companyCode#, #companyName#, #projCode#, #projName#, #planCode#, #commitStatus#, #finishDate#, #accountCode#, #depCode#, #depName#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
VALUES (#id#, #matId#, #companyCode#, #companyName#, #projCode#, #projName#, #planCode#, #commitStatus#, #finishDate#, #isSchedule#, #accountCode#, #depCode#, #depName#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
</insert>
<delete id="delete">
......@@ -217,6 +224,7 @@
plan_code = #planCode#, <!-- 计划编码 -->
commit_status = #commitStatus#, <!-- 提交状态 0:未提交;2:已提交 -->
finish_date = #finishDate#, <!-- 完工日期 -->
is_schedule = #isSchedule#, <!-- 是否排产 0:否;1:是 -->
account_code = #accountCode#, <!-- 帐套 -->
dep_code = #depCode#, <!-- 部门编码 -->
dep_name = #depName#, <!-- 部门名称 -->
......
......@@ -87,7 +87,7 @@
product_code = #productCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productName">
product_name = #productName#
product_name like ('%productName%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="finishDate">
finish_date = #finishDate#
......@@ -170,7 +170,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
id asc
product_type asc ,plan_start_date asc
</isEmpty>
</dynamic>
......@@ -350,4 +350,27 @@
id = #id#
</update>
<update id="update_plan_date">
UPDATE ${hggpSchema}.HGSC005A
SET
plan_start_date = #planStartDate#, <!-- 计划开始日期 -->
plan_end_date = #planEndDate#, <!-- 计划结束日期 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 -->
WHERE
id = #id#
</update>
<select id="queryProcessComboBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT DISTINCT
process_name as "processName"
FROM ${hggpSchema}.HGSC005A
WHERE plan_code = #planCode#
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
ORDER BY process_name
</select>
</sqlMap>
......@@ -42,7 +42,8 @@ public class HGSJ001 extends DaoEPBase {
public static final String FIELD_STANDARD_DAYS = "standardDays"; /* 标准人天*/
public static final String FIELD_STANDARD_NUM = "standardNum"; /* 标准工序人数*/
public static final String FIELD_PRINC = "princ"; /* 负责人*/
public static final String FIELD_STATUS = "status"; /* 状态0.启用1.停止*/
public static final String FIELD_PRINC_NAME = "princName"; /* 负责人名称*/
public static final String FIELD_STATUS = "status"; /* 状态0.停止1.启用*/
public static final String COL_ID = "ID"; /* 主键id*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码 预留*/
......@@ -63,7 +64,7 @@ public class HGSJ001 extends DaoEPBase {
public static final String COL_STANDARD_DAYS = "STANDARD_DAYS"; /* 标准人天*/
public static final String COL_STANDARD_NUM = "STANDARD_NUM"; /* 标准工序人数*/
public static final String COL_PRINC = "PRINC"; /* 负责人*/
public static final String COL_STATUS = "STATUS"; /* 状态0.启用1.停止*/
public static final String COL_STATUS = "STATUS"; /* 状态0.停止1.启用*/
public static final String QUERY = "HGSJ001.query";
public static final String COUNT = "HGSJ001.count";
......@@ -92,7 +93,8 @@ public class HGSJ001 extends DaoEPBase {
private BigDecimal standardDays = new BigDecimal("0"); /* 标准人天*/
private BigDecimal standardNum = new BigDecimal("0"); /* 标准工序人数*/
private String princ = " "; /* 负责人*/
private Integer status = 0; /* 状态0.启用1.停止*/
private String princName = " "; /* 负责人名称*/
private Integer status = 0; /* 状态0.停止1.启用*/
/**
* initialize the metadata.
......@@ -186,8 +188,12 @@ public class HGSJ001 extends DaoEPBase {
eiColumn.setDescName("负责人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRINC_NAME);
eiColumn.setDescName("负责人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态0.启用1.停止");
eiColumn.setDescName("状态0.停止1.启用");
eiMetadata.addMeta(eiColumn);
......@@ -504,6 +510,15 @@ public class HGSJ001 extends DaoEPBase {
public void setPrinc(String princ) {
this.princ = princ;
}
public String getPrincName() {
return princName;
}
public void setPrincName(String princName) {
this.princName = princName;
}
/**
* get the status - 状态0.启用1.停止.
* @return the status
......@@ -547,6 +562,7 @@ public class HGSJ001 extends DaoEPBase {
setStandardDays(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_STANDARD_DAYS)), standardDays));
setStandardNum(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_STANDARD_NUM)), standardNum));
setPrinc(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRINC)), princ));
setPrincName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRINC_NAME)), princName));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
}
......@@ -576,6 +592,7 @@ public class HGSJ001 extends DaoEPBase {
map.put(FIELD_STANDARD_DAYS, StringUtils.toString(standardDays, eiMetadata.getMeta(FIELD_STANDARD_DAYS)));
map.put(FIELD_STANDARD_NUM, StringUtils.toString(standardNum, eiMetadata.getMeta(FIELD_STANDARD_NUM)));
map.put(FIELD_PRINC, StringUtils.toString(princ, eiMetadata.getMeta(FIELD_PRINC)));
map.put(FIELD_PRINC_NAME, StringUtils.toString(princName, eiMetadata.getMeta(FIELD_PRINC_NAME)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
return map;
......
......@@ -202,6 +202,7 @@ public class ServiceHGSJ003 extends ServiceEPBase {
param.put(HGSJ003.FIELD_FACTORY_CODE, map.get("orgEname"));
param.put(HGSJ003.FIELD_FACTORY_NAME, map.get("orgCname"));
param.put(HGSJ003.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
param.put(HGSJ003.FIELD_STATUS, CommonConstant.YesNo.YES_1);
//param.put("orgType", OrgTypeEnum.COMPANY.getCode());
//param.put("loginName",UserSession.getLoginName());
param.put(HGSJ003.FIELD_ACCOUNT_CODE,UserSessionUtils.getAccountCode());
......
......@@ -22,7 +22,8 @@
STANDARD_DAYS as "standardDays", <!-- 标准人天 -->
STANDARD_NUM as "standardNum", <!-- 标准工序人数 -->
PRINC as "princ", <!-- 负责人 -->
STATUS as "status" <!-- 状态0.启用1.停止 -->
PRINC_NAME as "princName", <!-- 负责人名称 -->
STATUS as "status" <!-- 状态0.停止1.启动 -->
</sql>
<sql id="authCondition">
......@@ -104,6 +105,9 @@
<isNotEmpty prepend=" AND " property="princ">
PRINC LIKE CONCAT('%', #princ#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="princName">
PRINC_NAME LIKE CONCAT('%', #princName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
......@@ -217,9 +221,10 @@
STANDARD_DAYS, <!-- 标准人天 -->
STANDARD_NUM, <!-- 标准工序人数 -->
PRINC, <!-- 负责人 -->
STATUS <!-- 状态0.启用1.停止 -->
PRINC_NAME,
STATUS <!-- 状态0.停止1.启动 -->
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #factoryCode#, #factoryName#, #processCode#, #processName#, #unit#, #standardJob#, #standardDays#, #standardNum#, #princ#, #status#)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #factoryCode#, #factoryName#, #processCode#, #processName#, #unit#, #standardJob#, #standardDays#, #standardNum#, #princ#, #princName#,#status#)
</insert>
<delete id="delete">
......@@ -260,7 +265,8 @@
STANDARD_DAYS = #standardDays#, <!-- 标准人天 -->
STANDARD_NUM = #standardNum#, <!-- 标准工序人数 -->
PRINC = #princ#, <!-- 负责人 -->
STATUS = #status# <!-- 状态0.启用1.停止 -->
PRINC_NAME = #princName#,
STATUS = #status# <!-- 状态0.停止1.启动 -->
WHERE
ID = #id#
</update>
......@@ -278,14 +284,16 @@
<select id="queryProcessCode" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
PROCESS_CODE as "processCode", <!-- 工序编码 -->
CONCAT('[',FACTORY_NAME,']',PROCESS_NAME) as "processName", <!-- 工序名称 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
UNIT AS "unit"
PROCESS_CODE as "processCode", <!-- 工序编码 -->
CONCAT('[',FACTORY_NAME,']',PROCESS_NAME) as "processName", <!-- 工序名称 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
UNIT AS "unit",
STATUS as "status",
DELETE_FLAG as "deleteFlag"
FROM ${hggpSchema}.HGGY001 WHERE 1=1
<include refid="condition" />
group by PROCESS_CODE,PROCESS_NAME,FACTORY_CODE,FACTORY_NAME,UNIT
group by PROCESS_CODE,PROCESS_NAME,FACTORY_CODE,FACTORY_NAME,UNIT,STATUS,DELETE_FLAG
</select>
<!--查询用户所在的公司-->
......@@ -295,10 +303,16 @@
a.ORG_CNAME as "orgCname"
from ${platSchema}.txsog01 a
left join ${platSchema}.txsog02 b on a.ORG_ID = b.ORG_ID
where
a.ACCOUNT_CODE = #accountCode#
and a.ORG_TYPE = #orgType#
<!--and b.USER_ID = #userId#-->
where 1=1
<isNotEmpty prepend=" AND " property="accountCode">
a.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend="AND" property="orgType">
a.ORG_TYPE = #orgType#
</isNotEmpty>
<isNotEmpty prepend="AND" property="userId">
b.USER_ID = #userId#
</isNotEmpty>
</select>
</sqlMap>
......@@ -370,6 +370,9 @@
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
</select>
<select id="queryCompanyCode" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
......
......@@ -2,11 +2,18 @@ package com.baosight.hggp.hg.zl.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.hg.zl.utils.HGZLUtils;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
......@@ -31,9 +38,9 @@ public class ServiceHGZL001 extends ServiceBase {
@OperationLogAnnotation(operModul = "入库质检单", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGZL001().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
......@@ -150,17 +157,19 @@ public class ServiceHGZL001 extends ServiceBase {
@OperationLogAnnotation(operModul = "质量巡检单",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
// HPZL001 fZl001 = new HPZL001();
// fZl001.fromMap(resultRows.get(i));
// AssertUtils.isTrue(CommonConstant.YesNo.YES_1.equals(fZl001.getStatus()),
// String.format("单号[%s]的状态为\"已处理\"不允许删除", fZl001.getCheckNo()));
// DaoUtils.update(HPZL001.DELETE, resultRows.get(i));
List<HGZL001> fZl001s = MapUtils.toDaoEPBase(inInfo, HGZL001.class);
Map<String, HGZL001> dbZl001Map = HGZLUtils.HgZl001.lockGetDataEp(fZl001s);
for (HGZL001 fZl001 : fZl001s) {
String checkNo = fZl001.getCheckNo();
HGZL001 dbZl010 = dbZl001Map.get(checkNo);
AssertUtils.isEquals(CommonConstant.YesNo.YES_1, dbZl010.getStatus(),
String.format("单号[%s]的状态为\"已处理\",不允许删除", checkNo));
dbZl010.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode());
DaoUtils.update(HGZL001.DELETE, dbZl010);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
inInfo.setMsg("操作成功!本次对[" + fZl001s.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
......@@ -176,22 +185,55 @@ public class ServiceHGZL001 extends ServiceBase {
@OperationLogAnnotation(operModul = "质量巡检单",operType = "修改",operDesc = "已处理")
public EiInfo doProcess(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
// HPZL001 fZl001 = new HPZL001();
// fZl001.fromMap(resultRows.get(i));
///* fZl001.setCheckUser(UserSession.getLoginName());
// fZl001.setCheckUserName(UserSession.getLoginCName());*/
// fZl001.setStatus(CommonConstant.YesNo.YES_1);
// DaoUtils.update(HGSqlConstant.HPZL001.DO_PROCESS, fZl001);
}
List<HGZL001> fZl001s = MapUtils.toDaoEPBase(inInfo, HGZL001.class);
Map<String, HGZL001> dbZl001Map = HGZLUtils.HgZl001.lockGetDataEp(fZl001s);
// 数据校验
this.checkProcessData(fZl001s, dbZl001Map);
// 保存数据
this.saveProcessData(fZl001s, dbZl001Map);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据处理成功!");
inInfo.setMsg("操作成功!本次对[" + fZl001s.size() + "]条数据处理成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "提交失败");
LogUtils.setDetailMsg(inInfo, e, "处理失败");
}
return inInfo;
}
/**
* 校验数据
*
* @param fZl001s
* @param dbZl001Map
*/
private void checkProcessData(List<HGZL001> fZl001s, Map<String, HGZL001> dbZl001Map) {
for (HGZL001 fZl001 : fZl001s) {
String checkNo = fZl001.getCheckNo();
HGZL001 dbZl003 = dbZl001Map.get(checkNo);
AssertUtils.isNotEquals(CommonConstant.YesNo.NO_0, dbZl003.getStatus(),
String.format("质检单[%s]状态不是\"未处理\",不允许操作", checkNo));
AssertUtils.isNotEquals(fZl001.getQualifyQty().add(fZl001.getUnqualifyQty()), dbZl003.getReceiveQty(),
String.format("质检单[%s]的合格数量加不合格数量必须等于收货数量", checkNo));
}
}
/**
* 保存数据
*
* @param fZl001s
* @param dbZl001Map
*/
private void saveProcessData(List<HGZL001> fZl001s, Map<String, HGZL001> dbZl001Map) {
for (HGZL001 fZl001 : fZl001s) {
String checkNo = fZl001.getCheckNo();
HGZL001 dbZl001 = dbZl001Map.get(checkNo);
dbZl001.setQualifyQty(fZl001.getQualifyQty());
dbZl001.setUnqualifyQty(fZl001.getUnqualifyQty());
dbZl001.setStatus(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGSqlConstant.HgZl001.PROCESS, dbZl001);
// 更新收货单状态
HGCGTools.HgCg003.updateCheck(dbZl001);
}
}
}
package com.baosight.hggp.hg.zl.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.hg.zl.domain.HGZL001A;
import com.baosight.hggp.hg.zl.tools.HGZLTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/1/25,15:25
*/
public class ServiceHGZL001A extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单", operType = "查询", operDesc = "质量巡检单-附件清单-初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
// 查询物料ID所对应的项目名称和部件名称
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
HGZL001 dbZl001 = HGZLTools.HgZl001.get(MapUtils.getLong(queryMap, "checkId"));
inInfo.addBlock(CommonConstant.Field.DETAIL).addRow(dbZl001);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGZL001A().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单", operType = "查询", operDesc = "质量巡检单-附件清单-查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.projectEnv.RUN.equalsIgnoreCase(projectEnv)) {
inInfo = super.query(inInfo, "HGZL001A.queryRun", new HGZL001A());
} else {
inInfo = super.query(inInfo, "HGZL001A.queryDev", new HGZL001A());
}
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "附件清单", operType = "新增", operDesc = "质量巡检单-附件清单-新增操作")
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGZL001A fZl001A = new HGZL001A();
fZl001A.fromMap(resultRows.get(i));
// 校验质检单是否已处理
HGZL001 dbZl001 = HGZLTools.HgZl001.get(fZl001A.getCheckId());
AssertUtils.isTrue(CommonConstant.YesNo.YES_1.equals(dbZl001.getStatus()),
String.format("质检单[%s]状态为\"已处理\",不能上传附件", dbZl001.getCheckNo()));
DaoUtils.insert(HGZL001A.INSERT, fZl001A);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单", operType = "删除", operDesc = "质量巡检单-附件清单-删除操作")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGZL001A fZl001A = new HGZL001A();
fZl001A.fromMap(resultRows.get(i));
// 校验质检单是否已处理
HGZL001 dbZl001 = HGZLTools.HgZl001.get(fZl001A.getCheckId());
AssertUtils.isTrue(CommonConstant.YesNo.YES_1.equals(dbZl001.getStatus()),
String.format("质检单[%s]状态为\"已处理\",不能删除附件", dbZl001.getCheckNo()));
DaoUtils.update(HGZL001A.DELETE, fZl001A);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.zl.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cg.domain.HGCG003;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.BeanUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 选择生产任务
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHGZL001B extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "生产任务查询", operType = "查询", operDesc = "质量巡检单-生产任务查询-初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUP_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG003().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "生产任务查询", operType = "查询", operDesc = "质量巡检单-生产任务查询-查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HGCG003.FIELD_STATUS, HGConstant.CgReceiveStatus.S_2);
inInfo = super.query(inInfo, HGCG003.QUERY, new HGCG003());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 生成巡检单
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产任务查询", operType = "新增", operDesc = "质量巡检单-生产任务查询-生成巡检单")
public EiInfo confirm(EiInfo inInfo) {
try {
List<HGCG003> fCg003s = MapUtils.toDaoEPBase(inInfo, HGCG003.class);
Map<String, HGCG003> dbCg003Map = HGCGUtils.HgCg003.lockGetDataEp(fCg003s);
// 数据校验
this.checkConfirmData(fCg003s, dbCg003Map);
// 生成巡检单
this.saveConfirmData(fCg003s, dbCg003Map);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "生成质检单失败");
}
return inInfo;
}
/**
* 校验数据
*
* @param fCg003s
* @param dbCg003Map
*/
private void checkConfirmData(List<HGCG003> fCg003s, Map<String, HGCG003> dbCg003Map) {
for (HGCG003 fCg003 : fCg003s) {
String receiveNo = fCg003.getReceiveNo();
HGCG003 dbSc003 = dbCg003Map.get(fCg003.getReceiveNo());
AssertUtils.isNotEquals(HGConstant.CgReceiveStatus.S_2, dbSc003.getStatus(),
String.format("采购收货单[%s]状态不是\"已收货\",不允许操作", receiveNo));
}
}
/**
* 保存数据
*
* @param fCg003s
* @param dbCg003Map
*/
private void saveConfirmData(List<HGCG003> fCg003s, Map<String, HGCG003> dbCg003Map) {
for (HGCG003 fCg003 : fCg003s) {
String receiveNo = fCg003.getReceiveNo();
// 生成新数据
HGCG003 dbSc003b = dbCg003Map.get(receiveNo);
HGZL001 newZl001 = BeanUtils.copy(dbSc003b, HGZL001.class);
newZl001.setCheckNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HPZL001_NUMBER));
newZl001.setReceiptDate(DateUtils.shortDate());
newZl001.setStatus(CommonConstant.YesNo.NO_0);
newZl001.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGZL001.INSERT, newZl001);
// 更新收货单状态
HGCGTools.HgCg003.updateStatus(receiveNo, HGConstant.CgReceiveStatus.S_3);
}
}
}
......@@ -37,6 +37,7 @@
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="HGXSDataAuth.authCondition"/>
<include refid="idCondition"/>
<include refid="customCondition"/>
......@@ -58,9 +59,6 @@
<isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkNo">
CHECK_NO = #checkNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveNo">
RECEIVE_NO = #receiveNo#
</isNotEmpty>
......@@ -95,11 +93,11 @@
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reqNo">
REQ_NO = #reqNo#
<isNotEmpty prepend=" AND " property="checkNo">
CHECK_NO = #checkNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reqNos">
REQ_NO IN <iterate open="(" close=")" conjunction="," property="reqNos">#reqNos[]#</iterate>
<isNotEmpty prepend=" AND " property="checkNos">
CHECK_NO IN <iterate open="(" close=")" conjunction="," property="checkNos">#checkNos[]#</iterate>
</isNotEmpty>
</sql>
......@@ -163,16 +161,14 @@
WIDTH, <!-- 宽度 -->
THICK, <!-- 厚度 -->
RECEIVE_QTY, <!-- 收货数量 -->
QUALIFY_QTY, <!-- 合格数量 -->
UNQUALIFY_QTY, <!-- 不合格数量 -->
RECEIVE_UNIT_WEIGHT, <!-- 收货单重 -->
RECEIVE_WEIGHT, <!-- 收货重量 -->
STATUS <!-- 状态:0-质检中,1-质检完成 -->
) VALUES (
#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #receiptDate#, #checkNo#, #receiveNo#, #inventType#,
#inventCode#, #inventName#, #specId#, #spec#, #material#, #unit#, #length#, #width#, #thick#, #receiveQty#,
#qualifyQty#, #unqualifyQty#, #receiveUnitWeight#, #receiveWeight#, #status#
#receiveUnitWeight#, #receiveWeight#, #status#
)
</insert>
......@@ -184,4 +180,23 @@
WHERE CHECK_NO = #checkNo#
</delete>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGZL001
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 已处理 -->
<update id="process">
UPDATE ${hggpSchema}.HGZL001
SET
STATUS = #status#,
QUALIFY_QTY = #qualifyQty#, <!-- 合格数量 -->
UNQUALIFY_QTY = #unqualifyQty#, <!-- 不合格数量 -->
<include refid="updateRevise"/>
WHERE CHECK_NO = #checkNo#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGZL001A">
<sql id="column">
A.ID as "id",
A.ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
A.DEP_CODE as "depCode", <!-- 部门编码 -->
A.CREATED_BY as "createdBy", <!-- 记录创建者 -->
A.CREATED_NAME as "createdName", <!-- 记录创建名称 -->
A.CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
A.UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
A.UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
A.DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
A.DOC_TYPE as "docType", <!-- 附件类型 -->
A.CHECK_ID as "checkId", <!-- 质量单ID -->
A.DOC_ID as "docId" <!-- 文件ID -->
</sql>
<sql id="columnDev">
<include refid="column"/>,
B.DOC_NAME as "docName" <!-- 文件名称 -->
</sql>
<sql id="columnRun">
<include refid="column"/>,
B.RES_CNAME as "docName" <!-- 文件名称 -->
</sql>
<sql id="condition">
<include refid="customCondition"/>
<isNotEmpty prepend=" AND " property="id">
A.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
A.DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docType">
A.DOC_TYPE = #docType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkId">
A.CHECK_ID = #checkId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
A.DOC_ID = #docId#
</isNotEmpty>
</sql>
<!-- 开发环境 -->
<sql id="conditionDev">
AND A.DOC_ID = B.DOC_ID
<include refid="condition"/>
<isNotEmpty prepend=" AND " property="docName">
B.DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
</sql>
<!-- 正式环境 -->
<sql id="conditionRun">
AND A.DOC_ID = B.RES_ID
<include refid="condition"/>
<isNotEmpty prepend=" AND " property="docName">
B.RES_CNAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="createdDateFrom">
A.CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateTo">
A.CREATED_TIME &lt;= CONCAT(REPLACE(#createdDateTo#, '-', ''), '235959')
</isNotEmpty>
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="order">
$orderBy$
</isNotEmpty>
<isEmpty property="order">
A.ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="queryDev" resultClass="com.baosight.hggp.hg.zl.domain.HGZL001A">
SELECT
<include refid="columnDev"/>
FROM ${hggpSchema}.HGZL001A A, ${platSchema}.TEUDM02 B
WHERE 1=1
<include refid="conditionDev"/>
<include refid="order"/>
</select>
<select id="countDev" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGZL001A A, ${platSchema}.TEUDM02 B
WHERE 1=1
<include refid="conditionDev"/>
</select>
<select id="queryRun" resultClass="com.baosight.hggp.hg.zl.domain.HGZL001A">
SELECT
<include refid="columnRun"/>
FROM ${hggpSchema}.HGZL001A A, ${platSchema}.TEUDM05 B
WHERE 1=1
<include refid="conditionRun"/>
<include refid="order"/>
</select>
<select id="countRun" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGZL001A A, ${platSchema}.TEUDM05 B
WHERE 1=1
<include refid="conditionRun"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGZL001A (
ACCOUNT_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 预留 -->
CHECK_ID, <!-- 巡检单ID -->
DOC_TYPE, <!-- 文件类型 -->
DOC_ID, <!-- 文件ID -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME <!-- 创建时间 -->
) VALUES (
#accountCode#, #depCode#, #checkId#, #docType#, #docId#, #createdBy#,
#createdName#, #createdTime#
)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGZL001A WHERE ID = #id#
</delete>
</sqlMap>
package com.baosight.hggp.hg.zl.tools;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.util.AssertUtils;
import org.apache.commons.collections.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author:songx
* @date:2024/5/18,15:12
*/
public class HGZLTools {
/**
* @author:songx
* @date:2024/5/18,15:12
*/
public static class HgZl001 {
/**
* 锁
*
* @param checkNos
* @return
*/
public static void lock(List<String> checkNos) {
if (CollectionUtils.isEmpty(checkNos)) {
return;
}
Map paramMap = new HashMap();
paramMap.put("checkNos", checkNos);
DaoBase.getInstance().update(HGSqlConstant.HgZl001.LOCK, paramMap);
}
/**
* @param id
*/
public static HGZL001 get(Long id) {
AssertUtils.isNull(id, "ID不能为空");
Map paramMap = new HashMap();
paramMap.put(HGZL001.FIELD_ID, id);
List<HGZL001> results = DaoBase.getInstance().query(HGZL001.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param checkNos
* @return
*/
public static List<HGZL001> list(List<String> checkNos) {
AssertUtils.isEmpty(checkNos, "计划号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("checkNos", checkNos);
return DaoBase.getInstance().query(HGZL001.QUERY, paramMap);
}
/**
* 查询
*
* @param checkNos
* @return
*/
public static Map<String, HGZL001> map(List<String> checkNos) {
List<HGZL001> results = list(checkNos);
return results.stream().collect(Collectors.toMap(HGZL001::getCheckNo, item -> item));
}
}
}
......@@ -2,10 +2,13 @@ package com.baosight.hggp.hg.zl.utils;
import com.baosight.hggp.hg.utils.HGUtils;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.hg.zl.tools.HGZLTools;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.hggp.util.StringUtils;
import java.util.List;
import java.util.Map;
/**
......@@ -36,5 +39,28 @@ public class HGZLUtils {
queryRow.put(HGZL001.FIELD_RECEIPT_DATE, DateUtils.formatShort(receiptDate));
}
}
/**
* 锁并且获取数据
*
* @param fZl001s
* @return
*/
public static Map<String, HGZL001> lockGetDataEp(List<? extends HGZL001> fZl001s) {
return lockGetData(ObjectUtils.listEpKey(fZl001s, HGZL001.FIELD_CHECK_NO));
}
/**
* 锁并且获取数据
*
* @param checkNos
* @return
*/
public static Map<String, HGZL001> lockGetData(List<String> checkNos) {
// 锁
HGZLTools.HgZl001.lock(checkNos);
// db数据
return HGZLTools.HgZl001.map(checkNos);
}
}
}
......@@ -28,6 +28,9 @@
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC001.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC001A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC002.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC005.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC005A.xml"/>
<!-- 財務 -->
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW001.xml"/>
......
......@@ -16,7 +16,7 @@ $(function() {
let template = '';
if (item.id){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showFlowDetail(' + item.id + ',\''+item.inventCode+'\')" >工艺流程</a>';
+ 'onclick="showFlowDetail(' + item.id + ',\''+item.inventCode+'\','+item.flowId+')" >工艺流程</a>';
if (item.flowId>0){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ')" >工艺流程详情</a>';
......@@ -223,9 +223,9 @@ function showDetail(id) {
});
}
function showFlowDetail(id,inventCode) {
function showFlowDetail(id,inventCode,flowId) {
JSColorbox.open({
href: "HGPZ005B?methodName=initLoad&inqu_status-0-parentId=" + id+"&inqu_status-0-inventCode="+inventCode,
href: "HGPZ005B?methodName=initLoad&inqu_status-0-parentId=" + id+"&inqu_status-0-inventCode="+inventCode+"&inqu_status-0-flowId="+flowId,
title: "<div style='text-align: center;'>工艺流程</div>",
width: "75%",
height: "80%",
......
......@@ -56,9 +56,21 @@ $(function (){
$("#result").on("click", function () {
let id = $("#inqu_status-0-parentId").val();
let inventCode = $("#inqu_status-0-inventCode").val();
let flowId = $("#inqu_status-0-flowId").val();
let rows = resultGrid.getCheckedRows();
parent.JSColorbox.setValueCallback({"id":id,"inventCode":inventCode,"rows":rows[0]});
parent.JSColorbox.close();
let flag = true;
$.each(rows, function(index, item) {
let id= item.get("id");
if(id == flowId){
message("当前选中的公司流程 ["+(item.get("factoryName"))+" - "+(item.get("flowName"))+"] 已经绑定,无法重复绑定!");
flag = false;
return false;
}
});
if (flag){
parent.JSColorbox.setValueCallback({"id":id,"inventCode":inventCode,"rows":rows[0]});
parent.JSColorbox.close();
}
});
})
......
......@@ -22,6 +22,7 @@
<EF:EFInput blockId="inqu_status" row="0" ename="flowName" cname="流程名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="上级ID" colWidth="3" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="inventCode" cname="存货编码" colWidth="3" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="flowId" cname="流程ID" colWidth="3" type="hidden"/>
</div>
</EF:EFRegion>
......
......@@ -37,11 +37,13 @@ $(function () {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ',\''+item.companyCode+'\',\''+item.companyName+'\',\''+item.groupCode+'\',\''+item.groupName+'\')" >计划详情</a>';
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="updateStatus(' + item.id + ',1)" >启用</a>';
} else if (auditStatus == 1) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateStatus(' + item.id + ',0)" >停止</a>';
'onclick="updateStatus(' + item.id + ',1)" >审批完成</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateStatus(' + item.id + ',-1)" >审批未通过</a>';
} else if (auditStatus == -1) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateStatus(' + item.id + ',1)" >审批完成</a>';
}
}
return template;
......@@ -300,8 +302,8 @@ let save = function (btnNode) {
function updateStatus(id,deviceStatus) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-deviceStatus", deviceStatus);
EiCommunicator.send('HGSB001', 'updateStatus', inEiInfo, {
inEiInfo.set("result-0-planStatus", deviceStatus);
EiCommunicator.send('HGSB002', 'updateStatus', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
query();
......
......@@ -43,7 +43,7 @@
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<%--blockName="factoryCodeBox_block_id"--%>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="210" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
......@@ -79,8 +79,8 @@
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="planStatus" cname="审批状态" width="80" align="center" readonly="false" required="true" defaultValue="1">
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
<EF:EFComboColumn ename="planStatus" cname="审批状态" width="80" align="center" readonly="false" required="true" defaultValue="0">
<EF:EFCodeOption codeName="hggp.hgsb.approveStatus"/>
</EF:EFComboColumn>
<EF:EFColumn cname="创建人" ename="createdName" align="center" width="100" readonly="true" required="false"
enable="false"/>
......
......@@ -50,7 +50,7 @@ $(function () {
if(deviceType) {
// 返回我们过滤后的数据集
return _.filter(deviceCodeBox, function (item) {
return item["param1Field"]==deviceType;
return item["param1Field"]==deviceType && item["param3Field"] == "true";
})
}
return deviceCodeBox;
......
......@@ -67,7 +67,7 @@ $(function () {
if(companyCode) {
// 返回我们过滤后的数据集
return _.filter(deviceCodeBox, function (item) {
return item["param2Field"] === companyCode;
return item["param2Field"] === companyCode && item["param3Field"] == "true";
})
}
return deviceCodeBox;
......
......@@ -167,7 +167,7 @@ let query = function () {
*/
function taskResult() {
JSColorbox.open({
href: "HGSB004B?methodName=initLoad&inqu_status-0-pageNumber=HGSB004&inqu_status-0-planType="+1,
href: "HGSB004B?methodName=initLoad&inqu_status-0-pageNumber=HGSB004&inqu_status-0-planType="+1+"&inqu_status-0-planStatus="+1,
title: "<div style='text-align: center;'>选择设备计划任务</div>",
width: "80%",
height: "90%",
......
......@@ -33,6 +33,7 @@
<EF:EFInput blockId="inqu_status" row="0" ename="inspecUserName" cname="点检人名称" value="${userName}" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="planType" cname="计划类型" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="taskStatus" cname="任务类型" value="0" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="planStatus" cname="审批状态" value="1" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="pageNumber" cname="页面号" type="hidden"/>
</div>
</EF:EFRegion>
......@@ -78,7 +79,7 @@
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="planStatus" cname="审批状态" width="80" align="center" readonly="false" required="true" defaultValue="1">
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
<EF:EFCodeOption codeName="hggp.hgsb.approveStatus"/>
</EF:EFComboColumn>
<%--<EF:EFColumn cname="创建人" ename="createdName" align="center" width="100" readonly="true" required="false"
enable="false"/>
......
......@@ -25,7 +25,7 @@ $(function () {
if (item.companyCode) {
if (auditStatus == 1){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ',\''+item.companyCode+'\',\''+item.companyName+'\')" >点检详情</a>';
+ 'onclick="showDetail(' + item.id + ',\''+item.companyCode+'\',\''+item.companyName+'\')" >保养详情</a>';
}
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
......@@ -167,7 +167,7 @@ let query = function () {
*/
function taskResult() {
JSColorbox.open({
href: "HGSB004B?methodName=initLoad&inqu_status-0-pageNumber=HGSB005&inqu_status-0-planType="+2,
href: "HGSB004B?methodName=initLoad&inqu_status-0-pageNumber=HGSB005&inqu_status-0-planType="+2+"&inqu_status-0-planStatus="+1,
title: "<div style='text-align: center;'>选择设备计划任务</div>",
width: "80%",
height: "90%",
......
......@@ -15,27 +15,27 @@ $(function () {
field: "remainderDays",
template: function (item) {
let template = '';
if (isBlank(item.checkResult.trim()) || isBlank(item.docId.trim())){
return item["remainderDays"];
}else {
if (!isBlank(item.checkResult.trim()) || !isBlank(item.docId.trim())){
return "0";
}else {
return item["remainderDays"];
}
}
}, {
field: "checkStatus",
template: function (item) {
let template = '';
if (isBlank(item.checkResult.trim()) || isBlank(item.docId.trim())){
return "未点检";
}else {
if (!isBlank(item.checkResult.trim()) || !isBlank(item.docId.trim())){
return "已点检";
}else {
return "未点检";
}
}
}, {
field: "earlyStatus",
template: function (item) {
let earlyStatus;
if (!isBlank(item.checkResult.trim()) || isBlank(!item.docId.trim())){
if (!isBlank(item.checkResult.trim()) || !isBlank(item.docId.trim())){
earlyStatus = "<span>已完成</span>";;
}else if (item.remainderDays == 0){
earlyStatus = "<span style='color: #67c20b'>点检期</span>";
......
......@@ -102,27 +102,27 @@ $(function () {
field: "remainderDays",
template: function (item) {
let template = '';
if (isBlank(item.checkResult.trim()) || isBlank(item.docId.trim())){
return item["remainderDays"];
}else {
if (!isBlank(item.checkResult.trim()) || !isBlank(item.docId.trim())){
return "0";
}else {
return item["remainderDays"];
}
}
}, {
field: "upkeepStatus",
template: function (item) {
let template = '';
if (isBlank(item.checkResult.trim()) || isBlank(item.docId.trim())){
return "未保养";
}else {
if (!isBlank(item.checkResult.trim()) || !isBlank(item.docId.trim())){
return "已保养";
}else {
return "未保养";
}
}
}, {
field: "earlyStatus",
template: function (item) {
let earlyStatus;
if (!isBlank(item.checkResult.trim()) || isBlank(!item.docId.trim())){
if (!isBlank(item.checkResult.trim()) || !isBlank(item.docId.trim())){
earlyStatus = "<span>已完成</span>";;
}else if (item.remainderDays == 0){
earlyStatus = "<span style='color: #67c20b'>保养期</span>";
......
......@@ -30,7 +30,7 @@ $(function (){
let template = '';
if (item.id){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id +'\')" >蓝图详情</a>';
+ 'onclick="showDetail(' + item.id +',\''+item.blueprintCode+'\',\''+item.blueprintName+'\',\''+item.companyName+'\')" >蓝图详情</a>';
if (status == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="updateBlueprintStatus(' + item.id + ',1)" >启用</a>';
......@@ -137,14 +137,6 @@ $(function (){
},
onRowClick: function (e) {
},
exportGrid : {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "工艺流程_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls",
exportBlockId: "result",
}
}
}
......@@ -231,10 +223,10 @@ function deactivate() {
/**
* 显示详情
*/
function showDetail(id,factoryCode,flowCode,flowName) {
function showDetail(id,blueprintCode,blueprintName,companyName) {
JSColorbox.open({
href: "HGSC003A?methodName=initLoad&inqu_status-0-parendId=" + id+
"&inqu_status-0-flowCode="+flowCode+"&inqu_status-0-flowName="+flowName+"&inqu_status-0-factoryCode="+factoryCode,
href: "HGSC003A?methodName=initLoad&inqu_status-0-blueprintId=" + id +"&inqu_status-0-blueprintCode="+ blueprintCode
+"&inqu_status-0-blueprintName="+blueprintName+"&inqu_status-0-companyName="+companyName,
title: "<div style='text-align: center;'>蓝图清单详情</div>",
width: "80%",
height: "80%",
......
......@@ -25,7 +25,7 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
......
$(function (){
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
/* 页面查询框的尺寸设置 */
$.extend(true, IPLATUI.Config, {
EFGrid: {
height: $(document).height() - $("#inqu").height() - $("#ef_form_head").height() - 100,
}
});
IPLATUI.EFGrid = {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
{
field: "operator",
title: "操作",
template: function (item) {
let template = '';
if (item.id){
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="showUploadFile(' + item.id + ')" >附件详情</a>';
}
return template;
}
},
{
field: "companyName",
template: function (item) {
item['companyName'] =$("#inqu_status-0-companyName").val();
return $("#inqu_status-0-companyName").val();
}
},{
field: "blueprintId",
template: function (item) {
item['blueprintId'] =$("#inqu_status-0-blueprintId").val();
return $("#inqu_status-0-blueprintId").val();
}
},{
field: "blueprintCode",
template: function (item) {
item['blueprintCode'] =$("#inqu_status-0-blueprintCode").val();
return $("#inqu_status-0-blueprintCode").val();
}
},{
field: "blueprintName",
template: function (item) {
item['blueprintName'] =$("#inqu_status-0-blueprintName").val();
return $("#inqu_status-0-blueprintName").val();
}
}
],
loadComplete: function(grid) {
},
afterEdit:function (e) {
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {
},
}
}
downKeyUp();
})
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC003A", "save", true,
function (e) {
query();
});
btnNode.attr("disabled", false);
}
});
}
}
/**
* 显示详情
*/
function showDetail(id,factoryCode,flowCode,flowName) {
JSColorbox.open({
href: "HGSC003AA?methodName=initLoad&inqu_status-0-parendId=" + id+
"&inqu_status-0-flowCode="+flowCode+"&inqu_status-0-flowName="+flowName+"&inqu_status-0-factoryCode="+factoryCode,
title: "<div style='text-align: center;'>蓝图清单详情</div>",
width: "80%",
height: "80%",
});
}
/**
* 显示附件清单
*
* @param id
*/
function showUploadFile(id) {
JSColorbox.open({
href: "HGSC099?methodName=initLoad&inqu_status-0-bizType=LTXQ&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件详情</div>",
width: "80%",
height: "80%",
});
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script>
var ctx = "${ctx}";
</script>
<head>
</head>
<EF:EFPage title="蓝图清单详情">
<EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput ename="inqu_status-0-blueprintId" cname="蓝图id" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-blueprintCode" cname="蓝图编号" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-blueprintName" cname="蓝图名称" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-companyName" cname="公司名称" colWidth="3" type="hidden"/>
<div class="row">
<EF:EFInput ename="inqu_status-0-drawingCode" cname="图号" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-drawingName" cname="图纸名称" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="blueprintId" cname="蓝图id" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="blueprintCode" cname="蓝图编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="blueprintName" cname="蓝图名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="drawingCode" cname="图号" enable="true" width="120" align="center" required="true"/>
<EF:EFColumn ename="drawingName" cname="图纸名称" enable="true" width="120" align="center" required="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script>
var ctx = "${ctx}";
</script>
<head>
</head>
<EF:EFPage title="物料清单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput ename="inqu_status-0-companyName" cname="公司名称" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-projName" cname="项目名称" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-blueprintName" cname="蓝图名称" colWidth="3"/>
<EF:EFSelect cname="提交状态" ename="inqu_status-0-materialStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.sc.materialStatus" />
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="true" width="120" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" align="center" enable="false"/>
<EF:EFColumn ename="blueprintCode" cname="蓝图编码" enable="true" width="120" align="center"/>
<EF:EFColumn ename="blueprintName" cname="蓝图名称" enable="false" width="120" align="center" required="true"/>
<EF:EFComboColumn ename="materialStatus" cname="提交状态" width="80" align="center" enable="false" required="false" readonly="true">
<EF:EFCodeOption codeName="hggp.sc.materialStatus" />
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="物料清单详情">
<EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput ename="inqu_status-0-materialId" type="hidden"/>
<EF:EFInput ename="inqu_status-0-parentProdCode" type="hidden"/>
<div class="row">
<EF:EFInput ename="inqu_status-0-productName" cname="产品名称" colWidth="3"/>
<EF:EFSelect cname="变更类型" ename="inqu_status-0-changeType" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.sc.changeType" />
</EF:EFSelect>
<EF:EFSelect cname="提交状态" ename="inqu_status-0-productStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.sc.productStatus" />
</EF:EFSelect>
</div>
</EF:EFRegion>
<div id="splitter" class="i-fit-height" style="display: inline">
<div id="left-pane" class="i-fit-height" style="width: 20%;float:left;">
<EF:EFRegion id="companyTree" title="BOM结构图" fitHeight="true">
<EF:EFTree id="materialTree"
valueField="label"
textField="text"
hasChildren="leaf"
serviceName="HGSC004A"
methodName="queryTreeNode">
</EF:EFTree>
</EF:EFRegion>
</div>
<div id="right-pane" class="i-fit-height" style="width: 80%;float: right">
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="no" checkMode="single">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="lv" cname="层级" hidden="true"/>
<EF:EFColumn enable="false" ename="parentProdCode" hidden="true" cname="上级产品编号"/>
<EF:EFColumn enable="false" ename="parentProdName" hidden="true" cname="上级产品名称"/>
<EF:EFColumn enable="false" ename="productId" hidden="true" cname="产品id"/>
<EF:EFColumn enable="false" ename="productType" hidden="true" cname="产品类型"/>
<EF:EFColumn ename="operator" cname="操作" width="140" enable="false" readonly="false"/>
<EF:EFComboColumn cname="变更类型" ename="changeType" width="90" align="center" enable="false" required="false">
<EF:EFCodeOption codeName="hggp.sc.changeType" />
</EF:EFComboColumn>
<EF:EFColumn ename="productCode" required="true" cname="产品编号" />
<EF:EFColumn ename="productName" cname="产品名称" width="120" align="center" enable="false"/>
<EF:EFColumn ename="quantity" required="true" cname="数量"/>
<EF:EFColumn ename="singleWeight" required="true" format="{0:N3}" cname="单重(kg)"/>
<EF:EFColumn enable="true" required="true" format="{0:N3}" ename="totalWeight" cname="总重(kg)"/>
<EF:EFComboColumn cname="提交状态" ename="productStatus" width="90" align="center" required="false">
<EF:EFCodeOption codeName="hggp.sc.productStatus" />
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</div>
</div>
</EF:EFPage>
<script>
let ctx="${ctx}";
</script>
<script src="${ctx}/HG/SC/HGSC004A.js"></script>
$(function () {
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1);
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [
{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="showInfo(' + item.planCode + ')" >计划详情</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.matId + ')" >附件详情</a>';
return template;
}
}
],
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'commit'||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
}
}
});
function showInfo(planCode) {
JSColorbox.open({
href: "HGSC005A?methodName=initLoad&inqu_status-0-planCode=" + planCode + "&efParentFormEname=HGSC005",
title: "<div style='text-align: center;'>生产计划详情</div>",
width: "90%",
height: "90%"
});
}
/**
* 显示附件清单
*
* @param id
*/
function showUploadFile(id) {
JSColorbox.open({
href: "HGSC099?methodName=initLoad&inqu_status-0-bizType=XMRY&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件详情</div>",
width: "80%",
height: "80%",
});
}
\ No newline at end of file
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script>
var ctx = "${ctx}";
</script>
<head>
</head>
<EF:EFPage title="生产计划">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput ename="inqu_status-0-companyName" cname="公司名称" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-projName" cname="项目名称" colWidth="3"/>
<EF:EFDatePicker cname="生产计划日期" ename="inqu_status-0-createdTime" colWidth="3"
format="yyyy-MM-dd" readonly="false"/>
<EF:EFInput ename="inqu_status-0-planCode" cname="生产计划单号" colWidth="3"/>
<EF:EFDatePicker cname="交货日期" ename="inqu_status-0-finishDate" colWidth="3"
format="yyyy-MM-dd" readonly="false"/>
<EF:EFSelect cname="提交状态" ename="inqu_status-0-commitStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.commitStatus"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="true" width="100" align="center" />
<EF:EFColumn ename="companyName" cname="公司名称" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="createdTime" cname="生产计划日期" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="planCode" cname="生产计划单号" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="finishDate" cname="交货日期" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="finishRate" cname="生产完工进度" format="{0:0%}" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFComboColumn ename="commitStatus" cname="提交状态" width="80" align="center" required="true"
readonly="true">
<EF:EFCodeOption codeName="hggp.commitStatus"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1);
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [
],
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
}
}
});
\ No newline at end of file
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script>
var ctx = "${ctx}";
</script>
<head>
</head>
<EF:EFPage title="生产计划详情">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput ename="inqu_status-0-productName" cname="产品名称" colWidth="3"/>
<EF:EFSelect cname="工序" ename="result-0-processName" colWidth="3" required="true" filter="contains">
<EF:EFOptions blockId="plan_process_block_id" valueField="valueField" textField="textField"/>
</EF:EFSelect>
<EF:EFDatePicker cname="交货日期" ename="inqu_status-0-finishDate" colWidth="3"
format="yyyy-MM-dd" readonly="false"/>
<EF:EFDatePicker cname="计划完工日期" ename="inqu_status-0-planEndDate" colWidth="3"
format="yyyy-MM-dd" readonly="false"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="productCode" cname="产品编码" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="productName" cname="产品名称" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="processName" cname="工序" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="finishDate" cname="交货日期" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="planStartDate" cname="计划开工日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="planEndDate" cname="计划完工日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="quantity" cname="计划数量" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="finishQuantity" cname="完成数量" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="unfinishQuantity" cname="未完成数量" width="120" enable="true" align="center" readOnly="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function (){
var factoryCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
......@@ -37,7 +38,7 @@ $(function (){
}
return template;
}
},{
}, {
field: "factoryCode",
template: function (dataItem) {
for (let i = 0; i < factoryCodes.length; i++) {
......@@ -48,7 +49,18 @@ $(function (){
}
return dataItem['factoryCode'];
},
},{
}, {
field: "princ",
template: function (dataItem) {
for (let i = 0; i < userIdBox.length; i++) {
if (userIdBox[i]['valueField'] === dataItem['princ']) {
dataItem['princName'] = userIdBox[i]['textField'];
return userIdBox[i]['textField'];
}
}
return dataItem['princ'];
}
}, {
field: "createdName",
template: function (options) {
return showUserName(options.createdBy, options.createdName);
......
......@@ -19,8 +19,8 @@
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="processName" cname="工序名称" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="princ" cname="负责人" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="processName" cname="工序名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="princName" cname="负责人" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
......@@ -47,18 +47,15 @@
<EF:EFColumn ename="standardJob" cname="标准作业" width="120" enable="true" format="{0:N0}" editType="number"
displayType="0" sort="true" align="right" required="true"
data-regex="/^-?[0-9]{1,15}?$/" maxLength="15"
data-errorprompt="请输入数字,该值最大可设置15位整数!"
/>
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn ename="standardDays" cname="标准人天" width="120" enable="true" format="{0:N0}" editType="number"
displayType="0" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数!"
/>
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn ename="standardNum" cname="标准工序人数" width="120" enable="true" format="{0:N0}" editType="number"
displayType="0" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数!"
/>
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFComboColumn ename="princ" cname="负责人"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
......
......@@ -19,7 +19,7 @@
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="flowName" cname="流程名称" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="flowName" cname="流程名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
......
......@@ -34,6 +34,12 @@ $(function (){
},
},*/{
field: "processCode",
filter: function (options) {
// 返回我们过滤后的数据集
return _.filter(processCodes, function (item) {
return item["param4Field"]== "true" && item["param5Field"] == "false";
})
},
template: function (dataItem) {
for (let i = 0; i < processCodes.length; i++) {
if (processCodes[i]['valueField'] === dataItem['processCode']) {
......
......@@ -19,12 +19,13 @@
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="flowCode" cname="流程编码" colWidth="3" readonly="true"/>
<EF:EFInput blockId="inqu_status" row="0" ename="flowName" cname="流程名称" colWidth="3" readonly="true"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="processCode" cname="工序名称" colWidth="3" filter="contains">
<EF:EFInput blockId="inqu_status" row="0" ename="flowCode" cname="流程编码" colWidth="3" placeholder="模糊查询" readonly="true"/>
<EF:EFInput blockId="inqu_status" row="0" ename="flowName" cname="流程名称" colWidth="3" placeholder="模糊查询" readonly="true"/>
<EF:EFInput blockId="inqu_status" row="0" ename="processName" cname="工序名称" colWidth="3" placeholder="模糊查询"/>
<%--<EF:EFSelect blockId="inqu_status" row="0" ename="processCode" cname="工序名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="processCode_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</EF:EFSelect>--%>
<EF:EFInput blockId="inqu_status" row="0" ename="parendId" type="hidden" colWidth="3"/>
</div>
</EF:EFRegion>
......
......@@ -57,10 +57,12 @@ $(function (){
// 返回我们过滤后的数据集
/*return options.values[0][province];*/
return _.filter(processCodes, function (item) {
return item["param1Field"]==factoryCode;
return item["param1Field"]==factoryCode && item["param4Field"]== "true" && item["param5Field"] == "false";
})
} else {
return processCodes;
return _.filter(processCodes, function (item) {
return item["param4Field"]== "true" && item["param5Field"] == "false";
})
}
},
template: function (dataItem) {
......@@ -73,6 +75,9 @@ $(function (){
}
return dataItem['processCode'];
},
editor: function (container, options) {
this.filter(options);
}
}, {
field: "spec",
template: function (options) {
......
......@@ -23,7 +23,7 @@
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="processCode_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>--%>
<EF:EFInput blockId="inqu_status" row="0" ename="processName" cname="工序名称" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="processName" cname="工序名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
......
......@@ -14,17 +14,6 @@ $(function () {
class: "i-input-readonly"
}
}, {
field: "operator",
template: function (item) {
let status = item.status;
if (status === "0") {
return '<a style="cursor: pointer;display: flex;justify-content: center;" ' +
'onclick="doProcess(' + item.id + ', \'' + item.checkNo + '\')" >处理</a>';
} else {
return "";
}
}
}, {
field: "problemPhoto",
template: function (item) {
if (!isBlank(item.checkNo)) {
......@@ -63,8 +52,12 @@ $(function () {
// 查询
$("#QUERY").on("click", query);
// 选择生产任务
$("#SELECT_PROD").on("click", selectProd);
// 选择采购收货
$("#SELECT_RECEIVE").on("click", selectReceive);
// 质检完成
$("#PROCESS").on("click", process);
});
/**
......@@ -90,7 +83,7 @@ let query = function () {
*/
let showUploadFile = function (id, docType) {
JSColorbox.open({
href: "HPZL001A?methodName=initLoad&inqu_status-0-checkId=" + id + "&inqu_status-0-docType=" + docType,
href: "HGZL001A?methodName=initLoad&inqu_status-0-checkId=" + id + "&inqu_status-0-docType=" + docType,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
......@@ -103,32 +96,49 @@ let showUploadFile = function (id, docType) {
* @param id
* @param checkNo
*/
let doProcess = function (id, checkNo) {
let message = "确认将单号[" + checkNo + "]的状态修改为已处理吗? ";
JSUtils.confirm(message, {
let process = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let qualifyQty = rows[i]['qualifyQty'];
let unqualifyQty = rows[i]['unqualifyQty'];
let receiveQty = rows[i]['receiveQty'];
if (!isNumber(qualifyQty) || !isNumber(unqualifyQty)) {
message("第" + (i + 1) + "行合格数量和不合格数量必须是大于等于0的数字");
return;
}
if ((parseFloat(qualifyQty) + parseFloat(unqualifyQty)) != parseFloat(receiveQty)) {
message("第" + (i + 1) + "行合格数量加不合格数量必须等于收货数量");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做质检完成操作吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPZL001", "doProcess", true);
JSUtils.submitGridsData("result", "HGZL001", "doProcess", true);
}
});
}
/**
* 挑选生产任务
* 选择采购收货
*/
let selectProd = function () {
let selectReceive = function () {
JSColorbox.open({
href: "HPZL001B?methodName=initLoad",
title: "<div style='text-align: center;'>生产任务查询</div>",
width: "90%",
href: "HGZL001B?methodName=initLoad",
title: "<div style='text-align: center;'>采购收货查询</div>",
width: "80%",
height: "80%",
callbackName: selectStockCallback
callbackName: selectReceiveCallback
});
}
/**
* 挑选生产任务回调
* 选择采购收货回调
*/
let selectStockCallback = function () {
let selectReceiveCallback = function () {
// 刷新页面
query();
// 关闭弹窗
......@@ -144,20 +154,9 @@ function deleteFunc() {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let status= item.get("status");
if(status==="1"){
message("选中的第"+(index+1)+"行记录已处理,不能删除!");
flag = false;
return false;
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGZL001", "delete", true);
}
});
if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPZL001", "delete", true);
}
});
}
}
......@@ -10,33 +10,31 @@
<div class="row">
<EF:EFDatePicker cname="单据日期" ename="receiptDate" blockId="inqu_status" row="0" colWidth="3"
format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="部件名称" ename="inventName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="零件名称" ename="subInventName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="invent_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="规格" ename="inqu_status-0-spec" colWidth="3" filter="contains" optionLabel="全部"
defultValue="">
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFInput cname="工作组" ename="orgName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="检查人" ename="checkUserName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect cname="不良类型" ename="poorType" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.poorType"/>
</EF:EFSelect>
<EF:EFSelect cname="处理状态" ename="status" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFOption label="已处理" value="1"></EF:EFOption>
<EF:EFOption label="未处理" value="0"></EF:EFOption>
</EF:EFSelect>
</div>
<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"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="problemPhoto" cname="问题照片" locked="true" enable="false" width="100" align="center"
required="true"/>
<EF:EFColumn ename="processPhoto" cname="处理照片" locked="true" enable="false" width="100" align="center"
......@@ -55,18 +53,18 @@
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="specId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="receiveQty" cname="收货数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="receiveWeight" cname="收货重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="qualifyQty" cname="合格数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFColumn ename="unqualifyQty" cname="不合格数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFComboColumn ename="poorType" cname="不良品类" enable="false" width="100" align="center">
<EF:EFCodeOption codeName="hpjx.hpjx.poorType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="problemDesc" cname="质量问题描述" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="checkUser" cname="检查人" enable="false" width="120" align="center"
blockName="user_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFColumn ename="receiveQty" cname="收货数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="receiveWeight" cname="收货重量" enable="false" width="120" align="right" format="{0:N3}"/>
<%-- <EF:EFComboColumn ename="poorType" cname="不良品类" enable="false" width="100" align="center">--%>
<%-- <EF:EFCodeOption codeName="hpjx.hpjx.poorType"/>--%>
<%-- </EF:EFComboColumn>--%>
<%-- <EF:EFColumn ename="problemDesc" cname="质量问题描述" enable="false" width="140" align="center"/>--%>
<%-- <EF:EFComboColumn ename="checkUser" cname="检查人" enable="false" width="120" align="center"--%>
<%-- blockName="user_block_id" textField="textField" valueField="valueField"--%>
<%-- columnTemplate="#=textField#" itemTemplate="#=textField#">--%>
<%-- </EF:EFComboColumn>--%>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="unit" cname="单位" enable="false" width="80" align="center"/>
<EF:EFColumn ename="length" cname="长(M)" enable="false" width="80" align="right" format="{0:N3}"/>
......
......@@ -55,7 +55,7 @@ var query = function (e) {
*/
function uploadFile(id) {
JSColorbox.open({
href: "HPSC099?methodName=initLoad",
href: "HGSC099A?methodName=initLoad",
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
......@@ -73,7 +73,7 @@ function uploadFileCallback(docId) {
inEiInfo.set("result-0-checkId", $("#inqu_status-0-checkId").val());
inEiInfo.set("result-0-docType", $("#inqu_status-0-docType").val());
inEiInfo.set("result-0-docId", docId);
EiCommunicator.send('HPZL001A', 'insert', inEiInfo, {
EiCommunicator.send('HGZL001A', 'insert', inEiInfo, {
onSuccess(response) {
resultGrid.dataSource.page(1);
},
......@@ -96,7 +96,7 @@ function deleteFunc() {
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HPZL001A", "delete", true);
JSUtils.submitGridsData("result", "HGZL001A", "delete", true);
}
})
}
......@@ -7,15 +7,12 @@
<EF:EFPage title="附件清单">
<EF:EFRegion id="inqu" title="查询区域" type="query">
<EF:EFInput cname="质量巡检单ID" ename="checkId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="质量单ID" ename="checkId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="附件类型" ename="docType" blockId="inqu_status" row="0" type="hidden"/>
<div class="row">
<EF:EFInput cname="项目名称" ename="projName" blockId="detail" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="部件名称" ename="inventName" blockId="detail" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="零件名称" ename="subInventName" blockId="detail" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="生产组" ename="orgName" blockId="detail" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="存货名称" ename="inventName" blockId="detail" row="0" readonly="true"/>
<EF:EFInput cname="规格" ename="spec" blockId="detail" row="0" readonly="true"/>
</div>
<EF:EFInput cname="状态" ename="status" blockId="detail" row="0" colWidth="3" type="hidden"/>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
......
......@@ -13,7 +13,8 @@ $(function () {
$("#QUERY").on("click", query);
// 选择
$("#BTN_SELECT").on("click", select);
$("#CONFIRM").on("click", confirm);
downKeyUp();
});
......@@ -35,27 +36,15 @@ var query = function (e) {
/**
* 选择库存
*/
let select = function () {
let confirm = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let poorType = rows[i]['poorType'];
let problemDesc = rows[i]['problemDesc'];
if (isBlank(poorType)) {
message("第" + (i + 1) + "行不良品类不能为空");
return;
}
if (isBlank(problemDesc)) {
message("第" + (i + 1) + "行质量问题描述不能为空");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成巡检单吗? ", {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成质检单吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPZL001B", "select",
JSUtils.submitGridsData("result", "HGZL001B", "confirm",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
......
......@@ -5,46 +5,70 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="生产任务查询">
<EF:EFPage title="采购收货查询">
<EF:EFRegion id="inqu" title="查询区域" type="query">
<div class="row">
<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"/>
</div>
<div class="row">
<EF:EFInput cname="零件名称" ename="partName" blockId="inqu_status" row="0" colWidth="3"/>
</div>
<EF:EFDatePicker cname="收货日期" blockId="inqu_status" ename="receiveDate" row="0" colWidth="3"
role="date" format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="收货单号" blockId="inqu_status" ename="receiveNo" row="0" colWidth="3"/>
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="供应商名称" blockId="inqu_status" ename="supCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="sup_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="invent_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="规格" ename="inqu_status-0-spec" colWidth="3" filter="contains" optionLabel="全部"
defultValue="">
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDateSpan startCname="创建时间(从)" endCname="至" blockId="inqu_status"
startName="createdTimeFrom" endName="createdTimeTo" row="0" role="datetime"
format="yyyy-MM-dd HH:mm:ss" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="生产订单ID" enable="false" width="90" align="center" hidden="true"/>
<EF:EFColumn ename="childId" cname="生产任务ID" enable="false" width="90" align="center" hidden="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partName" cname="零件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partSpec" cname="零件规格" enable="false" width="150" align="center"/>
<EF:EFComboColumn ename="poorType" cname="不良品类" width="100" align="center" required="true">
<EF:EFCodeOption codeName="hpjx.hpjx.poorType"/>
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="130" align="center"/>
<EF:EFColumn ename="receiveDate" cname="收货日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="receiveNo" cname="收货单号" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="hggp.hgcg.receiveStatus"/>
</EF:EFComboColumn>
<EF:EFColumn ename="problemDesc" cname="质量问题描述" width="140" required="true"/>
<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="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"/>
<EF:EFColumn ename="prdtCode" cname="部件编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partCode" cname="零件编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="factoryCode" cname="厂区编码" enable="false" width="150"/>
<EF:EFColumn ename="orgNo" cname="生产组编码" enable="false" width="150"/>
<EF:EFColumn ename="prodTaskNo" cname="生产任务号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prodOrderNo" cname="生产订单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="supCode" cname="供应商编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="supName" cname="供应商名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="purUserName" cname="采购员" enable="false" width="100" align="center"/>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="specId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<%-- <EF:EFComboColumn ename="poorType" cname="不良品类" width="100" align="center" required="true">--%>
<%-- <EF:EFCodeOption codeName="hggp.hgzl.poorType"/>--%>
<%-- </EF:EFComboColumn>--%>
<%-- <EF:EFColumn ename="problemDesc" cname="质量问题描述" width="140" required="true"/>--%>
<EF:EFColumn ename="receiveQty" cname="收货数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="receiveWeight" cname="收货重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="unit" cname="单位" enable="false" width="80" align="center"/>
<EF:EFColumn ename="length" cname="长(M)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽(M)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚(M)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="contractNo" cname="合同号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
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