Commit 0e73e9b1 by liuyang

2024-06-11 库存盘点单

parent 7f40fb81
......@@ -110,6 +110,22 @@ public class HGSqlConstant {
// 锁
public static final String LOCK = MODULE_NAME + "lock";
}
/**
* HPKC005 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HgKc005 {
// 查询
public static final String QUERY_SUM = "HGKC005.querySum";
// 锁
public static final String LOCK = "HGKC005.lock";
// 统计
public static final String STAT_DATE = "HGKC005.statDate";
}
/**
* HGKC010 SQL 定义
......
......@@ -15,6 +15,10 @@ import com.baosight.hggp.hg.zl.domain.HGZL004;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.StringUtils;
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.soa.XLocalManager;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
......@@ -455,6 +459,101 @@ public class HGKCTools {
}
}
/**
* HGKC005公共DAO方法定义
*
* @author:songx
* @date:2024/1/31,16:36
*/
public static class HpKc005 {
/**
* 锁
*
* @param checkNos
* @return
*/
public static void lock(List<String> checkNos) {
if (org.springframework.util.CollectionUtils.isEmpty(checkNos)) {
return;
}
Map queryMap = new HashMap();
queryMap.put("checkNos", checkNos);
DaoBase.getInstance().update(HGSqlConstant.HgKc005.LOCK, queryMap);
}
/**
* 查询盘点单信息
*
* @param checkNos
* @return
*/
public static List<HGKC005> list(List<String> checkNos) {
if (org.springframework.util.CollectionUtils.isEmpty(checkNos)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("checkNos", checkNos);
return DaoBase.getInstance().query(HGKC005.QUERY, queryMap);
}
/**
* 查询盘点单信息
*
* @param checkNos
* @return
*/
public static Map<String, HGKC005> map(List<String> checkNos) {
List<HGKC005> results = list(checkNos);
if (org.springframework.util.CollectionUtils.isEmpty(results)) {
return null;
}
return results.stream().collect(Collectors.toMap(HGKC005::getCheckNo, item -> item));
}
}
/**
* 更新库存
*
* @param whCode
* @param inventRecordId
* @param amount
* @param weight
*/
public static void updateStock(String whCode, Long inventRecordId, BigDecimal amount, BigDecimal weight,String factCode) {
updateStock(whCode, inventRecordId, amount,weight, weight,factCode);
}
/**
* 更新库存
*
* @param whCode
* @param inventRecordId
* @param amount
* @param unitWeight
* @param weight
*/
public static void updateStock(String whCode, Long inventRecordId, BigDecimal amount, BigDecimal unitWeight,
BigDecimal weight,String factoryCode) {
if (amount.compareTo(BigDecimal.ZERO) == 0) {
throw new PlatException("入库数量不能为空");
}
EiInfo inInfo = new EiInfo();
inInfo.set("whCode", whCode);
inInfo.set("inventRecordId", inventRecordId);
inInfo.set("amount", amount);
inInfo.set("unitWeight", unitWeight);
inInfo.set("weight", weight);
inInfo.set("factoryCode", factoryCode);
inInfo.set(EiConstant.serviceName, "HGKC010");
inInfo.set(EiConstant.methodName, "updateStock");
EiInfo outInfo = XLocalManager.call(inInfo);
if (outInfo.getStatus() < 0) {
throw new PlatException("跟新库存失败:" + outInfo.getMsg());
}
}
public static class HgKc006 {
public static HGKC006 getById(Long id) {
AssertUtils.isEmpty(Collections.singleton(id), "ID为空!");
......
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