Commit a7052ae5 by 宋祥

1.生产领料质检单

parent fe87e7a9
......@@ -49,6 +49,9 @@ public class HGConstant {
public static final String HPKC008_NUMBER = "HPKC008_NUMBER";
// 巡检单号
public static final String HPZL001_NUMBER = "HPZL001_NUMBER";
// 巡检单号
public static final String SCLL_QUALITY_NO = "SCLL_QUALITY_NO";
//采购入库单号
public static final String HPKC001_NUMBER = "HPKC001_NUMBER";
// 生产领料单号
......@@ -142,7 +145,10 @@ public class HGConstant {
public static final String FOL_NO = "FOL_NO";
// 维修单号
public static final String REP_ORDER_NO = "REP_ORDER_NO";
// 生产领料单号
public static final String SC_APPLY_CODE = "SC_APPLY_CODE";
// 生产领料单行号
public static final String SC_APPLY_LINE_CODE = "SC_APPLY_LINE_CODE";
}
......
......@@ -320,18 +320,6 @@ public class HGSqlConstant {
}
/**
* HGKC008 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HGKC008 {
// 查询
public static final String QUERY_SUM = "HGKC008.querySum";
}
/**
* HGKC002 SQL 定义
*
* @author:songx
......
package com.baosight.hggp.hg.dm.utils;
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.MapUtils;
import com.baosight.iplat4j.core.ei.EiInfo;
import java.util.List;
/**
* @author:songx
* @date:2024/9/29,14:21
*/
public class HgDmUtils {
/**
* HGDM099 定义
*
* @author:songx
* @date:2024/9/29,14:21
*/
public static class HgDm099 {
/**
* 删除附件
*
* @param inInfo
*/
public static int delete(EiInfo inInfo) {
List<HGDM099> fDm099s = MapUtils.toDaoEPBases(inInfo, HGDM099.class);
for (HGDM099 fDm099 : fDm099s) {
DaoUtils.update(HGDM099.DELETE, fDm099);
if (!fDm099.getDocId().isEmpty()) {
Iplat4jUtils.deleteFileByDocId(fDm099.getDocId());
}
}
return fDm099s.size();
}
}
}
package com.baosight.hggp.hg.kc.constant;
/**
* @author:songx
* @date:2024/9/29,10:01
*/
public class HgKcConst {
/**
* HGKC008 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public static class HgKc008 {
/**
* 提交状态
*
* @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;
}
}
}
package com.baosight.hggp.hg.kc.constant;
/**
* @author:songx
* @date:2024/9/29,9:54
*/
public class HgKcSqlConst {
/**
* HGKC008 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HgKc008 {
// 锁
public static final String LOCK = "HGKC008.lock";
// 修改状态
public static final String UPDATE_STATUS = "HGKC008.updateStatus";
// 查询
public static final String QUERY_SUM = "HGKC008.querySum";
// 修改
public static final String UPDATE_RECEIVE_TYPE = "HGKC008.updateReceiveType";
}
/**
* HGKC008A SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HgKc008A {
// 锁
public static final String LOCK = "HGKC008A.lock";
// 修改状态
public static final String UPDATE_STATUS = "HGKC008A.updateStatus";
// 质检查询
public static final String QUERY_QC = "HGKC008A.queryQc";
// 批量删除
public static final String BATCH_DELETE = "HGKC008A.batchDelete";
}
}
......@@ -75,7 +75,6 @@ public class HGKC008 extends DaoEPBase {
public static final String DELETE = "HGKC008.delete";
public static final String BATCH_DELETE = "HGKC008.batchDelete";;
public static final String UPDATE_STATUS = "HGKC008.updateStatus";;
public static final String UPDATE_RECEIVE_TYPE = "HGKC008.updateReceiveType";;
private Long id = new Long(0); /* 主键id*/
private String accountCode = " "; /* 账套*/
......
......@@ -6,6 +6,7 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
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;
......@@ -117,7 +118,7 @@ public class ServiceHGKC008 extends ServiceBase {
HGKCTools.HgKc008A.updateWhCodeByReceiveId(fKc008);
} else {
//生成生产领料编号
fKc008.setApplyCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.RECEIVE_CODE));
fKc008.setApplyCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.SC_APPLY_CODE));
fKc008.setStatus(HGConstant.ProductStatus.WTJ);
DaoUtils.insert(HGKC008.INSERT, fKc008);
}
......@@ -196,15 +197,16 @@ public class ServiceHGKC008 extends ServiceBase {
}
List<HGKC008A> hgkc008AList = HGKCTools.HgKc008A.getHgkc008aList(hgkc008.getId());
if(!CollectionUtils.isEmpty(hgkc008AList)){
for(HGKC008A hgkc008A : hgkc008AList){
for (HGKC008A hgkc008A : hgkc008AList) {
// 更新明细状态
HGKCTools.HgKc008A.updateStatus(hgkc008A.getApplyLineCode(), HgKcConst.HgKc008.Status.S1);
//领料如果是正数则为出库,需要减少库存,如果是退回则要加库存
BigDecimal qty = hgkc008A.getInvQty().multiply(new BigDecimal(-1));
BigDecimal invUnitWeight = hgkc008A.getInvUnitWeight().multiply(new BigDecimal(-1));
BigDecimal invWeight = hgkc008A.getInvWeight().multiply(new BigDecimal(-1));
//增加库存
HGKCUtils.HgKc010.updateInv(hgkc008A.getCompanyCode(),hgkc008A.getWhCode(),
hgkc008A.getInventCode(),qty,
invUnitWeight,invWeight);
HGKCUtils.HgKc010.updateInv(hgkc008A.getCompanyCode(), hgkc008A.getWhCode(),
hgkc008A.getInventCode(), qty, invUnitWeight, invWeight);
}
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
......
......@@ -24,6 +24,7 @@ import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal;
import java.util.Arrays;
......@@ -123,6 +124,9 @@ public class ServiceHGKC008B extends ServiceBase {
Long id = fKc010B.getId();
HGKC010 dbKc010 = dbKc010Map.get(id);
HGKC008A newKc008A = BeanUtils.copy(dbKc010, HGKC008A.class);
newKc008A.setApplyCode(dbKc008.getApplyCode());
newKc008A.setApplyLineCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.SC_APPLY_LINE_CODE,
new String[]{dbKc008.getApplyCode()}));
newKc008A.setProjCode(dbKc008.getProjCode());
newKc008A.setProjName(dbKc008.getProjName());
newKc008A.setCompanyCode(dbKc008.getCompanyCode());
......
......@@ -28,10 +28,8 @@
</sql>
<sql id="condition">
<include refid="idCondition"/>
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
......@@ -68,9 +66,6 @@
<isNotEmpty prepend=" AND " property="receiptDate">
date_format(RECEIPT_DATE,'%Y-%m-%d') = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyCode">
APPLY_CODE like CONCAT('%',#applyCode#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
......@@ -101,6 +96,21 @@
</isNotEmpty>
</sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyCode">
APPLY_CODE = #applyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyCodes">
APPLY_CODE IN <iterate close=")" open="(" conjunction="," property="applyCodes">#applyCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
......@@ -180,21 +190,9 @@
<delete id="batchDelete">
DELETE FROM ${hggpSchema}.HGKC008 WHERE
id IN
<iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete>
<update id="updateStatus">
UPDATE ${hggpSchema}.HGKC008
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
STATUS = #status# <!-- 状态 0未提交,1已提交 -->
WHERE
ID = #id#
</update>
<update id="updateReceiveType">
UPDATE ${hggpSchema}.HGKC008
SET
......@@ -257,4 +255,22 @@
</dynamic>
</select>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGKC008
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 修改状态 -->
<update id="updateStatus">
UPDATE ${hggpSchema}.HGKC008
SET
STATUS = #status#,
<include refid="SqlBase.updateRevise"/>
WHERE 1=1
<include refid="idCondition"/>
</update>
</sqlMap>
......@@ -5,7 +5,16 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.cg.domain.HGCG003B;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.*;
import com.baosight.hggp.hg.kc.domain.HGKC001;
import com.baosight.hggp.hg.kc.domain.HGKC002;
import com.baosight.hggp.hg.kc.domain.HGKC003;
import com.baosight.hggp.hg.kc.domain.HGKC006;
import com.baosight.hggp.hg.kc.domain.HGKC007;
import com.baosight.hggp.hg.kc.domain.HGKC008;
import com.baosight.hggp.hg.kc.domain.HGKC008A;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.domain.HGKC010A;
import com.baosight.hggp.hg.kc.domain.HGKC011;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
......@@ -16,6 +25,7 @@ import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.hggp.util.StringUtils;
import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
......@@ -218,9 +228,51 @@ public class HGKCUtils {
}
}
/**
* HGKC008 定义
*
* @author:songx
* @date:2024/9/29,10:02
*/
public static class HgKc008 {
/**
* 锁并且获取数据
*
* @param kc008s
* @return
*/
public static Map<String, HGKC008> lockGetDataEp(List<? extends HGKC008> kc008s) {
return lockGetData(ObjectUtils.listEpKey(kc008s, HGKC008.FIELD_APPLY_CODE));
}
/**
* 锁并且获取数据
*
* @param applyCodes
* @return
*/
public static Map<String, HGKC008> lockGetData(List<String> applyCodes) {
// 锁
HGKCTools.HgKc008.lock(applyCodes);
// db数据
return HGKCTools.HgKc008.map(applyCodes);
}
/**
* 锁并且获取数据
*
* @param ids
* @return
*/
public static Map<Long, HGKC008> lockGetDataEx(List<Long> ids) {
// 锁
HGKCTools.HgKc008.lockEx(ids);
// db数据
return HGKCTools.HgKc008.mapEx(ids);
}
/**
* 查询
*
* @param receiveId
......@@ -233,11 +285,44 @@ public class HGKCUtils {
List<HGKC008> hgkc008List = DaoBase.getInstance().query(HGKC008.QUERY, paramMap);
return hgkc008List.get(0);
}
}
/**
*
* @author:songx
* @date:2024/9/29,10:30
*/
public static class HgKc008A {
/**
* 锁并且获取数据
*
* @param kc008As
* @return
*/
public static Map<String, HGKC008A> lockGetDataEp(List<? extends HGKC008A> kc008As) {
return lockGetData(ObjectUtils.listEpKey(kc008As, HGKC008A.FIELD_APPLY_LINE_CODE));
}
/**
* 锁并且获取数据
*
* @param applyLineCodes
* @return
*/
public static Map<String, HGKC008A> lockGetData(List<String> applyLineCodes) {
if (CollectionUtils.isEmpty(applyLineCodes)) {
return null;
}
// 锁
HGKCTools.HgKc008A.lock(applyLineCodes);
// db数据
return HGKCTools.HgKc008A.map(applyLineCodes);
}
/**
* 查询
*
* @param receiveId
......@@ -250,6 +335,7 @@ public class HGKCUtils {
return DaoBase.getInstance().query(HGKC008A.QUERY, paramMap);
}
}
/**
* HGKC010 工具类
*
......
package com.baosight.hggp.hg.zl.constant;
/**
* @author:songx
* @date:2024/9/29,11:29
*/
public class HgZlConst {
/**
* @author:songx
* @date:2024/9/29,13:38
*/
public static class HgZl011 {
/**
* 状态
*
* @author:songx
* @date:2024/5/15,15:18
*/
public static class Status {
// 未处理
public static final Integer S0 = 0;
// 已处理
public static final Integer S1 = 1;
}
}
}
package com.baosight.hggp.hg.zl.constant;
/**
* @author:songx
* @date:2024/9/29,11:29
*/
public class HgZlSqlConst {
/**
* HGZL011
*
* @author:songx
* @date:2024/5/7,16:36
*/
public static class HgZl011 {
// 锁
public static final String LOCK = "HGZL011.lock";
// 处理
public static final String PROCESS = "HGZL011.process";
}
}
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.core.utils.Iplat4jUtils;
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.xs.domain.HGXS007;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.hg.xs.utils.HGXSUtils;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.hg.zl.domain.HGZL001A;
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.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/1/25,15:25
*/
public class ServiceHGZL011A 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.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 ServiceHGZL011B 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());
HGZL011 newZl011 = BeanUtils.copy(dbKc008A, HGZL011.class);
newZl011.setQualityNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.SCLL_QUALITY_NO));
newZl011.setQualityDate(DateUtils.shortDate());
newZl011.setStatus(HgZlConst.HgZl011.Status.S0);
newZl011.setDeleteFlag(CommonConstant.YesNo.NO_0);
newZl011.setApplyQty(dbKc008A.getInvQty());
newZl011.setApplyUnitWeight(dbKc008A.getInvUnitWeight());
newZl011.setApplyWeight(dbKc008A.getInvWeight());
newZl011.setLength(dbKc008A.getInvLength());
newZl011.setWidth(dbKc008A.getInvWidth());
newZl011.setThick(dbKc008A.getInvThick());
newZl011.setSpecId(dbKc008A.getInvSpecId());
newZl011.setSpec(dbKc008A.getInvSpec());
DaoUtils.insert(HGZL011.INSERT, newZl011);
// 更新领用单状态
HGKCTools.HgKc008.updateStatus(fKc008A.getApplyCode(), HgKcConst.HgKc008.Status.S2);
// 更新领用单明细状态
HGKCTools.HgKc008A.updateStatus(fKc008A.getApplyLineCode(), HgKcConst.HgKc008.Status.S2);
}
}
}
......@@ -102,7 +102,6 @@
</isNotEmpty>
</sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
......
<?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="HGZL011">
<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", <!-- 规格 -->
MATERIAL as "material", <!-- 材质 -->
UNIT as "unit", <!-- 单位 -->
LENGTH as "length", <!-- 长度 -->
WIDTH as "width", <!-- 宽度 -->
THICK as "thick", <!-- 厚度 -->
APPLY_QTY as "applyQty", <!-- 领料数量 -->
APPLY_UNIT_WEIGHT as "applyUnitWeight", <!-- 领料单重 -->
APPLY_WEIGHT as "applyWeight", <!-- 领料重量 -->
QUALITY_QTY as "qualityQty", <!-- 合格数量 -->
UN_QUALITY_QTY as "unQualityQty", <!-- 不合格数量 -->
INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型大类 -->
APPLY_CODE as "applyCode", <!-- 领料单号 -->
APPLY_LINE_CODE as "applyLineCode" <!-- 领料单行号 -->
</sql>
<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>
<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="qualityNo">
QUALITY_NO = #qualityNo#
</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="material">
MATERIAL = #material#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unit">
UNIT = #unit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="length">
LENGTH = #length#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="width">
WIDTH = #width#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thick">
THICK = #thick#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="qualityQty">
QUALITY_QTY = #qualityQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unQualityQty">
UN_QUALITY_QTY = #unQualityQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypeDetail">
INVENT_TYPE_DETAIL = #inventTypeDetail#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyLineCode">
APPLY_LINE_CODE = #applyLineCode#
</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">
ID asc
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.zl.domain.HGZL011">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGZL011 WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGZL011 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGZL011 (
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, <!-- 规格 -->
MATERIAL, <!-- 材质 -->
UNIT, <!-- 单位 -->
LENGTH, <!-- 长度 -->
WIDTH, <!-- 宽度 -->
THICK, <!-- 厚度 -->
APPLY_QTY, <!-- 领料数量 -->
APPLY_UNIT_WEIGHT, <!-- 领料单重 -->
APPLY_WEIGHT, <!-- 领料重量 -->
QUALITY_QTY, <!-- 合格数量 -->
UN_QUALITY_QTY, <!-- 不合格数量 -->
INVENT_TYPE_DETAIL, <!-- 存货类型大类 -->
APPLY_CODE, <!-- 领料单号 -->
APPLY_LINE_CODE <!-- 领料单行号 -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
#updatedName#, #updatedTime#, #deleteFlag#, #status#, #qualityNo#, #qualityDate#,
#companyCode#, #companyName#, #inventType#, #inventCode#, #inventName#, #specId#,
#spec#, #material#, #unit#, #length#, #width#, #thick#, #applyQty#, #applyUnitWeight#,
#applyWeight#, #qualityQty#, #unQualityQty#, #inventTypeDetail#, #applyCode#, #applyLineCode#
)
</insert>
<delete id="delete">
UPDATE ${hggpSchema}.HGZL011 SET DELETE_FLAG = 1 WHERE ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGZL011
SET
QUALITY_DATE = #qualityDate#, <!-- 单据日期 -->
QUALITY_QTY = #qualityQty#, <!-- 合格数量 -->
UN_QUALITY_QTY = #unQualityQty#, <!-- 不合格数量 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGZL011
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 已处理 -->
<update id="process">
UPDATE ${hggpSchema}.HGZL011
SET
STATUS = #status#,
QUALITY_QTY = #qualityQty#, <!-- 合格数量 -->
UN_QUALITY_QTY = #unQualityQty#, <!-- 不合格数量 -->
<include refid="SqlBase.updateRevise"/>
WHERE QUALITY_NO = #qualityNo#
</update>
</sqlMap>
......@@ -10,6 +10,7 @@ import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.sc.domain.HGSC007;
import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.zl.constant.HgZlSqlConst;
import com.baosight.hggp.hg.zl.domain.*;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
......@@ -300,9 +301,85 @@ public class HGZLTools {
public static class THGZL004A {
public static void deleteByInformIds(List<Long> informIds){
public static void deleteByInformIds(List<Long> informIds) {
AssertUtils.isEmpty(informIds, "通知单ID不能为空");
DaoUtils.update(HGZL004A.DELETE_BY_INFORM_IDS,new HashMap<String,Object>(){{put("informIds",informIds);}});
DaoUtils.update(HGZL004A.DELETE_BY_INFORM_IDS, new HashMap<String, Object>() {{
put("informIds", informIds);
}});
}
}
/**
* HGZL011 定义
*
* @author:songx
* @date:2024/9/29,14:10
*/
public static class HgZl011 {
/**
* 锁
*
* @param qualityNo
* @return
*/
public static void lock(String qualityNo) {
AssertUtils.isEmpty(qualityNo, "质检单号不能为空");
Map paramMap = new HashMap();
paramMap.put("qualityNo", qualityNo);
DaoBase.getInstance().update(HgZlSqlConst.HgZl011.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.HgZl011.LOCK, paramMap);
}
/**
* 查询
*
* @param qualityNo
*/
public static HGZL011 get(String qualityNo) {
AssertUtils.isEmpty(qualityNo, "质检单号不能为空");
Map paramMap = new HashMap();
paramMap.put(HGZL011.FIELD_QUALITY_NO, qualityNo);
List<HGZL011> results = DaoBase.getInstance().query(HGZL011.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param qualityNos
* @return
*/
public static List<HGZL011> list(List<String> qualityNos) {
AssertUtils.isEmpty(qualityNos, "质检单号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("qualityNos", qualityNos);
return DaoBase.getInstance().query(HGZL011.QUERY, paramMap);
}
/**
* 查询
*
* @param qualityNos
* @return
*/
public static Map<String, HGZL011> map(List<String> qualityNos) {
List<HGZL011> results = list(qualityNos);
return results.stream().collect(Collectors.toMap(HGZL011::getQualityNo, item -> item));
}
}
......
......@@ -2,6 +2,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.tools.HGZLTools;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.MapUtils;
......@@ -63,4 +64,67 @@ public class HGZLUtils {
return HGZLTools.HgZl001.map(checkNos);
}
}
/**
* HGZL001 工具类
*
* @author:songx
* @date:2024/5/9,16:58
*/
public static class HgZl011 {
/**
* 设置查询条件
*
* @param queryRow 集合
* @return
*/
public static void setCondition(Map queryRow) {
HGUtils.setCondition(queryRow);
// 单据日期
String qualityDate = MapUtils.getString(queryRow, HGZL011.FIELD_QUALITY_DATE);
if (StringUtils.isNotBlank(qualityDate)) {
queryRow.put(HGZL011.FIELD_QUALITY_DATE, DateUtils.formatShort(qualityDate));
}
}
/**
* 锁并且获取数据
*
* @param qualityNo
* @return
*/
public static HGZL011 lockGetData(String qualityNo) {
// 锁
HGZLTools.HgZl011.lock(qualityNo);
// db数据
return HGZLTools.HgZl011.get(qualityNo);
}
/**
* 锁并且获取数据
*
* @param fZl011s
* @return
*/
public static Map<String, HGZL011> lockGetDataEp(List<? extends HGZL011> fZl011s) {
return lockGetData(ObjectUtils.listEpKey(fZl011s, HGZL011.FIELD_QUALITY_NO));
}
/**
* 锁并且获取数据
*
* @param qualityNos
* @return
*/
public static Map<String, HGZL011> lockGetData(List<String> qualityNos) {
// 锁
HGZLTools.HgZl011.lock(qualityNos);
// db数据
return HGZLTools.HgZl011.map(qualityNos);
}
}
}
......@@ -49,6 +49,7 @@
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC007.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC007A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC008.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC008A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC010.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC010A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC011.xml"/>
......@@ -61,6 +62,7 @@
<sqlMap resource="com/baosight/hggp/hg/zl/sql/HGZL003.xml"/>
<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/sc/sql/HGSC001.xml"/>
......
......@@ -15,7 +15,7 @@ $(function () {
e.response.docType = docName.substring(index + 1);
}
try {
parent.JSColorbox.setValueCallback(e);
uploadFile(e);
} catch (e) {
}
},
......@@ -23,4 +23,30 @@ $(function () {
};
});
/**
* 附件上传回调
*
* @param docId
*/
function uploadFile(e) {
let inInfo = new EiInfo();
inInfo.set("result-0-bizId", $("#inqu_status-0-bizId").val());
inInfo.set("result-0-bizType", $("#inqu_status-0-bizType").val());
inInfo.set("result-0-docId", e.response.docId);
inInfo.set("result-0-docName", e.response.docName);
inInfo.set("result-0-docType", e.response.docType);
EiCommunicator.send('HGDM099', 'upload', inInfo, {
onSuccess(res) {
if (res.status > -1) {
parent.JSColorbox.setValueCallback(e);
} else {
message(res.msg);
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
......@@ -7,6 +7,8 @@
<EF:EFPage title="附件上传">
<EF:EFRegion id="result" title="请选择文件">
<EF:EFInput ename="bizId" cname="业务ID" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput ename="bizType" cname="业务类型" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFUpload blockId="result" ename="uploadFile" docTag="fj_file" path="biz"/>
</EF:EFRegion>
</EF:EFPage>
......@@ -25,12 +25,16 @@
<EF:EFInput ename="inqu_status-0-inventName" cname="存货名称" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false" checkMode="row">
<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="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"
......@@ -61,6 +65,8 @@
displayType="0.000" sort="true" align="right" maxLength="17" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
<EF:EFColumn ename="applyLineCode" cname="领料单行号" enable="false" width="130" align="center"/>
<EF:EFColumn ename="qualityNo" cname="质检单号" enable="false" width="120" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(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: "HGZL011A",
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", "HGZL011", "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="inqu_status-0-spec" colWidth="3" filter="contains" optionLabel="全部"
defultValue="">
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
<div class="row">
<EF: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>
<EF:EFInput cname="领料单号" ename="applyCode" 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('HGZL011', '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", "HGXS007A", "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="SCLL_QUALITY_PROBLEM"/>
<EF:EFOption label="处理照片" value="SCLL_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">
<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", "HGZL011B", "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="applyCode" 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="内码" hidden="true"/>
<EF:EFColumn ename="applyLineCode" cname="领料单行号" 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:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="true" enable="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/>
<EF:EFColumn ename="invSpecId" cname="规格id" hidden="true"/>
<EF:EFColumn ename="invSpec" cname="规格" width="120" align="center" enable="false"/>
<EF:EFColumn ename="invLength" cname="长度(MM)" width="120" align="center" enable="false"/>
<EF:EFColumn ename="invWidth" cname="宽度(MM)" width="120" align="center" enable="false"/>
<EF:EFColumn ename="invThick" cname="厚度(MM)" width="120" align="center" enable="false"/>
<EF:EFColumn ename="invQty" cname="数量" width="120" align="right" format="{0:N3}" enable="true"
/>
<EF:EFColumn ename="invUnitWeight" cname="单重(KG)" enable="false" width="100" align="right" format="{0:N3}"
sort="true"/>
<EF:EFColumn ename="invWeight" cname="重量" enable="false" width="100" align="right" format="{0:N3}"
sort="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -248,7 +248,7 @@ let deptCodeChange = function (e) {
}
function refreshQuery() {
// resultGrid.dataSource.page(1);
resultGrid.dataSource.page(1);
}
const flashUser = (userGroup) => {
......
......@@ -27,8 +27,8 @@
required="true">
<EF:EFCodeOption codeName="hggp.role.dataAuthType"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="depCode" cname="所属部门编码" width="110" align="center"
defaultValue="" filter="contains" required="true"
<EF:EFComboColumn ename="depCode" cname="所属部门编码" width="150" align="center"
defaultValue="" filter="contains"
columnTemplate="#=valueField#">
<EF:EFOptions blockId="dept_code_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
......
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