| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.mapper.TechnologyMapper; |
| | | import com.yuanchu.mom.pojo.Product; |
| | |
| | | |
| | | //右上角新增-->技术指标 |
| | | @Override |
| | | public void addProduct(Integer technologyId, ProductDto productDto) { |
| | | public String addProduct(ProductDto productDto) { |
| | | Product product = new Product(); |
| | | String required = productDto.getRequired(); |
| | | String internal = productDto.getInternal(); |
| | | if (ObjectUtils.isNotEmpty(required)){ |
| | | char requ = required.charAt(0); |
| | | if (requ != '>' && requ != '<' && requ != '=') { |
| | | return "标准值输入格式有问题!"; |
| | | } |
| | | } |
| | | if (ObjectUtils.isNotEmpty(internal)){ |
| | | char inter = internal.charAt(0); |
| | | if (inter != '>' && inter != '<' && inter != '=') { |
| | | return "内控值输入格式有问题!"; |
| | | } |
| | | } |
| | | BeanUtils.copyProperties(productDto, product); |
| | | product.setTechnologyId(technologyId); |
| | | productMapper.insert(product); |
| | | return "新增成功!"; |
| | | } |
| | | |
| | | //填写标准值与内控值,鼠标移开保存 |