Commit 217e616e authored by YazhouChen's avatar YazhouChen

后端管理优化

parent 159364d1
This diff is collapsed.
......@@ -2,7 +2,7 @@ spring-boot-plus:
# 是否启用ansi控制台输出有颜色的字体,dev环境建议开启,服务器环境设置为false
enable-ansi: true
# 当前环境服务IP地址
server-ip: 127.0.0.1
server-ip: 114.67.82.178
# 文件上传下载配置
upload-path: /opt/upload/
taskstatus: 1
......
......@@ -2,7 +2,7 @@ spring-boot-plus:
# 是否启用ansi控制台输出有颜色的字体,dev环境建议开启,服务器环境设置为false
enable-ansi: true
# 当前环境服务IP地址
server-ip: 127.0.0.1
server-ip: 114.67.82.178
# 文件上传下载配置
upload-path: /opt/upload/
taskstatus: 1
......
......@@ -6,7 +6,7 @@ import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2021-07-08T18:02:51+0800",
date = "2021-07-09T14:13:11+0800",
comments = "version: 1.3.1.Final, compiler: javac, environment: Java 1.8.0_131 (Oracle Corporation)"
)
public class LoginSysUserVoConvertImpl implements LoginSysUserVoConvert {
......
......@@ -6,7 +6,7 @@ import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2021-07-08T18:02:51+0800",
date = "2021-07-09T14:13:11+0800",
comments = "version: 1.3.1.Final, compiler: javac, environment: Java 1.8.0_131 (Oracle Corporation)"
)
public class ShiroMapstructConvertImpl implements ShiroMapstructConvert {
......
......@@ -53,7 +53,7 @@ public class SurveyController extends BaseController {
@PostMapping("/update")
@OperationLog(name = "修改", type = OperationLogType.UPDATE)
@ApiOperation(value = "修改", response = ApiResult.class)
public ApiResult<Boolean> updateSurvey(@Validated(Update.class) @RequestBody Survey survey) throws Exception {
public ApiResult<Boolean> updateSurvey(@Validated(Update.class) @RequestBody SurveyAdd survey) throws Exception {
boolean flag = surveyService.updateSurvey(survey);
return ApiResult.result(flag);
}
......@@ -76,7 +76,7 @@ public class SurveyController extends BaseController {
@OperationLog(name = "详情", type = OperationLogType.INFO)
@ApiOperation(value = "详情", response = Survey.class)
public ApiResult<Survey> getSurvey(@PathVariable("id") Long id) throws Exception {
Survey survey = surveyService.getById(id);
Survey survey = surveyService.getSurveyById(id);
return ApiResult.ok(survey);
}
......
......@@ -45,7 +45,7 @@ public interface NoticeService extends BaseService<Notice> {
/**
* 获取分页对象
*
* @param noticeQueryParam
* @param noticePageParam
* @return
* @throws Exception
*/
......
......@@ -47,7 +47,7 @@ public interface NoticetypeService extends BaseService<Noticetype> {
/**
* 获取分页对象
*
* @param noticetypeQueryParam
* @param noticetypePageParam
* @return
* @throws Exception
*/
......
......@@ -47,7 +47,6 @@ public interface SuperadmindbService extends BaseService<Superadmindb> {
/**
* 获取分页对象
*
* @param superadmindbQueryParam
* @return
* @throws Exception
*/
......
......@@ -30,7 +30,7 @@ public interface SurveyService extends BaseService<Survey> {
* @return
* @throws Exception
*/
boolean updateSurvey(Survey survey) throws Exception;
boolean updateSurvey(SurveyAdd survey) throws Exception;
/**
* 删除
......@@ -45,10 +45,11 @@ public interface SurveyService extends BaseService<Survey> {
/**
* 获取分页对象
*
* @param surveyQueryParam
* @param surveyPageParam
* @return
* @throws Exception
*/
Paging<Survey> getSurveyPageList(SurveyPageParam surveyPageParam) throws Exception;
Survey getSurveyById(Long id);
}
......@@ -44,7 +44,7 @@ public interface SurveyfileService extends BaseService<Surveyfile> {
/**
* 获取分页对象
*
* @param surveyfileQueryParam
* @param surveyfilePageParam
* @return
* @throws Exception
*/
......
......@@ -323,6 +323,7 @@ public class MembersServiceImpl extends BaseServiceImpl<MembersMapper, Members>
return hashMap;
}
//首页会员统计
@Override
public HomeInfo getHomeInfo() {
HomeInfo homeInfo = new HomeInfo();
......@@ -341,6 +342,7 @@ public class MembersServiceImpl extends BaseServiceImpl<MembersMapper, Members>
return homeInfo;
}
//通过或者驳回会员的注册申请
@Override
public HashMap<String, Object> handleApply(Integer id, Integer status) {
HashMap<String, Object> hashMap = new HashMap<>();
......@@ -361,6 +363,7 @@ public class MembersServiceImpl extends BaseServiceImpl<MembersMapper, Members>
return hashMap;
}
//企业会员分页列表
@Override
public Paging<EnterpriseMembersPage> getPageListEnterprise(EnterPageParam enterPageParam) {
Page<EnterpriseMembersPage> page = new PageInfo<>(enterPageParam);
......
......@@ -41,11 +41,12 @@ public class NoticetypeServiceImpl extends BaseServiceImpl<NoticetypeMapper, Not
QueryWrapper<Noticetype> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("name",noticetype.getName());
List<Noticetype> noticetypes = noticetypeMapper.selectList(queryWrapper);
if(noticetypes!=null||noticetypes.size()>0){
if(noticetypes!=null&&noticetypes.size()>0){
hashMap.put("code","500");
hashMap.put("info","名称已存在");
return hashMap;
}
noticetypeMapper.insert(noticetype);
hashMap.put("code","200");
hashMap.put("info","新增成功");
return hashMap;
......@@ -60,7 +61,7 @@ public class NoticetypeServiceImpl extends BaseServiceImpl<NoticetypeMapper, Not
queryWrapper.eq("name",noticetype.getName());
queryWrapper.ne("id",noticetype.getId());
List<Noticetype> noticetypes = noticetypeMapper.selectList(queryWrapper);
if(noticetypes!=null||noticetypes.size()>0){
if(noticetypes!=null&&noticetypes.size()>0){
hashMap.put("code","500");
hashMap.put("info","名称已存在");
return hashMap;
......
......@@ -24,6 +24,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* 服务实现类
*
......@@ -72,7 +74,21 @@ public class SurveyServiceImpl extends BaseServiceImpl<SurveyMapper, Survey> imp
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateSurvey(Survey survey) throws Exception {
public boolean updateSurvey(SurveyAdd surveyAdd) throws Exception {
Survey survey = new Survey();
BeanUtils.copyProperties(surveyAdd, survey);
//修改附件表 项目id
if(!StringUtils.isEmpty( surveyAdd.getFileIdlist())){
String[] split = surveyAdd.getFileIdlist().split(",");
for (String string:split) {
Integer fileid = Integer.valueOf(string);
Surveyfile surveyfile = new Surveyfile();
surveyfile.setFileID(Long.valueOf( fileid));
surveyfile.setSurveyId(survey.getId().intValue());
surveyfileMapper.updateById(surveyfile);
}
}
return super.updateById(survey);
}
......@@ -108,9 +124,23 @@ public class SurveyServiceImpl extends BaseServiceImpl<SurveyMapper, Survey> imp
survey.setCreateUserName(superadmindb.getNickname());
}
}
QueryWrapper<Surveyfile> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.eq("surveyId",survey.getId());
List<Surveyfile> surveyfiles = surveyfileMapper.selectList(queryWrapper1);
survey.setFilelist(surveyfiles);
}
return new Paging<Survey>(iPage);
}
@Override
public Survey getSurveyById(Long id) {
Survey survey = surveyMapper.selectById(id);
QueryWrapper<Surveyfile> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.eq("surveyId",survey.getId());
List<Surveyfile> surveyfiles = surveyfileMapper.selectList(queryWrapper1);
survey.setFilelist(surveyfiles);
return survey;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment