| | |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.AgvLocDetl; |
| | | import com.zy.asrs.entity.DocType; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.service.AgvLocDetlService; |
| | | import com.zy.asrs.service.DocTypeService; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | private OrderDetlService orderDetlService; |
| | | @Autowired |
| | | private DocTypeService docTypeService; |
| | | @Autowired |
| | | private AgvWrkDetlService agvWrkDetlService; |
| | | @Autowired |
| | | private AgvWrkMastService agvWrkMastService; |
| | | |
| | | @RequestMapping(value = "/locDetl/list/auth") |
| | | @ManagerAuth |
| | |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(AgvLocDetl.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | if (!Cools.isEmpty(orderByField)) { |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | } |
| | | if (!row.equals("")){ |
| | | wrapper.and() |
| | | .where("loc_no like '" +row +"%'"); |
| | |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(AgvLocDetl.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | if (!Cools.isEmpty(orderByField)) { |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | } |
| | | if (!row.equals("")){ |
| | | wrapper.and() |
| | | .where("loc_no like '" +row +"%'"); |
| | | } |
| | | Page<AgvLocDetl> agvLocDetlPage = agvLocDetlService.selectPage(new Page<>(curr, limit), wrapper); |
| | | AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("source_loc_no", param.get("loc_no"))); |
| | | String orderNo = null; |
| | | if (agvWrkMast != null) { |
| | | List<AgvWrkDetl> agvWrkDetls = agvWrkDetlService.selectByWrkNo(agvWrkMast.getWrkNo()); |
| | | if (!agvWrkDetls.isEmpty()) { |
| | | orderNo = agvWrkDetls.get(0).getOrderNo(); |
| | | } |
| | | } |
| | | List<DocType> pakins = docTypeService.selectList(new EntityWrapper<DocType>().eq("pakout", 1)); |
| | | List<Long> docIds = new ArrayList<>(); |
| | | for (DocType pakin : pakins) { |
| | |
| | | } |
| | | } |
| | | for (AgvLocDetl record : agvLocDetlPage.getRecords()) { |
| | | OrderDetl orderDetl = orderDetlService.selectOne(new EntityWrapper<OrderDetl>() |
| | | OrderDetl orderDetl; |
| | | if (!Cools.isEmpty(orderNo)) { |
| | | orderDetl = orderDetlService.selectOne(new EntityWrapper<OrderDetl>() |
| | | .eq("order_no", orderNo) |
| | | .eq("three_code", record.getThreeCode()) |
| | | .eq("matnr", record.getMatnr()) |
| | | .in("source",docIds)); |
| | | } else { |
| | | orderDetl = orderDetlService.selectOne(new EntityWrapper<OrderDetl>() |
| | | .eq("three_code", record.getThreeCode()) |
| | | .eq("matnr", record.getMatnr()) |
| | | .in("source", docIds)); |
| | | } |
| | | // if (orderDetl.getAnfme() - orderDetl.getQty() > 0) { |
| | | // record.setStock(orderDetl.getAnfme() - orderDetl.getQty()); |
| | | // } else { |