|
@@ -12,6 +12,7 @@ import com.ruoyi.powerdistribution.domain.PdmConstructor;
|
|
import com.ruoyi.powerdistribution.domain.excel.ConstructTeam;
|
|
import com.ruoyi.powerdistribution.domain.excel.ConstructTeam;
|
|
import com.ruoyi.powerdistribution.domain.vo.PdmConstructTeamVo;
|
|
import com.ruoyi.powerdistribution.domain.vo.PdmConstructTeamVo;
|
|
import com.ruoyi.powerdistribution.mapper.PdmConstructorMapper;
|
|
import com.ruoyi.powerdistribution.mapper.PdmConstructorMapper;
|
|
|
|
+import com.ruoyi.powerdistribution.mapper.PdmVehicleAlarmMapper;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import com.ruoyi.powerdistribution.mapper.PdmConstructTeamMapper;
|
|
import com.ruoyi.powerdistribution.mapper.PdmConstructTeamMapper;
|
|
@@ -33,6 +34,8 @@ public class PdmConstructTeamServiceImpl implements IPdmConstructTeamService
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private PdmConstructorMapper pdmConstructorMapper;
|
|
private PdmConstructorMapper pdmConstructorMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private PdmVehicleAlarmMapper pdmVehicleAlarmMapper;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 查询配网工程队伍施工小组信息
|
|
* 查询配网工程队伍施工小组信息
|
|
@@ -65,6 +68,7 @@ public class PdmConstructTeamServiceImpl implements IPdmConstructTeamService
|
|
* @return 结果
|
|
* @return 结果
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
public int insertPdmConstructTeam(PdmConstructTeamVo pdmConstructTeam)
|
|
public int insertPdmConstructTeam(PdmConstructTeamVo pdmConstructTeam)
|
|
{
|
|
{
|
|
String teamNo= IdUtils.fastSimpleUUID();
|
|
String teamNo= IdUtils.fastSimpleUUID();
|
|
@@ -77,7 +81,10 @@ public class PdmConstructTeamServiceImpl implements IPdmConstructTeamService
|
|
constructor.setCreateBy(SecurityUtils.getUsername());
|
|
constructor.setCreateBy(SecurityUtils.getUsername());
|
|
pdmConstructorMapper.insertPdmConstructor(constructor);
|
|
pdmConstructorMapper.insertPdmConstructor(constructor);
|
|
}
|
|
}
|
|
- return pdmConstructTeamMapper.insertPdmConstructTeam(pdmConstructTeam);
|
|
|
|
|
|
+
|
|
|
|
+ int i= pdmConstructTeamMapper.insertPdmConstructTeam(pdmConstructTeam);
|
|
|
|
+ pdmVehicleAlarmMapper.insertVehicleAlar();
|
|
|
|
+ return i;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -98,7 +105,9 @@ public class PdmConstructTeamServiceImpl implements IPdmConstructTeamService
|
|
pdmConstructorMapper.insertPdmConstructor(constructor);
|
|
pdmConstructorMapper.insertPdmConstructor(constructor);
|
|
// }
|
|
// }
|
|
}
|
|
}
|
|
- return pdmConstructTeamMapper.updatePdmConstructTeam(pdmConstructTeam);
|
|
|
|
|
|
+ int i= pdmConstructTeamMapper.updatePdmConstructTeam(pdmConstructTeam);
|
|
|
|
+ pdmVehicleAlarmMapper.insertVehicleAlar();
|
|
|
|
+ return i;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -111,6 +120,12 @@ public class PdmConstructTeamServiceImpl implements IPdmConstructTeamService
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public int deletePdmConstructTeamByIds(Long[] ids)
|
|
public int deletePdmConstructTeamByIds(Long[] ids)
|
|
{
|
|
{
|
|
|
|
+ for(Long id:ids){
|
|
|
|
+ PdmConstructTeam constructTeam= pdmConstructTeamMapper.selectPdmConstructTeamById(id);
|
|
|
|
+ for(String carNo: constructTeam.getConstrucCarNumber()){
|
|
|
|
+ pdmVehicleAlarmMapper.deletePdmVehicleAlarmByVehicleNo(carNo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
pdmConstructorMapper.deletePdmConstructorByTeamIds(ids);
|
|
pdmConstructorMapper.deletePdmConstructorByTeamIds(ids);
|
|
return pdmConstructTeamMapper.deletePdmConstructTeamByIds(ids);
|
|
return pdmConstructTeamMapper.deletePdmConstructTeamByIds(ids);
|
|
}
|
|
}
|
|
@@ -122,13 +137,19 @@ public class PdmConstructTeamServiceImpl implements IPdmConstructTeamService
|
|
* @return 结果
|
|
* @return 结果
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
public int deletePdmConstructTeamById(Long id)
|
|
public int deletePdmConstructTeamById(Long id)
|
|
{
|
|
{
|
|
|
|
+ PdmConstructTeam constructTeam= pdmConstructTeamMapper.selectPdmConstructTeamById(id);
|
|
|
|
+ for(String carNo: constructTeam.getConstrucCarNumber()){
|
|
|
|
+ pdmVehicleAlarmMapper.deletePdmVehicleAlarmByVehicleNo(carNo);
|
|
|
|
+ }
|
|
pdmConstructorMapper.deletePdmConstructorByTeamId(id);
|
|
pdmConstructorMapper.deletePdmConstructorByTeamId(id);
|
|
return pdmConstructTeamMapper.deletePdmConstructTeamById(id);
|
|
return pdmConstructTeamMapper.deletePdmConstructTeamById(id);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
public void importExcel(List<ConstructTeam> constructTeamList) {
|
|
public void importExcel(List<ConstructTeam> constructTeamList) {
|
|
Map<String,PdmConstructTeamVo> data=new HashMap<>();
|
|
Map<String,PdmConstructTeamVo> data=new HashMap<>();
|
|
for (ConstructTeam constructTeam : constructTeamList) {
|
|
for (ConstructTeam constructTeam : constructTeamList) {
|
|
@@ -145,7 +166,7 @@ public class PdmConstructTeamServiceImpl implements IPdmConstructTeamService
|
|
BeanUtils.copyProperties(constructTeam,constructTeamVo);
|
|
BeanUtils.copyProperties(constructTeam,constructTeamVo);
|
|
if(StringUtils.isNotEmpty(constructTeam.getCarNumber())){
|
|
if(StringUtils.isNotEmpty(constructTeam.getCarNumber())){
|
|
constructTeam.setCarNumber(constructTeam.getCarNumber().replaceAll(" ","").replaceAll("、",",")
|
|
constructTeam.setCarNumber(constructTeam.getCarNumber().replaceAll(" ","").replaceAll("、",",")
|
|
- .replaceAll("\n",",").replaceAll("\r",",")
|
|
|
|
|
|
+ .replaceAll("\n",",").replaceAll("\r",",").replaceAll(",",",").toUpperCase()
|
|
);
|
|
);
|
|
constructTeamVo.setConstrucCarNumber(Arrays.asList(constructTeam.getCarNumber().split(",")));
|
|
constructTeamVo.setConstrucCarNumber(Arrays.asList(constructTeam.getCarNumber().split(",")));
|
|
}
|
|
}
|
|
@@ -160,9 +181,22 @@ public class PdmConstructTeamServiceImpl implements IPdmConstructTeamService
|
|
System.out.println("解析数据:"+ JSON.toJSON(data.values()));
|
|
System.out.println("解析数据:"+ JSON.toJSON(data.values()));
|
|
pdmConstructTeamMapper.clean();
|
|
pdmConstructTeamMapper.clean();
|
|
pdmConstructorMapper.clean();
|
|
pdmConstructorMapper.clean();
|
|
|
|
+ List<PdmConstructor> allConstructor=new ArrayList<>();
|
|
|
|
+ List<PdmConstructTeamVo> constructTeamVos=new ArrayList<>(data.values());
|
|
data.values().forEach(dmConstructTeamVo->{
|
|
data.values().forEach(dmConstructTeamVo->{
|
|
- insertPdmConstructTeam(dmConstructTeamVo);
|
|
|
|
-
|
|
|
|
|
|
+ String teamNo= IdUtils.fastSimpleUUID();
|
|
|
|
+ dmConstructTeamVo.setCreateTime(DateUtils.getNowDate());
|
|
|
|
+ dmConstructTeamVo.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
+ dmConstructTeamVo.setTeamNo(teamNo);
|
|
|
|
+ for(PdmConstructor constructor:dmConstructTeamVo.getConstructorList()){
|
|
|
|
+ constructor.setTeamNo(teamNo);
|
|
|
|
+ constructor.setCreateTime(DateUtils.getNowDate());
|
|
|
|
+ constructor.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
+ allConstructor.add(constructor);
|
|
|
|
+ }
|
|
});
|
|
});
|
|
|
|
+ pdmConstructTeamMapper.batchAdd(constructTeamVos);
|
|
|
|
+ pdmConstructorMapper.batchAdd(allConstructor);
|
|
|
|
+ pdmVehicleAlarmMapper.insertVehicleAlar();
|
|
}
|
|
}
|
|
}
|
|
}
|