| | |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.FrozenParam; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.LocOwner; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.param.AbnormalLocDetlParam; |
| | | import com.zy.asrs.entity.result.LocDetlAll; |
| | | import com.zy.asrs.entity.result.LocDetlDTO; |
| | | import com.zy.asrs.mapper.LocDetlMapper; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.LocOwnerService; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private LocDetlMapper locDetlMapper; |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | @Autowired |
| | | private LocOwnerService locOwnerService; |
| | | |
| | | @RequestMapping(value = "/locDetl/update") |
| | | public R update1() { |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping(value = "/locDetl/frozenInventory") |
| | | @ManagerAuth(memo = "库存冻结") |
| | | public R frozen(@RequestBody List<FrozenParam> param){ |
| | | if (param.size() == 0) { |
| | | return R.parse("未收到数据"); |
| | | } |
| | | |
| | | return locDetlService.frozenInventory(param); |
| | | } |
| | | |
| | | @PostMapping(value = "/locDetl/unfreezeInventory") |
| | | @ManagerAuth(memo = "库存解冻") |
| | | public R unfreeze(@RequestBody List<FrozenParam> param){ |
| | | if (param.size() == 0) { |
| | | return R.parse("未收到数据"); |
| | | } |
| | | |
| | | return locDetlService.unfreezeInventory(param); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locDetl/export/auth") |
| | | @ManagerAuth(memo = "库位明细导出") |
| | | public R export(@RequestBody JSONObject param){ |
| | |
| | | return R.ok(exportSupport(result, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locDetl/selectOwner/list/auth") |
| | | @ManagerAuth |
| | | public R selectOwnerlist(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | Integer owner = null; |
| | | if (param.get("owner$") != null && param.get("owner$") != ""){ |
| | | LocOwner locOwner = locOwnerService.selectOne(new EntityWrapper<LocOwner>().like("owner", (String) param.get("owner$"))); |
| | | if(locOwner == null){ |
| | | return R.error("参数有误!"); |
| | | } |
| | | param.remove("owner$"); |
| | | owner = locOwner.getId(); |
| | | } |
| | | |
| | | LocDetlDTO locDetlDTO = new LocDetlDTO(); |
| | | locDetlDTO.setPageSize(limit); |
| | | locDetlDTO.setPageNumber(curr); |
| | | String locNo = String.valueOf(param.get("locNo")); |
| | | String matnr = String.valueOf(param.get("matnr")); |
| | | if (!Cools.isEmpty(locNo) && !locNo.equals("null")) { |
| | | locDetlDTO.setLocNo(locNo); |
| | | } |
| | | if (!Cools.isEmpty(matnr) && !matnr.equals("null")) { |
| | | locDetlDTO.setMatnr(matnr); |
| | | } |
| | | if (!Cools.isEmpty(owner) && !owner.equals("null")) { |
| | | locDetlDTO.setOwner(owner); |
| | | } |
| | | List<LocDetlAll> list = locDetlService.selectAllOwner(locDetlDTO); |
| | | int count = locDetlService.selectAllCount(locDetlDTO); |
| | | Page<LocDetlAll> page = new Page<>(); |
| | | page.setRecords(list); |
| | | page.setTotal(count); |
| | | if (list.size()==0){ |
| | | locDetlDTO.setPageNumber(1); |
| | | list = locDetlService.selectAllOwner(locDetlDTO); |
| | | count = locDetlService.selectAllCount(locDetlDTO); |
| | | page = new Page<>(); |
| | | page.setRecords(list); |
| | | page.setTotal(count); |
| | | } |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locDetlQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |