| | |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.ManLocDetl; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.importexcle.LocMat; |
| | | import com.zy.asrs.importexcle.LocMatListener; |
| | | import com.zy.asrs.mapper.LocDetlMapper; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.ManLocDetlService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | @Resource |
| | | private LocMastService locMastService; |
| | | |
| | | @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("导入成功"); |
| | | } |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void importLocData1(MultipartFile multipartFile) throws IOException { |
| | | EasyExcel.read(multipartFile.getInputStream(), LocMat.class, |
| | | new LocMatListener(locMastService,locDetlMapper,getUserId())).sheet().doReadSync(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locDetl/update") |
| | | public R update1() { |
| | | if (!locDetlService.updateLocNo("0402805", "0402804")) { |