| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.consum.base.core.utils.CurrencyUtil; |
| | | import com.consum.base.core.utils.MapUtils; |
| | | import com.consum.base.core.utils.MapperUtil; |
| | | import com.consum.base.core.utils.PageUtil; |
| | | import com.consum.base.pojo.excel.ProcureExcelTemplate; |
| | | import com.consum.base.pojo.query.FormProcureQry; |
| | | import com.consum.model.po.LWhFormProcure; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | |
| | | |
| | | private static String QUERY_FORM_PROCURE_LIST = "SELECT * FROM L_WH_FORM_PROCURE WHERE 1 = 1"; |
| | | |
| | | public GenericPager<LWhFormProcure> queryFormProcureList(FormProcureQry param) { |
| | | public PageUtil<LWhFormProcure> queryFormProcureList(FormProcureQry param) { |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | | StringBuilder sql = new StringBuilder(QUERY_FORM_PROCURE_LIST); |
| | | //入库单号 |
| | |
| | | } |
| | | sql.append(" ORDER BY PROCURE_TIME DESC"); |
| | | GenericPager genericPager = selectSplit(sql.toString(), paramts, new LWhFormProcure()); |
| | | return genericPager; |
| | | PageUtil pageUtil = new PageUtil(genericPager); |
| | | return pageUtil; |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | public List<ProcureExcelTemplate> getExportList(Long id) { |
| | | String sql = "SELECT\n" |
| | | + "\tfp.BUSINESS_FORM_CODE,\n" |
| | | + "\tfp.AGENCY_NAME tenantName,\n" |
| | | + "\tfp.INCOME_TIME createTime,\n" |
| | | + "\tfp.INCOME_NAME operatorName,\n" |
| | | + "\tGOODS_NAME templateName,\n" |
| | | + "\tpm.BASE_GOODS_MODELS_NAME baseModelName,\n" |
| | | + "\tcounts num,\n" |
| | | + "\tprice,\n" |
| | | + "\ttotal_amount totalAmount,\n" |
| | | + "\tWAREHOUSE_NAME,\n" |
| | | + "\tBEIZ remark\n" |
| | | + "FROM\n" |
| | | + "\tl_wh_procure_model pm\n" |
| | | + "\tLEFT JOIN base_goods_models bgm ON pm.BASE_GOODS_MODELS_ID = bgm.id\n" |
| | | + "\tLEFT JOIN base_goods_template bgt ON bgm.GOODS_TEMPLATES_ID = bgt.id\n" |
| | | + "\tLEFT JOIN l_wh_form_procure fp ON fp.ID = pm.BUSINESS_ID\n" |
| | | + "WHERE\n" |
| | | + "\tpm.BUSINESS_ID = :id"; |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("id", id); |
| | | List<Map<String, Object>> select = this.select(sql, param, new MapperUtil()); |
| | | if (CollectionUtils.isEmpty(select)) { |
| | | return null; |
| | | } |
| | | |
| | | List<ProcureExcelTemplate> list = Lists.newArrayList(); |
| | | select.forEach(item -> { |
| | | ProcureExcelTemplate templateExcelExport = MapUtils.convertMapToObj(item, ProcureExcelTemplate.class); |
| | | templateExcelExport.setTotalAmount(CurrencyUtil.convertFenToYuan(templateExcelExport.getTotalAmount())); |
| | | templateExcelExport.setPrice(CurrencyUtil.convertFenToYuan(templateExcelExport.getPrice())); |
| | | list.add(templateExcelExport); |
| | | }); |
| | | return list; |
| | | |
| | | |
| | | } |
| | | } |