52 lines
1.4 KiB
Java
52 lines
1.4 KiB
Java
|
|
package com.gunshi.project.xyt.service;
|
||
|
|
|
||
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||
|
|
import com.gunshi.project.xyt.entity.vo.GateMonitorDataVo;
|
||
|
|
import com.gunshi.project.xyt.mapper.AttGateBMapper;
|
||
|
|
import com.gunshi.project.xyt.model.AttGateB;
|
||
|
|
import lombok.extern.slf4j.Slf4j;
|
||
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
|
import org.springframework.stereotype.Service;
|
||
|
|
import org.springframework.transaction.annotation.Transactional;
|
||
|
|
|
||
|
|
import java.util.List;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 描述: 水闸基本情况调查表
|
||
|
|
* author: xusan
|
||
|
|
* date: 2024-09-26 10:44:06
|
||
|
|
*/
|
||
|
|
@Service
|
||
|
|
@Slf4j
|
||
|
|
@Transactional(rollbackFor = Exception.class)
|
||
|
|
public class AttGateBService extends ServiceImpl<AttGateBMapper, AttGateB>
|
||
|
|
{
|
||
|
|
@Autowired
|
||
|
|
private FileAssociationsService fileService;
|
||
|
|
|
||
|
|
public List<AttGateB> queryList() {
|
||
|
|
List<AttGateB> list = this.list();
|
||
|
|
if(CollectionUtils.isNotEmpty(list)){
|
||
|
|
fillAttach(list);
|
||
|
|
}
|
||
|
|
return list;
|
||
|
|
}
|
||
|
|
|
||
|
|
private void fillAttach(List<AttGateB> list) {
|
||
|
|
for (AttGateB record : list) {
|
||
|
|
record.setFiles(fileService.getFiles(getGroupId(),record.getGateCode()));
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
private String getGroupId() {
|
||
|
|
return "attGateB";
|
||
|
|
}
|
||
|
|
|
||
|
|
public List<GateMonitorDataVo> dataList(String gateCode) {
|
||
|
|
return this.baseMapper.dataList(gateCode);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|