| | |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.param.ProductCalibrationExcelParam; |
| | | import com.zy.asrs.importexcle.LocMat; |
| | | import com.zy.asrs.importexcle.LocMatListener; |
| | | import com.zy.asrs.importexcle.ProductCalibrationImportListener; |
| | | import com.zy.asrs.mapper.LocDetlMapper; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.apache.ibatis.session.SqlSessionFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @Resource |
| | | private LocMastService locMastService; |
| | | |
| | | @Resource |
| | | private SqlSessionFactory sqlSessionFactory; |
| | | |
| | | @PostMapping("/importLocData") |
| | | @ManagerAuth(memo = "导入立库已有库存") |
| | | public R importLocData(@RequestParam("file") MultipartFile multipartFile) { |
| | | try { |
| | | importLocData1(multipartFile); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.error(e.getMessage()); |
| | | } |
| | | return R.ok("导入成功"); |
| | | } |
| | | |
| | | @PostMapping("/productCalibration") |
| | | @ManagerAuth(memo = "产品校验导入excel方式") |
| | | public R productCalibration(@RequestParam("file") MultipartFile multipartFile) { |
| | | try { |
| | | productCalibrationExcel(multipartFile); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.error(e.getMessage()); |
| | |
| | | new LocMatListener(locMastService,locDetlMapper,getUserId())).sheet().doReadSync(); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void productCalibrationExcel(MultipartFile multipartFile) throws IOException { |
| | | EasyExcel.read(multipartFile.getInputStream(), ProductCalibrationExcelParam.class, |
| | | new ProductCalibrationImportListener(sqlSessionFactory)).sheet().doReadSync(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locDetl/update") |
| | | public R update1() { |
| | | if (!locDetlService.updateLocNo("0402805", "0402804")) { |