package com.aps.core.service.impl;
|
|
import java.util.List;
|
|
import com.aps.common.core.utils.uuid.IdUtils;
|
import com.aps.core.domain.ApsGasPipingPlanTemp;
|
import com.aps.core.domain.ApsPartPlan;
|
import com.aps.core.domain.ApsPartPlanTemp;
|
import com.aps.core.mapper.ApsGasPipingPlanTempMapper;
|
import com.aps.core.mapper.ApsPartPlanMapper;
|
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
import com.aps.core.mapper.ApsGasPipingPlanMapper;
|
import com.aps.core.domain.ApsGasPipingPlan;
|
import com.aps.core.service.IApsGasPipingPlanService;
|
|
/**
|
* 气体管路计划管理Service业务层处理
|
*
|
* @author wwj
|
* @date 2025-04-09
|
*/
|
@Service
|
public class ApsGasPipingPlanServiceImpl implements IApsGasPipingPlanService
|
{
|
@Autowired
|
private ApsGasPipingPlanMapper apsGasPipingPlanMapper;
|
@Autowired
|
private ApsGasPipingPlanTempMapper apsGasPipingPlanTempMapper;
|
|
/**
|
* 查询气体管路计划管理
|
*
|
* @param id 气体管路计划管理主键
|
* @return 气体管路计划管理
|
*/
|
@Override
|
public ApsGasPipingPlan selectApsGasPipingPlanById(String id)
|
{
|
return apsGasPipingPlanMapper.selectApsGasPipingPlanById(id);
|
}
|
|
/**
|
* 查询气体管路计划管理列表
|
*
|
* @param apsGasPipingPlan 气体管路计划管理
|
* @return 气体管路计划管理
|
*/
|
@Override
|
public List<ApsGasPipingPlan> selectApsGasPipingPlanList(ApsGasPipingPlan apsGasPipingPlan)
|
{
|
return apsGasPipingPlanMapper.selectApsGasPipingPlanList(apsGasPipingPlan);
|
}
|
|
/**
|
* 新增气体管路计划管理
|
*
|
* @param apsGasPipingPlan 气体管路计划管理
|
* @return 结果
|
*/
|
@Override
|
public int insertApsGasPipingPlan(ApsGasPipingPlan apsGasPipingPlan)
|
{
|
apsGasPipingPlan.setId(IdUtils.fastUUID());
|
return apsGasPipingPlanMapper.insertApsGasPipingPlan(apsGasPipingPlan);
|
}
|
|
/**
|
* 修改气体管路计划管理
|
*
|
* @param apsGasPipingPlan 气体管路计划管理
|
* @return 结果
|
*/
|
@Override
|
public int updateApsGasPipingPlan(ApsGasPipingPlan apsGasPipingPlan)
|
{
|
return apsGasPipingPlanMapper.updateApsGasPipingPlan(apsGasPipingPlan);
|
}
|
|
/**
|
* 批量删除气体管路计划管理
|
*
|
* @param ids 需要删除的气体管路计划管理主键
|
* @return 结果
|
*/
|
@Override
|
public int deleteApsGasPipingPlanByIds(String[] ids)
|
{
|
return apsGasPipingPlanMapper.deleteApsGasPipingPlanByIds(ids);
|
}
|
|
/**
|
* 删除气体管路计划管理信息
|
*
|
* @param id 气体管路计划管理主键
|
* @return 结果
|
*/
|
@Override
|
public int deleteApsGasPipingPlanById(String id)
|
{
|
return apsGasPipingPlanMapper.deleteApsGasPipingPlanById(id);
|
}
|
|
@Override
|
public int confirmGasPiping(ApsGasPipingPlanTemp apsGasPipingPlanTemp) {
|
//查询临时表数据
|
List<ApsGasPipingPlanTemp> apsGasPipingPlanTemps=apsGasPipingPlanTempMapper.selectApsGasPipingPlanTempList(apsGasPipingPlanTemp);
|
int count=0;
|
String[] ids=new String[apsGasPipingPlanTemps.size()];
|
for (int i = 0; i <apsGasPipingPlanTemps.size() ; i++) {
|
//记录临时表id
|
ids[i]=apsGasPipingPlanTemps.get(i).getId();
|
ApsGasPipingPlan apsGasPipingPlan=new ApsGasPipingPlan();
|
BeanUtils.copyProperties(apsGasPipingPlanTemps.get(i), apsGasPipingPlan);
|
apsGasPipingPlan.setId(IdUtils.fastUUID());
|
//插入正式表,并记录
|
apsGasPipingPlanMapper.insertApsGasPipingPlan(apsGasPipingPlan);
|
count++;
|
}
|
//插入数量与临时表查询一直则删除临时表数据
|
if (count==apsGasPipingPlanTemps.size()) {
|
apsGasPipingPlanTempMapper.deleteApsGasPipingPlanTempByIds(ids);
|
}
|
return 1;
|
}
|
}
|