|
@@ -11,12 +11,14 @@ import com.ruoyi.common.utils.StringUtils;
|
|
import com.ruoyi.gas.domain.GWarningPile;
|
|
import com.ruoyi.gas.domain.GWarningPile;
|
|
import com.ruoyi.gas.domain.bo.GWarningPileBo;
|
|
import com.ruoyi.gas.domain.bo.GWarningPileBo;
|
|
import com.ruoyi.gas.domain.bo.GWarningPilePhotoBo;
|
|
import com.ruoyi.gas.domain.bo.GWarningPilePhotoBo;
|
|
|
|
+import com.ruoyi.gas.domain.vo.GUserVo;
|
|
import com.ruoyi.gas.domain.vo.GWarningPileVo;
|
|
import com.ruoyi.gas.domain.vo.GWarningPileVo;
|
|
import com.ruoyi.gas.mapper.GWarningPileMapper;
|
|
import com.ruoyi.gas.mapper.GWarningPileMapper;
|
|
import com.ruoyi.gas.service.IGWarningPilePhotoService;
|
|
import com.ruoyi.gas.service.IGWarningPilePhotoService;
|
|
import com.ruoyi.gas.service.IGWarningPileService;
|
|
import com.ruoyi.gas.service.IGWarningPileService;
|
|
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 org.springframework.util.ObjectUtils;
|
|
|
|
|
|
import java.util.Collection;
|
|
import java.util.Collection;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -41,7 +43,7 @@ public class GWarningPileServiceImpl extends ServicePlusImpl<GWarningPileMapper,
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public GWarningPileVo queryById(Long id){
|
|
|
|
|
|
+ public GWarningPileVo queryById(Long id) {
|
|
GWarningPileVo voById = getVoById(id);
|
|
GWarningPileVo voById = getVoById(id);
|
|
voById.setPhotoList(baseMapper.getPhoto(voById.getId()));
|
|
voById.setPhotoList(baseMapper.getPhoto(voById.getId()));
|
|
return voById;
|
|
return voById;
|
|
@@ -50,15 +52,29 @@ public class GWarningPileServiceImpl extends ServicePlusImpl<GWarningPileMapper,
|
|
@Override
|
|
@Override
|
|
public TableDataInfo<GWarningPileVo> queryPageList(GWarningPileBo bo) {
|
|
public TableDataInfo<GWarningPileVo> queryPageList(GWarningPileBo bo) {
|
|
PagePlus<GWarningPile, GWarningPileVo> result = pageVo(PageUtils.buildPagePlus(), buildQueryWrapper(bo));
|
|
PagePlus<GWarningPile, GWarningPileVo> result = pageVo(PageUtils.buildPagePlus(), buildQueryWrapper(bo));
|
|
- result.getRecordsVo().forEach(item -> item.setPhotoList(baseMapper.getPhoto(item.getId())));
|
|
|
|
|
|
+ result.getRecordsVo().forEach(item -> {
|
|
|
|
+ for (String uid : item.getUserId().split(",")) {
|
|
|
|
+ System.out.println(uid);
|
|
|
|
+ GUserVo voById = gUserService.getVoById(uid);
|
|
|
|
+ if (ObjectUtils.isEmpty(voById))
|
|
|
|
+ continue;
|
|
|
|
+ item.setUserName(StringUtils.isEmpty(item.getUserName()) ? voById.getName() : item.getUserName() + "," + voById.getName());
|
|
|
|
+ }
|
|
|
|
+ item.setPhotoList(baseMapper.getPhoto(item.getId()));
|
|
|
|
+ });
|
|
|
|
+
|
|
return PageUtils.buildDataInfo(result);
|
|
return PageUtils.buildDataInfo(result);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private GUserServiceImpl gUserService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public List<GWarningPileVo> getList(GWarningPileBo bo) {
|
|
public List<GWarningPileVo> getList(GWarningPileBo bo) {
|
|
LambdaQueryWrapper<GWarningPile> lqw = Wrappers.lambdaQuery();
|
|
LambdaQueryWrapper<GWarningPile> lqw = Wrappers.lambdaQuery();
|
|
lqw.eq(StringUtils.isNotBlank(bo.getUserId()), GWarningPile::getUserId, bo.getUserId());
|
|
lqw.eq(StringUtils.isNotBlank(bo.getUserId()), GWarningPile::getUserId, bo.getUserId());
|
|
lqw.like(StringUtils.isNotBlank(bo.getName()), GWarningPile::getName, bo.getName());
|
|
lqw.like(StringUtils.isNotBlank(bo.getName()), GWarningPile::getName, bo.getName());
|
|
|
|
+ // lqw.orderByDesc(GWarningPile::getCreateTime);
|
|
List<GWarningPileVo> gWarningPileVos = this.listVo(lqw);
|
|
List<GWarningPileVo> gWarningPileVos = this.listVo(lqw);
|
|
gWarningPileVos.forEach(item -> item.setPhotoList(baseMapper.getPhoto(item.getId())));
|
|
gWarningPileVos.forEach(item -> item.setPhotoList(baseMapper.getPhoto(item.getId())));
|
|
return gWarningPileVos;
|
|
return gWarningPileVos;
|
|
@@ -66,7 +82,8 @@ public class GWarningPileServiceImpl extends ServicePlusImpl<GWarningPileMapper,
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<GWarningPileVo> queryList(GWarningPileBo bo) {
|
|
public List<GWarningPileVo> queryList(GWarningPileBo bo) {
|
|
- return listVo(buildQueryWrapper(bo));
|
|
|
|
|
|
+ List<GWarningPileVo> gWarningPileVos = listVo(buildQueryWrapper(bo));
|
|
|
|
+ return gWarningPileVos;
|
|
}
|
|
}
|
|
|
|
|
|
private LambdaQueryWrapper<GWarningPile> buildQueryWrapper(GWarningPileBo bo) {
|
|
private LambdaQueryWrapper<GWarningPile> buildQueryWrapper(GWarningPileBo bo) {
|
|
@@ -74,6 +91,7 @@ public class GWarningPileServiceImpl extends ServicePlusImpl<GWarningPileMapper,
|
|
LambdaQueryWrapper<GWarningPile> lqw = Wrappers.lambdaQuery();
|
|
LambdaQueryWrapper<GWarningPile> lqw = Wrappers.lambdaQuery();
|
|
lqw.eq(StringUtils.isNotBlank(bo.getUserId()), GWarningPile::getUserId, bo.getUserId());
|
|
lqw.eq(StringUtils.isNotBlank(bo.getUserId()), GWarningPile::getUserId, bo.getUserId());
|
|
lqw.like(StringUtils.isNotBlank(bo.getName()), GWarningPile::getName, bo.getName());
|
|
lqw.like(StringUtils.isNotBlank(bo.getName()), GWarningPile::getName, bo.getName());
|
|
|
|
+ lqw.orderByDesc(GWarningPile::getCreateTime);
|
|
return lqw;
|
|
return lqw;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -134,13 +152,13 @@ public class GWarningPileServiceImpl extends ServicePlusImpl<GWarningPileMapper,
|
|
*
|
|
*
|
|
* @param entity 实体类数据
|
|
* @param entity 实体类数据
|
|
*/
|
|
*/
|
|
- private void validEntityBeforeSave(GWarningPile entity){
|
|
|
|
|
|
+ private void validEntityBeforeSave(GWarningPile entity) {
|
|
//TODO 做一些数据校验,如唯一约束
|
|
//TODO 做一些数据校验,如唯一约束
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
- if(isValid){
|
|
|
|
|
|
+ if (isValid) {
|
|
//TODO 做一些业务上的校验,判断是否需要校验
|
|
//TODO 做一些业务上的校验,判断是否需要校验
|
|
}
|
|
}
|
|
return removeByIds(ids);
|
|
return removeByIds(ids);
|