|
@@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.hssx.bms.entity.InstitutionalInformation;
|
|
import com.hssx.bms.entity.InstitutionalInformation;
|
|
|
|
+import com.hssx.bms.entity.InstitutionalPic;
|
|
import com.hssx.bms.entity.SystemUser;
|
|
import com.hssx.bms.entity.SystemUser;
|
|
import com.hssx.bms.entity.vo.InstitutionalInformationVO;
|
|
import com.hssx.bms.entity.vo.InstitutionalInformationVO;
|
|
import com.hssx.bms.mapper.InstitutionalInformationMapper;
|
|
import com.hssx.bms.mapper.InstitutionalInformationMapper;
|
|
|
|
+import com.hssx.bms.mapper.InstitutionalPicMapper;
|
|
import com.hssx.bms.mapper.SystemUserMapper;
|
|
import com.hssx.bms.mapper.SystemUserMapper;
|
|
import com.hssx.bms.service.InstitutionalInformationService;
|
|
import com.hssx.bms.service.InstitutionalInformationService;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -40,6 +42,8 @@ public class InstitutionalInformationServiceImpl extends ServiceImpl<Institution
|
|
private InstitutionalInformationMapper institutionalMapper;
|
|
private InstitutionalInformationMapper institutionalMapper;
|
|
@Resource
|
|
@Resource
|
|
private SystemUserMapper systemUserMapper;
|
|
private SystemUserMapper systemUserMapper;
|
|
|
|
+ @Resource
|
|
|
|
+ private InstitutionalPicMapper picMapper;
|
|
@Value("${upload.path}")
|
|
@Value("${upload.path}")
|
|
private String path;
|
|
private String path;
|
|
@Override
|
|
@Override
|
|
@@ -98,7 +102,7 @@ public class InstitutionalInformationServiceImpl extends ServiceImpl<Institution
|
|
page = new PageUtil();
|
|
page = new PageUtil();
|
|
}
|
|
}
|
|
PageHelper.startPage(page.getPageNum(),page.getPageSize());
|
|
PageHelper.startPage(page.getPageNum(),page.getPageSize());
|
|
- List<InstitutionalInformation> institutionalInformations = institutionalMapper.selectList(new QueryWrapper<InstitutionalInformation>().select("id", "name", "phone", "address"));
|
|
|
|
|
|
+ List<InstitutionalInformation> institutionalInformations = institutionalMapper.selectList(new QueryWrapper<InstitutionalInformation>().eq("is_delete",0).select("id", "name", "phone", "address"));
|
|
PageInfo<InstitutionalInformation> pageInfo = new PageInfo<>(institutionalInformations);
|
|
PageInfo<InstitutionalInformation> pageInfo = new PageInfo<>(institutionalInformations);
|
|
msg.data = pageInfo;
|
|
msg.data = pageInfo;
|
|
return msg;
|
|
return msg;
|
|
@@ -131,4 +135,20 @@ public class InstitutionalInformationServiceImpl extends ServiceImpl<Institution
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public HttpRespMsg deleteById(InstitutionalInformation information) {
|
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
|
+ //软删除
|
|
|
|
+ information.setIsDelete(1);
|
|
|
|
+ institutionalMapper.updateById(information);
|
|
|
|
+ //删除上传的自介绍图片
|
|
|
|
+ picMapper.delete(new QueryWrapper<InstitutionalPic>().eq("information_id",information.getId()));
|
|
|
|
+ InstitutionalInformation oldinformation = institutionalMapper.selectById(information.getId());
|
|
|
|
+ if(null != oldinformation.getSysId()){
|
|
|
|
+ //删除机构账号
|
|
|
|
+ systemUserMapper.delete(new QueryWrapper<SystemUser>().eq("id",oldinformation.getSysId()));
|
|
|
|
+ }
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|