| | |
| | | |
| | | @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.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 { |
| | |
| | | now, // 修改时间 |
| | | null // 备注 |
| | | ); |
| | | order.setShipCode(param.getQuality()); |
| | | order.setShipCode(String.valueOf(param.getDetails().get(0).getQuality())); |
| | | if (!orderService.insert(order)) { |
| | | throw new CoolException("生成单据主档失败,请联系管理员"); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | for (MatSyncParam.MatParam matParam : param.getMatDetails()) { |
| | | if (Cools.isEmpty(matParam.getMatnr())) { |
| | | throw new CoolException("商品编码不能为空"); |
| | |
| | | throw new CoolException("更新已存在商品信息失败,请联系管理员"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //Tag tag = tagService.selectOne(new EntityWrapper<Tag>().eq("memo", matParam.getTagId())); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Transactional |
| | | @Override |
| | | public void orderDelete(String orderNo) { |
| | |
| | | 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; |
| | | } |
| | | |
| | | } |