代码提交

This commit is contained in:
glj 2023-04-10 11:17:50 +08:00
parent 08d2b53896
commit ef795818c1
2 changed files with 78 additions and 0 deletions

View File

@ -0,0 +1,45 @@
package com.kening.vordm.vo;
import com.kening.vordm.entity.DisasterInfo;
import lombok.Getter;
import lombok.Setter;
import java.util.Date;
@Getter
@Setter
public class CallForHelpVo extends DisasterInfo {
/**
* 灾害id
*/
private Long disasterId;
/**
* 账户id
*/
private Long accountId;
/**
* 用户名称
*/
private String username;
/**
* 用户邮件
*/
private String email;
/**
* 用户组织机构
*/
private String organization;
/**
* 研究范围
*/
private String researchField;
/**
* 创建时间
*/
private Date createTime;
}

View File

@ -1,11 +1,14 @@
package com.kening.vordm.controller;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.kening.vordm.entity.*;
import com.kening.vordm.service.*;
import com.kening.vordm.vo.CallForHelpVo;
import com.kening.vordm.vo.DisasterMangerInfo;
import com.kening.vordm.vo.GroupByUse;
import com.kening.vordm.vo.UserTenantVo;
@ -31,6 +34,10 @@ public class DisasterInfoController {
private final NewsService newsService;
private final PictureInfoService pictureInfoService;
private final GuestInfoService guestInfoService;
private final GuestManageDisasterRefService guestManageDisasterRefService;
//下载次数记录
private final DownloadRecordService downloadRecordService;
@ -171,4 +178,30 @@ public class DisasterInfoController {
public R<List<UserTenantVo>> getUserTenant() {
return R.data(disasterInfoService.getAllUser());
}
/**
* call for help
*
*/
@PostMapping("Call-for-help")
public R<Boolean> insertRespondInfo(@RequestBody CallForHelpVo callForHelpVo){
GuestInfo guestInfo = new GuestInfo();
BeanUtil.copyProperties(callForHelpVo, guestInfo);
guestInfo.setId(IdWorker.getId());
DisasterInfo disasterInfo = new DisasterInfo();
BeanUtil.copyProperties(callForHelpVo, disasterInfo);
disasterInfo.setId(IdWorker.getId());
GuestManageDisasterRef GuestManageDisasterRef = new GuestManageDisasterRef();
GuestManageDisasterRef.setId(IdWorker.getId());
GuestManageDisasterRef.setSponsorId(guestInfo.getId());
String vordm_id="test";
GuestManageDisasterRef.setDisasterId(disasterInfo.getId());
Boolean flag1=guestInfoService.save(guestInfo);
Boolean flag2= guestManageDisasterRefService.save(GuestManageDisasterRef);
Boolean flag3=disasterInfoService.save(disasterInfo);
Boolean callForHelp= flag1&flag2&flag3;
// callForHelpVo.setId(IdWorker.getId());
// Boolean insertFlag=accountInfoService.save(accountInfo);
return R.data(callForHelp);
}
}