Commit f2914810 by 江和松

其他入库代码优化,以及提交后影响实时库存

parent ee6b4164
...@@ -263,17 +263,32 @@ public class HGConstant { ...@@ -263,17 +263,32 @@ public class HGConstant {
/** /**
* *
* 数据来源 * 出库单数据来源
* @author:songx * @author:songx
* @date:2024/5/15,15:18 * @date:2024/5/15,15:18
*/ */
public static class Source { public static class CKSource {
// 盘点 // 手动录入
public static final Integer PD = 1; public static final Integer SDLR = 1;
// 盘亏
public static final Integer PK = 2;
// 调拨 // 调拨
public static final Integer DB = 2; public static final Integer DB = 3;
// 其他 }
public static final Integer QT = 3;
/**
*
* 入库单数据来源
* @author:songx
* @date:2024/5/15,15:18
*/
public static class RKSource {
// 手动录入
public static final Integer SDLR = 1;
// 盘盈
public static final Integer PY = 2;
// 调拨
public static final Integer DB = 3;
} }
/** /**
......
...@@ -22,7 +22,7 @@ public class HGKC006A extends DaoEPBase { ...@@ -22,7 +22,7 @@ public class HGKC006A extends DaoEPBase {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id"; public static final String FIELD_ID = "id";
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码*/ public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/ public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 记录创建者*/ public static final String FIELD_CREATED_BY = "createdBy"; /* 记录创建者*/
...@@ -66,12 +66,14 @@ public class HGKC006A extends DaoEPBase { ...@@ -66,12 +66,14 @@ public class HGKC006A extends DaoEPBase {
public static final String FIELD_PART_WIDTH = "partWidth"; /* 零件-宽*/ public static final String FIELD_PART_WIDTH = "partWidth"; /* 零件-宽*/
public static final String FIELD_PART_THICK = "partThick"; /* 零件-厚*/ public static final String FIELD_PART_THICK = "partThick"; /* 零件-厚*/
public static final String FIELD_PART_SPEC = "partSpec"; /* 零件规格*/ public static final String FIELD_PART_SPEC = "partSpec"; /* 零件规格*/
public static final String FIELD_PART_SPEC_ID = "partSpecId"; /* 零件规格ID*/
public static final String FIELD_PRIMARY_ID = "primaryId"; /* 主表id*/ public static final String FIELD_PRIMARY_ID = "primaryId"; /* 主表id*/
public static final String FIELD_PRICE = "price"; /* 单价*/ public static final String FIELD_PRICE = "price"; /* 单价*/
public static final String FIELD_AMOUNT = "amount"; /* 金额*/ public static final String FIELD_AMOUNT = "amount"; /* 金额*/
public static final String FIELD_SOURCE = "source"; /* 数据来源*/ public static final String FIELD_SOURCE = "source"; /* 数据来源*/
public static final String COL_ID = "ID"; public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/ public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 记录创建者*/ public static final String COL_CREATED_BY = "CREATED_BY"; /* 记录创建者*/
...@@ -115,6 +117,7 @@ public class HGKC006A extends DaoEPBase { ...@@ -115,6 +117,7 @@ public class HGKC006A extends DaoEPBase {
public static final String COL_PART_WIDTH = "PART_WIDTH"; /* 零件-宽*/ public static final String COL_PART_WIDTH = "PART_WIDTH"; /* 零件-宽*/
public static final String COL_PART_THICK = "PART_THICK"; /* 零件-厚*/ public static final String COL_PART_THICK = "PART_THICK"; /* 零件-厚*/
public static final String COL_PART_SPEC = "PART_SPEC"; /* 零件规格*/ public static final String COL_PART_SPEC = "PART_SPEC"; /* 零件规格*/
public static final String COL_PART_SPEC_ID = "PART_SPEC_ID"; /* 零件规格ID*/
public static final String COL_PRIMARY_ID = "PRIMARY_ID"; /* 主表id*/ public static final String COL_PRIMARY_ID = "PRIMARY_ID"; /* 主表id*/
public static final String COL_PRICE = "PRICE"; /* 单价*/ public static final String COL_PRICE = "PRICE"; /* 单价*/
public static final String COL_AMOUNT = "AMOUNT"; /* 金额*/ public static final String COL_AMOUNT = "AMOUNT"; /* 金额*/
...@@ -126,7 +129,7 @@ public class HGKC006A extends DaoEPBase { ...@@ -126,7 +129,7 @@ public class HGKC006A extends DaoEPBase {
public static final String UPDATE = "HGKC006A.update"; public static final String UPDATE = "HGKC006A.update";
public static final String DELETE = "HGKC006A.delete"; public static final String DELETE = "HGKC006A.delete";
private Long id = new Long(0); private Long id = new Long(0);
private String accountCode = " "; /* 企业编码*/ private String accountCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/ private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 记录创建者*/ private String createdBy = " "; /* 记录创建者*/
...@@ -170,6 +173,7 @@ public class HGKC006A extends DaoEPBase { ...@@ -170,6 +173,7 @@ public class HGKC006A extends DaoEPBase {
private BigDecimal partWidth = new BigDecimal(0.000); /* 零件-宽*/ private BigDecimal partWidth = new BigDecimal(0.000); /* 零件-宽*/
private BigDecimal partThick = new BigDecimal(0.000); /* 零件-厚*/ private BigDecimal partThick = new BigDecimal(0.000); /* 零件-厚*/
private String partSpec = " "; /* 零件规格*/ private String partSpec = " "; /* 零件规格*/
private Long partSpecId = new Long(0); /* 规格id*/
private Long primaryId = new Long(0); /* 主表id*/ private Long primaryId = new Long(0); /* 主表id*/
private BigDecimal price = new BigDecimal("0"); /* 单价*/ private BigDecimal price = new BigDecimal("0"); /* 单价*/
private BigDecimal amount = new BigDecimal("0"); /* 金额*/ private BigDecimal amount = new BigDecimal("0"); /* 金额*/
...@@ -385,6 +389,10 @@ public class HGKC006A extends DaoEPBase { ...@@ -385,6 +389,10 @@ public class HGKC006A extends DaoEPBase {
eiColumn.setDescName("零件规格"); eiColumn.setDescName("零件规格");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PART_SPEC_ID);
eiColumn.setDescName("零件规格ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRIMARY_ID); eiColumn = new EiColumn(FIELD_PRIMARY_ID);
eiColumn.setDescName("主表id"); eiColumn.setDescName("主表id");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -428,7 +436,7 @@ public class HGKC006A extends DaoEPBase { ...@@ -428,7 +436,7 @@ public class HGKC006A extends DaoEPBase {
/** /**
* set the id . * set the id .
* *
* @param id * @param id
*/ */
public void setId(Long id) { public void setId(Long id) {
this.id = id; this.id = id;
...@@ -1185,6 +1193,15 @@ public class HGKC006A extends DaoEPBase { ...@@ -1185,6 +1193,15 @@ public class HGKC006A extends DaoEPBase {
public void setSource(Integer source) { public void setSource(Integer source) {
this.source = source; this.source = source;
} }
public Long getPartSpecId() {
return partSpecId;
}
public void setPartSpecId(Long partSpecId) {
this.partSpecId = partSpecId;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -1237,6 +1254,7 @@ public class HGKC006A extends DaoEPBase { ...@@ -1237,6 +1254,7 @@ public class HGKC006A extends DaoEPBase {
setPartWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PART_WIDTH)), partWidth)); setPartWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PART_WIDTH)), partWidth));
setPartThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PART_THICK)), partThick)); setPartThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PART_THICK)), partThick));
setPartSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PART_SPEC)), partSpec)); setPartSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PART_SPEC)), partSpec));
setPartSpecId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PART_SPEC_ID)), partSpecId));
setPrimaryId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PRIMARY_ID)), primaryId)); setPrimaryId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PRIMARY_ID)), primaryId));
setPrice(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PRICE)), price)); setPrice(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PRICE)), price));
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount)); setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount));
...@@ -1294,6 +1312,7 @@ public class HGKC006A extends DaoEPBase { ...@@ -1294,6 +1312,7 @@ public class HGKC006A extends DaoEPBase {
map.put(FIELD_PART_WIDTH, StringUtils.toString(partWidth, eiMetadata.getMeta(FIELD_PART_WIDTH))); map.put(FIELD_PART_WIDTH, StringUtils.toString(partWidth, eiMetadata.getMeta(FIELD_PART_WIDTH)));
map.put(FIELD_PART_THICK, StringUtils.toString(partThick, eiMetadata.getMeta(FIELD_PART_THICK))); map.put(FIELD_PART_THICK, StringUtils.toString(partThick, eiMetadata.getMeta(FIELD_PART_THICK)));
map.put(FIELD_PART_SPEC, StringUtils.toString(partSpec, eiMetadata.getMeta(FIELD_PART_SPEC))); map.put(FIELD_PART_SPEC, StringUtils.toString(partSpec, eiMetadata.getMeta(FIELD_PART_SPEC)));
map.put(FIELD_PART_SPEC_ID, StringUtils.toString(partSpecId, eiMetadata.getMeta(FIELD_PART_SPEC_ID)));
map.put(FIELD_PRIMARY_ID, StringUtils.toString(primaryId, eiMetadata.getMeta(FIELD_PRIMARY_ID))); map.put(FIELD_PRIMARY_ID, StringUtils.toString(primaryId, eiMetadata.getMeta(FIELD_PRIMARY_ID)));
map.put(FIELD_PRICE, StringUtils.toString(price, eiMetadata.getMeta(FIELD_PRICE))); map.put(FIELD_PRICE, StringUtils.toString(price, eiMetadata.getMeta(FIELD_PRICE)));
map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT))); map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT)));
......
...@@ -8,9 +8,9 @@ import com.baosight.hggp.hg.constant.HGConstant; ...@@ -8,9 +8,9 @@ import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.cw.tools.HGCWTools; import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO; import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.kc.domain.HGKC003; import com.baosight.hggp.hg.kc.domain.*;
import com.baosight.hggp.hg.kc.domain.HGKC006;
import com.baosight.hggp.hg.kc.domain.HGKC006; import com.baosight.hggp.hg.kc.domain.HGKC006;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.kc.utils.HGKCUtils; import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.utils.HGUtils; import com.baosight.hggp.hg.utils.HGUtils;
import com.baosight.hggp.hg.xs.tools.HGXSTools; import com.baosight.hggp.hg.xs.tools.HGXSTools;
...@@ -21,11 +21,10 @@ import com.baosight.iplat4j.core.ei.EiInfo; ...@@ -21,11 +21,10 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.springframework.util.CollectionUtils;
import java.util.Arrays; import java.math.BigDecimal;
import java.util.HashMap; import java.util.*;
import java.util.List;
import java.util.Map;
/** /**
* 其他入库单 * 其他入库单
...@@ -34,7 +33,7 @@ import java.util.Map; ...@@ -34,7 +33,7 @@ import java.util.Map;
* @date:2024/1/15,11:20 * @date:2024/1/15,11:20
*/ */
public class ServiceHGKC006 extends ServiceBase { public class ServiceHGKC006 extends ServiceBase {
/** /**
* 画面初始化 * 画面初始化
* *
...@@ -56,7 +55,7 @@ public class ServiceHGKC006 extends ServiceBase { ...@@ -56,7 +55,7 @@ public class ServiceHGKC006 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 查询数据列表 * 查询数据列表
* *
...@@ -77,7 +76,7 @@ public class ServiceHGKC006 extends ServiceBase { ...@@ -77,7 +76,7 @@ public class ServiceHGKC006 extends ServiceBase {
} }
/** /**
* 保存操作. * 保存操作.
* *
...@@ -96,7 +95,6 @@ public class ServiceHGKC006 extends ServiceBase { ...@@ -96,7 +95,6 @@ public class ServiceHGKC006 extends ServiceBase {
hgkc006.fromMap(resultRows.get(i)); hgkc006.fromMap(resultRows.get(i));
hgkc006.setOtherEnterDate(DateUtils.formatShort(hgkc006.getOtherEnterDate())); hgkc006.setOtherEnterDate(DateUtils.formatShort(hgkc006.getOtherEnterDate()));
if (hgkc006.getId() == null || hgkc006.getId() == 0) { if (hgkc006.getId() == null || hgkc006.getId() == 0) {
hgkc006.setSubmitStatus(HGConstant.ProductStatus.WTJ);
this.add(hgkc006); this.add(hgkc006);
} else { } else {
this.modify(hgkc006); this.modify(hgkc006);
...@@ -110,7 +108,7 @@ public class ServiceHGKC006 extends ServiceBase { ...@@ -110,7 +108,7 @@ public class ServiceHGKC006 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 校验保存的数据 * 校验保存的数据
* *
...@@ -121,10 +119,17 @@ public class ServiceHGKC006 extends ServiceBase { ...@@ -121,10 +119,17 @@ public class ServiceHGKC006 extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
HGKC006 hgkc006 = new HGKC006(); HGKC006 hgkc006 = new HGKC006();
hgkc006.fromMap(resultRows.get(i)); hgkc006.fromMap(resultRows.get(i));
AssertUtils.isNull(hgkc006.getSubmitStatus(), "是否启用不能为空"); if(Objects.nonNull(hgkc006.getId())&&hgkc006.getId()>0){
AssertUtils.isTrue(hgkc006.getSubmitStatus().compareTo(HGConstant.ProductStatus.YTJ) == 0,"领料单已提交,不可修改");
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(hgkc006.getCompanyCode(), "请选择公司!");
AssertUtils.isEmpty(hgkc006.getWhCode(), "请选择仓库信息!");
AssertUtils.isEmpty(hgkc006.getWhName(), "请选择仓库信息!");
} }
} }
/** /**
* 新增 * 新增
* *
...@@ -136,10 +141,11 @@ public class ServiceHGKC006 extends ServiceBase { ...@@ -136,10 +141,11 @@ public class ServiceHGKC006 extends ServiceBase {
UserVO userVO = HGCWTools.HgCw002.getUserCompany(); UserVO userVO = HGCWTools.HgCw002.getUserCompany();
hgkc006.setCompanyCode(userVO.getUsercode()); hgkc006.setCompanyCode(userVO.getUsercode());
hgkc006.setCompanyName(userVO.getUsername()); hgkc006.setCompanyName(userVO.getUsername());
hgkc006.setSource(HGConstant.Source.QT); hgkc006.setSource(HGConstant.RKSource.SDLR);
hgkc006.setSubmitStatus(HGConstant.ProductStatus.WTJ);
DaoUtils.insert(HGKC006.INSERT, hgkc006); DaoUtils.insert(HGKC006.INSERT, hgkc006);
} }
/** /**
* 修改数据 * 修改数据
* *
...@@ -163,6 +169,18 @@ public class ServiceHGKC006 extends ServiceBase { ...@@ -163,6 +169,18 @@ public class ServiceHGKC006 extends ServiceBase {
hgkc006.fromMap(map); hgkc006.fromMap(map);
DaoUtils.update(HGKC006.CHECK, hgkc006.toMap()); DaoUtils.update(HGKC006.CHECK, hgkc006.toMap());
} }
List<HGKC006A> hgkc006AList = HGKCTools.HgKc006A.getHgkc008aList(hgkc006.getId());
AssertUtils.isEmpty(hgkc006AList, "没有明细信息无法提交");
if(!CollectionUtils.isEmpty(hgkc006AList)){
for(HGKC006A hgkc006A : hgkc006AList){
//增加库存
HGKCUtils.HgKc010.updateInv(hgkc006A.getCompanyCode(),hgkc006A.getWhCode(),
hgkc006A.getPartSpecId(),hgkc006A.getInvQty(),
hgkc006A.getInvUnitWeight(),hgkc006A.getInvWeight());
}
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("提交成功!");
} catch (PlatException e) { } catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE); eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("提交失败,原因参见详细错误描述!"); eiInfo.setMsg("提交失败,原因参见详细错误描述!");
...@@ -170,66 +188,9 @@ public class ServiceHGKC006 extends ServiceBase { ...@@ -170,66 +188,9 @@ public class ServiceHGKC006 extends ServiceBase {
logError("提交失败!", e.getMessage()); logError("提交失败!", e.getMessage());
return eiInfo; return eiInfo;
} }
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("提交成功!");
return eiInfo; return eiInfo;
} }
/**
* 新增操作.
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "其他入库单", operType = "新增", operDesc = "新增")
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 数据写入
for (int i = 0; i < resultRows.size(); i++) {
HGKC006 hgkc006 = new HGKC006();
hgkc006.fromMap(resultRows.get(i));
this.add(hgkc006);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 修改操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "其他入库单", operType = "修改", operDesc = "修改操作")
public EiInfo update(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
for (int i = 0; i < resultRows.size(); i++) {
HGKC006 hppz009 = new HGKC006();
hppz009.fromMap(resultRows.get(i));
DaoUtils.update(HGKC006.UPDATE, hppz009);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
/** /**
* 删除操作 * 删除操作
* *
...@@ -258,5 +219,5 @@ public class ServiceHGKC006 extends ServiceBase { ...@@ -258,5 +219,5 @@ public class ServiceHGKC006 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
} }
...@@ -3,26 +3,20 @@ package com.baosight.hggp.hg.kc.service; ...@@ -3,26 +3,20 @@ package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.kc.domain.HGKC006; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.domain.HGKC006A; import com.baosight.hggp.hg.kc.domain.*;
import com.baosight.hggp.hg.kc.utils.HGKCUtils; import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.xs.tools.HGXSTools; import com.baosight.hggp.util.*;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays; import java.math.BigDecimal;
import java.util.HashMap; import java.util.*;
import java.util.List;
import java.util.Map;
/** /**
* 其他入库单明细 * 其他入库单明细
...@@ -31,7 +25,7 @@ import java.util.Map; ...@@ -31,7 +25,7 @@ import java.util.Map;
* @date:2024/1/15,11:20 * @date:2024/1/15,11:20
*/ */
public class ServiceHGKC006A extends ServiceBase { public class ServiceHGKC006A extends ServiceBase {
/** /**
* 画面初始化 * 画面初始化
* *
...@@ -42,15 +36,22 @@ public class ServiceHGKC006A extends ServiceBase { ...@@ -42,15 +36,22 @@ public class ServiceHGKC006A extends ServiceBase {
@OperationLogAnnotation(operModul = "其他入库单明细", operType = "查询", operDesc = "初始化") @OperationLogAnnotation(operModul = "其他入库单明细", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID), null, false); String whCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC006A.FIELD_WH_CODE);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BOX_BLOCK_ID), null, false); String companyCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC006A.FIELD_COMPANY_CODE);
Map map = new HashMap();
map.put(HGKC006A.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode());
map.put(HGKC006A.FIELD_WH_CODE, whCode);
map.put(HGKC006A.FIELD_COMPANY_CODE, companyCode);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID,DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID,DdynamicEnum.SPEC_BOX_BLOCK_ID),map,false
);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC006A().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC006A().eiMetadata);
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
} }
return inInfo; return inInfo;
} }
/** /**
* 查询数据列表 * 查询数据列表
* *
...@@ -62,12 +63,21 @@ public class ServiceHGKC006A extends ServiceBase { ...@@ -62,12 +63,21 @@ public class ServiceHGKC006A extends ServiceBase {
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
inInfo = super.query(inInfo, HGKC006A.QUERY, new HGKC006A()); inInfo = super.query(inInfo, HGKC006A.QUERY, new HGKC006A());
String whCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC006A.FIELD_WH_CODE);
String companyCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC006A.FIELD_COMPANY_CODE);
Map map = new HashMap();
map.put(HGKC006A.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode());
map.put(HGKC006A.FIELD_WH_CODE, whCode);
map.put(HGKC006A.FIELD_COMPANY_CODE, companyCode);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID,DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID,DdynamicEnum.SPEC_BOX_BLOCK_ID),map,false
);
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
} }
return inInfo; return inInfo;
} }
/** /**
* 保存操作. * 保存操作.
* *
...@@ -76,98 +86,59 @@ public class ServiceHGKC006A extends ServiceBase { ...@@ -76,98 +86,59 @@ public class ServiceHGKC006A extends ServiceBase {
*/ */
@OperationLogAnnotation(operModul = "其他入库单明细", operType = "插入", operDesc = "保存") @OperationLogAnnotation(operModul = "其他入库单明细", operType = "插入", operDesc = "保存")
public EiInfo save(EiInfo inInfo) { public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); try {Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
// 数据校验 HGKC006A hgkc006a = new HGKC006A();
this.checkSaveData(resultRows); hgkc006a.fromMap(resultMap);
// 写入数据 //查询主单
for (int i = 0; i < resultRows.size(); i++) { HGKC006 hgkc006 = HGKCTools.HgKc006.getById(hgkc006a.getPrimaryId());
HGKC006A hgkc006A = new HGKC006A(); this.checkSaveData(hgkc006a,hgkc006);
hgkc006A.fromMap(resultRows.get(i)); this.setData(hgkc006a,hgkc006);
if (hgkc006A.getId() == null || hgkc006A.getId() == 0) { if(Objects.nonNull(hgkc006a.getId())&&hgkc006a.getId()!=0){
Map queryMap = new HashMap(); DaoUtils.update(HGKC006A.UPDATE, hgkc006a);
queryMap.put("id",inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC006A.FIELD_PRIMARY_ID)); }else {
List<HGKC006> list = this.dao.query(HGKC006.QUERY,queryMap); hgkc006a.setPrimaryId(hgkc006.getId());
this.add(hgkc006A,list.get(0)); hgkc006a.setOtherEnterNo(hgkc006.getOtherEnterNo());
} else { DaoUtils.insert(HGKC006A.INSERT, hgkc006a);
this.modify(hgkc006A);
}
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败"); LogUtils.setDetailMsg(inInfo, e, "保存失败");
} }
return inInfo; return inInfo;
} }
/** private void setData(HGKC006A hgkc006a, HGKC006 hgkc006) {
* 校验保存的数据 if(Objects.nonNull(hgkc006)){
* hgkc006a.setProjCode(hgkc006.getProjCode());
* @param resultRows hgkc006a.setProjName(hgkc006.getProjName());
*/ hgkc006a.setWhCode(hgkc006.getWhCode());
private void checkSaveData(List<Map> resultRows) { hgkc006a.setWhName(hgkc006.getWhName());
// 数据校验 hgkc006a.setCompanyCode(hgkc006.getCompanyCode());
for (int i = 0; i < resultRows.size(); i++) { hgkc006a.setCompanyName(hgkc006.getCompanyName());
HGKC006A hgkc006A = new HGKC006A(); hgkc006a.setSource(hgkc006.getSource());
hgkc006A.fromMap(resultRows.get(i));
//AssertUtils.isNull(hgkc006A.s(), "是否启用不能为空");
} }
} }
/**
* 新增
*
* @param hgkc006A
* @throws Exception
*/
private void add(HGKC006A hgkc006A,HGKC006 hgkc006) throws Exception {
hgkc006A.setPrimaryId(hgkc006.getId());
hgkc006A.setOtherEnterNo(hgkc006.getOtherEnterNo());
DaoUtils.insert(HGKC006A.INSERT, hgkc006A);
// 更新库存数量
HGKCUtils.HgKc010.updateInv(hgkc006.getCompanyCode(), hgkc006.getWhCode(), hgkc006A.getInventRecordId(),
hgkc006A.getInvQty(), hgkc006A.getInvUnitWeight(), hgkc006A.getInvWeight());
}
/**
* 修改数据
*
* @param hgkc006A
*/
private void modify(HGKC006A hgkc006A) {
DaoUtils.update(HGKC006A.UPDATE, hgkc006A);
}
/** /**
* 修改操作 * 校验保存的数据
*
* @param inInfo
* @return
*/ */
@OperationLogAnnotation(operModul = "其他入库单明细", operType = "修改", operDesc = "修改操作") private void checkSaveData(HGKC006A hgkc006a,HGKC006 hgkc006) {
public EiInfo update(EiInfo inInfo) { AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
try { AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); AssertUtils.isNull(hgkc006a.getPrimaryId(), "未获取到其他入库单ID信息");
// 数据校验
this.checkSaveData(resultRows); HGKC010 hgkc010 = HGKCTools.HgKc010.get(hgkc006a.getCompanyCode(),hgkc006a.getWhCode(),hgkc006a.getPartSpecId());
for (int i = 0; i < resultRows.size(); i++) { if (hgkc010==null){
HGKC006A hppz009 = new HGKC006A(); throw new PlatException("实时库存不存在!");
hppz009.fromMap(resultRows.get(i)); }
DaoUtils.update(HGKC006A.UPDATE, hppz009); int result = hgkc006a.getInvQty().compareTo(hgkc010.getInvQty());
} if ( result > 0){
inInfo = this.query(inInfo); throw new PlatException("实时库存数量不够,无法保存!");
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
} }
return inInfo;
} }
/** /**
* 删除操作 * 删除操作
* *
...@@ -181,18 +152,7 @@ public class ServiceHGKC006A extends ServiceBase { ...@@ -181,18 +152,7 @@ public class ServiceHGKC006A extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
HGKC006A hgkc006A = new HGKC006A(); HGKC006A hgkc006A = new HGKC006A();
hgkc006A.fromMap(resultRows.get(i)); hgkc006A.fromMap(resultRows.get(i));
// 校验企业下是否存在用户
int count = HGXSTools.XsUser.countByAccount(hgkc006A.getAccountCode());
if (count > 0) {
// throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", hgkc006A.getAccountName()));
}
DaoUtils.update(HGKC006A.DELETE, hgkc006A); DaoUtils.update(HGKC006A.DELETE, hgkc006A);
// 扣减库存
Map queryMap = new HashMap();
queryMap.put("id",inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC006A.FIELD_PRIMARY_ID));
List<HGKC006> list = this.dao.query(HGKC006.QUERY,queryMap);
HGKCUtils.HgKc010.updateInv(list.get(0).getCompanyCode(), list.get(0).getWhCode(), hgkc006A.getInventRecordId(),
hgkc006A.getInvQty().negate(), hgkc006A.getInvWeight().negate());
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
...@@ -202,5 +162,5 @@ public class ServiceHGKC006A extends ServiceBase { ...@@ -202,5 +162,5 @@ public class ServiceHGKC006A extends ServiceBase {
} }
return inInfo; return inInfo;
} }
} }
...@@ -35,7 +35,7 @@ import java.util.Map; ...@@ -35,7 +35,7 @@ import java.util.Map;
* @date:2024/1/15,11:20 * @date:2024/1/15,11:20
*/ */
public class ServiceHGKC007 extends ServiceBase { public class ServiceHGKC007 extends ServiceBase {
/** /**
* 画面初始化 * 画面初始化
* *
...@@ -57,7 +57,7 @@ public class ServiceHGKC007 extends ServiceBase { ...@@ -57,7 +57,7 @@ public class ServiceHGKC007 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 查询数据列表 * 查询数据列表
* *
...@@ -78,7 +78,7 @@ public class ServiceHGKC007 extends ServiceBase { ...@@ -78,7 +78,7 @@ public class ServiceHGKC007 extends ServiceBase {
} }
/** /**
* 保存操作. * 保存操作.
* *
...@@ -111,7 +111,7 @@ public class ServiceHGKC007 extends ServiceBase { ...@@ -111,7 +111,7 @@ public class ServiceHGKC007 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 校验保存的数据 * 校验保存的数据
* *
...@@ -125,7 +125,7 @@ public class ServiceHGKC007 extends ServiceBase { ...@@ -125,7 +125,7 @@ public class ServiceHGKC007 extends ServiceBase {
AssertUtils.isNull(hgkc007.getSubmitStatus(), "是否启用不能为空"); AssertUtils.isNull(hgkc007.getSubmitStatus(), "是否启用不能为空");
} }
} }
/** /**
* 新增 * 新增
* *
...@@ -137,10 +137,10 @@ public class ServiceHGKC007 extends ServiceBase { ...@@ -137,10 +137,10 @@ public class ServiceHGKC007 extends ServiceBase {
UserVO userVO = HGCWTools.HgCw002.getUserCompany(); UserVO userVO = HGCWTools.HgCw002.getUserCompany();
hgkc007.setCompanyCode(userVO.getUsercode()); hgkc007.setCompanyCode(userVO.getUsercode());
hgkc007.setCompanyName(userVO.getUsername()); hgkc007.setCompanyName(userVO.getUsername());
hgkc007.setSource(HGConstant.Source.QT); hgkc007.setSource(HGConstant.CKSource.SDLR);
DaoUtils.insert(HGKC007.INSERT, hgkc007); DaoUtils.insert(HGKC007.INSERT, hgkc007);
} }
/** /**
* 修改数据 * 修改数据
* *
...@@ -174,7 +174,7 @@ public class ServiceHGKC007 extends ServiceBase { ...@@ -174,7 +174,7 @@ public class ServiceHGKC007 extends ServiceBase {
eiInfo.setMsg("提交成功!"); eiInfo.setMsg("提交成功!");
return eiInfo; return eiInfo;
} }
/** /**
* 新增操作. * 新增操作.
* *
...@@ -203,7 +203,7 @@ public class ServiceHGKC007 extends ServiceBase { ...@@ -203,7 +203,7 @@ public class ServiceHGKC007 extends ServiceBase {
return inInfo; return inInfo;
} }
/** /**
* 修改操作 * 修改操作
* *
...@@ -229,7 +229,7 @@ public class ServiceHGKC007 extends ServiceBase { ...@@ -229,7 +229,7 @@ public class ServiceHGKC007 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 删除操作 * 删除操作
* *
...@@ -258,5 +258,5 @@ public class ServiceHGKC007 extends ServiceBase { ...@@ -258,5 +258,5 @@ public class ServiceHGKC007 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
} }
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information <!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
Generate time : 2024-05-24 16:39:30
Version : 1.0
schema : hggp
tableName : HGKC006A
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR NOT NULL,
CREATED_NAME VARCHAR NOT NULL,
CREATED_TIME VARCHAR NOT NULL,
UPDATED_BY VARCHAR NOT NULL,
UPDATED_NAME VARCHAR NOT NULL,
UPDATED_TIME VARCHAR NOT NULL,
DELETE_FLAG TINYINT,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
OTHER_ENTER_DATE VARCHAR,
OTHER_ENTER_NO VARCHAR NOT NULL,
WH_CODE VARCHAR,
WH_NAME VARCHAR,
INVENT_RECORD_ID BIGINT,
INVENT_TYPE VARCHAR,
INVENT_CODE VARCHAR NOT NULL,
INVENT_NAME VARCHAR NOT NULL,
INV_QTY DECIMAL,
INV_UNIT_WEIGHT DECIMAL,
INV_WEIGHT DECIMAL,
OTHER_ENTER_NO_OLD VARCHAR,
REMARK VARCHAR,
FACTORY_CODE VARCHAR,
PROD_ORDER_NO VARCHAR,
PROD_TASK_NO VARCHAR,
PROJ_CODE VARCHAR,
PROJ_NAME VARCHAR,
PRDT_TYPE TINYINT,
PRDT_CODE VARCHAR,
PRDT_NAME VARCHAR,
PRDT_LENGTH DECIMAL,
PRDT_WIDTH DECIMAL,
PRDT_THICK DECIMAL,
PRDT_SPEC VARCHAR,
PART_TYPE TINYINT,
PART_CODE VARCHAR,
PART_NAME VARCHAR,
PART_LENGTH DECIMAL,
PART_WIDTH DECIMAL,
PART_THICK DECIMAL,
PART_SPEC VARCHAR,
PRIMARY_ID BIGINT,
PRICE DECIMAL,
AMOUNT DECIMAL,
SOURCE TINYINT
-->
<sqlMap namespace="HGKC006A"> <sqlMap namespace="HGKC006A">
<sql id="condition"> <sql id="condition">
...@@ -188,6 +135,9 @@ ...@@ -188,6 +135,9 @@
<isNotEmpty prepend=" AND " property="partSpec"> <isNotEmpty prepend=" AND " property="partSpec">
PART_SPEC = #partSpec# PART_SPEC = #partSpec#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="partSpecId">
PART_SPEC_ID = #partSpecId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="primaryId"> <isNotEmpty prepend=" AND " property="primaryId">
PRIMARY_ID = #primaryId# PRIMARY_ID = #primaryId#
</isNotEmpty> </isNotEmpty>
...@@ -205,7 +155,7 @@ ...@@ -205,7 +155,7 @@
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.kc.domain.HGKC006A"> resultClass="com.baosight.hggp.hg.kc.domain.HGKC006A">
SELECT SELECT
ID as "id", ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 --> ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 --> DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 --> CREATED_BY as "createdBy", <!-- 记录创建者 -->
...@@ -249,6 +199,7 @@ ...@@ -249,6 +199,7 @@
PART_WIDTH as "partWidth", <!-- 零件-宽 --> PART_WIDTH as "partWidth", <!-- 零件-宽 -->
PART_THICK as "partThick", <!-- 零件-厚 --> PART_THICK as "partThick", <!-- 零件-厚 -->
PART_SPEC as "partSpec", <!-- 零件规格 --> PART_SPEC as "partSpec", <!-- 零件规格 -->
PART_SPEC_ID as "partSpecId", <!-- 零件规格id -->
PRIMARY_ID as "primaryId", <!-- 主表id --> PRIMARY_ID as "primaryId", <!-- 主表id -->
PRICE as "price", <!-- 单价 --> PRICE as "price", <!-- 单价 -->
AMOUNT as "amount", <!-- 金额 --> AMOUNT as "amount", <!-- 金额 -->
...@@ -271,152 +222,6 @@ ...@@ -271,152 +222,6 @@
<include refid="condition" /> <include refid="condition" />
</select> </select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<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="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="otherEnterDate">
OTHER_ENTER_DATE = #otherEnterDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="otherEnterNo">
OTHER_ENTER_NO = #otherEnterNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventRecordId">
INVENT_RECORD_ID = #inventRecordId#
</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="invQty">
INV_QTY = #invQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invUnitWeight">
INV_UNIT_WEIGHT = #invUnitWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invWeight">
INV_WEIGHT = #invWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="otherEnterNoOld">
OTHER_ENTER_NO_OLD = #otherEnterNoOld#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remark">
REMARK = #remark#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodOrderNo">
PROD_ORDER_NO = #prodOrderNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodTaskNo">
PROD_TASK_NO = #prodTaskNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtType">
PRDT_TYPE = #prdtType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtCode">
PRDT_CODE = #prdtCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtName">
PRDT_NAME = #prdtName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtLength">
PRDT_LENGTH = #prdtLength#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtWidth">
PRDT_WIDTH = #prdtWidth#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtThick">
PRDT_THICK = #prdtThick#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtSpec">
PRDT_SPEC = #prdtSpec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partType">
PART_TYPE = #partType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partCode">
PART_CODE = #partCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partName">
PART_NAME = #partName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partLength">
PART_LENGTH = #partLength#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partWidth">
PART_WIDTH = #partWidth#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partThick">
PART_THICK = #partThick#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partSpec">
PART_SPEC = #partSpec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="primaryId">
PRIMARY_ID = #primaryId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="price">
PRICE = #price#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="amount">
AMOUNT = #amount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="source">
SOURCE = #source#
</isNotEmpty>
-->
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGKC006A (ID, INSERT INTO ${hggpSchema}.HGKC006A (ID,
...@@ -463,12 +268,13 @@ ...@@ -463,12 +268,13 @@
PART_WIDTH, <!-- 零件-宽 --> PART_WIDTH, <!-- 零件-宽 -->
PART_THICK, <!-- 零件-厚 --> PART_THICK, <!-- 零件-厚 -->
PART_SPEC, <!-- 零件规格 --> PART_SPEC, <!-- 零件规格 -->
PART_SPEC_ID, <!-- 零件规格id -->
PRIMARY_ID, <!-- 主表id --> PRIMARY_ID, <!-- 主表id -->
PRICE, <!-- 单价 --> PRICE, <!-- 单价 -->
AMOUNT, <!-- 金额 --> AMOUNT, <!-- 金额 -->
SOURCE <!-- 数据来源 --> SOURCE <!-- 数据来源 -->
) )
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #otherEnterDate#, #otherEnterNo#, #whCode#, #whName#, #inventRecordId#, #inventType#, #inventCode#, #inventName#, #invQty#, #invUnitWeight#, #invWeight#, #otherEnterNoOld#, #remark#, #factoryCode#, #prodOrderNo#, #prodTaskNo#, #projCode#, #projName#, #prdtType#, #prdtCode#, #prdtName#, #prdtLength#, #prdtWidth#, #prdtThick#, #prdtSpec#, #partType#, #partCode#, #partName#, #partLength#, #partWidth#, #partThick#, #partSpec#, #primaryId#, #price#, #amount#, #source#) VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #otherEnterDate#, #otherEnterNo#, #whCode#, #whName#, #inventRecordId#, #inventType#, #inventCode#, #inventName#, #invQty#, #invUnitWeight#, #invWeight#, #otherEnterNoOld#, #remark#, #factoryCode#, #prodOrderNo#, #prodTaskNo#, #projCode#, #projName#, #prdtType#, #prdtCode#, #prdtName#, #prdtLength#, #prdtWidth#, #prdtThick#, #prdtSpec#, #partType#, #partCode#, #partName#, #partLength#, #partWidth#, #partThick#, #partSpec#,#partSpecId#, #primaryId#, #price#, #amount#, #source#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -521,6 +327,7 @@ ...@@ -521,6 +327,7 @@
PART_WIDTH = #partWidth#, <!-- 零件-宽 --> PART_WIDTH = #partWidth#, <!-- 零件-宽 -->
PART_THICK = #partThick#, <!-- 零件-厚 --> PART_THICK = #partThick#, <!-- 零件-厚 -->
PART_SPEC = #partSpec#, <!-- 零件规格 --> PART_SPEC = #partSpec#, <!-- 零件规格 -->
PART_SPEC_ID = #partSpecId#, <!-- 零件规格id -->
PRIMARY_ID = #primaryId#, <!-- 主表id --> PRIMARY_ID = #primaryId#, <!-- 主表id -->
PRICE = #price#, <!-- 单价 --> PRICE = #price#, <!-- 单价 -->
AMOUNT = #amount#, <!-- 金额 --> AMOUNT = #amount#, <!-- 金额 -->
......
...@@ -316,6 +316,24 @@ public class HGKCTools { ...@@ -316,6 +316,24 @@ public class HGKCTools {
} }
} }
public static class HgKc006 {
public static HGKC006 getById(Long id) {
AssertUtils.isEmpty(Collections.singleton(id), "ID为空!");
HGKC006 result = (HGKC006) DaoBase.getInstance().get(HGKC006.QUERY, HGKC006.FIELD_ID, id);
return result;
}
}
public static class HgKc006A {
public static List<HGKC006A> getHgkc008aList(Long primaryId) {
Map paramMap = new HashMap();
paramMap.put("primaryId", primaryId);
List<HGKC006A> results = DaoBase.getInstance().query(HGKC006A.QUERY, paramMap);
return results;
}
}
public static class HgKc008 { public static class HgKc008 {
public static HGKC008 getById(Long id) { public static HGKC008 getById(Long id) {
......
...@@ -20,7 +20,7 @@ $(function () { ...@@ -20,7 +20,7 @@ $(function () {
// 详情 // 详情
if (item.id) { if (item.id) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="jump(' + item.id + ',\''+item.submitStatus+'\')" >详情</a>'; + 'onclick="jump(' + item.id + ',\''+item.submitStatus+'\',\''+item.whCode+'\',\''+item.companyCode+'\')" >详情</a>';
} }
return template; return template;
} }
...@@ -134,8 +134,12 @@ function check(id, auditStatus) { ...@@ -134,8 +134,12 @@ function check(id, auditStatus) {
inEiInfo.set("result-0-submitStatus", auditStatus); inEiInfo.set("result-0-submitStatus", auditStatus);
EiCommunicator.send('HGKC006', 'check', inEiInfo, { EiCommunicator.send('HGKC006', 'check', inEiInfo, {
onSuccess(response) { onSuccess(response) {
message("提交成功"); if (response.status == "-1") {
resultGrid.dataSource.page(1); NotificationUtil({msg: response.msg, detailMsg: response.detailMsg}, "error");
} else {
NotificationUtil(response.msg);
query();
}
}, },
onFail(errorMessage, status, e) { onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error"); NotificationUtil("执行失败!", "error");
...@@ -147,9 +151,13 @@ function check(id, auditStatus) { ...@@ -147,9 +151,13 @@ function check(id, auditStatus) {
); );
} }
//详情 //详情
function jump(id,submitStatus) { function jump(id,submitStatus,whCode,companyCode) {
var herf = ctx + "\\web\\" + "HGKC006A?inqu_status-0-primaryId=" + id + "&inqu_status-0-submitStatus="+ submitStatus +"&efParentFormEname=HGKC006"; JSColorbox.open({
window.open(herf); href: "HGKC006A?methodName=initLoad&inqu_status-0-primaryId=" + id+"&inqu_status-0-whCode="+whCode+"&inqu_status-0-companyCode="+companyCode+"&inqu_status-0-submitStatus="+submitStatus,
title: "<div style='text-align: center;'>其他入库详情</div>",
width: "80%",
height: "80%",
});
} }
/** /**
* 选择生产任务 * 选择生产任务
......
...@@ -7,6 +7,10 @@ ...@@ -7,6 +7,10 @@
<EF:EFPage title="其他入库单明细"> <EF:EFPage title="其他入库单明细">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput ename="inqu_status-0-primaryId" cname="领料单id" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-whCode" cname="仓库编码" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-companyCode" cname="仓库编码" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-submitStatus" cname="状态" colWidth="3" type="hidden"/>
<div class="row"> <div class="row">
<%-- <EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3" filter="contains" <%-- <EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3" filter="contains"
defultValue=""> defultValue="">
...@@ -30,15 +34,19 @@ ...@@ -30,15 +34,19 @@
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/> <EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="primaryId" cname="主表id" hidden="true"/>
<EF:EFColumn ename="whCode" cname="仓库编码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="公司编号" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true" <EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField" blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains"> filter="contains">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true" readonly="true"/> <EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" hidden="true"/> <EF:EFColumn ename="inventName" cname="存货名称" hidden="true"/>
<EF:EFColumn ename="partSpec" cname="规格" width="120" align="center" required="true" enable="false"/> <EF:EFColumn ename="partSpec" cname="规格" width="120" align="center" required="true" enable="true"/>
<EF:EFColumn ename="inventRecordId" cname="规格id" width="120" align="center" required="true" enable="false" hidden="true"/> <EF:EFColumn ename="partSpecId" cname="规格id" hidden="true"/>
<EF:EFColumn ename="inventRecordId" cname="存货档案id" width="120" align="center" required="true" enable="false" hidden="true"/>
<EF:EFColumn ename="partLength" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/> <EF:EFColumn ename="partLength" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="partWidth" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N3}"/> <EF:EFColumn ename="partWidth" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="partThick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N3}"/> <EF:EFColumn ename="partThick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
...@@ -46,7 +54,8 @@ ...@@ -46,7 +54,8 @@
<EF:EFColumn ename="invQty" cname="数量" width="120" align="right" format="{0:N0}" <EF:EFColumn ename="invQty" cname="数量" width="120" align="right" format="{0:N0}"
defaultValue="0" defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/" data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/> data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
required="true"/>
<EF:EFColumn ename="invUnitWeight" cname="单重" width="120" align="right" format="{0:N3}" <EF:EFColumn ename="invUnitWeight" cname="单重" width="120" align="right" format="{0:N3}"
defaultValue="0" defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/" data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
...@@ -57,7 +66,8 @@ ...@@ -57,7 +66,8 @@
<EF:EFColumn ename="price" cname="单价" width="120" align="right" format="{0:N3}" <EF:EFColumn ename="price" cname="单价" width="120" align="right" format="{0:N3}"
defaultValue="0" defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/" data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/> data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
required="true"/>
<EF:EFColumn ename="amount" cname="金额" width="120" align="right" enable="false" format="{0:N3}"/> <EF:EFColumn ename="amount" cname="金额" width="120" align="right" enable="false" format="{0:N3}"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
......
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