| | |
| | | |
| | | //右上角新增-->生产工艺 |
| | | @Override |
| | | public void addTechnique(Integer technologyId, TechniqueDto techniqueDto) { |
| | | public void addTechnique(TechniqueDto techniqueDto) { |
| | | Technique technique = new Technique(); |
| | | BeanUtils.copyProperties(techniqueDto, technique); |
| | | technique.setTechnologyId(technologyId); |
| | | techniqueMapper.insert(technique); |
| | | } |
| | | |
| | | //添加同一个型号生产工艺的版本 |
| | | @Override |
| | | public Integer addVersion(Integer specificationsId,Integer version) { |
| | | List<Technique> techniqueList = techniqueMapper.selAllBySpeId(specificationsId,version); |
| | | for (Technique technique : techniqueList) { |
| | | technique.setId(null); |
| | | //最新版本+1 |
| | | technique.setVersion(techniqueMapper.selectVerByTeq(specificationsId).get(0)+1); |
| | | } |
| | | saveBatch(techniqueList); |
| | | return techniqueList.get(0).getVersion(); |
| | | } |
| | | |
| | | //删除 |
| | |
| | | public void delAllTeq(String ids) { |
| | | techniqueMapper.delAllTeq(ids); |
| | | } |
| | | |
| | | //根据id查看详情 |
| | | @Override |
| | | public List<Map<String, Object>> selTeqById(Integer id) { |
| | | return techniqueMapper.selTeqById((id)); |
| | | } |
| | | |
| | | //编辑 |
| | | @Override |
| | | public String wriTeqById(Integer id, String product, String productFather, String unit) { |
| | | Technique technique = new Technique(); |
| | | technique.setId(id); |
| | | technique.setProduct(product); |
| | | technique.setProductFather(productFather); |
| | | technique.setUnit(unit); |
| | | techniqueMapper.updateById(technique); |
| | | return "修改成功!"; |
| | | } |
| | | } |
| | | |