| | |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private LWhFormScrappedCoreService lWhFormScrappedCoreService; |
| | | |
| | | private static String QUERY_LIST = "SELECT fs.* FROM l_wh_form_scrapped fs left join l_wh_form_scrapped_goods fsg on fs.id = fsg.FORM_SCRAPPED_ID WHERE 1 = 1 "; |
| | | private static String QUERY_LIST = "SELECT DISTINCT fs.* FROM l_wh_form_scrapped fs left join l_wh_form_scrapped_goods fsg on fs.id = fsg.FORM_SCRAPPED_ID WHERE 1 = 1 "; |
| | | |
| | | private static final String QUERY_BF_DETAIL_LIST = "select fs.id,fs.BUSINESS_FORM_CODE,fsg.GOODS_TEMPLATE_NAME,fsg.BASE_GOODS_MODELS_NAME,fsg.COUNTS," |
| | | + "fs.AGENCY_NAME,OPERATOR_NAME,DEAL_TIME from l_wh_form_scrapped fs " |
| | |
| | | lWhFormScrapped.setId(lWhFormScrappedId); |
| | | lWhFormScrapped.setBusinessFormCode(codeGeneratorService.createBusinessFormCode(CodeGeneratorEnum.Scrapped)); |
| | | lWhFormScrapped.setWarehouseType(warehouseType); |
| | | |
| | | // 公用 |
| | | Long warehouseId = null; |
| | | //仓库名称 |
| | | String wareHouseName = null; |
| | | if (warehouseType == 0){ |
| | | if (warehouseType == 0) { |
| | | warehouseId = param.getWarehouseId(); |
| | | //根据仓库id查询仓库 |
| | | BaseWarehouse warehouse = this.baseWarehouseService.getById(warehouseId); |
| | |
| | | lWhFormScrapped.setOperatorName(sysInfo.getUserName()); |
| | | lWhFormScrapped.setDealTime(param.getDealTime()); |
| | | lWhFormScrapped.setStates(0); |
| | | lWhFormScrapped.setUploadFiles(param.getUploadFiles()); |
| | | //根据部门id查询部门 |
| | | FinSysTenantDepartment department = this.departmentService.getById(sysInfo.getSysDeptId()); |
| | | if (department != null) { |
| | |
| | | |
| | | scrappedGoodsList.add(scrappedGoods); |
| | | } |
| | | int flag2 = this.scrappedGoodsService.insert(scrappedGoodsList); |
| | | int flag2 = this.scrappedGoodsService.insertBatch(scrappedGoodsList); |
| | | if (flag2 != scrappedGoodsList.size()) { |
| | | log.error("新增报废单物品记录 失败"); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | |
| | | FormScrappedGoodsVO formScrappedGoodsVO = new FormScrappedGoodsVO(); |
| | | formScrappedGoodsVO.setBaseGoodsTemplateId(baseGoodsTemplateId); |
| | | formScrappedGoodsVO.setGoodsName(lWhFormScrappedGoods.getGoodsTemplateName()); |
| | | |
| | | String sql = "select CATEGORY_NAME from base_goods_template where id = :id"; |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("id", baseGoodsTemplateId); |
| | | List<Map<String, Object>> goodTemplate = this.select(sql, param, new MapperUtil()); |
| | | if (!CollectionUtils.isEmpty(goodTemplate)) { |
| | | Optional<Map<String, Object>> first = goodTemplate.stream().findFirst(); |
| | | Map<String, Object> objectMap = first.get(); |
| | | formScrappedGoodsVO.setCategoryName(objectMap.get("categoryName").toString()); |
| | | } |
| | | |
| | | List<GoodsModelVO> goodsModelList = Lists.newArrayList(); |
| | | goodsList.forEach(item -> { |
| | |
| | | // } |
| | | // return scrappedExtend; |
| | | // } |
| | | |
| | | } |