| | |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | @Autowired |
| | | private InOutService inOutService; |
| | | @Autowired |
| | | private MatBarcodeService matBarcodeService; |
| | | |
| | | @RequestMapping(value = "/mat/auto/matnr/auth") |
| | |
| | | if (!matService.insert(mat)) { |
| | | throw new CoolException("商品档案添加失败,请联系管理员"); |
| | | } |
| | | if (!inOutService.insert(inOut)){ |
| | | throw new CoolException("商品信息添加失败,请联系管理员"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | if (Cools.isEmpty(mat) || null==mat.getId()){ |
| | | return R.error(); |
| | | } |
| | | if (mat.getColor().equals("正常")){ |
| | | mat.setColor("报废"); |
| | | }else if (mat.getColor().equals("报废")){ |
| | | mat.setColor("正常"); |
| | | } |
| | | InOut inOut = inOutService.selectByMatnr(mat.getMatnr()); |
| | | inOut.setMatnr(mat.getMatnr()); |
| | | inOut.setMaktx(mat.getMaktx()); |
| | | inOut.setColor(mat.getColor()); |
| | | inOut.setSpecs(mat.getSpecs()); |
| | | mat.setUpdateBy(getUserId()); |
| | | mat.setUpdateTime(new Date()); |
| | | matService.updateById(mat); |
| | | inOutService.updateById(inOut); |
| | | return R.ok(); |
| | | } |
| | | |