| | |
| | | import com.consum.base.pojo.LWhFormScrappedGoodsInfoParam; |
| | | import com.consum.base.pojo.LWhFormScrappedGoodsModelParams; |
| | | import com.consum.base.pojo.LWhFormScrappedParam; |
| | | import com.consum.base.pojo.excel.ScrappedInfoExcelTemplate; |
| | | import com.consum.base.pojo.query.LWhFormScrappedQry; |
| | | import com.consum.base.pojo.response.FormScrappedGoodsDetailVO; |
| | | import com.consum.base.pojo.response.FormScrappedGoodsVO; |
| | | import com.consum.base.pojo.response.GoodsModelVO; |
| | | import com.consum.base.pojo.response.LWhFormScrappedExtendVO; |
| | | import com.consum.model.po.*; |
| | | import com.consum.model.po.BaseGoodsModels; |
| | | import com.consum.model.po.BaseGoodsTemplate; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.FinSysTenantDepartment; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.LWhFormScrapped; |
| | | import com.consum.model.po.LWhFormScrappedGoods; |
| | | import com.consum.model.po.SDictData; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Description 报废单 |
| | |
| | | return pageUtil; |
| | | } |
| | | |
| | | public List<Map<String, Object>> export(Long id) { |
| | | |
| | | public List<ScrappedInfoExcelTemplate> export(Long id) { |
| | | String sql = |
| | | "SELECT BUSINESS_FORM_CODE, fs.DEAL_TIME, OPERATOR_NAME, AGENCY_NAME, GOODS_TEMPLATE_NAME, BASE_GOODS_MODELS_NAME, DEPARTMENT_NAME, COUNTS, SCRAPPED_NAME, BEIZ " |
| | | + "FROM l_wh_form_scrapped_goods fsg LEFT JOIN l_wh_form_scrapped fs ON fs.id = fsg.FORM_SCRAPPED_ID WHERE " |
| | | + "fs.ID = :id and STATES = 1"; |
| | | "SELECT\n" |
| | | + "\tBUSINESS_FORM_CODE,\n" |
| | | + "\tfs.DEAL_TIME,\n" |
| | | + "\tOPERATOR_NAME,\n" |
| | | + "\tAGENCY_NAME tenantName,\n" |
| | | + "\tGOODS_TEMPLATE_NAME templateName,\n" |
| | | + "\tBASE_GOODS_MODELS_NAME baseModelName,\n" |
| | | + "\tCOUNTS num,\n" |
| | | + "\tSCRAPPED_NAME deception,\n" |
| | | + "\tBEIZ remark\n" |
| | | + "FROM\n" |
| | | + "\tl_wh_form_scrapped_goods fsg\n" |
| | | + "\tLEFT JOIN l_wh_form_scrapped fs ON fs.id = fsg.FORM_SCRAPPED_ID\n" |
| | | + "WHERE\n" |
| | | + "\tfs.ID = :id\n" |
| | | + "\tAND STATES = 1"; |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("id", id); |
| | | List<Map<String, Object>> select = this.select(sql, param, new MapperUtil()); |
| | | return select; |
| | | if (CollectionUtils.isEmpty(select)) { |
| | | return null; |
| | | } |
| | | List<ScrappedInfoExcelTemplate> list = Lists.newArrayList(); |
| | | select.forEach(item -> { |
| | | ScrappedInfoExcelTemplate inventoryExcelTemplate = MapUtils.convertMapToObj(item, ScrappedInfoExcelTemplate.class); |
| | | list.add(inventoryExcelTemplate); |
| | | }); |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * @Description 导出报废登记单 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/11/2 |
| | | */ |
| | | // public LWhFormScrappedExtendVO export(Long id, FinSysTenantUser sysInfo) { |
| | | // LWhFormScrappedExtendVO scrappedExtend = new LWhFormScrappedExtendVO(); |
| | | // //1.查询报废单 |
| | | // LWhFormScrapped lWhFormScrapped = this.get(new LWhFormScrapped(id)); |
| | | // if (lWhFormScrapped != null) { |
| | | // lWhFormScrapped.setDealTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | // lWhFormScrapped.setOperatorName(sysInfo.getUserName()); |
| | | // BeanUtils.copyProperties(lWhFormScrapped, scrappedExtend); |
| | | // } |
| | | // //2.查询报废单物品 |
| | | // List<LWhFormScrappedGoods> scrappedGoodsList = this.scrappedGoodsService.getByFormScrappedId(id); |
| | | // if (!CollectionUtils.isEmpty(scrappedGoodsList)) { |
| | | // scrappedExtend.setScrappedGoodsList(scrappedGoodsList); |
| | | // } |
| | | // return scrappedExtend; |
| | | // } |
| | | |
| | | } |