| | |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.MatCode; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.mapper.LocDetlMapper; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.MatCodeService; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private LocDetlMapper locDetlMapper; |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | @RequestMapping(value = "/locDetl/update") |
| | | public R update1() { |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private MatCodeService matCodeService; |
| | | |
| | | @RequestMapping(value = "/locDetl/statis/auth") |
| | | @ManagerAuth |
| | | public R statis(@RequestParam(defaultValue = "1")Integer curr, |
| | |
| | | @RequestParam Map<String, Object> param) { |
| | | Page<LocDetl> stockStatis = locDetlService.getStockStatis(toPage(curr, limit, param, LocDetl.class)); |
| | | for (LocDetl locDetl : stockStatis.getRecords()) { |
| | | MatCode matCode = matCodeService.selectById(locDetl.getMatnr()); |
| | | if (matCode != null) { |
| | | VersionUtils.setLocDetl(locDetl, matCode); |
| | | Mat mat = matService.selectByMatnr(locDetl.getMatnr()); |
| | | if (mat != null) { |
| | | locDetl.sync(mat); |
| | | } |
| | | } |
| | | return R.ok().add(stockStatis); |
| | |
| | | public void statisExport(HttpServletResponse response) throws IOException { |
| | | List<LocDetl> excel = LocDetlMapper.getStockStatisExcel(); |
| | | for (LocDetl locDetl : excel) { |
| | | MatCode matCode = matCodeService.selectById(locDetl.getMatnr()); |
| | | if (matCode != null) { |
| | | VersionUtils.setLocDetl(locDetl, matCode); |
| | | Mat mat = matService.selectByMatnr(locDetl.getMatnr()); |
| | | if (mat != null) { |
| | | locDetl.sync(mat); |
| | | } |
| | | } |
| | | response.setContentType("application/vnd.ms-excel"); |