| | |
| | | |
| | | @RequestMapping(value = "/mat/tiaoma/auth") |
| | | @ManagerAuth |
| | | public R findByTiaoMa(@RequestParam("matnr") String matnr, @RequestParam(required = false, value = "orderNo") String orderNo) { |
| | | public synchronized R findByTiaoMa(@RequestParam("matnr") String matnr, @RequestParam(required = false, value = "orderNo") String orderNo) { |
| | | List<CodeDataParam> data = mobileService.getData(TokenUtils.getToken(url), new CodeParam(Arrays.asList(matnr))); |
| | | if (data == null || data.isEmpty()) { |
| | | return R.error("条码不存在"); |
| | |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", codeDataParam.getProductionCode())); |
| | | mat.setMatnr(codeDataParam.getProductionCode()); |
| | | mat.setSafeQty(codeDataParam.getQty()); |
| | | mat.setUnit(codeDataParam.getBatchNum()); |
| | | mat.setUnit(null); |
| | | mat.setMemo(matnr); |
| | | return R.ok(mat); |
| | | } |
| | |
| | | private String department; //部门 |
| | | private String businessType; //业务类型 |
| | | private String user; //制单人 |
| | | private String quality; |
| | | // private String quality; |
| | | |
| | | |
| | | private List<DetlDto> details; //物料列表 |
| | |
| | | if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>(). |
| | | eq("zpallet", param.getBarcode()) |
| | | .eq("io_status", "N") |
| | | .eq("matnr", elem.getMatnr()).eq("batch", elem.getBatch())) > 0) { |
| | | .eq("matnr", elem.getMatnr()).eq("three_code",elem.getThreeCode()).eq("batch", elem.getBatch())) > 0) { |
| | | throw new CoolException(param.getBarcode() + "已有相同数据"); |
| | | } |
| | | |
| | |
| | | |
| | | // DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme(),orderDetl.getManu()); |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme(), elem.getThreeCode() |
| | | , orderDetl.getManu(), orderDetl.getSku(), orderDetl.getSupp(), orderDetl.getTemp1(), orderDetl.getTemp2(), orderDetl.getTemp3(), orderDetl.getTemp4()); |
| | | , orderDetl.getManu(), codeDataParam.getBatchNum(), orderDetl.getSupp(), orderDetl.getTemp1(), orderDetl.getTemp2(), orderDetl.getTemp3(), orderDetl.getTemp4()); |
| | | detlDto.setTemp1(codeDataParam.getQuality()); |
| | | detlDto.setFromOrderNo(codeDataParam.getBarcode()); |
| | | if (DetlDto.has(detlDtos, detlDto)) { |
| | | DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch()); |
| | | DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch(),detlDto.getFromOrderNo()); |
| | | assert one != null; |
| | | one.setAnfme(one.getAnfme() + detlDto.getAnfme()); |
| | | } else { |
| | |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | |
| | | public void callApiLogSaveOrder(Object order, String name, Boolean bool) { |
| | | apiLogService.save(name, "null", null, null, |
| | | JSON.toJSONString(order), |
| | | public void callApiLogSaveOrder(Object order, String name, Boolean bool) { |
| | | apiLogService.save(name, "null", null,null, |
| | | JSON.toJSONString(order), |
| | | null, bool); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void pakinOrderCreate(OpenOrderPakinParam param) { |
| | | callApiLogSaveOrder(param, "入库单", true); |
| | | callApiLogSaveOrder(param,"入库单", true); |
| | | |
| | | Order order = orderService.selectByNo(param.getOrderNo()); |
| | | if (!Cools.isEmpty(order) && order.getSettle() != 1) { |
| | | if (!Cools.isEmpty(order) && order.getSettle() !=1) { |
| | | throw new CoolException(param.getOrderNo() + "单据已有工作任务"); |
| | | } |
| | | if (!Cools.isEmpty(order)) { |
| | |
| | | now, // 修改时间 |
| | | null // 备注 |
| | | ); |
| | | order.setShipCode(param.getQuality()); |
| | | order.setShipCode(String.valueOf(param.getDetails().get(0).getQuality())); |
| | | if (!orderService.insert(order)) { |
| | | throw new CoolException("生成单据主档失败,请联系管理员"); |
| | | } |
| | |
| | | List<DetlDto> list = new ArrayList<>(); |
| | | List<DetlDto> orderDetails = param.getDetails(); |
| | | for (DetlDto detail : orderDetails) { |
| | | DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(), detail.getAnfme(), detail.getFromOrderNo() |
| | | , detail.getMark(), detail.getCustomer(), detail.getSuppName(), detail.getTemp1(), detail.getTemp2(), detail.getTemp3(), detail.getTemp4()); |
| | | DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(), detail.getAnfme(),detail.getFromOrderNo() |
| | | , detail.getMark(),detail.getCustomer(),detail.getSuppName(),detail.getTemp1(),detail.getTemp2(),detail.getTemp3(),detail.getTemp4()); |
| | | if (DetlDto.has(list, dto)) { |
| | | DetlDto detlDto = DetlDto.find(list, dto.getMatnr(), dto.getBatch()); |
| | | assert detlDto != null; |
| | |
| | | @Override |
| | | @Transactional |
| | | public List<OpenOrderCompeteResult> pakinOrderComplete(OpenOrderCompleteParam param) { |
| | | callApiLogSaveOrder(param, "出库单", true); |
| | | callApiLogSaveOrder(param,"出库单", true); |
| | | List<OpenOrderCompeteResult> results = new ArrayList<>(); |
| | | if (!Cools.isEmpty(param) && !Cools.isEmpty(param.getOrderNo())) { |
| | | // 指定订单 |
| | |
| | | @Override |
| | | @Transactional |
| | | public void pakoutOrderCreate(OpenOrderPakoutParam param) { |
| | | callApiLogSaveOrder(param, "出库单", true); |
| | | callApiLogSaveOrder(param,"出库单", true); |
| | | Order order = orderService.selectByNo(param.getOrderNo()); |
| | | // 如果单据不存在则添加;如果单据存在,作业中无法修改,反之则修改单据 |
| | | if (!Cools.isEmpty(order)) { |
| | |
| | | List<DetlDto> list = new ArrayList<>(); |
| | | List<DetlDto> orderDetails = param.getDetails(); |
| | | for (DetlDto detail : orderDetails) { |
| | | DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(), detail.getAnfme(), detail.getFromOrderNo() |
| | | , detail.getMark(), detail.getCustomer(), detail.getSuppName(), detail.getTemp1(), detail.getTemp2(), detail.getTemp3(), detail.getTemp4()); |
| | | DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(), detail.getAnfme(),detail.getFromOrderNo() |
| | | , detail.getMark(),detail.getCustomer(),detail.getSuppName(),detail.getTemp1(),detail.getTemp2(),detail.getTemp3(),detail.getTemp4()); |
| | | dto.setTemp1(param.getQuality()); |
| | | if (DetlDto.has(list, dto)) { |
| | | DetlDto detlDto = DetlDto.find(list, dto.getMatnr(), dto.getBatch()); |
| | |
| | | @Override |
| | | @Transactional |
| | | public void syncMat(MatSyncParam param) { |
| | | if (Cools.isEmpty(param.getMatDetails()) || param.getMatDetails().size() <= 0) { |
| | | if (Cools.isEmpty(param.getMatDetails()) || param.getMatDetails().size() <=0 ) { |
| | | throw new CoolException("商品数据为空"); |
| | | } |
| | | |
| | | |
| | | for (MatSyncParam.MatParam matParam : param.getMatDetails()) { |
| | | if (Cools.isEmpty(matParam.getMatnr())) { |
| | | |
| | | |
| | | |
| | | for(MatSyncParam.MatParam matParam : param.getMatDetails()){ |
| | | if(Cools.isEmpty(matParam.getMatnr())){ |
| | | throw new CoolException("商品编码不能为空"); |
| | | } |
| | | |
| | |
| | | } else { |
| | | mat.sync(matParam); |
| | | mat.setTagId(tagId); |
| | | if (!matService.update(mat, new EntityWrapper<Mat>().eq("matnr", matParam.getMatnr()))) { |
| | | if (!matService.update(mat, new EntityWrapper<Mat>().eq("matnr",matParam.getMatnr()))) { |
| | | throw new CoolException("更新已存在商品信息失败,请联系管理员"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //Tag tag = tagService.selectOne(new EntityWrapper<Tag>().eq("memo", matParam.getTagId())); |
| | |
| | | public List<LocDetlByTimeDTO> selectTimeLocDetl(TimeSelectParam param) { |
| | | ArrayList<LocDetlByTimeDTO> locDetlByTimeDTOS = new ArrayList<>(); |
| | | EntityWrapper<WrkMastLog> wrkMastLogEntityWrapper = new EntityWrapper<>(); |
| | | wrkMastLogEntityWrapper.ge("modi_time", param.getStartTime()); |
| | | wrkMastLogEntityWrapper.le("modi_time", param.getEndTime()); |
| | | wrkMastLogEntityWrapper.ge("modi_time",param.getStartTime()); |
| | | wrkMastLogEntityWrapper.le("modi_time",param.getEndTime()); |
| | | // wrkMastLogEntityWrapper.isNotNull("sheet_no"); |
| | | wrkMastLogService.selectList(wrkMastLogEntityWrapper).forEach(wrkMastLog -> { |
| | | if (wrkMastLog.getWrkSts() == 5 || wrkMastLog.getWrkSts() == 15) { |
| | |
| | | wrkDetlLogs.forEach(wrkDetlLog -> { |
| | | if (wrkDetlLog.getOrderNo() != null && !wrkDetlLog.getOrderNo().isEmpty()) { |
| | | LocDetlByTimeDTO locDetlByTimeDTO = new LocDetlByTimeDTO(); |
| | | if (!Cools.isEmpty(wrkDetlLog.getOrderNo())) { |
| | | if (!Cools.isEmpty(wrkDetlLog.getOrderNo())){ |
| | | Order order = orderService.selectByNo(wrkDetlLog.getOrderNo()); |
| | | if (!Cools.isEmpty(order)) { |
| | | locDetlByTimeDTO.setDate(order.getOrderTime()); |
| | |
| | | locDetlByTimeDTO.setOrderType(order.getDocType$()); |
| | | } |
| | | locDetlByTimeDTO.setMatnr(wrkDetlLog.getMatnr()); |
| | | locDetlByTimeDTO.setLocNo(wrkMastLog.getIoType() < 100 ? wrkMastLog.getLocNo() : wrkMastLog.getSourceLocNo()); |
| | | locDetlByTimeDTO.setLocNo(wrkMastLog.getIoType() <100? wrkMastLog.getLocNo(): wrkMastLog.getSourceLocNo()); |
| | | locDetlByTimeDTO.setBatch(wrkDetlLog.getBatch()); |
| | | locDetlByTimeDTO.setAnfme(wrkDetlLog.getAnfme()); |
| | | locDetlByTimeDTO.setOrderNo(wrkDetlLog.getOrderNo()); |
| | |
| | | @Transactional |
| | | public void syncTag(List<TagParam> param) { |
| | | |
| | | param.forEach(tag -> { |
| | | param.forEach(tag-> { |
| | | // 分类 |
| | | Long tagId; |
| | | Date now = new Date(); |
| | | if (Cools.isEmpty(tag.getParentItemClassId())) { |
| | | if (Cools.isEmpty(tag.getParentItemClassId())){ |
| | | Tag priTag = tagService.selectByName("全部", 1); |
| | | |
| | | // 二级分类 |
| | |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } |
| | | } |
| | | } else { |
| | | Tag priTag = tagService.selectOne(new EntityWrapper<Tag>().eq("memo", tag.getParentItemClassId())); |
| | | }else { |
| | | Tag priTag =tagService.selectOne(new EntityWrapper<Tag>().eq("memo", tag.getParentItemClassId())); |
| | | if (priTag == null) { |
| | | Tag top = tagService.getTop(); |
| | | NodeUtils nodeUtils = new NodeUtils(); |
| | |
| | | if (tagMapper.insert(secTag) == 0) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } |
| | | } else { |
| | | }else { |
| | | secTag.setName(tag.getName()); |
| | | secTag.setParentId(priTag.getId()); |
| | | secTag.setParentName(priTag.getName()); |
| | |
| | | List<Tag> tags = tagService.selectList(new EntityWrapper<Tag>().eq("parent_id", secTag.getId())); |
| | | if (!Cools.isEmpty(tags)) { |
| | | for (Tag tag1 : tags) { |
| | | tag1.setPath(nodeUtils.path.toString() + "," + secTag.getId()); |
| | | tag1.setPathName(nodeUtils.pathName.toString() + "," + secTag.getName()); |
| | | tag1.setPath(nodeUtils.path.toString()+","+secTag.getId()); |
| | | tag1.setPathName(nodeUtils.pathName.toString()+","+secTag.getName()); |
| | | if (tagMapper.updateById(tag1) == 0) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Transactional |
| | | @Override |
| | | public void orderDelete(String orderNo) { |
| | |
| | | if (order == null) { |
| | | throw new CoolException("未查询到对应订单信息"); |
| | | } |
| | | if (order.getSettle() != 1) { |
| | | if (order.getSettle() != 1){ |
| | | throw new CoolException("该订单已有对应任务,禁止删除"); |
| | | } |
| | | List<OrderDetl> OrderDetl = orderDetlService.selectList(new EntityWrapper<OrderDetl>().eq("order_no", orderNo)); |
| | |
| | | MesPakinParam.Detl detl = new MesPakinParam.Detl(); |
| | | detl.setQty(orderDetl.getAnfme()); |
| | | detl.setBarcode(orderDetl.getThreeCode()); |
| | | detl.setPalletBarcode(orderDetl.getBarcode()); |
| | | detl.setPalletBarcode(orderDetl.getZpallet()); |
| | | detl.setProductionCode(orderDetl.getMatnr()); |
| | | pakinParam.getBarcodeList().add(detl); |
| | | } |
| | |
| | | private String temp4 = ""; |
| | | private Double actulQty; |
| | | private Integer danger; |
| | | private Integer quality; |
| | | |
| | | public DetlDto() { |
| | | } |
| | |
| | | |
| | | public static boolean has(List<DetlDto> detlDtos, DetlDto detlDto) { |
| | | for (DetlDto dto : detlDtos) { |
| | | if (dto.getMatnr().equals(detlDto.getMatnr()) && Cools.eq(dto.getBatch(), detlDto.getBatch())) { |
| | | if (dto.getMatnr().equals(detlDto.getMatnr()) && Cools.eq(dto.getBatch(), detlDto.getBatch()) && dto.getFromOrderNo().equals(detlDto.getFromOrderNo())) { |
| | | return true; |
| | | } |
| | | } |
| | |
| | | } |
| | | return null; |
| | | } |
| | | public static DetlDto find(List<DetlDto> detlDtos, String matnr, String batch,String threeCode) { |
| | | if (Cools.isEmpty(matnr)) { |
| | | return null; |
| | | } |
| | | if (Cools.isEmpty(threeCode)){ |
| | | return null; |
| | | } |
| | | for (DetlDto detlDto : detlDtos) { |
| | | if (matnr.equals(detlDto.getMatnr()) && Cools.eq(batch, detlDto.getBatch()) && threeCode.equals(detlDto.getFromOrderNo())) { |
| | | return detlDto; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | </if> |
| | | |
| | | order by |
| | | a.anfme asc,DATEPART(yyyy,a.modi_time),DATEPART(mm,a.modi_time),DATEPART(dd,a.modi_time) |
| | | desc, |
| | | sku, |
| | | <!-- a.anfme asc,DATEPART(yyyy,a.modi_time),DATEPART(mm,a.modi_time),DATEPART(dd,a.modi_time) |
| | | desc,--> |
| | | NEWID(), |
| | | case |
| | | when (left(a.loc_no, 2) = '01') then 0 |
| | |
| | | </if> |
| | | |
| | | order by |
| | | DATEPART(yyyy,a.modi_time),DATEPART(mm,a.modi_time),DATEPART(dd,a.modi_time), a.anfme |
| | | desc, |
| | | NEWID(), |
| | | case |
| | | when (left(a.loc_no, 2) = '01') then 0 |
| | | when (left(a.loc_no, 2) = '02') then 1 |
| | | when (left(a.loc_no, 2) = '03') then 1 |
| | | when (left(a.loc_no, 2) = '04') then 0 |
| | | when (left(a.loc_no, 2) = '05') then 0 |
| | | when (left(a.loc_no, 2) = '06') then 1 |
| | | when (left(a.loc_no, 2) = '07') then 1 |
| | | when (left(a.loc_no, 2) = '08') then 0 |
| | | when (left(a.loc_no, 2) = '09') then 0 |
| | | when (left(a.loc_no, 2) = '10') then 1 |
| | | when (left(a.loc_no, 2) = '11') then 1 |
| | | when (left(a.loc_no, 2) = '12') then 0 |
| | | when (left(a.loc_no, 2) = '13') then 0 |
| | | when (left(a.loc_no, 2) = '14') then 1 |
| | | when (left(a.loc_no, 2) = '15') then 1 |
| | | when (left(a.loc_no, 2) = '16') then 0 |
| | | when (left(a.loc_no, 2) = '17') then 0 |
| | | when (left(a.loc_no, 2) = '18') then 1 |
| | | when (left(a.loc_no, 2) = '19') then 1 |
| | | when (left(a.loc_no, 2) = '20') then 0 |
| | | when (left(a.loc_no, 2) = '21') then 0 |
| | | when (left(a.loc_no, 2) = '22') then 1 |
| | | when (left(a.loc_no, 2) = '23') then 1 |
| | | when (left(a.loc_no, 2) = '24') then 0 |
| | | when (left(a.loc_no, 2) = '25') then 0 |
| | | when (left(a.loc_no, 2) = '26') then 1 |
| | | when (left(a.loc_no, 2) = '27') then 1 |
| | | when (left(a.loc_no, 2) = '28') then 0 |
| | | when (left(a.loc_no, 2) = '29') then 0 |
| | | when (left(a.loc_no, 2) = '30') then 1 |
| | | when (left(a.loc_no, 2) = '31') then 1 |
| | | when (left(a.loc_no, 2) = '32') then 0 |
| | | when (left(a.loc_no, 2) = '33') then 0 |
| | | when (left(a.loc_no, 2) = '34') then 1 |
| | | when (left(a.loc_no, 2) = '35') then 1 |
| | | when (left(a.loc_no, 2) = '36') then 0 |
| | | when (left(a.loc_no, 2) = '37') then 0 |
| | | when (left(a.loc_no, 2) = '38') then 1 |
| | | when (left(a.loc_no, 2) = '39') then 1 |
| | | when (left(a.loc_no, 2) = '40') then 0 |
| | | when (left(a.loc_no, 2) = '41') then 0 |
| | | when (left(a.loc_no, 2) = '42') then 1 |
| | | when (left(a.loc_no, 2) = '43') then 1 |
| | | when (left(a.loc_no, 2) = '44') then 0 |
| | | when (left(a.loc_no, 2) = '45') then 0 |
| | | when (left(a.loc_no, 2) = '46') then 1 |
| | | when (left(a.loc_no, 2) = '47') then 1 |
| | | when (left(a.loc_no, 2) = '48') then 0 |
| | | else 0 |
| | | end |
| | | desc |
| | | </select> |
| | | sku, |
| | | <!-- DATEPART(yyyy,a.modi_time),DATEPART(mm,a.modi_time),DATEPART(dd,a.modi_time), a.anfme |
| | | desc, --> |
| | | NEWID(), |
| | | case |
| | | when (left(a.loc_no, 2) = '01') then 0 |
| | | when (left(a.loc_no, 2) = '02') then 1 |
| | | when (left(a.loc_no, 2) = '03') then 1 |
| | | when (left(a.loc_no, 2) = '04') then 0 |
| | | when (left(a.loc_no, 2) = '05') then 0 |
| | | when (left(a.loc_no, 2) = '06') then 1 |
| | | when (left(a.loc_no, 2) = '07') then 1 |
| | | when (left(a.loc_no, 2) = '08') then 0 |
| | | when (left(a.loc_no, 2) = '09') then 0 |
| | | when (left(a.loc_no, 2) = '10') then 1 |
| | | when (left(a.loc_no, 2) = '11') then 1 |
| | | when (left(a.loc_no, 2) = '12') then 0 |
| | | when (left(a.loc_no, 2) = '13') then 0 |
| | | when (left(a.loc_no, 2) = '14') then 1 |
| | | when (left(a.loc_no, 2) = '15') then 1 |
| | | when (left(a.loc_no, 2) = '16') then 0 |
| | | when (left(a.loc_no, 2) = '17') then 0 |
| | | when (left(a.loc_no, 2) = '18') then 1 |
| | | when (left(a.loc_no, 2) = '19') then 1 |
| | | when (left(a.loc_no, 2) = '20') then 0 |
| | | when (left(a.loc_no, 2) = '21') then 0 |
| | | when (left(a.loc_no, 2) = '22') then 1 |
| | | when (left(a.loc_no, 2) = '23') then 1 |
| | | when (left(a.loc_no, 2) = '24') then 0 |
| | | when (left(a.loc_no, 2) = '25') then 0 |
| | | when (left(a.loc_no, 2) = '26') then 1 |
| | | when (left(a.loc_no, 2) = '27') then 1 |
| | | when (left(a.loc_no, 2) = '28') then 0 |
| | | when (left(a.loc_no, 2) = '29') then 0 |
| | | when (left(a.loc_no, 2) = '30') then 1 |
| | | when (left(a.loc_no, 2) = '31') then 1 |
| | | when (left(a.loc_no, 2) = '32') then 0 |
| | | when (left(a.loc_no, 2) = '33') then 0 |
| | | when (left(a.loc_no, 2) = '34') then 1 |
| | | when (left(a.loc_no, 2) = '35') then 1 |
| | | when (left(a.loc_no, 2) = '36') then 0 |
| | | when (left(a.loc_no, 2) = '37') then 0 |
| | | when (left(a.loc_no, 2) = '38') then 1 |
| | | when (left(a.loc_no, 2) = '39') then 1 |
| | | when (left(a.loc_no, 2) = '40') then 0 |
| | | when (left(a.loc_no, 2) = '41') then 0 |
| | | when (left(a.loc_no, 2) = '42') then 1 |
| | | when (left(a.loc_no, 2) = '43') then 1 |
| | | when (left(a.loc_no, 2) = '44') then 0 |
| | | when (left(a.loc_no, 2) = '45') then 0 |
| | | when (left(a.loc_no, 2) = '46') then 1 |
| | | when (left(a.loc_no, 2) = '47') then 1 |
| | | when (left(a.loc_no, 2) = '48') then 0 |
| | | else 0 |
| | | end |
| | | desc |
| | | </select> |
| | | |
| | | <select id="queryStockFour" resultMap="BaseResultMap"> |
| | | select a.* |
| | | from asr_loc_detl a |
| | | left join asr_loc_mast b on a.loc_no = b.loc_no |
| | | where 1=1 |
| | | and b.loc_sts = 'F' |
| | | and a.matnr = #{matnr} |
| | | and b.crn_no in (7) |
| | | <!-- <choose>--> |
| | | <select id="queryStockFour" resultMap="BaseResultMap"> |
| | | select a.* |
| | | from asr_loc_detl a |
| | | left join asr_loc_mast b on a.loc_no = b.loc_no |
| | | where 1=1 |
| | | and b.loc_sts = 'F' |
| | | and a.matnr = #{matnr} |
| | | and b.crn_no in (7) |
| | | <!-- <choose>--> |
| | | <!-- <when test="batch != null and batch != ''">--> |
| | | <!-- and a.batch = #{batch}--> |
| | | <!-- </when>--> |
| | |
| | | </if> |
| | | |
| | | order by |
| | | DATEPART(yyyy,a.modi_time),DATEPART(mm,a.modi_time),DATEPART(dd,a.modi_time), a.anfme |
| | | desc, |
| | | sku, |
| | | <!-- DATEPART(yyyy,a.modi_time),DATEPART(mm,a.modi_time),DATEPART(dd,a.modi_time), a.anfme |
| | | desc, --> |
| | | NEWID(), |
| | | case |
| | | when (left(a.loc_no, 2) = '01') then 0 |