| | |
| | | package com.consum.base.service.impl; |
| | | |
| | | import com.consum.base.service.LWhGoodsStatisticsService; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.consum.base.core.utils.MapUtils; |
| | | import com.consum.base.core.utils.MapperUtil; |
| | | import com.consum.base.pojo.query.LWhGoodsStatisQry; |
| | | import com.consum.base.pojo.response.GoodsStatisticsInfoVO; |
| | | import com.consum.base.service.LWhGoodsStatisticsService; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | |
| | |
| | | |
| | | @Override |
| | | public List getWhGoodsStatisList(LWhGoodsStatisQry param) { |
| | | |
| | | List<GoodsStatisticsInfoVO> result = Lists.newArrayList(); |
| | | |
| | | StringBuilder sqlColumn = new StringBuilder(GET_WHGOODS_STATIS_LIST_COLUMN); |
| | | StringBuilder sqlCangKu = new StringBuilder(GET_WHGOODS_STATIS_LIST_T_CANGKU); |
| | | StringBuilder sqlCangKuWhere = new StringBuilder(GET_WHGOODS_STATIS_LIST_T_CANGKU_WHERE); |
| | |
| | | |
| | | StringBuilder sql = new StringBuilder(); |
| | | sql.append(sqlColumn).append(sqlCangKu).append(sqlCangKuWhere).append(sqlCangKuEnd).append(sqlKuCun) |
| | | .append(sqlKuCunWhere).append(sqlKuCunGoupBy) |
| | | .append(sqlKuCunWhere).append(sqlKuCunGoupBy).append(sqlEndWhere); |
| | | |
| | | .append(sqlEndWhere); |
| | | |
| | | return select(sql.toString(), paramts, new MapperUtil()); |
| | | List<Map<String, Object>> select = select(sql.toString(), paramts, new MapperUtil()); |
| | | select.forEach(item -> { |
| | | GoodsStatisticsInfoVO goodsStatisticsInfoVO = MapUtils.convertMapToObj(item, GoodsStatisticsInfoVO.class); |
| | | // 统计总数改为:在库数量+报废数量 |
| | | goodsStatisticsInfoVO |
| | | .setTotalNum(goodsStatisticsInfoVO.getZaiKuNum() + goodsStatisticsInfoVO.getBaoFeiNum()); |
| | | result.add(goodsStatisticsInfoVO); |
| | | }); |
| | | return result; |
| | | } |
| | | } |