| | |
| | | } finally { |
| | | try { |
| | | // ä¿åæ¥å£æ¥å¿ |
| | | // apiLogService.save( |
| | | // "æå
ä¸çº¿å¸®æä¸æ¥", |
| | | // MesConstant.URL + MesConstant.PACK_DOWN_URL, |
| | | // null, |
| | | // "127.0.0.1", |
| | | // JSON.toJSONString(mesCombParam), |
| | | // response, |
| | | // success |
| | | // ); |
| | | apiLogService.save( |
| | | "æå
ä¸çº¿å¸®æä¸æ¥", |
| | | MesConstant.URL + MesConstant.PACK_DOWN_URL, |
| | | null, |
| | | "127.0.0.1", |
| | | JSON.toJSONString(mesCombParam), |
| | | response, |
| | | success |
| | | ); |
| | | } catch (Exception e) { log.error("", e); } |
| | | } |
| | | |
| | |
| | | import com.zy.asrs.entity.result.OpenOrderCompeteResult; |
| | | import com.zy.asrs.entity.result.StockVo; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.MatUtils; |
| | | import com.zy.common.model.DetlDto; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | throw new CoolException(barcode + "éå¤æäº¤"); |
| | | } |
| | | Date now = new Date(); |
| | | // todo:luxiaotao è§£ææ¡ç è§åï¼è·åç©æä»£ç |
| | | pack = new Pack( |
| | | barcode, // æ¡ç [é空] |
| | | null, // ååç¼å· |
| | |
| | | if (!packService.insert(pack)) { |
| | | throw new CoolException("æå¡å¨å
é¨é误ï¼è¯·è系管çå"); |
| | | } |
| | | Mat mat = new Mat(); |
| | | mat.setTagId(tagService.getTop().getId()); |
| | | mat.setMatnr(barcode); |
| | | mat.setMaktx(barcode); |
| | | mat.setStatus(1); |
| | | mat.setCreateTime(now); |
| | | mat.setUpdateTime(now); |
| | | mat.setMemo("æå
ä¸çº¿"); |
| | | if (!matService.insert(mat)) { |
| | | throw new CoolException("æå¡å¨å
é¨é误ï¼è¯·è系管çå"); |
| | | |
| | | Mat analyse = MatUtils.analyseMat(barcode); |
| | | Mat mat = matService.selectByMatnr(analyse.getMatnr()); |
| | | if (mat == null) { |
| | | mat = new Mat(); |
| | | // todo |
| | | mat.setTagId(tagService.getTop().getId()); |
| | | mat.setMatnr(analyse.getMatnr()); |
| | | mat.setMaktx(barcode); |
| | | mat.setStatus(1); |
| | | mat.setCreateTime(now); |
| | | mat.setUpdateTime(now); |
| | | mat.setMemo("æå
ä¸çº¿"); |
| | | if (!matService.insert(mat)) { |
| | | throw new CoolException("æå¡å¨å
é¨é误ï¼è¯·è系管çå"); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } finally { |
| | | try { |
| | | // ä¿åæ¥å£æ¥å¿ |
| | | // apiLogService.save( |
| | | // "æååºå
¥åºä¸æ¥", |
| | | // MesConstant.URL + MesConstant.PAKIN_URL, |
| | | // null, |
| | | // "127.0.0.1", |
| | | // JSON.toJSONString(pakinParam), |
| | | // response, |
| | | // success |
| | | // ); |
| | | apiLogService.save( |
| | | "æååºå
¥åºä¸æ¥", |
| | | MesConstant.URL + MesConstant.PAKIN_URL, |
| | | null, |
| | | "127.0.0.1", |
| | | JSON.toJSONString(pakinParam), |
| | | response, |
| | | success |
| | | ); |
| | | } catch (Exception e) { log.error("", e); } |
| | | } |
| | | return SUCCESS; |
New file |
| | |
| | | package com.zy.asrs.utils; |
| | | |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.Mat; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * Created by vincent on 2022/4/23 |
| | | */ |
| | | @Slf4j |
| | | public class MatUtils { |
| | | |
| | | // |
| | | public static Mat analyseMat(String uuid) { |
| | | try { |
| | | String[] split = uuid.split("-"); |
| | | String matnr = split[0] + "-" + split[1]; |
| | | String serial = split[2]; |
| | | Mat mat = new Mat(); |
| | | mat.setMatnr(matnr); |
| | | mat.setBarcode(serial); |
| | | mat.setModel(split[0]); |
| | | return mat; |
| | | } catch (Exception e) { |
| | | log.error("", e); |
| | | throw new CoolException(uuid + "æ¡ç æå
ä¸çº¿é误"); |
| | | } |
| | | } |
| | | |
| | | } |