优化首页统计

This commit is contained in:
季圣华
2021-11-09 00:35:48 +08:00
parent a923700c0e
commit 3ad93e20e5
8 changed files with 78 additions and 25 deletions

View File

@@ -796,8 +796,8 @@ public class DepotHeadService {
return depotHeadMapperEx.getBuyAndSaleStatistics(type, subType, hasSupplier, beginTime, endTime);
}
public BigDecimal getBuyAndSaleRetailStatistics(String type, String subType, Integer hasSupplier, String beginTime, String endTime) {
return depotHeadMapperEx.getBuyAndSaleRetailStatistics(type, subType, hasSupplier, beginTime, endTime);
public BigDecimal getBuyAndSaleRetailStatistics(String type, String subType, String beginTime, String endTime) {
return depotHeadMapperEx.getBuyAndSaleRetailStatistics(type, subType, beginTime, endTime).abs();
}
public DepotHead getDepotHead(String number)throws Exception {

View File

@@ -298,6 +298,27 @@ public class DepotItemService {
return result;
}
/**
* 统计零售的总金额
* @param type
* @param subType
* @param month
* @return
* @throws Exception
*/
public BigDecimal inOrOutRetailPrice(String type, String subType, String month) throws Exception{
BigDecimal result= BigDecimal.ZERO;
try{
String beginTime = Tools.firstDayOfMonth(month) + BusinessConstants.DAY_FIRST_TIME;
String endTime = Tools.lastDayOfMonth(month) + BusinessConstants.DAY_LAST_TIME;
result = depotItemMapperEx.inOrOutRetailPrice(type, subType, beginTime, endTime);
result = result.abs();
}catch(Exception e){
JshException.readFail(logger, e);
}
return result;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public void saveDetials(String rows, Long headerId, HttpServletRequest request) throws Exception{
//查询单据主表信息