Commit 00386c8f by liuyang

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

parents 453272b8 674963de
......@@ -60,6 +60,7 @@ public class HGKC001 extends DaoEPBase {
public static final String FIELD_PRICE = "price"; /* 单价*/
public static final String FIELD_AMOUNT = "amount"; /* 金额*/
public static final String FIELD_INVENT_TYPE_DETAIL = "inventTypeDetail"; /*存货类型明细*/
public static final String FIELD_RECEIVE_DETAIL_ID = "receiveDetailId"; /*采购收货明细id*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -149,6 +150,7 @@ public class HGKC001 extends DaoEPBase {
private BigDecimal price = new BigDecimal(0.000); /* 单价*/
private BigDecimal amount = new BigDecimal(0.000); /* 金额*/
private Integer inventTypeDetail; /*存货类型明细 1:构建 2:零件*/
private Long receiveDetailId = new Long(0); /* 采购收货明细id*/
/**
* initialize the metadata.
......@@ -332,6 +334,10 @@ public class HGKC001 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_INVENT_TYPE_DETAIL);
eiColumn.setDescName("存货类型明细");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_RECEIVE_DETAIL_ID);
eiColumn.setDescName("采购收货明细id");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -941,6 +947,15 @@ public class HGKC001 extends DaoEPBase {
public void setInventTypeDetail(Integer inventTypeDetail) {
this.inventTypeDetail = inventTypeDetail;
}
public Long getReceiveDetailId() {
return receiveDetailId;
}
public void setReceiveDetailId(Long receiveDetailId) {
this.receiveDetailId = receiveDetailId;
}
/**
* get the value from Map.
*
......@@ -987,6 +1002,7 @@ public class HGKC001 extends DaoEPBase {
setPrice(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PRICE)), price));
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount));
setInventTypeDetail(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_INVENT_TYPE_DETAIL)), inventTypeDetail));
setReceiveDetailId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_RECEIVE_DETAIL_ID)), receiveDetailId));
}
/**
......@@ -1034,6 +1050,7 @@ public class HGKC001 extends DaoEPBase {
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_INVENT_TYPE_DETAIL,StringUtils.toString(inventTypeDetail, eiMetadata.getMeta(FIELD_INVENT_TYPE_DETAIL)));
map.put(FIELD_RECEIVE_DETAIL_ID,StringUtils.toString(receiveDetailId, eiMetadata.getMeta(FIELD_RECEIVE_DETAIL_ID)));
return map;
}
......
......@@ -208,6 +208,7 @@ public class ServiceHGKC001 extends ServiceBase {
hgkc001.getDepositQty(), hgkc001.getDepositUnitWeight(), hgkc001.getDepositWeight());
// 更新收货单状态
HGCGTools.HgCg003.updateStatus(hgkc001.getReceiveNo(), HGConstant.CgReceiveStatus.S_5);
HGCGTools.HgCg003B.updateStatus(hgkc001.getReceiveDetailId(), HGConstant.CgReceiveStatus.S_5);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "提交")});
......
......@@ -40,7 +40,8 @@
PRICE as "price", <!-- 单价 -->
AMOUNT as "amount", <!-- 金额 -->
SUBMIT_STATUS as "submitStatus", <!-- 提交状态 -->
INVENT_TYPE_DETAIL as "inventTypeDetail"
INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型明细 -->
RECEIVE_DETAIL_ID as "receiveDetailId" <!-- 采购收货明细id -->
</sql>
<sql id="condition">
......@@ -120,6 +121,12 @@
<isNotEmpty prepend=" AND " property="inventTypeDetails">
INVENT_TYPE_DETAIL IN <iterate close=")" open="(" conjunction="," property="inventTypeDetails">#inventTypeDetails[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveDetailId">
RECEIVE_DETAIL_ID = #receiveDetailId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveDetailIds">
RECEIVE_DETAIL_ID IN <iterate close=")" open="(" conjunction="," property="receiveDetailIds">#receiveDetailIds[]#</iterate>
</isNotEmpty>
</sql>
<sql id="idCondition">
......@@ -206,14 +213,15 @@
PRICE, <!-- 单价 -->
AMOUNT, <!-- 金额 -->
SUBMIT_STATUS,
INVENT_TYPE_DETAIL
INVENT_TYPE_DETAIL,
RECEIVE_DETAIL_ID
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #depositDate#, #depositNo#,
#receiveNo#, #planNo#, #contractNo#, #whCode#, #whName#, #inventType#,
#inventCode#, #inventName#, #specId#, #spec#, #material#,
#unit#, #length#, #width#, #thick#, #depositQty#, #depositUnitWeight#, #depositWeight#,
#storageType#, #isReturn#,#price#, #amount#,#submitStatus#,#inventTypeDetail#
#storageType#, #isReturn#,#price#, #amount#,#submitStatus#,#inventTypeDetail#, #receiveDetailId#
)
</insert>
......
......@@ -3,12 +3,11 @@ package com.baosight.hggp.hg.kc.tools;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.baosight.hggp.common.CheckTypeEnum;
import com.baosight.hggp.common.InventorySource;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.cg.domain.HGCG003;
import com.baosight.hggp.hg.cg.domain.HGCG003B;
import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
......@@ -104,25 +103,25 @@ public class HGKCTools {
/**
* 生产入库(入库质检单)
* @param receiveNo
* @param receiveId
*/
public static void putInStorageData(String receiveNo) {
List<String> receiveNoList = new LinkedList<>();
receiveNoList.add(receiveNo);
public static void putInStorageData(Long receiveId) {
List<Long> receiveIDsList = new LinkedList<>();
receiveIDsList.add(receiveId);
// db数据
Map<String, HGCG003> dbCg003Map = HGCGUtils.HgCg003.lockGetData(receiveNoList);
HGCG003 dbCg003 = dbCg003Map.get(receiveNo);
HGKC001 newKc001 = BeanUtils.copy(dbCg003, HGKC001.class);
Map<Long, HGCG003B> dbCg003BMap = HGCGUtils.HgCg003B.lockGetData(receiveIDsList);
HGCG003B dbCg003B = dbCg003BMap.get(receiveId);
HGKC001 newKc001 = BeanUtils.copy(dbCg003B, HGKC001.class);
newKc001.setDepositDate(DateUtils.shortDate());
newKc001.setDepositNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CG_DEPOSIT_NO));
newKc001.setDepositQty(dbCg003.getDepositQty());
newKc001.setDepositUnitWeight(dbCg003.getReceiveUnitWeight());
newKc001.setDepositWeight(dbCg003.getDepositQty().multiply(dbCg003.getReceiveUnitWeight()));
newKc001.setDepositQty(dbCg003B.getDepositQty());
newKc001.setDepositUnitWeight(dbCg003B.getReceiveUnitWeight());
newKc001.setDepositWeight(dbCg003B.getDepositQty().multiply(dbCg003B.getReceiveUnitWeight()));
newKc001.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
newKc001.setSpecId(dbCg003.getSpecId());
newKc001.setSubmitStatus(HGConstant.ProductStatus.WTJ);
newKc001.setStorageType(HGConstant.StorageType.RK);
newKc001.setIsReturn(CommonConstant.YesNo.NO_0);
newKc001.setReceiveDetailId(dbCg003B.getId());
DaoUtils.insert(HGKC001.INSERT, newKc001);
// 更新库存数量
// HGKCUtils.HgKc010.updateInv(newKc001.getCompanyCode(), newKc001.getWhCode(), newKc001.getInventCode(),
......
......@@ -241,7 +241,7 @@ public class ServiceHGZL001 extends ServiceBase {
// 更新收货单状态
HGCGTools.HgCg003.updateCheck(dbZl001);
//生成采购入库单
HGKCTools.HgKc001.putInStorageData(dbZl001.getReceiveNo());
HGKCTools.HgKc001.putInStorageData(dbZl001.getReceiveDetailId());
}
}
......
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