package com.jcdm.main.bs.technologyRoute.service.impl; import java.util.List; import com.jcdm.common.utils.DateUtils; import com.jcdm.main.bs.domain.BsTechnologyRouteChildInfo; import com.jcdm.main.bs.technologyRoute.domain.BsTechnologyRouteInfo; import com.jcdm.main.bs.technologyRoute.mapper.BsTechnologyRouteInfoMapper; import com.jcdm.main.bs.technologyRoute.service.IBsTechnologyRouteInfoService; import com.jcdm.main.bs.technologyRouteChild.mapper.BsTechnologyRouteChildInfoMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.jcdm.main.bs.domain.BsTechnologyRouteChildInfo; import static org.apache.commons.lang3.SystemUtils.getUserName; /** * 工艺流程Service业务层处理 * * @author ruimin * @date 2023-12-09 */ @Service public class BsTechnologyRouteInfoServiceImpl implements IBsTechnologyRouteInfoService { @Autowired private BsTechnologyRouteInfoMapper bsTechnologyRouteInfoMapper; @Autowired private BsTechnologyRouteChildInfoMapper bsTechnologyRouteChildInfoMapper; /** * 查询工艺流程 * * @param id 工艺流程主键 * @return 工艺流程 */ @Override public BsTechnologyRouteInfo selectBsTechnologyRouteInfoById(Long id) { return bsTechnologyRouteInfoMapper.selectBsTechnologyRouteInfoById(id); } /** * 查询工艺流程列表 * * @param bsTechnologyRouteInfo 工艺流程 * @return 工艺流程 */ @Override public List selectBsTechnologyRouteInfoList(BsTechnologyRouteInfo bsTechnologyRouteInfo) { return bsTechnologyRouteInfoMapper.selectBsTechnologyRouteInfoList(bsTechnologyRouteInfo); } /** * 新增工艺流程 * * @param bsTechnologyRouteInfo 工艺流程 * @return 结果 */ @Override public int insertBsTechnologyRouteInfo(BsTechnologyRouteInfo bsTechnologyRouteInfo) { bsTechnologyRouteInfo.setCreateTime(DateUtils.getNowDate()); bsTechnologyRouteInfo.setCreateUser(getUserName()); return bsTechnologyRouteInfoMapper.insertBsTechnologyRouteInfo(bsTechnologyRouteInfo); } /** * 修改工艺流程 * * @param bsTechnologyRouteInfo 工艺流程 * @return 结果 */ @Override public int updateBsTechnologyRouteInfo(BsTechnologyRouteInfo bsTechnologyRouteInfo) { bsTechnologyRouteInfo.setUpdateTime(DateUtils.getNowDate()); bsTechnologyRouteInfo.setUpdateUser(getUserName()); return bsTechnologyRouteInfoMapper.updateBsTechnologyRouteInfo(bsTechnologyRouteInfo); } /** * 批量删除工艺流程 * * @param ids 需要删除的工艺流程主键 * @return 结果 */ @Override public int deleteBsTechnologyRouteInfoByIds(Long[] ids) { return bsTechnologyRouteInfoMapper.deleteBsTechnologyRouteInfoByIds(ids); } /** * 删除工艺流程信息 * * @param id 工艺流程主键 * @return 结果 */ @Override public int deleteBsTechnologyRouteInfoById(Long id) { return bsTechnologyRouteInfoMapper.deleteBsTechnologyRouteInfoById(id); } @Override public int updateBsTechnologyRouteAndChildInfo(BsTechnologyRouteInfo bsTechnologyRouteInfo) { int i = this.updateBsTechnologyRouteInfo(bsTechnologyRouteInfo); com.jcdm.main.bs.domain.BsTechnologyRouteChildInfo bsTechnologyRouteChildInfo = new com.jcdm.main.bs.domain.BsTechnologyRouteChildInfo(); bsTechnologyRouteChildInfo.setId(bsTechnologyRouteInfo.getId()); List bsTechnologyRouteChildInfos = bsTechnologyRouteChildInfoMapper.selectBsTechnologyRouteChildInfoList(bsTechnologyRouteChildInfo); for (com.jcdm.main.bs.domain.BsTechnologyRouteChildInfo technologyRouteChildInfo : bsTechnologyRouteChildInfos) { technologyRouteChildInfo.setRouteCode(bsTechnologyRouteInfo.getRouteCode()); int i1 = bsTechnologyRouteChildInfoMapper.updateBsTechnologyRouteChildByCodeInfo(technologyRouteChildInfo); } return i; } }