优化单据列表接口,增加总数量返回字段

This commit is contained in:
季圣华
2022-10-19 21:00:21 +08:00
parent b0b1ddf8cb
commit 3f1b4410d6
4 changed files with 30 additions and 1 deletions

View File

@@ -61,6 +61,9 @@ public interface DepotHeadMapperEx {
String findMaterialsListByHeaderId(
@Param("id") Long id);
BigDecimal getMaterialCountByHeaderId(
@Param("id") Long id);
List<DepotHeadVo4InDetail> findInOutDetail(
@Param("beginTime") String beginTime,
@Param("endTime") String endTime,

View File

@@ -41,6 +41,8 @@ public class DepotHeadVo4List extends DepotHead{
private BigDecimal debt;
private BigDecimal materialCount;
public String getProjectName() {
return projectName;
}
@@ -176,4 +178,12 @@ public class DepotHeadVo4List extends DepotHead{
public void setDebt(BigDecimal debt) {
this.debt = debt;
}
public BigDecimal getMaterialCount() {
return materialCount;
}
public void setMaterialCount(BigDecimal materialCount) {
this.materialCount = materialCount;
}
}

View File

@@ -151,6 +151,7 @@ public class DepotHeadService {
dh.setOperTimeStr(getCenternTime(dh.getOperTime()));
}
dh.setMaterialsList(findMaterialsListByHeaderId(dh.getId()));
dh.setMaterialCount(getMaterialCountByHeaderId(dh.getId()));
resList.add(dh);
}
}
@@ -486,6 +487,16 @@ public class DepotHeadService {
return result;
}
private BigDecimal getMaterialCountByHeaderId(Long id) {
BigDecimal result = null;
try{
result = depotHeadMapperEx.getMaterialCountByHeaderId(id);
}catch(Exception e){
JshException.readFail(logger, e);
}
return result;
}
public List<DepotHeadVo4InDetail> findInOutDetail(String beginTime, String endTime, String type, String [] creatorArray,
String [] organArray, String materialParam, List<Long> depotList, Integer oId, String number,
String remark, Integer offset, Integer rows) throws Exception{