lxw
2022-08-03 6ff5bc37802033b8ed9fdd5eda09852bd9563064
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package com.whyc.service;
 
import com.whyc.dto.Response;
import com.whyc.mapper.ComponentProductMapper;
import com.whyc.pojo.ComponentProduct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
@Service
public class ComponentProductService {
    @Autowired(required = false)
    private ComponentProductMapper mapper;
    //增加散装件和产品之间替换关系
    public Response addCompentConnectBom(int componentId, String parentModel, String subName) {
        ComponentProduct comProduct=new ComponentProduct();
        comProduct.setComponentId(componentId);
        comProduct.setParentModel(parentModel);
        comProduct.setSubName(subName);
        int bl=mapper.insert(comProduct);
        return new Response().setII(1,true,bl,bl>0?"添加关联成功":"添加关联失败");
    }
}