Commit ea751d9a by 宋祥

1.委外入库质检单

parent a7052ae5
......@@ -51,6 +51,8 @@ public class HGConstant {
public static final String HPZL001_NUMBER = "HPZL001_NUMBER";
// 巡检单号
public static final String SCLL_QUALITY_NO = "SCLL_QUALITY_NO";
// 委外入库质检单
public static final String WWRK_QUALITY_NO = "WWRK_QUALITY_NO";
//采购入库单号
public static final String HPKC001_NUMBER = "HPKC001_NUMBER";
......
package com.baosight.hggp.hg.dm.service;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.constant.S3Constant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.utils.Iplat4jUtils;
import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -62,6 +62,9 @@ public class ServiceHGDM099 extends ServiceEPBase {
public EiInfo upload(EiInfo inInfo) {
try {
HGDM099 fDm099 = MapUtils.toDaoEPBase(inInfo, HGDM099.class);
AssertUtils.isEmpty(fDm099.getBizId(), "业务ID不能为空");
AssertUtils.isEmpty(fDm099.getBizType(), "业务类型不能为空");
AssertUtils.isEmpty(fDm099.getDocId(), "文件ID不能为空");
fDm099.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGDM099.INSERT, fDm099);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
......@@ -28,7 +28,34 @@ public class HgKcConst {
public static final Integer S1 = 1;
// 质检中
public static final Integer S2 = 2;
// 已完成
// 已出库
public static final Integer S3 = 3;
}
}
/**
* HGKC014 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public static class HgKc014 {
/**
* 提交状态
*
* @author:songx
* @date:2024/5/15,15:18
*/
public static class Status {
// 未提交
public static final Integer S0 = 0;
// 已提交
public static final Integer S1 = 1;
// 质检中
public static final Integer S2 = 2;
// 已入库
public static final Integer S3 = 3;
}
}
......
......@@ -42,4 +42,36 @@ public class HgKcSqlConst {
public static final String BATCH_DELETE = "HGKC008A.batchDelete";
}
/**
* HGKC014 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HgKc014 {
// 锁
public static final String LOCK = "HGKC014.lock";
// 修改状态
public static final String UPDATE_STATUS = "HGKC014.updateStatus";
// 修改
public static final String UPDATE_RECEIVE_TYPE = "HGKC014.updateReceiveType";
}
/**
* HGKC014A SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HgKc014A {
// 锁
public static final String LOCK = "HGKC014A.lock";
// 修改状态
public static final String UPDATE_STATUS = "HGKC014A.updateStatus";
// 批量删除
public static final String BATCH_DELETE = "HGKC014A.batchDelete";
}
}
......@@ -36,14 +36,22 @@ import java.util.stream.Collectors;
*/
public class ServiceHGKC008A extends ServiceBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGKC008A.QUERY, new HGKC008A());
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
// 主信息
HGKC008 dbKc088 = HGKCTools.HgKc008.getById(MapUtils.getLong(queryMap, "receiveId"));
inInfo.addBlock("main").addRow(dbKc088);
String whCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC008A.FIELD_WH_CODE);
Map map = new HashMap();
map.put(HGKC008A.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode());
map.put(HGKC008A.FIELD_WH_CODE, whCode);
// map.put(HGPZ004.FIELD_INVENT_TYPE_DETAILS, InventTypeDetailEnum.getInentTypeThree());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID, DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID), map,
false
......@@ -54,6 +62,12 @@ public class ServiceHGKC008A extends ServiceBase {
return inInfo;
}
/**
* 查询
*
* @param inInfo
* @return
*/
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGKC008A.QUERY, new HGKC008A());
......
......@@ -462,7 +462,8 @@ public class HGKCUtils {
private static void updateInvData(HGKC010 newKc010, HGKC010 dbKc010) {
BigDecimal newQty = newKc010.getInvQty().add(dbKc010.getInvQty());
AssertUtils.isGt(BigDecimal.ZERO, newQty, String.format("更新后的库存数量小于0(%s),请检查", newQty));
BigDecimal newWeight = newKc010.getInvWeight().add(dbKc010.getInvWeight());
BigDecimal newWeight = newQty.compareTo(BigDecimal.ZERO) == 0 ? BigDecimal.ZERO
: newKc010.getInvWeight().add(dbKc010.getInvWeight());
BigDecimal newUnitWeight = newQty.compareTo(BigDecimal.ZERO) == 0 ? BigDecimal.ZERO
: newWeight.divide(newQty, 3, RoundingMode.HALF_UP);
dbKc010.setInvQty(newQty);
......
......@@ -27,4 +27,25 @@ public class HgZlConst {
}
}
/**
* @author:songx
* @date:2024/9/29,13:38
*/
public static class HgZl012 {
/**
* 状态
*
* @author:songx
* @date:2024/5/15,15:18
*/
public static class Status {
// 未处理
public static final Integer S0 = 0;
// 已处理
public static final Integer S1 = 1;
}
}
}
......@@ -20,4 +20,18 @@ public class HgZlSqlConst {
public static final String PROCESS = "HGZL011.process";
}
/**
* HGZL012
*
* @author:songx
* @date:2024/5/7,16:36
*/
public static class HgZl012 {
// 锁
public static final String LOCK = "HGZL012.lock";
// 处理
public static final String PROCESS = "HGZL012.process";
}
}
......@@ -56,7 +56,7 @@ public class ServiceHGZL011 extends ServiceBase {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
EiInfoUtils.addBlock(inInfo, "roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGZL001().eiMetadata);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGZL011().eiMetadata);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "初始化失败");
}
......@@ -248,7 +248,7 @@ public class ServiceHGZL011 extends ServiceBase {
String applyCode = fZl011.getApplyCode();
HGKCTools.HgKc008.updateStatus(applyCode, HgKcConst.HgKc008.Status.S3);
// 如果存在不合格数量生产一笔负数领料单
if (fZl011.getUnQualityQty().compareTo(BigDecimal.ZERO) > 0) {
if (fZl011.getUnQualityQty().compareTo(BigDecimal.ZERO) < 1) {
return;
}
HGKC008A dbKc008A = dbKc008AMap.get(applyLineCode);
......
package com.baosight.hggp.hg.zl.service;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.hg.dm.utils.HgDmUtils;
import com.baosight.hggp.hg.xs.constant.HgXsConstant;
import com.baosight.hggp.hg.zl.domain.HGZL011;
import com.baosight.hggp.hg.zl.tools.HGZLTools;
import com.baosight.hggp.hg.zl.utils.HGZLUtils;
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.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Map;
/**
* @author:songx
* @date:2024/1/25,15:25
*/
public class ServiceHGZL012A extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
this.setDetailInfo(inInfo);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGDM099().eiMetadata);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGDM099.QUERY, new HGDM099());
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryMap, HGDM099.FIELD_BIZ_ID);
HGZL011 dbZl011 = HGZLUtils.HgZl011.lockGetData(bizId);
this.checkRemoveData(dbZl011);
// 删除数据
int num = HgDmUtils.HgDm099.delete(inInfo);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + num + "]条数据删除成功!");
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param dbXs011
*/
private void checkRemoveData(HGZL011 dbXs011) {
AssertUtils.isNotEquals(dbXs011.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("质检单【%s】不是\"未删除\"状态,不允许操作", dbXs011.getQualityNo()));
AssertUtils.isNotEquals(dbXs011.getStatus(), HgXsConstant.FolStatus.S0,
String.format("质检单【%s】不是\"质检中\"状态,不允许操作", dbXs011.getQualityNo()));
}
/**
* 设置信息
*
* @param inInfo
*/
public void setDetailInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryRow, HGDM099.FIELD_BIZ_ID);
if (bizId == null) {
return;
}
EiBlock block = new EiBlock(CommonConstant.Field.DETAIL);
block.addRow(HGZLTools.HgZl011.get(bizId));
block.addBlockMeta(new HGZL011().eiMetadata);
inInfo.setBlock(block);
}
}
package com.baosight.hggp.hg.zl.service;
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.HGCG003B1;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.constant.HgKcConst;
import com.baosight.hggp.hg.kc.domain.HGKC008;
import com.baosight.hggp.hg.kc.domain.HGKC008A;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.zl.constant.HgZlConst;
import com.baosight.hggp.hg.zl.domain.HGZL011;
import com.baosight.hggp.hg.zl.domain.HGZL012;
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.hggp.util.ObjectUtils;
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 ServiceHGZL012B extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
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 HGCG003B1().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HGKC008A.FIELD_STATUS, HgKcConst.HgKc008.Status.S1);
queryMap.put("isInvQty", CommonConstant.YesNo.YES_1);
inInfo = super.query(inInfo, HGKC008A.QUERY, new HGKC008A());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 生成质检单
*
* @param inInfo
* @return
*/
public EiInfo confirm(EiInfo inInfo) {
try {
List<HGKC008A> fKc008As = MapUtils.toDaoEPBases(inInfo, HGKC008A.class);
// 锁主信息和明细信息
List<String> applyNos = ObjectUtils.listEpKey(fKc008As, HGKC008A.FIELD_APPLY_CODE);
Map<String, HGKC008> dbKc008Map = HGKCUtils.HgKc008.lockGetData(applyNos);
Map<String, HGKC008A> dbKc008AMap = HGKCUtils.HgKc008A.lockGetDataEp(fKc008As);
// 数据校验
this.checkConfirmData(fKc008As, dbKc008Map, dbKc008AMap);
// 生成巡检单
this.saveConfirmData(fKc008As, dbKc008AMap);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "生成质检单失败");
}
return inInfo;
}
/**
* 校验数据
*
* @param fKc008As
* @param dbKc008Map
* @param dbKc008AMap
*/
private void checkConfirmData(List<HGKC008A> fKc008As, Map<String, HGKC008> dbKc008Map,
Map<String, HGKC008A> dbKc008AMap) {
for (HGKC008A fKc008A : fKc008As) {
HGKC008 dbKc008 = dbKc008Map.get(fKc008A.getApplyCode());
AssertUtils.isNull(dbKc008, String.format("领料单【%s】不存在", fKc008A.getApplyLineCode()));
HGKC008A dbKc008A = dbKc008AMap.get(fKc008A.getApplyLineCode());
AssertUtils.isNull(dbKc008A, String.format("领料单行【%s】不存在", fKc008A.getApplyLineCode()));
AssertUtils.isNotEquals(HgKcConst.HgKc008.Status.S1, dbKc008A.getStatus(),
String.format("领料单行[%s]的状态不是\"已提交\",不允许操作", fKc008A.getApplyLineCode()));
}
}
/**
* 保存数据
*
* @param fKc008As
* @param dbKc008AMap
*/
private void saveConfirmData(List<HGKC008A> fKc008As, Map<String, HGKC008A> dbKc008AMap) {
for (HGKC008A fKc008A : fKc008As) {
HGKC008A dbKc008A = dbKc008AMap.get(fKc008A.getApplyLineCode());
HGZL012 newZl012 = BeanUtils.copy(dbKc008A, HGZL012.class);
newZl012.setQualityNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.WWRK_QUALITY_NO));
newZl012.setQualityDate(DateUtils.shortDate());
newZl012.setStatus(HgZlConst.HgZl011.Status.S0);
newZl012.setDeleteFlag(CommonConstant.YesNo.NO_0);
newZl012.setApplyQty(dbKc008A.getInvQty());
newZl012.setApplyUnitWeight(dbKc008A.getInvUnitWeight());
newZl012.setApplyWeight(dbKc008A.getInvWeight());
newZl012.setSpec(dbKc008A.getInvSpec());
DaoUtils.insert(HGZL012.INSERT, newZl012);
// 更新入库单状态
HGKCTools.HgKc014.updateStatus(fKc008A.getApplyCode(), HgKcConst.HgKc014.Status.S2);
// 更新入库单明细状态
HGKCTools.HgKc014A.updateStatus(fKc008A.getId(), HgKcConst.HgKc014.Status.S2);
}
}
}
......@@ -41,12 +41,7 @@
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="idCondition"/>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
......@@ -71,9 +66,6 @@
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="qualityNo">
QUALITY_NO = #qualityNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="qualityDate">
QUALITY_DATE = #qualityDate#
</isNotEmpty>
......@@ -145,7 +137,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
STATUS ASC, ID DESC
</isEmpty>
</dynamic>
</sql>
......
<?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="HGZL012">
<sql id="column">
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
STATUS as "status", <!-- 状态:0-质检中,1-质检完成 -->
QUALITY_NO as "qualityNo", <!-- 质检单号 -->
QUALITY_DATE as "qualityDate", <!-- 单据日期 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
SPEC_ID as "specId", <!-- 规格ID -->
SPEC as "spec", <!-- 规格 -->
UNIT as "unit", <!-- 单位 -->
APPLY_QTY as "applyQty", <!-- 入库数量 -->
APPLY_UNIT_WEIGHT as "applyUnitWeight", <!-- 入库单重 -->
APPLY_WEIGHT as "applyWeight", <!-- 入库重量 -->
QUALITY_QTY as "qualityQty", <!-- 合格数量 -->
UN_QUALITY_QTY as "unQualityQty", <!-- 不合格数量 -->
DEPOSIT_CODE as "depositCode", <!-- 委外入库单号 -->
DEPOSIT_LINE_CODE as "depositLineCode" <!-- 委外入库行号 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="idCondition"/>
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="qualityDate">
QUALITY_DATE = #qualityDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="specId">
SPEC_ID = #specId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unit">
UNIT = #unit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyQty">
APPLY_QTY = #applyQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyUnitWeight">
APPLY_UNIT_WEIGHT = #applyUnitWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyWeight">
APPLY_WEIGHT = #applyWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="qualityQty">
QUALITY_QTY = #qualityQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unQualityQty">
UN_QUALITY_QTY = #unQualityQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositCode">
DEPOSIT_CODE = #depositCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositLineCode">
DEPOSIT_LINE_CODE = #depositLineCode#
</isNotEmpty>
</sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="qualityNo">
QUALITY_NO = #qualityNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="qualityNos">
QUALITY_NO IN <iterate open="(" close=")" conjunction="," property="qualityNos">#qualityNos[]#</iterate>
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
STATUS ASC, ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.zl.domain.HGZL012">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGZL012
WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGZL012 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGZL012 (
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
STATUS, <!-- 状态:0-质检中,1-质检完成 -->
QUALITY_NO, <!-- 质检单号 -->
QUALITY_DATE, <!-- 单据日期 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
INVENT_TYPE, <!-- 存货类型 -->
INVENT_CODE, <!-- 存货编码 -->
INVENT_NAME, <!-- 存货名称 -->
SPEC_ID, <!-- 规格ID -->
SPEC, <!-- 规格 -->
UNIT, <!-- 单位 -->
APPLY_QTY, <!-- 入库数量 -->
APPLY_UNIT_WEIGHT, <!-- 入库单重 -->
APPLY_WEIGHT, <!-- 入库重量 -->
QUALITY_QTY, <!-- 合格数量 -->
UN_QUALITY_QTY, <!-- 不合格数量 -->
DEPOSIT_CODE, <!-- 委外入库单号 -->
DEPOSIT_LINE_CODE <!-- 委外入库行号 -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #status#, #qualityNo#, #qualityDate#, #companyCode#, #companyName#, #inventType#,
#inventCode#, #inventName#, #specId#, #spec#, #unit#, #applyQty#, #applyUnitWeight#, #applyWeight#,
#qualityQty#, #unQualityQty#, #depositCode#, #depositLineCode#)
</insert>
<delete id="delete">
UPDATE ${hggpSchema}.HGZL012 SET DELETE_FLAG = 1 WHERE ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGZL012
SET
QUALITY_DATE = #qualityDate#, <!-- 单据日期 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
INVENT_TYPE = #inventType#, <!-- 存货类型 -->
INVENT_CODE = #inventCode#, <!-- 存货编码 -->
INVENT_NAME = #inventName#, <!-- 存货名称 -->
SPEC_ID = #specId#, <!-- 规格ID -->
SPEC = #spec#, <!-- 规格 -->
UNIT = #unit#, <!-- 单位 -->
APPLY_QTY = #applyQty#, <!-- 入库数量 -->
APPLY_UNIT_WEIGHT = #applyUnitWeight#, <!-- 入库单重 -->
APPLY_WEIGHT = #applyWeight#, <!-- 入库重量 -->
QUALITY_QTY = #qualityQty#, <!-- 合格数量 -->
UN_QUALITY_QTY = #unQualityQty#, <!-- 不合格数量 -->
DEPOSIT_CODE = #depositCode#, <!-- 委外入库单号 -->
DEPOSIT_LINE_CODE = #depositLineCode#, <!-- 委外入库行号 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
</sqlMap>
......@@ -384,4 +384,77 @@ public class HGZLTools {
}
/**
* HGZL012 定义
*
* @author:songx
* @date:2024/9/29,14:10
*/
public static class HgZl012 {
/**
* 锁
*
* @param qualityNo
* @return
*/
public static void lock(String qualityNo) {
AssertUtils.isEmpty(qualityNo, "质检单号不能为空");
Map paramMap = new HashMap();
paramMap.put(HGZL012.FIELD_QUALITY_NO, qualityNo);
DaoBase.getInstance().update(HgZlSqlConst.HgZl012.LOCK, paramMap);
}
/**
* 锁
*
* @param qualityNos
* @return
*/
public static void lock(List<String> qualityNos) {
AssertUtils.isEmpty(qualityNos, "质检单号不能为空");
Map paramMap = new HashMap();
paramMap.put("qualityNos", qualityNos);
DaoBase.getInstance().update(HgZlSqlConst.HgZl012.LOCK, paramMap);
}
/**
* 查询
*
* @param qualityNo
*/
public static HGZL012 get(String qualityNo) {
AssertUtils.isEmpty(qualityNo, "质检单号不能为空");
Map paramMap = new HashMap();
paramMap.put(HGZL012.FIELD_QUALITY_NO, qualityNo);
List<HGZL012> results = DaoBase.getInstance().query(HGZL012.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param qualityNos
* @return
*/
public static List<HGZL012> list(List<String> qualityNos) {
AssertUtils.isEmpty(qualityNos, "质检单号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("qualityNos", qualityNos);
return DaoBase.getInstance().query(HGZL012.QUERY, paramMap);
}
/**
* 查询
*
* @param qualityNos
* @return
*/
public static Map<String, HGZL012> map(List<String> qualityNos) {
List<HGZL012> results = list(qualityNos);
return results.stream().collect(Collectors.toMap(HGZL012::getQualityNo, item -> item));
}
}
}
......@@ -3,6 +3,7 @@ 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.domain.HGZL011;
import com.baosight.hggp.hg.zl.domain.HGZL012;
import com.baosight.hggp.hg.zl.tools.HGZLTools;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.MapUtils;
......@@ -65,7 +66,6 @@ public class HGZLUtils {
}
}
/**
* HGZL001 工具类
*
......@@ -127,4 +127,63 @@ public class HGZLUtils {
}
/**
* HGZL002 工具类
*
* @author:songx
* @date:2024/5/9,16:58
*/
public static class HgZl012 {
/**
* 设置查询条件
*
* @param queryRow 集合
* @return
*/
public static void setCondition(Map queryRow) {
HGUtils.setCondition(queryRow);
// 单据日期
String qualityDate = MapUtils.getString(queryRow, HGZL012.FIELD_QUALITY_DATE);
if (StringUtils.isNotBlank(qualityDate)) {
queryRow.put(HGZL012.FIELD_QUALITY_DATE, DateUtils.formatShort(qualityDate));
}
}
/**
* 锁并且获取数据
*
* @param qualityNo
* @return
*/
public static HGZL012 lockGetData(String qualityNo) {
// 锁
HGZLTools.HgZl012.lock(qualityNo);
// db数据
return HGZLTools.HgZl012.get(qualityNo);
}
/**
* 锁并且获取数据
*
* @param fZl012s
* @return
*/
public static Map<String, HGZL012> lockGetDataEp(List<? extends HGZL012> fZl012s) {
return lockGetData(ObjectUtils.listEpKey(fZl012s, HGZL012.FIELD_QUALITY_NO));
}
/**
* 锁并且获取数据
*
* @param qualityNos
* @return
*/
public static Map<String, HGZL012> lockGetData(List<String> qualityNos) {
// 锁
HGZLTools.HgZl012.lock(qualityNos);
// db数据
return HGZLTools.HgZl012.map(qualityNos);
}
}
}
......@@ -63,6 +63,7 @@
<sqlMap resource="com/baosight/hggp/hg/zl/sql/HGZL004.xml"/>
<sqlMap resource="com/baosight/hggp/hg/zl/sql/HGZL004A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/zl/sql/HGZL011.xml"/>
<sqlMap resource="com/baosight/hggp/hg/zl/sql/HGZL012.xml"/>
<!-- 生产 -->
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC001.xml"/>
......
......@@ -264,21 +264,22 @@ function updateStatus(id,status) {
});
}
/**
* 显示详情
*/
function showDetail(id,whCode,companyCode,status) {
function showDetail(id, whCode, companyCode, status) {
let params = {
"inqu_status-0-receiveId": id,
}
JSColorbox.open({
href: "HGKC008A?methodName=initLoad&inqu_status-0-receiveId=" + id+"&inqu_status-0-whCode="+whCode+"&inqu_status-0-companyCode="+companyCode+"&inqu_status-0-status="+status,
href: "HGKC008A",
title: "<div style='text-align: center;'>领料详情</div>",
width: "90%",
height: "90%",
params: params
});
}
function loadChange(grid,e,field) {
var cell_label = field,that = grid;
// locked 表示是否为固定列
......
......@@ -68,7 +68,7 @@
</EF:EFComboColumn>
<EF:EFColumn ename="receiveUserName" cname="领料人姓名" width="120" align="center" enable="false" hidden="true"/>
<EF:EFComboColumn cname="状态" ename="status" width="90" align="center" required="false" enable="false">
<EF:EFCodeOption codeName="hggp.sc.productStatus"/>
<EF:EFCodeOption codeName="hggp.hgkc.ScllStatus"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
......
......@@ -151,15 +151,22 @@ $(function (){
* 页面加载时执行
*/
$(window).load(function () {
var status = $("#inqu_status-0-status").val();
// 查询
query();
// 按钮显示
let status = $("#main-0-status").val();
//如果提交了,则不能修改
if(status && status === "1"){
if (isBlank(status) || status != "0") {
$('#add').hide();
$('#save-changes').hide();
$('#cancel-changes').hide();
$('#delete').hide();
}
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
......
......@@ -8,14 +8,13 @@
<script>
var ctx = "${ctx}";
</script>
<head>
</head>
<EF:EFPage title="生产领料详情">
<EF:EFInput ename="main-0-applyCode" cname="领料单号" colWidth="3" type="hidden"/>
<EF:EFInput ename="main-0-status" cname="状态" colWidth="3" type="hidden"/>
<EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput ename="inqu_status-0-receiveId" cname="领料单id" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-whCode" cname="仓库编码" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-companyCode" cname="公司编码" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-status" cname="状态" colWidth="3" type="hidden"/>
<div class="row">
<EF:EFSelect cname="存货类型" ename="inqu_status-0-inventType" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
......@@ -30,11 +29,11 @@
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false" checkMode="row,single">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="receiveId" cname="领料单id" hidden="true"/>
<EF:EFColumn ename="whCode" cname="仓库编码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="公司编码" hidden="true"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="hggp.hgkc.ScllStatus"/>
</EF:EFComboColumn>
<EF:EFColumn ename="whCode" cname="仓库编码" hidden="true"/>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="true" width="120" align="center" required="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" enable="false" required="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true"
......
......@@ -124,7 +124,7 @@ function remove() {
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HGXS007A", "remove", true);
JSUtils.submitGridsData("result", "HGZL011A", "remove", true);
}
});
}
......
$(function () {
IPLATUI.EFGrid = {
"result": {
pageable: {
input: true,
numeric: false,
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [{
field: "qualityDate",
attributes: {
class: "i-input-readonly"
}
}, {
field: "problemPhoto",
template: function (item) {
if (!isBlank(item.qualityNo)) {
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(\'' + item.qualityNo + '\', \'SCLL_QUALITY_PROBLEM\')" >附件清单</a>';
} else {
return "";
}
}
}, {
field: "processPhoto",
template: function (item) {
if (!isBlank(item.qualityNo)) {
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(\'' + item.qualityNo + '\', \'SCLL_QUALITY_PROCESS\')" >附件清单</a>';
} else {
return "";
}
}
}, {
field: "createdName",
template: function (options) {
return showUserName(options.createdBy, options.createdName);
}
}],
loadComplete: function (grid) {
grid.dataSource.bind("change", function (e) {
var item = e.items[0];
if (e.field == "qualityQty") {
if (item.qualityQty && item.applyQty) {
let unQualityQty = item.applyQty - item.qualityQty;
resultGrid.setCellValue(item, 'unQualityQty', unQualityQty.toFixed(3))
}
}
if (e.field == "unQualityQty") {
if (item.unQualityQty && item.applyQty) {
let qualityQty = item.applyQty - item.unQualityQty;
resultGrid.setCellValue(item, 'qualityQty', qualityQty.toFixed(3))
}
}
});
},
onSuccess: function (e) {
}
}
}
// 查询
$("#QUERY").on("click", query);
// 选择采购收货
$("#SELECT").on("click", select);
// 质检完成
$("#PROCESS").on("click", process);
// 删除
$("#REMOVE").on("click", remove);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 附件清单
*
* @param id
* @param type
*/
function showUploadFile(id, type) {
let params = {
"inqu_status-0-bizId": id,
"inqu_status-0-bizType": type
}
JSColorbox.open({
href: "HGZL012A",
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
params: params
});
}
/**
* 提交操作
*
* @param id
* @param checkNo
*/
let process = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let qualityQty = rows[i]['qualityQty'];
let unQualityQty = rows[i]['unQualityQty'];
let applyQty = rows[i]['applyQty'];
if (!isNumber(qualityQty) || !isNumber(unQualityQty)) {
message("第" + (i + 1) + "行合格数量和不合格数量必须是大于等于0的数字");
return;
}
if ((parseFloat(qualityQty) + parseFloat(unQualityQty)) != parseFloat(applyQty)) {
message("第" + (i + 1) + "行合格数量加不合格数量必须等于领料数量");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"质检完成\"操作吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGZL012", "process", true);
}
});
}
/**
* 选择生产领料
*/
let select = function () {
JSColorbox.open({
href: "HGZL011B?methodName=initLoad",
title: "<div style='text-align: center;'>生产领料查询</div>",
width: "80%",
height: "80%",
callbackName: selectCallback
});
}
/**
* 选择采购收货回调
*/
let selectCallback = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
/**
* 删除
*/
function remove() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGZL011", "remove", true);
}
});
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="委外入库质检单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker cname="单据日期" ename="qualityDate" blockId="inqu_status" row="0" colWidth="3"
format="yyyy-MM-dd" readonly="true"/>
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</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="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="depositCode" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row" height="68vh">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="problemPhoto" cname="问题照片" locked="true" enable="false" width="80" align="center"
required="true"/>
<EF:EFColumn ename="processPhoto" cname="处理照片" locked="true" enable="false" width="80" align="center"
required="true"/>
<EF:EFColumn ename="qualityNo" cname="质检单号" enable="false" width="130" align="center"/>
<EF:EFColumn ename="qualityDate" cname="单据日期" enable="false" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="100" align="center">
<EF:EFOption label="已处理" value="1"></EF:EFOption>
<EF:EFOption label="未处理" value="0"></EF:EFOption>
</EF:EFComboColumn>
<EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="180" align="center"/>
<EF:EFColumn ename="applyLineCode" cname="领料单行号" enable="false" width="130" 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:EFColumn ename="qualityQty" cname="合格数量" width="120" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="unQualityQty" cname="不合格数量" width="120" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="applyQty" cname="领料数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="applyWeight" cname="领料重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="length" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="150" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="150" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFSelect = {
"inqu_status-0-bizType": {
change: function (e) {
query();
}
}
}
IPLATUI.EFGrid = {
"result": {
columns: [{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(item.docId) + '" target="_blank">附件下载</a>';
return template;
}
}],
dataBound: function () {
}
}
};
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
// 附件上传
$("#UPLOAD_FILE").on("click", uploadFile);
// 删除
$("#REMOVE").on("click", remove);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
// 隐藏按钮
showButton();
});
/**
* 查询
*/
let query = function (e) {
resultGrid.dataSource.page(1);
}
/**
* 显示按钮
*/
let showButton = function () {
var status = $("#detail-0-status").val();
//如果提交了,则不能修改
if (!isBlank(status) && status === "0") {
$('#UPLOAD_FILE').show();
$('#REMOVE').show();
} else {
$('#UPLOAD_FILE').hide();
$('#REMOVE').hide();
}
}
/**
* 文件上传
*
* @param id
*/
function uploadFile() {
let bizId = $("#inqu_status-0-bizId").val();
let bizType = $("#inqu_status-0-bizType").val();
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-qualityNo", bizId);
EiCommunicator.send('HGZL012', 'checkStatus', inInfo, {
onSuccess(res) {
if (res.status !== -1) {
let params = {
"inqu_status-0-bizId": bizId,
"inqu_status-0-bizType": bizType
}
JSColorbox.open({
href: "HGDM099A",
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
params: params,
callbackName: uploadFileCallback
});
} else {
message(res.msg);
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
/**
* 附件上传回调
*
* @param docId
*/
function uploadFileCallback(e) {
resultGrid.dataSource.page(1);
}
/**
* 删除
*/
function remove() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HGZL012A", "remove", true);
}
});
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="附件清单">
<EF:EFRegion id="inqu" title="查询区域" type="query">
<EF:EFInput cname="ID" ename="id" blockId="detail" row="0" type="hidden"/>
<EF:EFInput cname="状态" ename="status" blockId="detail" row="0" type="hidden"/>
<div class="row">
<EF:EFInput cname="质检单号" ename="bizId" blockId="inqu_status" row="0" readonly="true"/>
<EF:EFSelect cname="业务类型" ename="bizType" blockId="inqu_status" row="0" colWidth="3" readonly="true">
<EF:EFOption label="问题照片" value="WWRK_QUALITY_PROBLEM"/>
<EF:EFOption label="处理照片" value="WWRK_QUALITY_PROCESS"/>
</EF:EFSelect>
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true"
serviceName="HGDM099" methodName="query">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid = {
"result": {
columns: [],
dataBound: function () {
}
}
};
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
// 确认
$("#CONFIRM").on("click", confirm);
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
initInventCode();
});
/**
* 查询
*/
var query = function (e) {
resultGrid.dataSource.page(1);
};
/**
* 确认
*/
let confirm = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成质检单吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGZL012B", "confirm",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
parent.JSColorbox.setValueCallback();
}
}
);
}
});
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="委外入库查询">
<EF:EFRegion id="inqu" title="查询区域" type="query">
<div class="row">
<EF:EFInput ename="depositCode" cname="入库单号" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect ename="companyCode" cname="公司名称" 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:EFInput ename="projName" cname="项目名称" blockId="inqu_status" row="0" colWidth="4"/>
</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="130" align="center"/>
<EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="160" align="center"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="hggp.hgkc.ScllStatus"/>
</EF:EFComboColumn>
<EF:EFColumn ename="whCode" cname="仓库编码" hidden="true"/>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="true" width="120" align="center"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" enable="false"/>
<EF:EFColumn ename="invSpecId" cname="规格id" hidden="true"/>
<EF:EFColumn ename="invSpec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="invQty" cname="数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invWeight" cname="重量" enable="false" width="100" align="right" format="{0:N3}"
sort="true"/>
</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