征求意见流程-----加按钮判断权限接口

This commit is contained in:
yuezhihang
2021-08-03 13:56:33 +08:00
parent 09e4a5a767
commit 6f654406fd
3 changed files with 49 additions and 30 deletions
@@ -52,6 +52,14 @@ public class SarPublicIdeaAllController extends BaseController<SarPublicIdeaAll>
return Result.success("200",publicList); return Result.success("200",publicList);
} }
@ApiOperation(value = "查询全部意见")
@GetMapping("/checkIsShow")
public ResponseMessage checkIsShow(DetAllStandDto detAllStandDto){
String publicList =sarPublicIdeaAllImpl.checkIsShow(detAllStandDto);
return Result.success("200",publicList);
}
@ApiOperation(value = "增加意见") @ApiOperation(value = "增加意见")
@PostMapping("/insetStand") @PostMapping("/insetStand")
public ResponseMessage addAllStand(SarPublicIdeaAll sar){ public ResponseMessage addAllStand(SarPublicIdeaAll sar){
@@ -26,4 +26,5 @@ public interface ISarPublicIdeaAllService extends IService<SarPublicIdeaAll> {
String updateById(SarPublicIdeaAll sarPublicIdeaAll, String autUserid); String updateById(SarPublicIdeaAll sarPublicIdeaAll, String autUserid);
String delete(DelStandDto delStandDto); String delete(DelStandDto delStandDto);
String del(String id); String del(String id);
String checkIsShow(DetAllStandDto detAllStandDto);
} }
@@ -3,10 +3,7 @@ package com.adc.da.slrs.sarStandIdea.service.Impl;
import com.adc.da.slrs.sarLawsDetailedList.Util.BeanConverUtil; import com.adc.da.slrs.sarLawsDetailedList.Util.BeanConverUtil;
import com.adc.da.slrs.sarStandIdea.dao.SarPublicIdeaAllDao; import com.adc.da.slrs.sarStandIdea.dao.SarPublicIdeaAllDao;
import com.adc.da.slrs.sarStandIdea.entity.DelStandDto; import com.adc.da.slrs.sarStandIdea.entity.*;
import com.adc.da.slrs.sarStandIdea.entity.DetAllStandDto;
import com.adc.da.slrs.sarStandIdea.entity.SarPublicIdeaAll;
import com.adc.da.slrs.sarStandIdea.entity.SarPublicIdeaAllSUD;
import com.adc.da.slrs.sarStandIdea.service.ISarPublicIdeaAllService; import com.adc.da.slrs.sarStandIdea.service.ISarPublicIdeaAllService;
import com.adc.da.util.UUIDUtils; import com.adc.da.util.UUIDUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -38,7 +35,6 @@ public class SarPublicIdeaAllServiceImpl extends ServiceImpl<SarPublicIdeaAllDao
private SarPublicIdeaAllDao sarPublicIdeaAllDao; private SarPublicIdeaAllDao sarPublicIdeaAllDao;
@Override @Override
public IPage<SarPublicIdeaAllSUD> selectAll(DetAllStandDto detAllStandDto) { public IPage<SarPublicIdeaAllSUD> selectAll(DetAllStandDto detAllStandDto) {
if (detAllStandDto.getEndTime() != null) { if (detAllStandDto.getEndTime() != null) {
@@ -58,10 +54,10 @@ public class SarPublicIdeaAllServiceImpl extends ServiceImpl<SarPublicIdeaAllDao
List<SarPublicIdeaAll> list = userIPage.getRecords(); List<SarPublicIdeaAll> list = userIPage.getRecords();
List<SarPublicIdeaAllSUD> list1 = new ArrayList<>(); List<SarPublicIdeaAllSUD> list1 = new ArrayList<>();
list1 = BeanConverUtil.converList(list, SarPublicIdeaAllSUD.class); list1 = BeanConverUtil.converList(list, SarPublicIdeaAllSUD.class);
for (SarPublicIdeaAllSUD sud:list1){ // for (SarPublicIdeaAllSUD sud:list1){
if (Time.compareTo(new Date())>=0)sud.setIdeaKey(0); // if (Time.compareTo(new Date())>=0)sud.setIdeaKey(0);
else {sud.setIdeaKey(1);} // else {sud.setIdeaKey(1);}
} // }
IPage<SarPublicIdeaAllSUD> userIPage1 = new Page<>(); IPage<SarPublicIdeaAllSUD> userIPage1 = new Page<>();
userIPage1.setPages(userIPage.getPages()); userIPage1.setPages(userIPage.getPages());
userIPage1.setSize(userIPage.getSize()); userIPage1.setSize(userIPage.getSize());
@@ -79,9 +75,9 @@ public class SarPublicIdeaAllServiceImpl extends ServiceImpl<SarPublicIdeaAllDao
List<SarPublicIdeaAll> list = userIPage.getRecords(); List<SarPublicIdeaAll> list = userIPage.getRecords();
List<SarPublicIdeaAllSUD> list1 = new ArrayList<>(); List<SarPublicIdeaAllSUD> list1 = new ArrayList<>();
list1 = BeanConverUtil.converList(list, SarPublicIdeaAllSUD.class); list1 = BeanConverUtil.converList(list, SarPublicIdeaAllSUD.class);
for (SarPublicIdeaAllSUD sud:list1){ // for (SarPublicIdeaAllSUD sud:list1){
sud.setIdeaKey(0); // sud.setIdeaKey(0);
} // }
IPage<SarPublicIdeaAllSUD> userIPage1 = new Page<>(); IPage<SarPublicIdeaAllSUD> userIPage1 = new Page<>();
userIPage1.setPages(userIPage.getPages()); userIPage1.setPages(userIPage.getPages());
userIPage1.setSize(userIPage.getSize()); userIPage1.setSize(userIPage.getSize());
@@ -90,9 +86,23 @@ public class SarPublicIdeaAllServiceImpl extends ServiceImpl<SarPublicIdeaAllDao
userIPage1.setRecords(list1); userIPage1.setRecords(list1);
return userIPage1; return userIPage1;
} }
}
@Override
public String checkIsShow(DetAllStandDto detAllStandDto) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date Time = null;
try {
Time = sdf.parse(detAllStandDto.getEndTime());
} catch (ParseException e) {
e.printStackTrace();
}
if (Time.compareTo(new Date()) >= 0) return "0";
else {
return "1";
}
} }
@Override @Override