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

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( String findMaterialsListByHeaderId(
@Param("id") Long id); @Param("id") Long id);
BigDecimal getMaterialCountByHeaderId(
@Param("id") Long id);
List<DepotHeadVo4InDetail> findInOutDetail( List<DepotHeadVo4InDetail> findInOutDetail(
@Param("beginTime") String beginTime, @Param("beginTime") String beginTime,
@Param("endTime") String endTime, @Param("endTime") String endTime,

View File

@@ -41,6 +41,8 @@ public class DepotHeadVo4List extends DepotHead{
private BigDecimal debt; private BigDecimal debt;
private BigDecimal materialCount;
public String getProjectName() { public String getProjectName() {
return projectName; return projectName;
} }
@@ -176,4 +178,12 @@ public class DepotHeadVo4List extends DepotHead{
public void setDebt(BigDecimal debt) { public void setDebt(BigDecimal debt) {
this.debt = 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.setOperTimeStr(getCenternTime(dh.getOperTime()));
} }
dh.setMaterialsList(findMaterialsListByHeaderId(dh.getId())); dh.setMaterialsList(findMaterialsListByHeaderId(dh.getId()));
dh.setMaterialCount(getMaterialCountByHeaderId(dh.getId()));
resList.add(dh); resList.add(dh);
} }
} }
@@ -486,6 +487,16 @@ public class DepotHeadService {
return result; 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, public List<DepotHeadVo4InDetail> findInOutDetail(String beginTime, String endTime, String type, String [] creatorArray,
String [] organArray, String materialParam, List<Long> depotList, Integer oId, String number, String [] organArray, String materialParam, List<Long> depotList, Integer oId, String number,
String remark, Integer offset, Integer rows) throws Exception{ String remark, Integer offset, Integer rows) throws Exception{

View File

@@ -239,6 +239,12 @@
and ifnull(jsh_depot_item.delete_flag,'0') !='1' and ifnull(jsh_depot_item.delete_flag,'0') !='1'
</select> </select>
<select id="getMaterialCountByHeaderId" resultType="java.math.BigDecimal">
select sum(oper_number) from jsh_depot_item
where header_id = #{id}
and ifnull(delete_flag,'0') !='1'
</select>
<select id="findInOutDetail" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap"> <select id="findInOutDetail" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap">
select dh.number,me.bar_code, m.`name` MName,m.model,m.standard,di.unit_price,di.material_unit as mUnit, select dh.number,me.bar_code, m.`name` MName,m.model,m.standard,di.unit_price,di.material_unit as mUnit,
di.oper_number,di.all_price, ifnull(di.tax_rate,0) tax_rate, ifnull(di.tax_money,0) tax_money, ifnull(di.tax_last_money,0) tax_last_money, di.oper_number,di.all_price, ifnull(di.tax_rate,0) tax_rate, ifnull(di.tax_money,0) tax_money, ifnull(di.tax_last_money,0) tax_last_money,
@@ -908,5 +914,4 @@
and dh.number!=#{number} and dh.number!=#{number}
and ifnull(dh.delete_flag,'0') !='1' and ifnull(dh.delete_flag,'0') !='1'
</select> </select>
</mapper> </mapper>