Commit 6f80eea7 by 江和松

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

parents e7752899 ae3dbb08
......@@ -190,7 +190,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"),
/**
* 模块:设备台账编码
* 用途:设备区域下拉框
......@@ -228,6 +228,13 @@ public enum DdynamicEnum {
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")
;
......
......@@ -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);
}
}
}
......@@ -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
......
......@@ -32,7 +32,7 @@ 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_account_code = "accountCode"; /* 帐套*/
public static final String FIELD_dep_code = "depCode"; /* 部门编码*/
public static final String FIELD_dep_name = "depName"; /* 部门名称*/
......@@ -52,7 +52,7 @@ 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_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"; /* 部门名称*/
......
......@@ -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);
......
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()));
}
}
}
......@@ -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#
......
......@@ -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#
......@@ -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,7 @@ 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_STATUS = "status"; /* 状态0.停止1.启用*/
public static final String COL_ID = "ID"; /* 主键id*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码 预留*/
......@@ -63,7 +63,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 +92,7 @@ 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 Integer status = 0; /* 状态0.停止1.启用*/
/**
* initialize the metadata.
......@@ -187,7 +187,7 @@ public class HGSJ001 extends DaoEPBase {
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态0.启用1.停止");
eiColumn.setDescName("状态0.停止1.启用");
eiMetadata.addMeta(eiColumn);
......
......@@ -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,7 @@
STANDARD_DAYS as "standardDays", <!-- 标准人天 -->
STANDARD_NUM as "standardNum", <!-- 标准工序人数 -->
PRINC as "princ", <!-- 负责人 -->
STATUS as "status" <!-- 状态0.启用1.停止 -->
STATUS as "status" <!-- 状态0.停止1.启动 -->
</sql>
<sql id="authCondition">
......@@ -217,7 +217,7 @@
STANDARD_DAYS, <!-- 标准人天 -->
STANDARD_NUM, <!-- 标准工序人数 -->
PRINC, <!-- 负责人 -->
STATUS <!-- 状态0.启用1.停止 -->
STATUS <!-- 状态0.停止1.启动 -->
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #factoryCode#, #factoryName#, #processCode#, #processName#, #unit#, #standardJob#, #standardDays#, #standardNum#, #princ#, #status#)
</insert>
......@@ -260,7 +260,7 @@
STANDARD_DAYS = #standardDays#, <!-- 标准人天 -->
STANDARD_NUM = #standardNum#, <!-- 标准工序人数 -->
PRINC = #princ#, <!-- 负责人 -->
STATUS = #status# <!-- 状态0.启用1.停止 -->
STATUS = #status# <!-- 状态0.停止1.启动 -->
WHERE
ID = #id#
</update>
......@@ -278,14 +278,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 +297,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/pz/sql/HGPZ005A.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>
......
$(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>
......@@ -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"
......
......@@ -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']) {
......
......@@ -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) {
......
......@@ -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