Commit 7e92ce00 by liuyang

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

 Conflicts:
	src/main/java/com/baosight/hggp/hg/sc/sql/HGSC002.xml
parents 321ac87f b8c068e8
......@@ -38,21 +38,21 @@ import lombok.extern.slf4j.Slf4j;
public class OperationLogAspect {
private static final Dao dao = (Dao) PlatApplicationContext.getBean("dao");
/**
* 设置操作日志切入点 记录操作日志 在注解的位置切入代码
*/
@Pointcut("@annotation(com.baosight.hggp.aspect.annotation.OperationLogAnnotation)")
public void operLogPointCut() {
}
/**
* 设置操作异常切入点记录异常日志 扫描所有dc包下操作
*/
@Pointcut("execution(* com.baosight.hggp.hp.*.service..*.*(..))")
@Pointcut("execution(* com.baosight.hggp.hg.*.service..*.*(..))")
public void operExceptionLogPointCut() {
}
/**
* 正常返回通知,拦截用户操作日志,连接点正常执行完成后执行, 如果连接点抛出异常,则不会执行
*
......@@ -106,7 +106,7 @@ public class OperationLogAspect {
}
}
}
/**
* 异常返回通知,用于拦截异常日志信息 连接点抛出异常后执行
*
......
......@@ -79,6 +79,13 @@ public enum DdynamicEnum {
*/
INVENT_ALL_BLOCK_ID("invent_all_block_id", "id", "spec", "material", "unit", "length", "width", "thick",
"coefficient", "HGPZ005.queryComboBoxAll"),
/**
* 模块:规格
* 用途:存货档案下拉框
* 编写:
*/
SPEC_RECORD_BLOCK_ID("spec_record_block_id", "id", "spec", "HGPZ005.queryComboBoxAll"),
/**
* 模块:规格(无ID)
......
......@@ -9,6 +9,7 @@ import java.util.*;
* @Date 2024/1/10 14:29
*/
public enum InventTypeEnum {
RAW(1,"原料"),
CONSUMABLE(2,"耗材"),
SEMI_FINISHED_PRODUCT(3,"零件"),
......
......@@ -83,6 +83,20 @@ public class HGSqlConstant {
}
/**
* HGKC002 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HgKc002 {
// 模块名称
private static final String MODULE_NAME = "HGKC002.";
// 锁
public static final String LOCK = MODULE_NAME + "lock";
}
/**
* HGKC001 SQL 定义
*
* @author:songx
......@@ -95,6 +109,8 @@ public class HGSqlConstant {
// 锁
public static final String LOCK = MODULE_NAME + "lock";
// 锁
public static final String LOCKS = MODULE_NAME + "locks";
// 修改库存
public static final String UPDATE_INV = MODULE_NAME + "updateInv";
}
......
package com.baosight.hggp.hg.kc.domain;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
/**
* Project: <br>
* Title:Hgkc010.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-05-13 15:39:23 create
*/
public class HGKC010A extends HGKC010 {
public static final String FIELD_APPLY_QTY = "applyQty"; /* 申请数量*/
public static final String FIELD_APPLY_REMARK = "applyRemark"; /* 申请说明*/
public static final String COL_APPLY_QTY = "APPLY_QTY"; /* 申请数量*/
public static final String COL_APPLY_REMARK = "APPLY_REMARK"; /* 申请说明*/
private BigDecimal applyQty = new BigDecimal(0.000); /* 申请数量*/
private String applyRemark = " "; /* 申请说明*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_APPLY_QTY);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(15);
eiColumn.setDescName("申请数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_APPLY_REMARK);
eiColumn.setDescName("申请说明");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGKC010A() {
super.initMetaData();
initMetaData();
}
public BigDecimal getApplyQty() {
return applyQty;
}
public void setApplyQty(BigDecimal applyQty) {
this.applyQty = applyQty;
}
public String getApplyRemark() {
return applyRemark;
}
public void setApplyRemark(String applyRemark) {
this.applyRemark = applyRemark;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
super.fromMap(map);
setApplyQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_APPLY_QTY)), applyQty));
setApplyRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_APPLY_REMARK)), applyRemark));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = super.toMap();
map.put(FIELD_APPLY_QTY, StringUtils.toString(applyQty, eiMetadata.getMeta(FIELD_APPLY_QTY)));
map.put(FIELD_APPLY_REMARK, StringUtils.toString(applyRemark, eiMetadata.getMeta(FIELD_APPLY_REMARK)));
return map;
}
}
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.domain.HGKC002;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.BeanUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/1/25,23:19
*/
public class ServiceHGKC002 extends ServiceBase {
/**
* 画面初始化.
*
* @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.INVENT_TYPE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC002().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "生产领料单", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
HGKCUtils.HgKc002.setCondition(queryRow);
inInfo = super.query(inInfo, HGKC002.QUERY, new HGKC002());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产领料单", operType = "删除", operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<HGKC002> fKc002s = MapUtils.toDaoEPBase(inInfo, HGKC002.class);
// 查询数据库记录
Map<String, HGKC002> dbKc002Map = HGKCUtils.HgKc002.lockGetDataEp(fKc002s);
// 删除检查
this.checkRemoveData(fKc002s, dbKc002Map);
// 删除数据
this.removeData(fKc002s, dbKc002Map);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fKc002s.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 删除检查
*
* @param fKc002s
* @param dbKc002Map
*/
private void checkRemoveData(List<HGKC002> fKc002s, Map<String, HGKC002> dbKc002Map) {
for (HGKC002 fKc002 : fKc002s) {
String reqNo = fKc002.getReqNo();
HGKC002 dbKc002 = dbKc002Map.get(reqNo);
AssertUtils.isEquals(DeleteFlagEnum.REMOVE.getCode(), dbKc002.getDeleteFlag(),
String.format("领用单【%s】已删除,请勿重复操作", reqNo));
}
}
/**
* 删除数据
*
* @param fKc002s
* @param dbKc002Map
*/
private void removeData(List<HGKC002> fKc002s, Map<String, HGKC002> dbKc002Map) {
for (HGKC002 fKc002 : fKc002s) {
fKc002.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode());
DaoUtils.update(HGKC002.DELETE, fKc002);
// 生成红冲记录
HGKC002 dbKc002 = dbKc002Map.get(fKc002.getReqNo());
HGKC002 newKc002 = BeanUtils.copy(dbKc002, HGKC002.class);
newKc002.setReqNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HPKC002_NUMBER));
newKc002.setApplyQty(dbKc002.getApplyQty().negate());
newKc002.setApplyWeight(dbKc002.getApplyWeight().negate());
newKc002.setOldReqNo(dbKc002.getReqNo());
newKc002.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.insert(HGKC002.INSERT, newKc002);
// 修改库存
HGKCUtils.HgKc010.updateInv(dbKc002.getCompanyCode(), dbKc002.getWhCode(), dbKc002.getSpecId(),
dbKc002.getApplyQty(), dbKc002.getApplyWeight());
}
}
}
package com.baosight.hggp.hg.kc.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.constant.HGConstant;
import com.baosight.hggp.hg.kc.domain.HGKC002;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.domain.HGKC010A;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
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.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 生产领料挑选库存
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHGKC002A 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.INVENT_TYPE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC010().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 queryRow = EiInfoUtils.getFirstRow(inInfo);
inInfo = super.query(inInfo, HGKC010.QUERY, new HGKC010());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 生成出库单
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "库存查询", operType = "插入", operDesc = "生产领料单-库存查询-生成出库单")
public EiInfo select(EiInfo inInfo) {
try {
List<HGKC010A> hc010as = MapUtils.toDaoEPBase(inInfo, HGKC010A.class);
// 获取库存信息
Map<Long, HGKC010> dbKc010Map = HGKCUtils.HgKc010.lockGetDataEp(hc010as);
// 状态校验
this.checkData(hc010as, dbKc010Map);
// 生成销售库单
this.saveData(hc010as, dbKc010Map);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "生成领料单失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fKc010as
* @param dbKc010Map
*/
private void checkData(List<HGKC010A> fKc010as, Map<Long, HGKC010> dbKc010Map) {
for (HGKC010A fKc010a : fKc010as) {
Long id = fKc010a.getId();
HGKC010 dbKc010 = dbKc010Map.get(id);
AssertUtils.isNull(dbKc010, String.format("库存号[%s]不存在!", id));
// 校验数量
AssertUtils.isGt(fKc010a.getApplyQty(), dbKc010.getInvQty(),
String.format("库存号【%s】可用数量(%s)不足!", id, dbKc010.getInvQty()));
}
}
/**
* 保存数据
*
* @param fKc010as
* @param dbKc010Map
*/
private void saveData(List<HGKC010A> fKc010as, Map<Long, HGKC010> dbKc010Map) {
for (HGKC010A fKc010a : fKc010as) {
BigDecimal applyQty = fKc010a.getApplyQty();
Long invId = fKc010a.getId();
HGKC010 dbKc010 = dbKc010Map.get(invId);
HGKC002 newKc002 = BeanUtils.copy(dbKc010, HGKC002.class);
newKc002.setReqNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HPKC002_NUMBER));
newKc002.setReceiptDate(DateUtils.shortDate());
newKc002.setApplyQty(applyQty);
newKc002.setUnitWeight(dbKc010.getInvUnitWeight());
newKc002.setApplyWeight(dbKc010.getInvUnitWeight().multiply(applyQty));
newKc002.setRemark(fKc010a.getApplyRemark());
newKc002.setInvId(invId);
newKc002.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGKC002.INSERT, newKc002);
// 修改库存数量
HGKCUtils.HgKc010.updateInv(dbKc010.getCompanyCode(), dbKc010.getWhCode(), dbKc010.getSpecId(),
applyQty.negate(), dbKc010.getInvUnitWeight(), newKc002.getApplyWeight().negate());
}
}
}
......@@ -32,6 +32,7 @@ public class ServiceHGKC010 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_TYPE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_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="HGKC002">
<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-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
RECEIPT_DATE as "receiptDate", <!-- 单据日期 -->
REQ_NO as "reqNo", <!-- 领料单号 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
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", <!-- 数量 -->
UNIT_WEIGHT as "unitWeight", <!-- 单重 -->
APPLY_WEIGHT as "applyWeight", <!-- 重量 -->
INV_ID as "invId", <!-- 库存ID -->
OLD_REQ_NO as "oldReqNo", <!-- 原领料单号 -->
REMARK as "remark", <!-- 备注 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName" <!-- 厂区名称 -->
</sql>
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<include refid="idCondition"/>
<include refid="customCondition"/>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</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="applyQty">
APPLY_QTY = #applyQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unitWeight">
UNIT_WEIGHT = #unitWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyWeight">
APPLY_WEIGHT = #applyWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invId">
INV_ID = #invId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="oldReqNo">
OLD_REQ_NO = #oldReqNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remark">
REMARK = #remark#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
</sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reqNo">
REQ_NO = #reqNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reqNos">
REQ_NO IN <iterate open="(" close=")" conjunction="," property="reqNos">#reqNos[]#</iterate>
</isNotEmpty>
</sql>
<sql id="customCondition">
<include refid="BaseCondition.specCondition"/>
<include refid="BaseCondition.createdTimeCondition"/>
</sql>
<!-- 公共修改字段 -->
<sql id="updateRevise">
UPDATED_BY = #updatedBy#,
UPDATED_NAME = #updatedName#,
UPDATED_TIME = #updatedTime#
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.kc.domain.HGKC002">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGKC002 WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGKC002 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGKC002 (
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
RECEIPT_DATE, <!-- 单据日期 -->
REQ_NO, <!-- 领料单号 -->
WH_CODE, <!-- 仓库编码 -->
WH_NAME, <!-- 仓库名称 -->
INVENT_TYPE, <!-- 存货类型 -->
INVENT_CODE, <!-- 存货编码 -->
INVENT_NAME, <!-- 存货名称 -->
SPEC_ID, <!-- 规格ID -->
SPEC, <!-- 规格 -->
MATERIAL, <!-- 材质 -->
UNIT, <!-- 单位 -->
LENGTH, <!-- 长度 -->
WIDTH, <!-- 宽度 -->
THICK, <!-- 厚度 -->
APPLY_QTY, <!-- 数量 -->
UNIT_WEIGHT, <!-- 单重 -->
APPLY_WEIGHT, <!-- 重量 -->
INV_ID, <!-- 库存ID -->
OLD_REQ_NO, <!-- 原领料单号 -->
REMARK, <!-- 备注 -->
FACTORY_CODE, <!-- 厂区编码 -->
FACTORY_NAME <!-- 厂区名称 -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #receiptDate#, #reqNo#,
#whCode#, #whName#, #inventType#, #inventCode#, #inventName#, #specId#,
#spec#, #material#, #unit#, #length#, #width#, #thick#, #applyQty#,
#unitWeight#, #applyWeight#, #invId#, #oldReqNo#, #remark#, #factoryCode#, #factoryName#
)
</insert>
<delete id="delete">
UPDATE ${hggpSchema}.HGKC002
SET
DELETE_FLAG = #deleteFlag#,
<include refid="updateRevise"/>
WHERE REQ_NO = #reqNo#
</delete>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGKC002
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
</sqlMap>
......@@ -124,6 +124,15 @@
</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>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
......@@ -195,7 +204,7 @@
<!-- 锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGKC010
SET CREATED_TIME = #createdTime#
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
AND ACCOUNT_CODE = #accountCode#
AND COMPANY_CODE = #companyCode#
......@@ -204,6 +213,14 @@
AND SPEC_ID = #specId#
</update>
<!-- 锁 -->
<update id="locks">
UPDATE ${hggpSchema}.HGKC010
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 更新库存 -->
<update id="updateInv">
UPDATE ${hggpSchema}.HGKC010
......
......@@ -3,6 +3,7 @@ package com.baosight.hggp.hg.kc.tools;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.HGKC001;
import com.baosight.hggp.hg.kc.domain.HGKC002;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.StringUtils;
......@@ -69,6 +70,55 @@ public class HGKCTools {
}
/**
* HGKC002 工具类
*
* @author:songx
* @date:2024/5/9,14:33
*/
public static class HgKc002 {
/**
* 锁
*
* @param reqNos
* @return
*/
public static void lock(List<String> reqNos) {
if (CollectionUtils.isEmpty(reqNos)) {
return;
}
Map paramMap = new HashMap();
paramMap.put("reqNos", reqNos);
DaoBase.getInstance().update(HGSqlConstant.HgKc002.LOCK, paramMap);
}
/**
* 查询
*
* @param reqNos
* @return
*/
public static List<HGKC002> list(List<String> reqNos) {
AssertUtils.isEmpty(reqNos, "领用单号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("reqNos", reqNos);
return DaoBase.getInstance().query(HGKC002.QUERY, paramMap);
}
/**
* 查询
*
* @param reqNos
* @return
*/
public static Map<String, HGKC002> map(List<String> reqNos) {
List<HGKC002> results = list(reqNos);
return results.stream().collect(Collectors.toMap(HGKC002::getReqNo, item -> item));
}
}
/**
* HGKC010 工具类
*
* @author:songx
......@@ -79,6 +129,22 @@ public class HGKCTools {
/**
* 锁
*
* @param ids
* @return
*/
public static void lock(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return;
}
Map paramMap = new HashMap();
paramMap.put("ids", ids);
DaoBase.getInstance().update(HGSqlConstant.HgKc010.LOCKS, paramMap);
}
/**
* 锁
*
* @param companyCode
* @param whCode
* @param specId
......@@ -112,6 +178,30 @@ public class HGKCTools {
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param ids
* @return
*/
public static List<HGKC010> list(List<Long> ids) {
AssertUtils.isEmpty(ids, "库存ID不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("ids", ids);
return DaoBase.getInstance().query(HGKC010.QUERY, paramMap);
}
/**
* 查询
*
* @param ids
* @return
*/
public static Map<Long, HGKC010> map(List<Long> ids) {
List<HGKC010> results = list(ids);
return results.stream().collect(Collectors.toMap(HGKC010::getId, item -> item));
}
}
}
......@@ -5,6 +5,7 @@ import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.HGKC001;
import com.baosight.hggp.hg.kc.domain.HGKC002;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
......@@ -75,6 +76,53 @@ public class HGKCUtils {
}
/**
* HGKC002 工具类
*
* @author:songx
* @date:2024/5/9,16:58
*/
public static class HgKc002 {
/**
* 设置查询条件
*
* @param queryRow 集合
* @return
*/
public static void setCondition(Map queryRow) {
HGCGUtils.setCondition(queryRow);
// 单据日期
String receiptDate = MapUtils.getString(queryRow, HGKC002.FIELD_RECEIPT_DATE);
if (StringUtils.isNotBlank(receiptDate)) {
queryRow.put(HGKC002.FIELD_RECEIPT_DATE, DateUtils.formatShort(receiptDate));
}
}
/**
* 锁并且获取数据
*
* @param kc002s
* @return
*/
public static Map<String, HGKC002> lockGetDataEp(List<? extends HGKC002> kc002s) {
return lockGetData(ObjectUtils.listEpKey(kc002s, HGKC002.FIELD_REQ_NO));
}
/**
* 锁并且获取数据
*
* @param reqNos
* @return
*/
public static Map<String, HGKC002> lockGetData(List<String> reqNos) {
// 锁
HGKCTools.HgKc002.lock(reqNos);
// db数据
return HGKCTools.HgKc002.map(reqNos);
}
}
/**
* HGKC010 工具类
*
* @author:songx
......@@ -208,5 +256,28 @@ public class HGKCUtils {
DaoUtils.update(HGSqlConstant.HgKc010.UPDATE_INV, dbKc010);
}
/**
* 锁并且获取数据
*
* @param kc010s
* @return
*/
public static Map<Long, HGKC010> lockGetDataEp(List<? extends HGKC010> kc010s) {
return lockGetData(ObjectUtils.listEpKey(kc010s, HGKC010.FIELD_ID));
}
/**
* 锁并且获取数据
*
* @param ids
* @return
*/
public static Map<Long, HGKC010> lockGetData(List<Long> ids) {
// 锁
HGKCTools.HgKc010.lock(ids);
// db数据
return HGKCTools.HgKc010.map(ids);
}
}
}
......@@ -19,13 +19,13 @@ import com.baosight.iplat4j.core.util.StringUtils;
* @history 2024-05-13 15:26:20 create
*/
public class HGSC099 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_id = "id"; /* 主键ID*/
public static final String FIELD_account_code = "accountCode"; /* 帐套*/
public static final String FIELD_main_id = "mainId"; /* 主表ID*/
public static final String FIELD_mat_id = "matId"; /* 物料ID*/
public static final String FIELD_doc_id = "docId"; /* 文件ID*/
public static final String FIELD_doc_name = "docName"; /* 文件名称*/
public static final String FIELD_created_by = "createdBy"; /* 创建人*/
public static final String FIELD_created_name = "createdName"; /* 创建人名称*/
public static final String FIELD_created_time = "createdTime"; /* 创建时间*/
......@@ -33,11 +33,13 @@ public class HGSC099 extends DaoEPBase {
public static final String FIELD_updated_name = "updatedName"; /* 修改人名称*/
public static final String FIELD_updated_time = "updatedTime"; /* 修改时间*/
public static final String FIELD_biz_type = "bizType"; /* 业务类型*/
public static final String FIELD_dep_code = "depCode"; /* 部门编码*/
public static final String COL_id = "id"; /* 主键ID*/
public static final String COL_account_code = "account_code"; /* 帐套*/
public static final String COL_main_id = "main_id"; /* 主表ID*/
public static final String COL_mat_id = "mat_id"; /* 物料ID*/
public static final String COL_doc_id = "doc_id"; /* 文件ID*/
public static final String COL_doc_name = "doc_name"; /* 文件文件*/
public static final String COL_created_by = "created_by"; /* 创建人*/
public static final String COL_created_name = "created_name"; /* 创建人名称*/
public static final String COL_created_time = "created_time"; /* 创建时间*/
......@@ -45,6 +47,7 @@ public class HGSC099 extends DaoEPBase {
public static final String COL_updated_name = "updated_name"; /* 修改人名称*/
public static final String COL_updated_time = "updated_time"; /* 修改时间*/
public static final String COL_biz_type = "biz_type"; /* 业务类型*/
public static final String COL_dep_code = "dep_code"; /* 部门编码*/
public static final String QUERY = "HGSC099.query";
public static final String COUNT = "HGSC099.count";
......@@ -54,8 +57,9 @@ public class HGSC099 extends DaoEPBase {
private Long id = new Long(0); /* 主键ID*/
private String accountCode = " "; /* 帐套*/
private Long mainId = new Long(0); /* 主表ID*/
private Long matId = new Long(0); /* 物料ID*/
private String docId = " "; /* 文件ID*/
private String docName = " "; /* 文件名称*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
......@@ -63,6 +67,7 @@ public class HGSC099 extends DaoEPBase {
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 修改时间*/
private String bizType = " "; /* 业务类型*/
private String depCode = " "; /* 部门编码*/
/**
* initialize the metadata.
......@@ -79,14 +84,18 @@ public class HGSC099 extends DaoEPBase {
eiColumn.setDescName("帐套");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_main_id);
eiColumn.setDescName("主表ID");
eiColumn = new EiColumn(FIELD_mat_id);
eiColumn.setDescName("物料ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_doc_id);
eiColumn.setDescName("文件ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_doc_name);
eiColumn.setDescName("文件名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_created_by);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
......@@ -115,6 +124,10 @@ public class HGSC099 extends DaoEPBase {
eiColumn.setDescName("业务类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_dep_code);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
}
......@@ -158,20 +171,20 @@ public class HGSC099 extends DaoEPBase {
this.accountCode = accountCode;
}
/**
* get the mainId - 主表ID.
* @return the mainId
* get the matId - 物料ID.
* @return the matId
*/
public Long getMainId() {
return this.mainId;
public Long getMatId() {
return this.matId;
}
/**
* set the mainId - 主表ID.
* set the matId - 物料ID.
*
* @param mainId - 主表ID
* @param matId - 物料ID
*/
public void setMainId(Long mainId) {
this.mainId = mainId;
public void setMatId(Long matId) {
this.matId = matId;
}
/**
* get the docId - 文件ID.
......@@ -189,6 +202,16 @@ public class HGSC099 extends DaoEPBase {
public void setDocId(String docId) {
this.docId = docId;
}
/**
* set the docName - 文件名称.
*
* @param docName - 文件名称
*/
public void setDocName(String docName) {
this.docName = docName;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
......@@ -302,6 +325,22 @@ public class HGSC099 extends DaoEPBase {
this.bizType = bizType;
}
/**
* get the depCode - 部门编码.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
* @param depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the value from Map.
*
* @param map - source data map
......@@ -311,8 +350,9 @@ public class HGSC099 extends DaoEPBase {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_id)), id));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_account_code)), accountCode));
setMainId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_main_id)), mainId));
setMatId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_mat_id)), matId));
setDocId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_doc_id)), docId));
setDocName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_doc_name)), docName));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_created_by)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_created_name)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_created_time)), createdTime));
......@@ -320,6 +360,7 @@ public class HGSC099 extends DaoEPBase {
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_name)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_time)), updatedTime));
setBizType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_biz_type)), bizType));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_dep_code)), depCode));
}
/**
......@@ -331,8 +372,9 @@ public class HGSC099 extends DaoEPBase {
Map map = new HashMap();
map.put(FIELD_id, StringUtils.toString(id, eiMetadata.getMeta(FIELD_id)));
map.put(FIELD_account_code, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_account_code)));
map.put(FIELD_main_id, StringUtils.toString(mainId, eiMetadata.getMeta(FIELD_main_id)));
map.put(FIELD_mat_id, StringUtils.toString(matId, eiMetadata.getMeta(FIELD_mat_id)));
map.put(FIELD_doc_id, StringUtils.toString(docId, eiMetadata.getMeta(FIELD_doc_id)));
map.put(FIELD_doc_name, StringUtils.toString(docName, eiMetadata.getMeta(FIELD_doc_name)));
map.put(FIELD_created_by, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_created_by)));
map.put(FIELD_created_name, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_created_name)));
map.put(FIELD_created_time, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_created_time)));
......@@ -340,6 +382,7 @@ public class HGSC099 extends DaoEPBase {
map.put(FIELD_updated_name, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_updated_name)));
map.put(FIELD_updated_time, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_updated_time)));
map.put(FIELD_biz_type, StringUtils.toString(bizType, eiMetadata.getMeta(FIELD_biz_type)));
map.put(FIELD_dep_code, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_dep_code)));
return map;
}
......
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.ds.domain.HGDS002;
import com.baosight.hggp.hg.sc.domain.HGSC099;
import com.baosight.hggp.util.FileUtils;
import com.baosight.hggp.util.LogUtils;
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 com.baosight.iplat4j.core.service.soa.XServiceManager;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author wwl
* @Date 2024/5/6 19:48
*/
public class ServiceHGSC099 extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC099().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.projectEnv.RUN.equalsIgnoreCase(projectEnv)) {
inInfo = super.query(inInfo, "HGSC099.queryRun", new HGSC099());
} else {
inInfo = super.query(inInfo, "HGSC099.queryDev", new HGSC099());
}
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGSC099 hgsc099 = new HGSC099();
hgsc099.fromMap(resultRows.get(i));
DaoUtils.insert(HGSC099.INSERT, hgsc099);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGSC099 hgsc099 = new HGSC099();
hgsc099.fromMap(resultRows.get(i));
DaoUtils.update(HGSC099.DELETE, hgsc099);
if (!hgsc099.getDocId().isEmpty()) {
this.delectDoc(hgsc099.getDocId());
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 删除文件
* @param docId 文件ID
*/
public void delectDoc(String docId){
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
List<HGDS002> list = this.dao.query(HGDS002.QUERY,map);
if (list.size() > 0) {
String realPath = list.get(0).getRealPath();
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
EiInfo queryInfo = new EiInfo();
queryInfo.set(HGSC099.FIELD_doc_id,list.get(0).getDocId());
//获取文档信息
queryInfo.set(EiConstant.serviceId,"S_EU_0102");
EiInfo docInfo = XServiceManager.call(queryInfo);
//数据库
Map docInfoMap = docInfo.getMap("docMap");
if (docInfoMap.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("data",docInfoMap.get("url")+"-"+0);
eiInfo.set(EiConstant.serviceId,"S_EU_0105");
//调用接口
EiInfo outInfo = XServiceManager.call(eiInfo);
if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){
LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败");
outInfo.setMsg("失败");
}
}
}else {
FileUtils.deleteFile(realPath);
}
this.dao.delete(HGDS002.DELETE,map);
}
}
}
package com.baosight.hggp.hg.sc.service;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
/**
*
*/
public class ServiceHGSC099A extends ServiceBase {
/**
* 画面初始化.
*/
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
/**
* 附件上传.
*/
public EiInfo form(EiInfo inInfo) {
return inInfo;
}
}
......@@ -4,23 +4,23 @@
Version : 1.0
schema : hggp
tableName : HGSC002
id BIGINT NOT NULL primarykey,
company_code VARCHAR NOT NULL,
company_name VARCHAR NOT NULL,
dep_code VARCHAR,
dep_name VARCHAR,
proj_code VARCHAR,
proj_name VARCHAR,
person_dep_name VARCHAR,
person_name VARCHAR,
person_phone VARCHAR,
person_id_card VARCHAR,
account_code VARCHAR NOT NULL,
created_by VARCHAR,
created_name VARCHAR,
created_time VARCHAR,
updated_by VARCHAR,
updated_name VARCHAR,
id BIGINT NOT NULL primarykey,
company_code VARCHAR NOT NULL,
company_name VARCHAR NOT NULL,
dep_code VARCHAR,
dep_name VARCHAR,
proj_code VARCHAR,
proj_name VARCHAR,
person_dep_name VARCHAR,
person_name VARCHAR,
person_phone VARCHAR,
person_id_card VARCHAR,
account_code VARCHAR NOT NULL,
created_by VARCHAR,
created_name VARCHAR,
created_time VARCHAR,
updated_by VARCHAR,
updated_name VARCHAR,
updated_time VARCHAR
-->
<sqlMap namespace="HGSC002">
......@@ -35,7 +35,7 @@
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name = ('%$companyName$')
company_name like ('%$companyName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
......@@ -47,19 +47,19 @@
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name = ('%$projName$')
proj_name like ('%$projName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="personDepName">
person_dep_name = ('%$personDepName$')
person_dep_name like ('%$personDepName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="personName">
person_name = ('%$personName$')
person_name like ('%$personName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="personPhone">
person_phone = ('%$personPhone$')
person_phone like ('%$personPhone$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="personIdCard">
person_id_card = ('%$personIdCard$')
person_id_card like ('%$personIdCard$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
......@@ -87,7 +87,7 @@
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC002">
SELECT
id as "id",
id as "id",
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编码 -->
......
......@@ -6,7 +6,7 @@
tableName : HGSC099
id BIGINT NOT NULL primarykey,
account_code VARCHAR NOT NULL,
main_id BIGINT,
mat_id BIGINT,
doc_id VARCHAR,
created_by VARCHAR,
created_name VARCHAR,
......@@ -18,146 +18,155 @@
-->
<sqlMap namespace="HGSC099">
<sql id="column">
A.ID as "id",
A.ACCOUNT_CODE as "accountCode", <!-- 企业编码 预留 -->
A.DEP_CODE as "depCode", <!-- 部门编码 预留 -->
A.BIZ_TYPE as "bizType", <!-- 物料ID -->
A.MAT_ID as "matId", <!-- 物料ID -->
A.DOC_ID as "docId", <!-- 文件ID -->
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" <!-- 修改时间 -->
</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="authCondition">
<isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
A.DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCodes">
A.DEP_CODE IN <iterate close=")" open="(" conjunction="," property="depCodes">#depCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="condition">
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="id">
id = #id#
A.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="mainId">
main_id = #mainId#
<isNotEmpty prepend=" AND " property="depCode">
A.DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
doc_id = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
<isNotEmpty prepend=" AND " property="bizType">
A.BIZ_TYPE = #bizType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
created_name = #createdName#
<isNotEmpty prepend=" AND " property="matId">
A.MAT_ID = #matId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
<isNotEmpty prepend=" AND " property="docId">
A.DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
</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>
<isNotEmpty prepend=" AND " property="updatedName">
updated_name = #updatedName#
</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>
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="createdDateFrom">
A.CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="bizType">
biz_type = #bizType#
<isNotEmpty prepend=" AND " property="createdDateTo">
A.CREATED_TIME &lt;= CONCAT(REPLACE(#createdDateTo#, '-', ''), '235959')
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC099">
SELECT
id as "id", <!-- 主键ID -->
account_code as "accountCode", <!-- 帐套 -->
main_id as "mainId", <!-- 主表ID -->
doc_id as "docId", <!-- 文件ID -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 修改人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime", <!-- 修改时间 -->
biz_type as "bizType" <!-- 业务类型 -->
FROM ${hggpSchema}.HGSC099 WHERE 1=1
<include refid="condition" />
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
<isNotEmpty property="order">
$order$
</isNotEmpty>
<isEmpty property="orderBy">
id asc
<isEmpty property="order">
A.ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="queryDev" resultClass="com.baosight.hggp.hg.sc.domain.HGSC099">
SELECT
<include refid="columnDev"/>
FROM ${hggpSchema}.HGSC099 A, ${platSchema}.TEUDM02 B
WHERE 1=1
<include refid="conditionDev"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC099 WHERE 1=1
<include refid="condition" />
<select id="countDev" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC099 A, ${platSchema}.TEUDM02 B
WHERE 1=1
<include refid="conditionDev"/>
<include refid="customCondition"/>
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="mainId">
main_id = #mainId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
doc_id = #docId#
</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="bizType">
biz_type = #bizType#
</isNotEmpty>
-->
<select id="queryRun" resultClass="com.baosight.hggp.hg.sc.domain.HGSC099">
SELECT
<include refid="columnRun"/>
FROM ${hggpSchema}.HGSC099 A, ${platSchema}.TEUDM05 B
WHERE 1=1
<include refid="conditionRun"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
<select id="countRun" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC099 A, ${platSchema}.TEUDM05 B
WHERE 1=1
<include refid="conditionRun"/>
<include refid="customCondition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSC099 (id, <!-- 主键ID -->
account_code, <!-- 帐套 -->
main_id, <!-- 主表ID -->
doc_id, <!-- 文件ID -->
created_by, <!-- 创建人 -->
created_name, <!-- 创建人名称 -->
created_time, <!-- 创建时间 -->
updated_by, <!-- 修改人 -->
updated_name, <!-- 修改人名称 -->
updated_time, <!-- 修改时间 -->
biz_type <!-- 业务类型 -->
)
VALUES (#id#, #accountCode#, #mainId#, #docId#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #bizType#)
INSERT INTO ${hggpSchema}.HGSC099 (
ACCOUNT_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 预留 -->
BIZ_TYPE,
MAT_ID, <!-- 物料ID -->
DOC_ID, <!-- 文件ID -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME <!-- 创建时间 -->
) VALUES (
#accountCode#, #depCode#, #bizType#, #matId#, #docId#, #createdBy#,
#createdName#, #createdTime#
)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSC099 WHERE
id = #id#
DELETE FROM ${hggpSchema}.HGSC099 WHERE ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGSC099
SET
account_code = #accountCode#, <!-- 帐套 -->
main_id = #mainId#, <!-- 主表ID -->
doc_id = #docId#, <!-- 文件ID -->
created_by = #createdBy#, <!-- 创建人 -->
created_name = #createdName#, <!-- 创建人名称 -->
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 修改人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime#, <!-- 修改时间 -->
biz_type = #bizType# <!-- 业务类型 -->
WHERE
id = #id#
</update>
</sqlMap>
......@@ -16,15 +16,13 @@
<sqlMap resource="com/baosight/hggp/hg/cg/sql/HGCG001.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cg/sql/HGCG002.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cg/sql/HGCG003.xml"/>
<!-- 库存 -->
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC001.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC002.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC010.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/HGSC002.xml"/>
<!-- 库存 -->
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC001.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC010.xml"/>
</sqlMapConfig>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<!-- <bean id="platFileUploader" class="com.baosight.iplat4j.eu.dm.util.PlatFileUploader">-->
<!-- <property name="dao" ref="platDao"/>-->
<!-- </bean>-->
<!-- <bean id="fileUpLoadManager" class="com.baosight.iplat4j.eu.dm.PlatFileUploadManagerByAmazonS3">-->
<!-- <property name="fileUploader" ref="platFileUploader"/>-->
<!-- </bean>-->
</beans>
......@@ -51,7 +51,6 @@
<EF:EFColumn ename="receiveDate" cname="收货日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="receiveNo" cname="收货单号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="contractNo" cname="合同号" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="hggp.hgcg.receiveStatus"/>
</EF:EFComboColumn>
......@@ -63,14 +62,15 @@
<EF:EFColumn ename="specId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="receiveQty" cname="收货数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFColumn ename="deliverQty" cname="退货数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFColumn ename="depositQty" cname="入库数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFColumn ename="deliverQty" cname="退货数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="depositQty" cname="入库数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="receiveWeight" cname="收货重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="unit" cname="单位" enable="false" width="80" align="center"/>
<EF:EFColumn ename="length" cname="长(M)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽(M)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚(M)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="contractNo" cname="合同号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
......@@ -78,7 +78,6 @@
</EF:EFRegion>
<EF:EFRegion title="提示">
<span style="color: red">1."待确认"状态时,仅能修改收货数量。</span><br/>
<span style="color: red">2."质检完成"状态时,可修改"退货数量"和"入库数量",同时可进行收货确认。</span>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid = {
"result": {
columns: [{
field: "createdName",
template: function (options) {
return showUserName(options.createdBy, options.createdName);
}
}],
loadComplete: function (grid) {
},
onSuccess: function (e) {
}
}
}
// 查询
$("#QUERY").on("click", query);
// 挑选库存
$("#SELECT_INV").on("click", selectInv);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 挑选库存
*/
let selectInv = function () {
JSColorbox.open({
href: "HGKC002A?methodName=initLoad",
title: "<div style='text-align: center;'>库存查询</div>",
width: "80%",
height: "80%",
callbackName: selectInvCallback
});
}
/**
* 挑选库存回调
*/
let selectInvCallback = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
<!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="单据日期" blockId="inqu_status" ename="receiptDate" row="0"
colWidth="3" format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="领料单号" blockId="inqu_status" ename="reqNo" row="0" colWidth="3"/>
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="仓库名称" blockId="inqu_status" ename="whCode" row="0" colWidth="3" optionLabel="全部"
filter="contains">
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect cname="存货类型" blockId="inqu_status" ename="inventType" row="0" colWidth="3" optionLabel="全部"
filter="contains">
<EF:EFOptions blockId="invent_type_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3" optionLabel="全部"
filter="contains">
<EF:EFOptions blockId="invent_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="规格" blockId="inqu_status" ename="spec" row="0" colWidth="3" optionLabel="全部"
filter="contains">
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="是否删除" blockId="inqu_status" ename="deleteFlag" row="0" colWidth="3" optionlabel="全部"
defaultValue="0">
<EF:EFCodeOption codeName="hpjx.hpjx.deleteFlag"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFDateSpan startCname="创建日期(从)" endCname="至" blockId="inqu_status"
startName="createdDateFrom" endName="createdDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" autoFit="true" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="主键id" hidden="true"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" enable="false" width="90" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="reqNo" cname="领料单号" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="whCode" cname="仓库编码" enable="false" width="120" align="center"
blockName="wh_record_block_id" textField="textField" valueField="valueField">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="120" align="center"
blockName="invent_type_block_id" textField="textField" valueField="valueField">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="false" width="120" align="center"
blockName="invent_record_block_id" textField="textField" valueField="valueField">
</EF:EFComboColumn>
<EF:EFComboColumn ename="specId" cname="规格" enable="false" width="120" align="center"
blockName="spec_record_block_id" textField="textField" valueField="valueField">
</EF:EFComboColumn>
<EF:EFColumn ename="applyQty" cname="数量" enable="false" width="100" align="right" format="{0:N0}"/>
<EF:EFColumn ename="unitWeight" cname="单重(KG)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="applyWeight" cname="总重(T)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="100" align="center"/>
<EF:EFColumn ename="oldReqNo" cname="原领料单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="120" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid = {
"result": {
columns: []
}
}
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
// 选择
$("#BTN_SELECT").on("click", select);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
});
/**
* 查询
*/
var query = function (e) {
resultGrid.dataSource.page(1);
};
/**
* 选择库存
*/
let select = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let applyQty = rows[i]['applyQty'];
let invQty = rows[i]['invQty'];
if (!isPositiveInteger(applyQty)) {
message("勾选的第" + (i + 1) + "行申请数量必须是大于0");
return;
}
if (parseFloat(applyQty) > parseFloat(invQty)) {
message("第" + (i + 1) + "行申请数量不能大于库存数量");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成出库单吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC002A", "select",
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:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="仓库名称" blockId="inqu_status" ename="whCode" row="0" colWidth="3" optionLabel="全部"
filter="contains">
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货类型" blockId="inqu_status" ename="inventType" row="0" colWidth="3" optionLabel="全部"
filter="contains">
<EF:EFOptions blockId="invent_type_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3" optionLabel="全部"
filter="contains">
<EF:EFOptions blockId="invent_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect cname="规格" blockId="inqu_status" ename="spec" row="0" colWidth="3" optionLabel="全部"
filter="contains">
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="id" cname="库存ID" enable="false" width="60" align="center" hidden="true"/>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="100" align="center"
blockName="wh_record_block_id" textField="textField" valueField="valueField">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="100" align="center"
blockName="invent_type_block_id" textField="textField" valueField="valueField">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="false" width="100" align="center"
blockName="invent_record_block_id" textField="textField" valueField="valueField">
</EF:EFComboColumn>
<EF:EFComboColumn ename="specId" cname="规格" enable="false" width="150" align="center"
blockName="spec_record_block_id" textField="textField" valueField="valueField">
</EF:EFComboColumn>
<EF:EFColumn ename="applyQty" cname="申请数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFColumn ename="applyRemark" cname="申请说明" width="200" editType="textarea" copy="true"/>
<EF:EFColumn ename="invQty" cname="库存数量" enable="false" width="120" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="invUnitWeight" cname="单量(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invWeight" cname="库存重量(KG)" enable="false" width="120" align="right" format="{0:N3}"
sumType="all"/>
<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:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -14,8 +14,7 @@
</EF:EFSelect>
<EF:EFSelect cname="存货类型" blockId="inqu_status" ename="incentType" row="0" colWidth="3" optionLabel="全部"
filter="contains" defultValue="">
<%-- 1.原料,2.耗材,5废料 --%>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2', '5')"/>
<EF:EFOptions blockId="invent_type_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货名称" blockId="inqu_status" ename="incentCode" row="0" colWidth="3" optionLabel="全部"
filter="contains" defultValue="">
......@@ -29,16 +28,16 @@
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" autoFit="true" isFloat="true" checkMode="row">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="130" align="center"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="100" align="center">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="120" align="center"
blockName="wh_record_block_id" textField="textField" valueField="valueField">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="100" align="center"
blockName="invent_type_block_id" textField="textField" valueField="valueField">
</EF:EFComboColumn>
<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"/>
......
......@@ -88,7 +88,7 @@ $(function () {
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="showFile(' + item.id + ')" >附件详情</a>';
'onclick="showUploadFile(' + item.id + ')" >附件详情</a>';
return template;
}
}
......@@ -137,13 +137,17 @@ function saveCallBack(){
resultGrid.dataSource.page(1);
}
function showFile(id) {
// JSColorbox.open({
// href: "HGSC001D?inqu_status-0-id=" + id + "&efParentFormEname=HGSC001",
// title: "<div style='text-align: center;'>查看项目</div>",
// width: "90%",
// height: "90%",
// callbackName: windowCallback
// });
/**
* 显示附件清单
*
* @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%",
});
}
$(function () {
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;
}
}],
loadComplete: function(grid){
// 附件上传
$("#UPLOAD_FILE").on("click", uploadFile);
// 删除
$("#BTN_DELETE").on("click", deleteFunc);
},
dataBound: function () {
}
}
};
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
});
/**
* 查询
*/
var query = function (e) {
resultGrid.dataSource.page(1);
}
/**
* 文件上传
*
* @param id
*/
function uploadFile(id) {
JSColorbox.open({
href: "HGSC099A?methodName=initLoad&inqu_status-0-bizType="+$("#inqu_status-0-bizType").val()+"&inqu_status-0-matId="+$("#inqu_status-0-matId").val(),
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
callbackName: uploadFileCallback
});
}
/**
* 附件上传回调
*
* @param docId
*/
function uploadFileCallback(docId) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-matId", $("#inqu_status-0-matId").val());
inEiInfo.set("result-0-docId", docId);
inEiInfo.set("result-0-bizType", $("#inqu_status-0-bizType").val());
EiCommunicator.send('HGSC099', 'insert', inEiInfo, {
onSuccess(response) {
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
/**
* 删除
*/
function deleteFunc() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC099", "delete", 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="matId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden"/>
<div class="row">
<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.EFUpload = {
uploadFile: {
success: function(e) {
let docId = e.response.docId;
if (isBlank(docId)) {
return;
}
$("#fileDocId").val(docId);
NotificationUtil("附件上传成功");
console.log($("#fileDocId").val())
saveTemp(e);
try {
parent.JSColorbox.setValueCallback(docId);
} catch (e){
}
},
}
};
function saveTemp(e) {
let docId = e.response.docId;
let docName = e.response.docName;
let docSize = e.response.docSize;
let docTag = e.response.docTag;
let docUrl = e.response.docUrl;
let result = new EiInfo();
result.set("result-0-docId",docId);
result.set("result-0-docName",docName);
result.set("result-0-docSize",docSize);
result.set("result-0-docTag",docTag);
result.set("result-0-realPath",docUrl);
result.set("result-0-bizType",$("#inqu_status-0-bizType").val());
result.set("result-0-matId",$("#inqu_status-0-matId").val());
EiCommunicator.send("HGDS002", "insert", result, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
<!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:EFInput cname="主表ID" ename="matId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFRegion id="result">
<EF:EFUpload blockId="result" ename="uploadFile" docTag="hk_file11" path="HGSC"/>
</EF:EFRegion>
<EF:EFInput ename="fileDocId" cname="" hidden="true"/>
</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