后台接口
This commit is contained in:
@ -87,7 +87,7 @@ public class PartyEventMaintainController {
|
||||
|
||||
@ApiOperation("后台查询列表")
|
||||
@PostMapping("/styleProject/list")
|
||||
public BaseResponse<List<EventMaintainOutVO>> queryStyleAndProject(@RequestBody EventMaintainInVO inVO) {
|
||||
public BaseResponse<List<EventMaintainOutVO>> queryStyleAndProject(@RequestBody(required = false) EventMaintainInVO inVO) {
|
||||
return BaseResponse.success(eventStyleService.queryStyleAndProject(inVO));
|
||||
}
|
||||
|
||||
@ -103,6 +103,7 @@ public class PartyEventMaintainController {
|
||||
public BaseResponse<Boolean> sendStyleOrProject(@RequestParam("id") String id,@RequestParam("status") String status) {
|
||||
return BaseResponse.success(eventStyleService.sendStyleOrProject(id, status));
|
||||
}
|
||||
|
||||
@ApiOperation("删除风采或项目")
|
||||
@GetMapping("/styleProject/delete")
|
||||
public BaseResponse<Boolean> deleteStyleOrProject(@RequestParam("id") String id) {
|
||||
@ -112,12 +113,12 @@ public class PartyEventMaintainController {
|
||||
|
||||
@ApiOperation("后台查询列表")
|
||||
@PostMapping("/suggestion/list")
|
||||
public BaseResponse<List<EventContactSuggestion>> querySuggestion(@RequestBody EventMaintainInVO inVO) {
|
||||
public BaseResponse<List<EventContactSuggestion>> querySuggestion(@RequestBody(required = false) EventMaintainInVO inVO) {
|
||||
return BaseResponse.success(eventContactSuggestionService.querySuggestion(inVO));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/suggestion/export/")
|
||||
public BaseResponse<Boolean> export(@RequestParam("ids") List<String> ids) {
|
||||
public BaseResponse<Boolean> export(@RequestParam(value = "ids",required = false) List<String> ids) {
|
||||
ExcelTable table = eventContactSuggestionService.export(ids);
|
||||
ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletResponse response = requestAttributes.getResponse();
|
||||
|
@ -58,6 +58,9 @@ public class EventContactSuggestionServiceImpl extends ServiceImpl<EventContactS
|
||||
|
||||
@Override
|
||||
public List<EventContactSuggestion> querySuggestion(EventMaintainInVO inVO) {
|
||||
if (ObjectUtil.isNull(inVO)) {
|
||||
return this.list();
|
||||
}
|
||||
LambdaQueryWrapper<EventContactSuggestion> query = Wrappers.lambdaQuery();
|
||||
if (ObjectUtil.isNotNull(inVO.getStartTime())) {
|
||||
query.gt(EventContactSuggestion::getCreateTime, inVO.getStartTime());
|
||||
@ -81,41 +84,22 @@ public class EventContactSuggestionServiceImpl extends ServiceImpl<EventContactS
|
||||
}
|
||||
List<EventContactSuggestion> list = this.list(query);
|
||||
Map<String, String> titleMap = new LinkedHashMap<>(16);
|
||||
titleMap.put("num", "num");
|
||||
titleMap.put("contact_name", "联系人名称");
|
||||
titleMap.put("suggestion_type", "意见类型");
|
||||
titleMap.put("suggestion_content", "意见内容");
|
||||
titleMap.put("num", "序号");
|
||||
titleMap.put("contactName", "联系人名称");
|
||||
titleMap.put("suggestionType", "意见类型");
|
||||
titleMap.put("suggestionContent", "意见内容");
|
||||
titleMap.put("instructions", "补充说明");
|
||||
titleMap.put("suggestion_sponsor", "意见提出人");
|
||||
titleMap.put("suggestion_sponsor_id", "意见提出人id");
|
||||
titleMap.put("suggestion_sponsor_unit", "意见提出人组织机构");
|
||||
titleMap.put("remark", "备注");
|
||||
titleMap.put("create_time", "创建时间");
|
||||
titleMap.put("suggestionSponsor", "意见提出人");
|
||||
titleMap.put("suggestionSponsorId", "意见提出人id");
|
||||
titleMap.put("suggestionSponsorUnit", "意见提出人组织机构");
|
||||
titleMap.put("createTime", "创建时间");
|
||||
titleMap.put("company", "公司");
|
||||
//制作表格
|
||||
ExcelTable table = new ExcelTable("第一页");
|
||||
DateFormat df = new SimpleDateFormat("yyyyMMddhhmmss");
|
||||
table.setFileName("表" + df.format(new Date()));
|
||||
/*第0行*/
|
||||
ExcelTr tr0 = new ExcelTr();
|
||||
tr0.setHeight(800);
|
||||
tr0.add(new ExcelTd().setTdValue("表").setIsRowMerge(true).setRowMergeNum(8).setCellStyleKey("name"));
|
||||
table.add(tr0);
|
||||
/*第一行*/
|
||||
ExcelTr tr1 = new ExcelTr();
|
||||
tr1.setHeight(480);
|
||||
tr1.add(new ExcelTd().setTdValue("序号").setCellStyleKey("title1"));
|
||||
tr1.add(new ExcelTd().setTdValue("联系人名称").setCellStyleKey("title1"));
|
||||
tr1.add(new ExcelTd().setTdValue("意见类型").setCellStyleKey("title1"));
|
||||
tr1.add(new ExcelTd().setTdValue("意见内容").setCellStyleKey("title1"));
|
||||
tr1.add(new ExcelTd().setTdValue("补充说明").setCellStyleKey("title1"));
|
||||
tr1.add(new ExcelTd().setTdValue("意见提出人").setCellStyleKey("title1"));
|
||||
tr1.add(new ExcelTd().setTdValue("意见提出人公司").setCellStyleKey("title1"));
|
||||
tr1.add(new ExcelTd().setTdValue("意见提出人组织机构").setCellStyleKey("title1"));
|
||||
tr1.add(new ExcelTd().setTdValue("备注").setCellStyleKey("title1"));
|
||||
tr1.add(new ExcelTd().setTdValue("创建时间").setCellStyleKey("title1"));
|
||||
table.setFileName(df.format(new Date()));
|
||||
|
||||
|
||||
table.add(tr1);
|
||||
|
||||
/*第4行开始投递数据表头*/
|
||||
ExcelTr tr4 = new ExcelTr();
|
||||
|
@ -65,28 +65,28 @@ public class EventMockDataServiceImpl extends ServiceImpl<EventMockDataMapper, E
|
||||
List<EventMockData> list = this.list(query.eq(EventMockData::getStatus, "1"));
|
||||
list.forEach(l -> {
|
||||
String dataPy = l.getDataPy();
|
||||
if ("ddjyze".equals(dataPy)) {
|
||||
if ("ddjyze".equals(dataPy) && StrUtil.isNotBlank(inVO.getDdjyze())) {
|
||||
l.setDataValue(inVO.getDdjyze());
|
||||
}
|
||||
if ("ddzsl".equals(dataPy)) {
|
||||
if ("ddzsl".equals(dataPy) && StrUtil.isNotBlank(inVO.getDdzsl())) {
|
||||
l.setDataValue(inVO.getDdzsl());
|
||||
}
|
||||
if ("spsl".equals(dataPy)) {
|
||||
if ("spsl".equals(dataPy) && StrUtil.isNotBlank(inVO.getSpsl())) {
|
||||
l.setDataValue(inVO.getSpsl());
|
||||
}
|
||||
if ("xysl".equals(dataPy)) {
|
||||
if ("xysl".equals(dataPy) && StrUtil.isNotBlank(inVO.getXysl())) {
|
||||
l.setDataValue(inVO.getXysl());
|
||||
}
|
||||
if ("yxdy".equals(dataPy)) {
|
||||
if ("yxdy".equals(dataPy) && StrUtil.isNotBlank(inVO.getYxdy())) {
|
||||
l.setDataValue(inVO.getYxdy());
|
||||
}
|
||||
if ("ftrs".equals(dataPy)) {
|
||||
if ("ftrs".equals(dataPy) && StrUtil.isNotBlank(inVO.getFtrs())) {
|
||||
l.setDataValue(inVO.getFtrs());
|
||||
}
|
||||
if ("bzxq".equals(dataPy)) {
|
||||
if ("bzxq".equals(dataPy) && StrUtil.isNotBlank(inVO.getBzxq())) {
|
||||
l.setDataValue(inVO.getBzxq());
|
||||
}
|
||||
if ("gjknxm".equals(dataPy)) {
|
||||
if ("gjknxm".equals(dataPy) && StrUtil.isNotBlank(inVO.getGjknxm())) {
|
||||
l.setDataValue(inVO.getGjknxm());
|
||||
}
|
||||
});
|
||||
|
@ -86,15 +86,18 @@ public class EventStyleServiceImpl extends ServiceImpl<EventStyleMapper, EventSt
|
||||
|
||||
@Override
|
||||
public List<EventMaintainOutVO> queryStyleAndProject(EventMaintainInVO inVO) {
|
||||
if (ObjectUtil.isNotNull(inVO)) {
|
||||
inVO = new EventMaintainInVO();
|
||||
}
|
||||
List<EventMaintainOutVO> outVOList = new ArrayList<>();
|
||||
List<EventStyle> styleList = new ArrayList<>();
|
||||
if (StrUtil.isNotBlank(inVO.getType()) && !"3".equals(inVO.getType()) ) {
|
||||
|
||||
List<EventSubject> subjectList = new ArrayList<>();
|
||||
LambdaQueryWrapper<EventStyle> queryStyle = Wrappers.lambdaQuery();
|
||||
queryStyle.ne(EventStyle::getDeleteFlag, "1");
|
||||
|
||||
LambdaQueryWrapper<EventSubject> queryProject = Wrappers.lambdaQuery();
|
||||
queryProject.ne(EventSubject::getDeleteFlag, "1");
|
||||
if (ObjectUtil.isNull(inVO)) {
|
||||
styleList = this.list(queryStyle);
|
||||
subjectList = eventSubjectService.list(queryProject);
|
||||
} else {
|
||||
if (StrUtil.isNotBlank(inVO.getType()) && !"3".equals(inVO.getType()) ) {
|
||||
if (StrUtil.isNotBlank(inVO.getTitle())) {
|
||||
queryStyle.like(EventStyle::getTitle, inVO.getTitle());
|
||||
}
|
||||
@ -114,11 +117,9 @@ public class EventStyleServiceImpl extends ServiceImpl<EventStyleMapper, EventSt
|
||||
styleList = this.list(queryStyle);
|
||||
}
|
||||
|
||||
List<EventSubject> subjectList = new ArrayList<>();
|
||||
|
||||
if (StrUtil.isNotBlank(inVO.getType()) && !"1".equals(inVO.getType()) && !"2".equals(inVO.getType())) {
|
||||
|
||||
LambdaQueryWrapper<EventSubject> queryProject = Wrappers.lambdaQuery();
|
||||
queryProject.ne(EventSubject::getDeleteFlag, "1");
|
||||
if (StrUtil.isNotBlank(inVO.getTitle())) {
|
||||
queryProject.like(EventSubject::getTitle, inVO.getTitle());
|
||||
}
|
||||
@ -135,6 +136,8 @@ public class EventStyleServiceImpl extends ServiceImpl<EventStyleMapper, EventSt
|
||||
}
|
||||
subjectList = eventSubjectService.list(queryProject);
|
||||
}
|
||||
}
|
||||
List<EventMaintainOutVO> outVOList = new ArrayList<>();
|
||||
|
||||
if (!styleList.isEmpty()) {
|
||||
styleList.forEach(s -> outVOList.add(
|
||||
@ -167,7 +170,7 @@ public class EventStyleServiceImpl extends ServiceImpl<EventStyleMapper, EventSt
|
||||
.sendTime(s.getSendTime())
|
||||
.build()));
|
||||
}
|
||||
return outVOList.stream().sorted(Comparator.comparing(EventMaintainOutVO::getSendTime).reversed()).collect(Collectors.toList());
|
||||
return outVOList.stream().sorted(Comparator.comparing(EventMaintainOutVO::getSendTime, Comparator.nullsLast(LocalDateTime::compareTo)).reversed()).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user