给库存流水增加强审核的过滤
This commit is contained in:
@@ -92,7 +92,8 @@ public class DepotItemController {
|
||||
if(StringUtil.isNotEmpty(endTime)) {
|
||||
endTime = endTime + BusinessConstants.DAY_LAST_TIME;
|
||||
}
|
||||
List<DepotItemVo4DetailByTypeAndMId> list = depotItemService.findDetailByDepotIdsAndMaterialIdList(depotIds, sku,
|
||||
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
|
||||
List<DepotItemVo4DetailByTypeAndMId> list = depotItemService.findDetailByDepotIdsAndMaterialIdList(depotIds, forceFlag, sku,
|
||||
batchNumber, StringUtil.toNull(number), beginTime, endTime, mId, (currentPage-1)*pageSize, pageSize);
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (list != null) {
|
||||
@@ -120,7 +121,7 @@ public class DepotItemController {
|
||||
return returnJson(objectMap, "查找不到数据", ErpInfo.OK.code);
|
||||
}
|
||||
objectMap.put("rows", dataArray);
|
||||
objectMap.put("total", depotItemService.findDetailByDepotIdsAndMaterialIdCount(depotIds, sku,
|
||||
objectMap.put("total", depotItemService.findDetailByDepotIdsAndMaterialIdCount(depotIds, forceFlag, sku,
|
||||
batchNumber, StringUtil.toNull(number), beginTime, endTime, mId));
|
||||
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ public interface DepotItemMapperEx {
|
||||
|
||||
List<DepotItemVo4DetailByTypeAndMId> findDetailByDepotIdsAndMaterialIdList(
|
||||
@Param("depotIdArray") Long[] depotIdArray,
|
||||
@Param("forceFlag") Boolean forceFlag,
|
||||
@Param("sku") String sku,
|
||||
@Param("batchNumber") String batchNumber,
|
||||
@Param("number") String number,
|
||||
@@ -42,6 +43,7 @@ public interface DepotItemMapperEx {
|
||||
|
||||
Long findDetailByDepotIdsAndMaterialIdCount(
|
||||
@Param("depotIdArray") Long[] depotIdArray,
|
||||
@Param("forceFlag") Boolean forceFlag,
|
||||
@Param("sku") String sku,
|
||||
@Param("batchNumber") String batchNumber,
|
||||
@Param("number") String number,
|
||||
|
||||
@@ -174,7 +174,7 @@ public class DepotItemService {
|
||||
return list==null?0:list.size();
|
||||
}
|
||||
|
||||
public List<DepotItemVo4DetailByTypeAndMId> findDetailByDepotIdsAndMaterialIdList(String depotIds, String sku, String batchNumber,
|
||||
public List<DepotItemVo4DetailByTypeAndMId> findDetailByDepotIdsAndMaterialIdList(String depotIds, Boolean forceFlag, String sku, String batchNumber,
|
||||
String number, String beginTime, String endTime, Long mId, int offset, int rows)throws Exception {
|
||||
Long depotId = null;
|
||||
if(StringUtil.isNotEmpty(depotIds)) {
|
||||
@@ -184,14 +184,14 @@ public class DepotItemService {
|
||||
Long[] depotIdArray = StringUtil.listToLongArray(depotList);
|
||||
List<DepotItemVo4DetailByTypeAndMId> list =null;
|
||||
try{
|
||||
list = depotItemMapperEx.findDetailByDepotIdsAndMaterialIdList(depotIdArray, sku, batchNumber, number, beginTime, endTime, mId, offset, rows);
|
||||
list = depotItemMapperEx.findDetailByDepotIdsAndMaterialIdList(depotIdArray, forceFlag, sku, batchNumber, number, beginTime, endTime, mId, offset, rows);
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public Long findDetailByDepotIdsAndMaterialIdCount(String depotIds, String sku, String batchNumber,
|
||||
public Long findDetailByDepotIdsAndMaterialIdCount(String depotIds, Boolean forceFlag, String sku, String batchNumber,
|
||||
String number, String beginTime, String endTime, Long mId)throws Exception {
|
||||
Long depotId = null;
|
||||
if(StringUtil.isNotEmpty(depotIds)) {
|
||||
@@ -201,7 +201,7 @@ public class DepotItemService {
|
||||
Long[] depotIdArray = StringUtil.listToLongArray(depotList);
|
||||
Long result =null;
|
||||
try{
|
||||
result = depotItemMapperEx.findDetailByDepotIdsAndMaterialIdCount(depotIdArray, sku, batchNumber, number, beginTime, endTime, mId);
|
||||
result = depotItemMapperEx.findDetailByDepotIdsAndMaterialIdCount(depotIdArray, forceFlag, sku, batchNumber, number, beginTime, endTime, mId);
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
@@ -873,7 +873,6 @@ public class DepotItemService {
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal getSkuStockByParam(Long depotId, Long meId, String beginTime, String endTime) throws Exception {
|
||||
//获取库存审核开关
|
||||
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
|
||||
List<Long> depotList = depotService.parseDepotList(depotId);
|
||||
DepotItemVo4Stock stockObj = depotItemMapperEx.getSkuStockByParamWithDepotList(depotList, meId, forceFlag, beginTime, endTime);
|
||||
@@ -915,7 +914,6 @@ public class DepotItemService {
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal getStockByParamWithDepotList(List<Long> depotList, Long mId, String beginTime, String endTime) throws Exception {
|
||||
//获取库存审核开关
|
||||
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
|
||||
//初始库存
|
||||
BigDecimal initStock = materialService.getInitStockByMidAndDepotList(depotList, mId);
|
||||
@@ -947,7 +945,6 @@ public class DepotItemService {
|
||||
* @return
|
||||
*/
|
||||
public Map<String, BigDecimal> getIntervalMapByParamWithDepotList(List<Long> depotList, Long mId, String beginTime, String endTime) throws Exception {
|
||||
//获取库存审核开关
|
||||
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
|
||||
Map<String,BigDecimal> intervalMap = new HashMap<>();
|
||||
BigDecimal inSum = BigDecimal.ZERO;
|
||||
|
||||
@@ -167,6 +167,9 @@
|
||||
<foreach collection="depotIdArray" item="depotId" separator=",">#{depotId}</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="forceFlag">
|
||||
and dh.status = '1'
|
||||
</if>
|
||||
<if test="sku != null and sku !=''">
|
||||
and di.sku = #{sku}
|
||||
</if>
|
||||
@@ -201,6 +204,9 @@
|
||||
<foreach collection="depotIdArray" item="depotId" separator=",">#{depotId}</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="forceFlag">
|
||||
and dh.status = '1'
|
||||
</if>
|
||||
<if test="sku != null and sku !=''">
|
||||
and di.sku = #{sku}
|
||||
</if>
|
||||
@@ -238,6 +244,9 @@
|
||||
<foreach collection="depotIdArray" item="depotId" separator=",">#{depotId}</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="forceFlag">
|
||||
and dh.status = '1'
|
||||
</if>
|
||||
<if test="sku != null and sku !=''">
|
||||
and di.sku = #{sku}
|
||||
</if>
|
||||
@@ -266,6 +275,9 @@
|
||||
<foreach collection="depotIdArray" item="depotId" separator=",">#{depotId}</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="forceFlag">
|
||||
and dh.status = '1'
|
||||
</if>
|
||||
<if test="sku != null and sku !=''">
|
||||
and di.sku = #{sku}
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user