zss
2023-09-21 2dbc49184bd74845c8da694c20d6fd03d7ac87e0
base-server/src/main/java/com/yuanchu/mom/service/impl/TechnicalModelServiceImpl.java
@@ -2,11 +2,13 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.mom.mapper.TechnicalModelMapper;
import com.yuanchu.mom.mapper.TechniqueModelMapper;
import com.yuanchu.mom.pojo.TechnicalModel;
import com.yuanchu.mom.pojo.dto.TechnicalModelDto;
import com.yuanchu.mom.service.TechnicalModelService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
@@ -24,9 +26,10 @@
    @Resource
    TechnicalModelMapper technicalModelMapper;
    //查询技术指标维护列表-->左边二级展示工序和工艺
    @Override
    public List<Map<String, Object>> selectAllTechTem(Integer type, String message) {
    public List<Map<String, Object>> selectAllTechTem(String type, String message) {
        return technicalModelMapper.selectAllTechTem(type, message);
    }
@@ -38,7 +41,7 @@
    //新增技术指标维护-->选择工序和工艺
    @Override
    public List<Map<String, Object>> chooseTechFath(Integer type) {
    public List<Map<String, Object>> chooseTechFath(String type) {
        return technicalModelMapper.chooseTechFath(type);
    }
@@ -51,10 +54,13 @@
    //新增技术指标维护
    @Override
    public void addTechMode(Integer id, TechnicalModelDto technicalModelDto) {
        TechnicalModel technicalModel = new TechnicalModel();
        BeanUtils.copyProperties(technicalModelDto, technicalModel);
        technicalModel.setTechTemId(id);
    public void addTechMode(TechnicalModelDto technicalModelDto) {
        TechnicalModel technicalModel = TechnicalModel.builder()
                .techTemId(technicalModelDto.getTechTemId())
                .father(technicalModelDto.getFather())
                .name(technicalModelDto.getName())
                .unit(technicalModelDto.getUnit())
                .build();
        technicalModelMapper.insert(technicalModel);
    }
@@ -66,7 +72,7 @@
    //编辑
    @Override
    public void writeTechById(Integer id, TechnicalModelDto technicalModelDto) {
    public void writeTechById(Integer id,TechnicalModelDto technicalModelDto) {
        TechnicalModel technicalModel = new TechnicalModel();
        BeanUtils.copyProperties(technicalModelDto, technicalModel);
        technicalModel.setId(id);
@@ -75,7 +81,9 @@
    //删除
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void delTechById(Integer id) {
        //删除技术指标
        TechnicalModel technicalModel = new TechnicalModel();
        technicalModel.setState(0);
        technicalModel.setId(id);
@@ -84,6 +92,7 @@
    //批量删除
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void delAllTech(String ids) {
        technicalModelMapper.delAllTech(ids);
    }