Commit 6f80eea7 by 江和松

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

parents e7752899 ae3dbb08
...@@ -190,7 +190,7 @@ public enum DdynamicEnum { ...@@ -190,7 +190,7 @@ public enum DdynamicEnum {
* 用途:工序编码下拉框 * 用途:工序编码下拉框
* 编写:ly * 编写: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 { ...@@ -228,6 +228,13 @@ public enum DdynamicEnum {
ITEM_CODE_BOX_BLOCK_ID("item_code_box_block_id", "itemCode", "itemCname", "HGPZ005A.queryEdcm01"), 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 @@ ...@@ -227,7 +227,7 @@
SET SET
STATUS = #status#, STATUS = #status#,
DELIVER_QTY = #deliverQty#, <!-- 退货数量 --> DELIVER_QTY = #deliverQty#, <!-- 退货数量 -->
DEPOSIT_QTY = #depositQty#, <!-- 退货数量 --> DEPOSIT_QTY = #depositQty#, <!-- 入库数量 -->
<include refid="updateRevise"/> <include refid="updateRevise"/>
WHERE RECEIVE_NO = #receiveNo# WHERE RECEIVE_NO = #receiveNo#
</update> </update>
......
...@@ -6,9 +6,9 @@ import com.baosight.hggp.hg.cg.domain.HGCG001; ...@@ -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.HGCG002;
import com.baosight.hggp.hg.cg.domain.HGCG002A; import com.baosight.hggp.hg.cg.domain.HGCG002A;
import com.baosight.hggp.hg.cg.domain.HGCG003; 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.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
...@@ -234,6 +234,22 @@ public class HGCGTools { ...@@ -234,6 +234,22 @@ public class HGCGTools {
paramMap.put("status", status); paramMap.put("status", status);
DaoUtils.update(HGSqlConstant.HgCg003.UPDATE_STATUS, paramMap); 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 { ...@@ -64,7 +64,7 @@ public class HGSqlConstant {
public static final String UPDATE_STATUS = MODULE_NAME + "updateStatus"; public static final String UPDATE_STATUS = MODULE_NAME + "updateStatus";
// 修改数量 // 修改数量
public static final String UPDATE_QTY = MODULE_NAME + "updateQty"; public static final String UPDATE_QTY = MODULE_NAME + "updateQty";
// 修改数量 // 收货完成
public static final String UPDATE_CONFIRM = MODULE_NAME + "updateConfirm"; public static final String UPDATE_CONFIRM = MODULE_NAME + "updateConfirm";
} }
...@@ -147,6 +147,22 @@ public class HGSqlConstant { ...@@ -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 定义 * HPKC001 SQL 定义
* *
* @author:songx * @author:songx
...@@ -519,21 +535,6 @@ public class HGSqlConstant { ...@@ -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 * @author:songx
......
...@@ -32,7 +32,7 @@ public class HGSC005 extends DaoEPBase { ...@@ -32,7 +32,7 @@ public class HGSC005 extends DaoEPBase {
public static final String FIELD_plan_code = "planCode"; /* 计划编码*/ public static final String FIELD_plan_code = "planCode"; /* 计划编码*/
public static final String FIELD_commit_status = "commitStatus"; /* 提交状态 0:未提交;2:已提交*/ public static final String FIELD_commit_status = "commitStatus"; /* 提交状态 0:未提交;2:已提交*/
public static final String FIELD_finish_date = "finishDate"; /* 完工日期*/ 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_account_code = "accountCode"; /* 帐套*/
public static final String FIELD_dep_code = "depCode"; /* 部门编码*/ public static final String FIELD_dep_code = "depCode"; /* 部门编码*/
public static final String FIELD_dep_name = "depName"; /* 部门名称*/ public static final String FIELD_dep_name = "depName"; /* 部门名称*/
...@@ -52,7 +52,7 @@ public class HGSC005 extends DaoEPBase { ...@@ -52,7 +52,7 @@ public class HGSC005 extends DaoEPBase {
public static final String COL_plan_code = "plan_code"; /* 计划编码*/ 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_commit_status = "commit_status"; /* 提交状态 0:未提交;2:已提交*/
public static final String COL_finish_date = "finish_date"; /* 完工日期*/ 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_account_code = "account_code"; /* 帐套*/
public static final String COL_dep_code = "dep_code"; /* 部门编码*/ public static final String COL_dep_code = "dep_code"; /* 部门编码*/
public static final String COL_dep_name = "dep_name"; /* 部门名称*/ public static final String COL_dep_name = "dep_name"; /* 部门名称*/
......
...@@ -88,6 +88,7 @@ public class HGSC005A extends DaoEPBase { ...@@ -88,6 +88,7 @@ public class HGSC005A extends DaoEPBase {
public static final String INSERT = "HGSC005A.insert"; public static final String INSERT = "HGSC005A.insert";
public static final String UPDATE = "HGSC005A.update"; public static final String UPDATE = "HGSC005A.update";
public static final String DELETE = "HGSC005A.delete"; 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 id = new Long(0);
private Long matId = new Long(0); /* 物料清单ID*/ private Long matId = new Long(0); /* 物料清单ID*/
......
package com.baosight.hggp.hg.sc.service; package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
...@@ -30,6 +31,7 @@ import java.util.*; ...@@ -30,6 +31,7 @@ import java.util.*;
*/ */
public class ServiceHGSC001 extends ServiceBase { public class ServiceHGSC001 extends ServiceBase {
@OperationLogAnnotation(operModul = "项目立项", operType = "查询", operDesc = "初始化页面")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
inInfo = super.query(inInfo, HGSC001.QUERY, new HGSC001()); inInfo = super.query(inInfo, HGSC001.QUERY, new HGSC001());
...@@ -42,6 +44,7 @@ public class ServiceHGSC001 extends ServiceBase { ...@@ -42,6 +44,7 @@ public class ServiceHGSC001 extends ServiceBase {
return inInfo; return inInfo;
} }
@OperationLogAnnotation(operModul = "项目立项", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
inInfo = super.query(inInfo, HGSC001.QUERY, new HGSC001()); inInfo = super.query(inInfo, HGSC001.QUERY, new HGSC001());
...@@ -56,6 +59,7 @@ public class ServiceHGSC001 extends ServiceBase { ...@@ -56,6 +59,7 @@ public class ServiceHGSC001 extends ServiceBase {
} }
@Override @Override
@OperationLogAnnotation(operModul = "项目立项", operType = "删除", operDesc = "删除")
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
...@@ -72,6 +76,7 @@ public class ServiceHGSC001 extends ServiceBase { ...@@ -72,6 +76,7 @@ public class ServiceHGSC001 extends ServiceBase {
return inInfo; return inInfo;
} }
@OperationLogAnnotation(operModul = "项目立项", operType = "完工", operDesc = "完工")
public EiInfo complete(EiInfo inInfo) { public EiInfo complete(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
...@@ -87,6 +92,7 @@ public class ServiceHGSC001 extends ServiceBase { ...@@ -87,6 +92,7 @@ public class ServiceHGSC001 extends ServiceBase {
return inInfo; return inInfo;
} }
@OperationLogAnnotation(operModul = "项目立项", operType = "提交", operDesc = "提交")
public EiInfo commit(EiInfo inInfo) { public EiInfo commit(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
...@@ -102,6 +108,7 @@ public class ServiceHGSC001 extends ServiceBase { ...@@ -102,6 +108,7 @@ public class ServiceHGSC001 extends ServiceBase {
return inInfo; return inInfo;
} }
@OperationLogAnnotation(operModul = "项目立项", operType = "保存", operDesc = "保存")
public EiInfo save(EiInfo inInfo){ public EiInfo save(EiInfo inInfo){
try { try {
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock); Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
......
package com.baosight.hggp.hg.sc.service; package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
...@@ -23,6 +24,7 @@ import java.util.stream.Collectors; ...@@ -23,6 +24,7 @@ import java.util.stream.Collectors;
*/ */
public class ServiceHGSC002 extends ServiceBase { public class ServiceHGSC002 extends ServiceBase {
@OperationLogAnnotation(operModul = "项目人员", operType = "查询", operDesc = "初始化页面")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
List<Company> companyList = UserSessionUtils.getRoleCompany(); List<Company> companyList = UserSessionUtils.getRoleCompany();
...@@ -40,6 +42,7 @@ public class ServiceHGSC002 extends ServiceBase { ...@@ -40,6 +42,7 @@ public class ServiceHGSC002 extends ServiceBase {
return inInfo; return inInfo;
} }
@OperationLogAnnotation(operModul = "项目人员", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
inInfo = super.query(inInfo, HGSC002.QUERY, new HGSC002()); inInfo = super.query(inInfo, HGSC002.QUERY, new HGSC002());
...@@ -51,6 +54,7 @@ public class ServiceHGSC002 extends ServiceBase { ...@@ -51,6 +54,7 @@ public class ServiceHGSC002 extends ServiceBase {
} }
@Override @Override
@OperationLogAnnotation(operModul = "项目人员", operType = "删除", operDesc = "删除")
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
...@@ -66,6 +70,7 @@ public class ServiceHGSC002 extends ServiceBase { ...@@ -66,6 +70,7 @@ public class ServiceHGSC002 extends ServiceBase {
return inInfo; return inInfo;
} }
@OperationLogAnnotation(operModul = "项目人员", operType = "新增", operDesc = "新增")
public EiInfo save(EiInfo inInfo){ public EiInfo save(EiInfo inInfo){
try { try {
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock); Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
......
package com.baosight.hggp.hg.sc.service; 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.domain.HGSC005;
import com.baosight.hggp.hg.sc.tools.HGSCTools; import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.*; import com.baosight.hggp.util.*;
...@@ -18,6 +19,7 @@ import java.util.*; ...@@ -18,6 +19,7 @@ import java.util.*;
*/ */
public class ServiceHGSC005 extends ServiceBase { public class ServiceHGSC005 extends ServiceBase {
@OperationLogAnnotation(operModul = "生产计划", operType = "查询", operDesc = "初始化页面")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
inInfo = super.query(inInfo, HGSC005.QUERY, new HGSC005()); inInfo = super.query(inInfo, HGSC005.QUERY, new HGSC005());
...@@ -32,6 +34,7 @@ public class ServiceHGSC005 extends ServiceBase { ...@@ -32,6 +34,7 @@ public class ServiceHGSC005 extends ServiceBase {
return inInfo; return inInfo;
} }
@OperationLogAnnotation(operModul = "生产计划", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
inInfo = super.query(inInfo, HGSC005.QUERY, new HGSC005()); 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 @@ ...@@ -26,6 +26,8 @@
<sqlMap namespace="HGSC005"> <sqlMap namespace="HGSC005">
<sql id="condition"> <sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
id = #id# id = #id#
</isNotEmpty> </isNotEmpty>
...@@ -36,16 +38,16 @@ ...@@ -36,16 +38,16 @@
company_code = #companyCode# company_code = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName"> <isNotEmpty prepend=" AND " property="companyName">
company_name = #companyName# company_name like ('%$companyName$%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode"> <isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode# proj_code = #projCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="projName"> <isNotEmpty prepend=" AND " property="projName">
proj_name = #projName# proj_name like ('%projName%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="planCode"> <isNotEmpty prepend=" AND " property="planCode">
plan_code = #planCode# plan_code = like ('%planCode%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="commitStatus"> <isNotEmpty prepend=" AND " property="commitStatus">
commit_status = #commitStatus# commit_status = #commitStatus#
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
product_code = #productCode# product_code = #productCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="productName"> <isNotEmpty prepend=" AND " property="productName">
product_name = #productName# product_name like ('%productName%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="finishDate"> <isNotEmpty prepend=" AND " property="finishDate">
finish_date = #finishDate# finish_date = #finishDate#
...@@ -350,4 +350,27 @@ ...@@ -350,4 +350,27 @@
id = #id# id = #id#
</update> </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> </sqlMap>
...@@ -42,7 +42,7 @@ public class HGSJ001 extends DaoEPBase { ...@@ -42,7 +42,7 @@ public class HGSJ001 extends DaoEPBase {
public static final String FIELD_STANDARD_DAYS = "standardDays"; /* 标准人天*/ public static final String FIELD_STANDARD_DAYS = "standardDays"; /* 标准人天*/
public static final String FIELD_STANDARD_NUM = "standardNum"; /* 标准工序人数*/ public static final String FIELD_STANDARD_NUM = "standardNum"; /* 标准工序人数*/
public static final String FIELD_PRINC = "princ"; /* 负责人*/ 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_ID = "ID"; /* 主键id*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码 预留*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码 预留*/
...@@ -63,7 +63,7 @@ public class HGSJ001 extends DaoEPBase { ...@@ -63,7 +63,7 @@ public class HGSJ001 extends DaoEPBase {
public static final String COL_STANDARD_DAYS = "STANDARD_DAYS"; /* 标准人天*/ public static final String COL_STANDARD_DAYS = "STANDARD_DAYS"; /* 标准人天*/
public static final String COL_STANDARD_NUM = "STANDARD_NUM"; /* 标准工序人数*/ public static final String COL_STANDARD_NUM = "STANDARD_NUM"; /* 标准工序人数*/
public static final String COL_PRINC = "PRINC"; /* 负责人*/ 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 QUERY = "HGSJ001.query";
public static final String COUNT = "HGSJ001.count"; public static final String COUNT = "HGSJ001.count";
...@@ -92,7 +92,7 @@ public class HGSJ001 extends DaoEPBase { ...@@ -92,7 +92,7 @@ public class HGSJ001 extends DaoEPBase {
private BigDecimal standardDays = new BigDecimal("0"); /* 标准人天*/ private BigDecimal standardDays = new BigDecimal("0"); /* 标准人天*/
private BigDecimal standardNum = new BigDecimal("0"); /* 标准工序人数*/ private BigDecimal standardNum = new BigDecimal("0"); /* 标准工序人数*/
private String princ = " "; /* 负责人*/ private String princ = " "; /* 负责人*/
private Integer status = 0; /* 状态0.启用1.停止*/ private Integer status = 0; /* 状态0.停止1.启用*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -187,7 +187,7 @@ public class HGSJ001 extends DaoEPBase { ...@@ -187,7 +187,7 @@ public class HGSJ001 extends DaoEPBase {
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS); eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态0.启用1.停止"); eiColumn.setDescName("状态0.停止1.启用");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
......
...@@ -202,6 +202,7 @@ public class ServiceHGSJ003 extends ServiceEPBase { ...@@ -202,6 +202,7 @@ public class ServiceHGSJ003 extends ServiceEPBase {
param.put(HGSJ003.FIELD_FACTORY_CODE, map.get("orgEname")); param.put(HGSJ003.FIELD_FACTORY_CODE, map.get("orgEname"));
param.put(HGSJ003.FIELD_FACTORY_NAME, map.get("orgCname")); param.put(HGSJ003.FIELD_FACTORY_NAME, map.get("orgCname"));
param.put(HGSJ003.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0); 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("orgType", OrgTypeEnum.COMPANY.getCode());
//param.put("loginName",UserSession.getLoginName()); //param.put("loginName",UserSession.getLoginName());
param.put(HGSJ003.FIELD_ACCOUNT_CODE,UserSessionUtils.getAccountCode()); param.put(HGSJ003.FIELD_ACCOUNT_CODE,UserSessionUtils.getAccountCode());
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
STANDARD_DAYS as "standardDays", <!-- 标准人天 --> STANDARD_DAYS as "standardDays", <!-- 标准人天 -->
STANDARD_NUM as "standardNum", <!-- 标准工序人数 --> STANDARD_NUM as "standardNum", <!-- 标准工序人数 -->
PRINC as "princ", <!-- 负责人 --> PRINC as "princ", <!-- 负责人 -->
STATUS as "status" <!-- 状态0.启用1.停止 --> STATUS as "status" <!-- 状态0.停止1.启动 -->
</sql> </sql>
<sql id="authCondition"> <sql id="authCondition">
...@@ -217,7 +217,7 @@ ...@@ -217,7 +217,7 @@
STANDARD_DAYS, <!-- 标准人天 --> STANDARD_DAYS, <!-- 标准人天 -->
STANDARD_NUM, <!-- 标准工序人数 --> STANDARD_NUM, <!-- 标准工序人数 -->
PRINC, <!-- 负责人 --> 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#) VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #factoryCode#, #factoryName#, #processCode#, #processName#, #unit#, #standardJob#, #standardDays#, #standardNum#, #princ#, #status#)
</insert> </insert>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
STANDARD_DAYS = #standardDays#, <!-- 标准人天 --> STANDARD_DAYS = #standardDays#, <!-- 标准人天 -->
STANDARD_NUM = #standardNum#, <!-- 标准工序人数 --> STANDARD_NUM = #standardNum#, <!-- 标准工序人数 -->
PRINC = #princ#, <!-- 负责人 --> PRINC = #princ#, <!-- 负责人 -->
STATUS = #status# <!-- 状态0.启用1.停止 --> STATUS = #status# <!-- 状态0.停止1.启动 -->
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
...@@ -282,10 +282,12 @@ ...@@ -282,10 +282,12 @@
CONCAT('[',FACTORY_NAME,']',PROCESS_NAME) as "processName", <!-- 工序名称 --> CONCAT('[',FACTORY_NAME,']',PROCESS_NAME) as "processName", <!-- 工序名称 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 --> FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 厂区名称 --> FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
UNIT AS "unit" UNIT AS "unit",
STATUS as "status",
DELETE_FLAG as "deleteFlag"
FROM ${hggpSchema}.HGGY001 WHERE 1=1 FROM ${hggpSchema}.HGGY001 WHERE 1=1
<include refid="condition" /> <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> </select>
<!--查询用户所在的公司--> <!--查询用户所在的公司-->
...@@ -295,10 +297,16 @@ ...@@ -295,10 +297,16 @@
a.ORG_CNAME as "orgCname" a.ORG_CNAME as "orgCname"
from ${platSchema}.txsog01 a from ${platSchema}.txsog01 a
left join ${platSchema}.txsog02 b on a.ORG_ID = b.ORG_ID left join ${platSchema}.txsog02 b on a.ORG_ID = b.ORG_ID
where where 1=1
<isNotEmpty prepend=" AND " property="accountCode">
a.ACCOUNT_CODE = #accountCode# a.ACCOUNT_CODE = #accountCode#
and a.ORG_TYPE = #orgType# </isNotEmpty>
<!--and b.USER_ID = #userId#--> <isNotEmpty prepend="AND" property="orgType">
a.ORG_TYPE = #orgType#
</isNotEmpty>
<isNotEmpty prepend="AND" property="userId">
b.USER_ID = #userId#
</isNotEmpty>
</select> </select>
</sqlMap> </sqlMap>
...@@ -370,6 +370,9 @@ ...@@ -370,6 +370,9 @@
<isNotEmpty prepend=" AND " property="deleteFlag"> <isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag# DELETE_FLAG = #deleteFlag#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
</select> </select>
<select id="queryCompanyCode" parameterClass="java.util.HashMap" resultClass="java.util.HashMap"> <select id="queryCompanyCode" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
......
...@@ -2,11 +2,18 @@ package com.baosight.hggp.hg.zl.service; ...@@ -2,11 +2,18 @@ package com.baosight.hggp.hg.zl.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; 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.domain.HGZL001;
import com.baosight.hggp.hg.zl.utils.HGZLUtils; 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.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils; 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.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
...@@ -31,9 +38,9 @@ public class ServiceHGZL001 extends ServiceBase { ...@@ -31,9 +38,9 @@ public class ServiceHGZL001 extends ServiceBase {
@OperationLogAnnotation(operModul = "入库质检单", operType = "查询", operDesc = "初始化") @OperationLogAnnotation(operModul = "入库质检单", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), null); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID), null); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_BLOCK_ID), null); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGZL001().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGZL001().eiMetadata);
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
...@@ -150,17 +157,19 @@ public class ServiceHGZL001 extends ServiceBase { ...@@ -150,17 +157,19 @@ public class ServiceHGZL001 extends ServiceBase {
@OperationLogAnnotation(operModul = "质量巡检单",operType = "删除",operDesc = "删除") @OperationLogAnnotation(operModul = "质量巡检单",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<HGZL001> fZl001s = MapUtils.toDaoEPBase(inInfo, HGZL001.class);
for (int i = 0; i < resultRows.size(); i++) { Map<String, HGZL001> dbZl001Map = HGZLUtils.HgZl001.lockGetDataEp(fZl001s);
// HPZL001 fZl001 = new HPZL001(); for (HGZL001 fZl001 : fZl001s) {
// fZl001.fromMap(resultRows.get(i)); String checkNo = fZl001.getCheckNo();
// AssertUtils.isTrue(CommonConstant.YesNo.YES_1.equals(fZl001.getStatus()), HGZL001 dbZl010 = dbZl001Map.get(checkNo);
// String.format("单号[%s]的状态为\"已处理\"不允许删除", fZl001.getCheckNo())); AssertUtils.isEquals(CommonConstant.YesNo.YES_1, dbZl010.getStatus(),
// DaoUtils.update(HPZL001.DELETE, resultRows.get(i)); String.format("单号[%s]的状态为\"已处理\",不允许删除", checkNo));
dbZl010.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode());
DaoUtils.update(HGZL001.DELETE, dbZl010);
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!"); inInfo.setMsg("操作成功!本次对[" + fZl001s.size() + "]条数据删除成功!");
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败"); LogUtils.setDetailMsg(inInfo, e, "删除失败");
} }
...@@ -176,22 +185,55 @@ public class ServiceHGZL001 extends ServiceBase { ...@@ -176,22 +185,55 @@ public class ServiceHGZL001 extends ServiceBase {
@OperationLogAnnotation(operModul = "质量巡检单",operType = "修改",operDesc = "已处理") @OperationLogAnnotation(operModul = "质量巡检单",operType = "修改",operDesc = "已处理")
public EiInfo doProcess(EiInfo inInfo) { public EiInfo doProcess(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<HGZL001> fZl001s = MapUtils.toDaoEPBase(inInfo, HGZL001.class);
for (int i = 0; i < resultRows.size(); i++) { Map<String, HGZL001> dbZl001Map = HGZLUtils.HgZl001.lockGetDataEp(fZl001s);
// HPZL001 fZl001 = new HPZL001(); // 数据校验
// fZl001.fromMap(resultRows.get(i)); this.checkProcessData(fZl001s, dbZl001Map);
///* fZl001.setCheckUser(UserSession.getLoginName()); // 保存数据
// fZl001.setCheckUserName(UserSession.getLoginCName());*/ this.saveProcessData(fZl001s, dbZl001Map);
// fZl001.setStatus(CommonConstant.YesNo.YES_1);
// DaoUtils.update(HGSqlConstant.HPZL001.DO_PROCESS, fZl001);
}
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据处理成功!"); inInfo.setMsg("操作成功!本次对[" + fZl001s.size() + "]条数据处理成功!");
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "提交失败"); LogUtils.setDetailMsg(inInfo, e, "处理失败");
} }
return inInfo; 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 @@ ...@@ -37,6 +37,7 @@
</sql> </sql>
<sql id="condition"> <sql id="condition">
AND DELETE_FLAG = 0
<include refid="HGXSDataAuth.authCondition"/> <include refid="HGXSDataAuth.authCondition"/>
<include refid="idCondition"/> <include refid="idCondition"/>
<include refid="customCondition"/> <include refid="customCondition"/>
...@@ -58,9 +59,6 @@ ...@@ -58,9 +59,6 @@
<isNotEmpty prepend=" AND " property="receiptDate"> <isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate# RECEIPT_DATE = #receiptDate#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="checkNo">
CHECK_NO = #checkNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveNo"> <isNotEmpty prepend=" AND " property="receiveNo">
RECEIVE_NO = #receiveNo# RECEIVE_NO = #receiveNo#
</isNotEmpty> </isNotEmpty>
...@@ -95,11 +93,11 @@ ...@@ -95,11 +93,11 @@
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="reqNo"> <isNotEmpty prepend=" AND " property="checkNo">
REQ_NO = #reqNo# CHECK_NO = #checkNo#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="reqNos"> <isNotEmpty prepend=" AND " property="checkNos">
REQ_NO IN <iterate open="(" close=")" conjunction="," property="reqNos">#reqNos[]#</iterate> CHECK_NO IN <iterate open="(" close=")" conjunction="," property="checkNos">#checkNos[]#</iterate>
</isNotEmpty> </isNotEmpty>
</sql> </sql>
...@@ -163,16 +161,14 @@ ...@@ -163,16 +161,14 @@
WIDTH, <!-- 宽度 --> WIDTH, <!-- 宽度 -->
THICK, <!-- 厚度 --> THICK, <!-- 厚度 -->
RECEIVE_QTY, <!-- 收货数量 --> RECEIVE_QTY, <!-- 收货数量 -->
QUALIFY_QTY, <!-- 合格数量 -->
UNQUALIFY_QTY, <!-- 不合格数量 -->
RECEIVE_UNIT_WEIGHT, <!-- 收货单重 --> RECEIVE_UNIT_WEIGHT, <!-- 收货单重 -->
RECEIVE_WEIGHT, <!-- 收货重量 --> RECEIVE_WEIGHT, <!-- 收货重量 -->
STATUS <!-- 状态:0-质检中,1-质检完成 --> STATUS <!-- 状态:0-质检中,1-质检完成 -->
) VALUES ( ) VALUES (
#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #receiptDate#, #checkNo#, #receiveNo#, #inventType#, #deleteFlag#, #companyCode#, #companyName#, #receiptDate#, #checkNo#, #receiveNo#, #inventType#,
#inventCode#, #inventName#, #specId#, #spec#, #material#, #unit#, #length#, #width#, #thick#, #receiveQty#, #inventCode#, #inventName#, #specId#, #spec#, #material#, #unit#, #length#, #width#, #thick#, #receiveQty#,
#qualifyQty#, #unqualifyQty#, #receiveUnitWeight#, #receiveWeight#, #status# #receiveUnitWeight#, #receiveWeight#, #status#
) )
</insert> </insert>
...@@ -184,4 +180,23 @@ ...@@ -184,4 +180,23 @@
WHERE CHECK_NO = #checkNo# WHERE CHECK_NO = #checkNo#
</delete> </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> </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; ...@@ -2,10 +2,13 @@ package com.baosight.hggp.hg.zl.utils;
import com.baosight.hggp.hg.utils.HGUtils; import com.baosight.hggp.hg.utils.HGUtils;
import com.baosight.hggp.hg.zl.domain.HGZL001; 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.DateUtils;
import com.baosight.hggp.util.MapUtils; import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.hggp.util.StringUtils; import com.baosight.hggp.util.StringUtils;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -36,5 +39,28 @@ public class HGZLUtils { ...@@ -36,5 +39,28 @@ public class HGZLUtils {
queryRow.put(HGZL001.FIELD_RECEIPT_DATE, DateUtils.formatShort(receiptDate)); 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 @@ ...@@ -28,6 +28,9 @@
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC001.xml"/> <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/HGSC001A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC002.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"/> <sqlMap resource="com/baosight/hggp/hg/pz/sql/HGPZ005A.xml"/>
......
...@@ -16,7 +16,7 @@ $(function() { ...@@ -16,7 +16,7 @@ $(function() {
let template = ''; let template = '';
if (item.id){ if (item.id){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' 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){ if (item.flowId>0){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ')" >工艺流程详情</a>'; + 'onclick="showDetail(' + item.id + ')" >工艺流程详情</a>';
...@@ -223,9 +223,9 @@ function showDetail(id) { ...@@ -223,9 +223,9 @@ function showDetail(id) {
}); });
} }
function showFlowDetail(id,inventCode) { function showFlowDetail(id,inventCode,flowId) {
JSColorbox.open({ 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>", title: "<div style='text-align: center;'>工艺流程</div>",
width: "75%", width: "75%",
height: "80%", height: "80%",
......
...@@ -56,9 +56,21 @@ $(function (){ ...@@ -56,9 +56,21 @@ $(function (){
$("#result").on("click", function () { $("#result").on("click", function () {
let id = $("#inqu_status-0-parentId").val(); let id = $("#inqu_status-0-parentId").val();
let inventCode = $("#inqu_status-0-inventCode").val(); let inventCode = $("#inqu_status-0-inventCode").val();
let flowId = $("#inqu_status-0-flowId").val();
let rows = resultGrid.getCheckedRows(); let rows = resultGrid.getCheckedRows();
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.setValueCallback({"id":id,"inventCode":inventCode,"rows":rows[0]});
parent.JSColorbox.close(); parent.JSColorbox.close();
}
}); });
}) })
......
...@@ -22,6 +22,7 @@ ...@@ -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="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="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="inventCode" cname="存货编码" colWidth="3" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="flowId" cname="流程ID" colWidth="3" type="hidden"/>
</div> </div>
</EF:EFRegion> </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 @@ ...@@ -47,18 +47,15 @@
<EF:EFColumn ename="standardJob" cname="标准作业" width="120" enable="true" format="{0:N0}" editType="number" <EF:EFColumn ename="standardJob" cname="标准作业" width="120" enable="true" format="{0:N0}" editType="number"
displayType="0" sort="true" align="right" required="true" displayType="0" sort="true" align="right" required="true"
data-regex="/^-?[0-9]{1,15}?$/" maxLength="15" 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" <EF:EFColumn ename="standardDays" cname="标准人天" width="120" enable="true" format="{0:N0}" editType="number"
displayType="0" sort="true" align="right" displayType="0" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}?$/" maxLength="20" required="true" 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" <EF:EFColumn ename="standardNum" cname="标准工序人数" width="120" enable="true" format="{0:N0}" editType="number"
displayType="0" sort="true" align="right" displayType="0" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}?$/" maxLength="20" required="true" data-regex="/^-?[0-9]{1,15}?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数!" data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
/>
<EF:EFComboColumn ename="princ" cname="负责人" <EF:EFComboColumn ename="princ" cname="负责人"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
......
...@@ -34,6 +34,12 @@ $(function (){ ...@@ -34,6 +34,12 @@ $(function (){
}, },
},*/{ },*/{
field: "processCode", field: "processCode",
filter: function (options) {
// 返回我们过滤后的数据集
return _.filter(processCodes, function (item) {
return item["param4Field"]== "true" && item["param5Field"] == "false";
})
},
template: function (dataItem) { template: function (dataItem) {
for (let i = 0; i < processCodes.length; i++) { for (let i = 0; i < processCodes.length; i++) {
if (processCodes[i]['valueField'] === dataItem['processCode']) { if (processCodes[i]['valueField'] === dataItem['processCode']) {
......
...@@ -57,10 +57,12 @@ $(function (){ ...@@ -57,10 +57,12 @@ $(function (){
// 返回我们过滤后的数据集 // 返回我们过滤后的数据集
/*return options.values[0][province];*/ /*return options.values[0][province];*/
return _.filter(processCodes, function (item) { return _.filter(processCodes, function (item) {
return item["param1Field"]==factoryCode; return item["param1Field"]==factoryCode && item["param4Field"]== "true" && item["param5Field"] == "false";
}) })
} else { } else {
return processCodes; return _.filter(processCodes, function (item) {
return item["param4Field"]== "true" && item["param5Field"] == "false";
})
} }
}, },
template: function (dataItem) { template: function (dataItem) {
......
...@@ -14,17 +14,6 @@ $(function () { ...@@ -14,17 +14,6 @@ $(function () {
class: "i-input-readonly" 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", field: "problemPhoto",
template: function (item) { template: function (item) {
if (!isBlank(item.checkNo)) { if (!isBlank(item.checkNo)) {
...@@ -63,8 +52,12 @@ $(function () { ...@@ -63,8 +52,12 @@ $(function () {
// 查询 // 查询
$("#QUERY").on("click", query); $("#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 () { ...@@ -90,7 +83,7 @@ let query = function () {
*/ */
let showUploadFile = function (id, docType) { let showUploadFile = function (id, docType) {
JSColorbox.open({ 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>", title: "<div style='text-align: center;'>附件清单</div>",
width: "80%", width: "80%",
height: "80%", height: "80%",
...@@ -103,32 +96,49 @@ let showUploadFile = function (id, docType) { ...@@ -103,32 +96,49 @@ let showUploadFile = function (id, docType) {
* @param id * @param id
* @param checkNo * @param checkNo
*/ */
let doProcess = function (id, checkNo) { let process = function () {
let message = "确认将单号[" + checkNo + "]的状态修改为已处理吗? "; let rows = resultGrid.getCheckedRows();
JSUtils.confirm(message, { 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 () { ok: function () {
JSUtils.submitGridsData("result", "HPZL001", "doProcess", true); JSUtils.submitGridsData("result", "HGZL001", "doProcess", true);
} }
}); });
} }
/** /**
* 挑选生产任务 * 选择采购收货
*/ */
let selectProd = function () { let selectReceive = function () {
JSColorbox.open({ JSColorbox.open({
href: "HPZL001B?methodName=initLoad", href: "HGZL001B?methodName=initLoad",
title: "<div style='text-align: center;'>生产任务查询</div>", title: "<div style='text-align: center;'>采购收货查询</div>",
width: "90%", width: "80%",
height: "80%", height: "80%",
callbackName: selectStockCallback callbackName: selectReceiveCallback
}); });
} }
/** /**
* 挑选生产任务回调 * 选择采购收货回调
*/ */
let selectStockCallback = function () { let selectReceiveCallback = function () {
// 刷新页面 // 刷新页面
query(); query();
// 关闭弹窗 // 关闭弹窗
...@@ -144,20 +154,9 @@ function deleteFunc() { ...@@ -144,20 +154,9 @@ function deleteFunc() {
message("请选择数据"); message("请选择数据");
return; return;
} }
let flag = true;
$.each(rows, function(index, item) {
let status= item.get("status");
if(status==="1"){
message("选中的第"+(index+1)+"行记录已处理,不能删除!");
flag = false;
return false;
}
});
if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HPZL001", "delete", true); JSUtils.submitGridsData("result", "HGZL001", "delete", true);
} }
}); });
}
} }
...@@ -10,33 +10,31 @@ ...@@ -10,33 +10,31 @@
<div class="row"> <div class="row">
<EF:EFDatePicker cname="单据日期" ename="receiptDate" blockId="inqu_status" row="0" colWidth="3" <EF:EFDatePicker cname="单据日期" ename="receiptDate" blockId="inqu_status" row="0" colWidth="3"
format="yyyy-MM-dd" readonly="true"/> format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3"/> <EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
<EF:EFInput cname="部件名称" ename="inventName" blockId="inqu_status" row="0" colWidth="3"/> filter="contains" optionLabel="全部" defultValue="">
<EF:EFInput cname="零件名称" ename="subInventName" blockId="inqu_status" row="0" colWidth="3"/> <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>
<div class="row"> <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:EFSelect cname="处理状态" ename="status" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFOption label="已处理" value="1"></EF:EFOption> <EF:EFOption label="已处理" value="1"></EF:EFOption>
<EF:EFOption label="未处理" value="0"></EF:EFOption> <EF:EFOption label="未处理" value="0"></EF:EFOption>
</EF:EFSelect> </EF:EFSelect>
</div> </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>
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/> <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" <EF:EFColumn ename="problemPhoto" cname="问题照片" locked="true" enable="false" width="100" align="center"
required="true"/> required="true"/>
<EF:EFColumn ename="processPhoto" cname="处理照片" locked="true" enable="false" width="100" align="center" <EF:EFColumn ename="processPhoto" cname="处理照片" locked="true" enable="false" width="100" align="center"
...@@ -55,18 +53,18 @@ ...@@ -55,18 +53,18 @@
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/> <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="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="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="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: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:EFColumn ename="receiveQty" cname="收货数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFCodeOption codeName="hpjx.hpjx.poorType"/> <EF:EFColumn ename="receiveWeight" cname="收货重量" enable="false" width="120" align="right" format="{0:N3}"/>
</EF:EFComboColumn> <%-- <EF:EFComboColumn ename="poorType" cname="不良品类" enable="false" width="100" align="center">--%>
<EF:EFColumn ename="problemDesc" cname="质量问题描述" enable="false" width="140" align="center"/> <%-- <EF:EFCodeOption codeName="hpjx.hpjx.poorType"/>--%>
<EF:EFComboColumn ename="checkUser" cname="检查人" enable="false" width="120" align="center" <%-- </EF:EFComboColumn>--%>
blockName="user_block_id" textField="textField" valueField="valueField" <%-- <EF:EFColumn ename="problemDesc" cname="质量问题描述" enable="false" width="140" align="center"/>--%>
columnTemplate="#=textField#" itemTemplate="#=textField#"> <%-- <EF:EFComboColumn ename="checkUser" cname="检查人" enable="false" width="120" align="center"--%>
</EF:EFComboColumn> <%-- 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="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="unit" 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="length" cname="长(M)" enable="false" width="80" align="right" format="{0:N3}"/>
......
...@@ -55,7 +55,7 @@ var query = function (e) { ...@@ -55,7 +55,7 @@ var query = function (e) {
*/ */
function uploadFile(id) { function uploadFile(id) {
JSColorbox.open({ JSColorbox.open({
href: "HPSC099?methodName=initLoad", href: "HGSC099A?methodName=initLoad",
title: "<div style='text-align: center;'>附件上传</div>", title: "<div style='text-align: center;'>附件上传</div>",
width: "60%", width: "60%",
height: "50%", height: "50%",
...@@ -73,7 +73,7 @@ function uploadFileCallback(docId) { ...@@ -73,7 +73,7 @@ function uploadFileCallback(docId) {
inEiInfo.set("result-0-checkId", $("#inqu_status-0-checkId").val()); inEiInfo.set("result-0-checkId", $("#inqu_status-0-checkId").val());
inEiInfo.set("result-0-docType", $("#inqu_status-0-docType").val()); inEiInfo.set("result-0-docType", $("#inqu_status-0-docType").val());
inEiInfo.set("result-0-docId", docId); inEiInfo.set("result-0-docId", docId);
EiCommunicator.send('HPZL001A', 'insert', inEiInfo, { EiCommunicator.send('HGZL001A', 'insert', inEiInfo, {
onSuccess(response) { onSuccess(response) {
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
}, },
...@@ -96,7 +96,7 @@ function deleteFunc() { ...@@ -96,7 +96,7 @@ function deleteFunc() {
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HPZL001A", "delete", true); JSUtils.submitGridsData("result", "HGZL001A", "delete", true);
} }
}) })
} }
...@@ -7,15 +7,12 @@ ...@@ -7,15 +7,12 @@
<EF:EFPage title="附件清单"> <EF:EFPage title="附件清单">
<EF:EFRegion id="inqu" title="查询区域" type="query"> <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"/> <EF:EFInput cname="附件类型" ename="docType" blockId="inqu_status" row="0" type="hidden"/>
<div class="row"> <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" readonly="true"/>
<EF:EFInput cname="部件名称" ename="inventName" blockId="detail" row="0" colWidth="3" readonly="true"/> <EF:EFInput cname="规格" ename="spec" blockId="detail" row="0" 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"/>
</div> </div>
<EF:EFInput cname="状态" ename="status" blockId="detail" row="0" colWidth="3" type="hidden"/>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
......
...@@ -13,7 +13,8 @@ $(function () { ...@@ -13,7 +13,8 @@ $(function () {
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
// 选择 // 选择
$("#BTN_SELECT").on("click", select); $("#CONFIRM").on("click", confirm);
downKeyUp(); downKeyUp();
}); });
...@@ -35,27 +36,15 @@ var query = function (e) { ...@@ -35,27 +36,15 @@ var query = function (e) {
/** /**
* 选择库存 * 选择库存
*/ */
let select = function () { let confirm = function () {
let rows = resultGrid.getCheckedRows(); let rows = resultGrid.getCheckedRows();
if (rows.length < 1) { if (rows.length < 1) {
message("请选择数据") message("请选择数据")
return; return;
} }
for (let i = 0; i < rows.length; i++) { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成质检单吗? ", {
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 + "]条数据生成巡检单吗? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HPZL001B", "select", JSUtils.submitGridsData("result", "HGZL001B", "confirm",
true, function (e) { true, function (e) {
var status = e.getStatus(); var status = e.getStatus();
if (status !== -1) { if (status !== -1) {
......
...@@ -5,46 +5,70 @@ ...@@ -5,46 +5,70 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/> <c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="生产任务查询"> <EF:EFPage title="采购收货查询">
<EF:EFRegion id="inqu" title="查询区域" type="query"> <EF:EFRegion id="inqu" title="查询区域" type="query">
<div class="row"> <div class="row">
<div class="row"> <EF:EFDatePicker cname="收货日期" blockId="inqu_status" ename="receiveDate" row="0" colWidth="3"
<EF:EFInput cname="生产订单号" ename="prodOrderNo" blockId="inqu_status" row="0" colWidth="3"/> role="date" format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="生产任务号" ename="prodTaskNo" blockId="inqu_status" row="0" colWidth="3"/> <EF:EFInput cname="收货单号" blockId="inqu_status" ename="receiveNo" row="0" colWidth="3"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3"/> <EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
<EF:EFInput cname="部件名称" ename="prdtName" blockId="inqu_status" 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>
<div class="row"> <div class="row">
<EF:EFInput cname="零件名称" ename="partName" blockId="inqu_status" row="0" colWidth="3"/> <EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3"
</div> 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> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true"> <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="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="childId" cname="生产任务ID" enable="false" width="90" align="center" hidden="true"/> <EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/> <EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="130" align="center"/>
<EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="120" align="center"/> <EF:EFColumn ename="receiveDate" cname="收货日期" enable="false" width="100" align="center" editType="date"
<EF:EFColumn ename="partName" cname="零件名称" enable="false" width="120" align="center"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="partSpec" cname="零件规格" enable="false" width="150" align="center"/> <EF:EFColumn ename="receiveNo" cname="收货单号" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="poorType" cname="不良品类" width="100" align="center" required="true"> <EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="hpjx.hpjx.poorType"/> <EF:EFCodeOption codeName="hggp.hgcg.receiveStatus"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="problemDesc" cname="质量问题描述" width="140" required="true"/> <EF:EFColumn ename="supCode" cname="供应商编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="completeNum" cname="已入库数量" enable="false" width="120" align="right" format="{0:N0}"/> <EF:EFColumn ename="supName" cname="供应商名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="num" cname="任务数量" enable="false" width="120" align="right" format="{0:N0}"/> <EF:EFColumn ename="purUserName" cname="采购员" enable="false" width="100" align="center"/>
<EF:EFColumn ename="totalWt" cname="任务重量" enable="false" width="120" align="right" format="{0:N3}"/> <EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="factoryName" cname="工厂" enable="false" width="150" align="center"/> <EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" width="150" align="center"/> <EF:EFColumn ename="specId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/> <EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="projCode" cname="项目号" enable="false" width="140" align="center"/> <%-- <EF:EFComboColumn ename="poorType" cname="不良品类" width="100" align="center" required="true">--%>
<EF:EFColumn ename="prdtCode" cname="部件编码" enable="false" width="120" align="center"/> <%-- <EF:EFCodeOption codeName="hggp.hgzl.poorType"/>--%>
<EF:EFColumn ename="partCode" cname="零件编码" enable="false" width="120" align="center"/> <%-- </EF:EFComboColumn>--%>
<EF:EFColumn ename="factoryCode" cname="厂区编码" enable="false" width="150"/> <%-- <EF:EFColumn ename="problemDesc" cname="质量问题描述" width="140" required="true"/>--%>
<EF:EFColumn ename="orgNo" cname="生产组编码" enable="false" width="150"/> <EF:EFColumn ename="receiveQty" cname="收货数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="prodTaskNo" cname="生产任务号" enable="false" width="140" align="center"/> <EF:EFColumn ename="receiveWeight" cname="收货重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="prodOrderNo" cname="生产订单号" enable="false" width="140" align="center"/> <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:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </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