glj-代码提交

This commit is contained in:
管李杰 2024-05-30 09:11:56 +08:00
parent 361a4425b7
commit 2c8bfdfb44
10 changed files with 270 additions and 120 deletions

View File

@ -58,5 +58,8 @@ public class Administrator extends BaseEntity {
private Integer status;
//分数
private Integer fraction;
private Integer isDeleted;
}

View File

@ -117,24 +117,35 @@ public class DisasterInfo implements Serializable {
private String sponsorOrganization;
/**
* 灾害管理者id
* 灾害管理者id_B1
*/
private Long chiefId;
/**
* 灾害管理者名称_B1
*/
private String chiefName;
/**
* 是否发起灾害响应结束申请0未发起/1发起审批/2审批通过/3审批不通过
*/
private Integer isEndApply;
private String chiefName;
/**
* 完成时间
*/
private Date respondedTime;
/**
* 灾害管理者id_B2
*/
private Long adminId;
/**
* 灾害管理者名称_B2
*/
private String adminName;
/**
* 管理用户
*/

View File

@ -51,6 +51,11 @@ public class GuestManageDisasterRef implements Serializable {
*/
private Date reviewTime;
/**
* 管理人
*/
private Long adminId;
@TableField(exist = false)
private static final long serialVersionUID = 1L;

View File

@ -9,6 +9,10 @@ import java.util.Date;
@Getter
@Setter
public class CallForHelpVo extends DisasterInfo {
/**
* 灾害id
*/
private Long id;
/**
* 灾害id
@ -102,6 +106,9 @@ public class CallForHelpVo extends DisasterInfo {
*/
private Long parentId;
//发起用户
private Long sponsorId;
private String roleAlias;
private Integer respondStatus;

View File

@ -77,6 +77,11 @@ public class MenuVO extends Menu implements INode<MenuVO> {
*/
private String parentName;
/**
* 图标
*/
private String source;
/**
* 菜单类型
*/

View File

@ -37,11 +37,12 @@ import java.util.stream.Collectors;
@RequestMapping("/ui/disasterInfo")
public class DisasterInfoController {
private final AdministratorService administratorService;
private final DisasterInfoService disasterInfoService;
private final WebsitesService websitesService;
private final PictureInfoService pictureInfoService;
private final GuestInfoService guestInfoService;
@ -312,20 +313,7 @@ public class DisasterInfoController {
*/
@PostMapping("Call-for-help")
public R<Boolean> insertRespondInfo(@RequestBody CallForHelpVo callForHelpVo) {
LambdaQueryWrapper<GuestInfo> qw = new LambdaQueryWrapper<>();
qw.eq(GuestInfo::getEmail, callForHelpVo.getEmail());
GuestInfo one = guestInfoService.getOne(qw);
GuestInfo guestInfo = new GuestInfo();
BeanUtil.copyProperties(callForHelpVo, guestInfo);
Boolean flag1 = false;
if (one == null) {
guestInfo.setId(IdWorker.getId());
flag1 = guestInfoService.save(guestInfo);
} else {
guestInfo.setId(one.getId());
flag1 = guestInfoService.updateById(guestInfo);
}
DisasterInfo disasterInfo = new DisasterInfo();
BeanUtil.copyProperties(callForHelpVo, disasterInfo);
disasterInfo.setUploadTime(new Date());
@ -335,26 +323,70 @@ public class DisasterInfoController {
Boolean flag3 = disasterInfoService.save(disasterInfo);
GuestManageDisasterRef guestManageDisasterRef = new GuestManageDisasterRef();
guestManageDisasterRef.setSponsorId(guestInfo.getId());
guestManageDisasterRef.setDisasterId(disasterInfo.getId());
guestManageDisasterRef.setApplyTime(new Date());
Boolean flag2 = guestManageDisasterRefService.save(guestManageDisasterRef);
//是否是注册用户
LambdaQueryWrapper<Administrator> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(Administrator::getEmail, callForHelpVo.getEmail());
Administrator administrator = administratorService.getOne(queryWrapper);
Boolean callForHelp = flag1 && flag2 && flag3;
return R.data(callForHelp);
if (administrator == null) {
LambdaQueryWrapper<GuestInfo> qw = new LambdaQueryWrapper<>();
qw.eq(GuestInfo::getEmail, callForHelpVo.getEmail());
GuestInfo one = guestInfoService.getOne(qw);
GuestInfo guestInfo = new GuestInfo();
BeanUtil.copyProperties(callForHelpVo, guestInfo);
if (one == null) {
guestInfo.setId(IdWorker.getId());
guestInfoService.save(guestInfo);
} else {
guestInfo.setId(one.getId());
guestInfoService.updateById(guestInfo);
}
GuestManageDisasterRef guestManageDisasterRef = new GuestManageDisasterRef();
guestManageDisasterRef.setSponsorId(guestInfo.getId());
guestManageDisasterRef.setDisasterId(disasterInfo.getId());
guestManageDisasterRef.setApplyTime(new Date());
guestManageDisasterRefService.save(guestManageDisasterRef);
} else {
GuestManageDisasterRef guestManageDisasterRef = new GuestManageDisasterRef();
guestManageDisasterRef.setSponsorId(administrator.getId());
guestManageDisasterRef.setDisasterId(disasterInfo.getId());
guestManageDisasterRef.setApplyTime(new Date());
guestManageDisasterRefService.save(guestManageDisasterRef);
}
return R.data(flag3);
}
private final AdministratorService administratorService;
@PostMapping("review")
public R<Boolean> review(@RequestBody DisasterInfo disasterInfo) {
//审核邮件实例化
Email email = new Email();
//查询邮箱
QueryWrapper<GuestInfo> qw = new QueryWrapper<>();
qw.apply("id = (select sponsor_id from guest_manage_disaster_ref where disaster_id = {0})", disasterInfo.getId());
GuestInfo guestInfo = guestInfoService.getOne(qw);
//获取用户信息
LambdaQueryWrapper<GuestManageDisasterRef> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(GuestManageDisasterRef::getDisasterId, disasterInfo.getId());
GuestManageDisasterRef one = guestManageDisasterRefService.getOne(queryWrapper);
GuestInfo guestInfo = new GuestInfo();
LambdaQueryWrapper<GuestInfo> guestInfoQw = new LambdaQueryWrapper<>();
guestInfoQw.eq(GuestInfo::getId, one.getSponsorId());
GuestInfo guestInfoNew = guestInfoService.getOne(guestInfoQw);
if (guestInfoNew == null) {
LambdaQueryWrapper<Administrator> administratorQw = new LambdaQueryWrapper<>();
administratorQw.eq(Administrator::getId, one.getSponsorId());
Administrator administrator = administratorService.getOne(administratorQw);
guestInfo.setId(administrator.getId());
guestInfo.setEmail(administrator.getEmail());
Integer fractionUser = administrator.getFraction();
administrator.setFraction(fractionUser + 1);
administratorService.updateById(administrator);
}else {
guestInfo.setId(guestInfoNew.getId());
guestInfo.setEmail(guestInfoNew.getEmail());
}
//审批通过 响应状态0未审批1审批未通过2审批通过并正在响应3审批通过并且响应完成
@ -369,7 +401,7 @@ public class DisasterInfoController {
String html = "<a href='http://121.89.234.154:6300/vordm/Responding'>here</a>";
email.setSubject("Your disaster response application has been approved!");
String content = "The disaster reduction request for the " + disasterInfoVo.getDisasterCountry()+ " " +disasterInfoVo.getDictValue()+"("+simpleDateFormat.format(disasterInfoVo.getDisasterTime())+")" +"has been approved by the VoRDM office. Click " +html+" to check!";
String content = "The disaster reduction request for the " + disasterInfoVo.getDisasterCountry() + " " + disasterInfoVo.getDictValue() + "(" + simpleDateFormat.format(disasterInfoVo.getDisasterTime()) + ")" + "has been approved by the VoRDM office. Click " + html + " to check!";
email.setText(content);
email.setHtmlText(true);
@ -446,7 +478,7 @@ public class DisasterInfoController {
email.setSubject("You have a Disaster Response task pending");
String html = "<a href='http://121.89.234.154:6300/vordm/Responding'>go and check</a>";
String text = "Dear administrator "+user.getName()+", you have been assigned by the VoRDM office to respond to the "+disasterInfoVo.getDisasterCountry()+" "+ disasterInfoVo.getDictValue()+"("+simpleDateFormat.format(disasterInfoVo.getDisasterTime()) +")"+". Please "+html+" in a timely manner.";
String text = "Dear administrator " + user.getName() + ", you have been assigned by the VoRDM office to respond to the " + disasterInfoVo.getDisasterCountry() + " " + disasterInfoVo.getDictValue() + "(" + simpleDateFormat.format(disasterInfoVo.getDisasterTime()) + ")" + ". Please " + html + " in a timely manner.";
email.setText(text);
String[] to = new String[]{user.getEmail()};
@ -461,8 +493,52 @@ public class DisasterInfoController {
return R.status(disasterInfoService.saveOrUpdate(disasterInfo));
}
@ApiOperation(value = "提交", notes = "传入DisasterInfo")
@PostMapping("/submitByAdmin")
public R submitByAdmin(@ApiParam(value = "DisasterInfo对象", required = true) @RequestBody DisasterInfo disasterInfo) {
Long chiefId = disasterInfo.getAdminId();
//判断是否是分配
String Allocation = disasterInfo.getAllocation();
LambdaQueryWrapper<GuestManageDisasterRef> qw = new LambdaQueryWrapper<>();
qw.eq(GuestManageDisasterRef::getDisasterId, disasterInfo.getId());
GuestManageDisasterRef one = guestManageDisasterRefService.getOne(qw);
one.setStatus(1);
one.setAdminId(chiefId);
guestManageDisasterRefService.updateById(one);
disasterInfoService.updateById(disasterInfo);
//获得disasterInfo
disasterInfo = disasterInfoService.getById(disasterInfo.getId());
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
if (!StringUtil.isEmpty(Allocation)) {
Administrator user = administratorService.getById(chiefId);
//获取灾害详情
DisasterInfoVo disasterInfoVo = disasterInfoVoService.getById(disasterInfo.getId());
//发送邮件
Email email = new Email();
email.setSubject("You have a Disaster Response task pending");
String html = "<a href='http://121.89.234.154:6300/vordm/Responding'>go and check</a>";
String text = "Dear administrator " + user.getName() + ", you have been assigned by the VoRDM office to respond to the " + disasterInfoVo.getDisasterCountry() + " " + disasterInfoVo.getDictValue() + "(" + simpleDateFormat.format(disasterInfoVo.getDisasterTime()) + ")" + ". Please " + html + " in a timely manner.";
email.setText(text);
String[] to = new String[]{user.getEmail()};
email.setTos(to);
email.setHtmlText(true);
try {
emailService.sendMimeMessage(email);
} catch (Exception e) {
return R.fail("Sending failed, please check if the email is correct!");
}
}
return R.status(disasterInfoService.saveOrUpdate(disasterInfo));
}
/**
* 取消管理员对灾害的管理权限
*
* @param id
* @return
*/
@ -475,15 +551,15 @@ public class DisasterInfoController {
one.setManagerId(null);
LambdaUpdateWrapper<GuestManageDisasterRef> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.eq(GuestManageDisasterRef::getId,one.getId());
lambdaUpdateWrapper.set(GuestManageDisasterRef::getStatus,3);
lambdaUpdateWrapper.set(GuestManageDisasterRef::getManagerId,null);
lambdaUpdateWrapper.eq(GuestManageDisasterRef::getId, one.getId());
lambdaUpdateWrapper.set(GuestManageDisasterRef::getStatus, 3);
lambdaUpdateWrapper.set(GuestManageDisasterRef::getManagerId, null);
guestManageDisasterRefService.update(lambdaUpdateWrapper);
LambdaUpdateWrapper<DisasterInfo> disasterInfoLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
disasterInfoLambdaUpdateWrapper.eq(DisasterInfo::getId,id);
disasterInfoLambdaUpdateWrapper.set(DisasterInfo::getChiefId,null);
disasterInfoLambdaUpdateWrapper.set(DisasterInfo::getChiefName,null);
disasterInfoLambdaUpdateWrapper.eq(DisasterInfo::getId, id);
disasterInfoLambdaUpdateWrapper.set(DisasterInfo::getChiefId, null);
disasterInfoLambdaUpdateWrapper.set(DisasterInfo::getChiefName, null);
return R.status(disasterInfoService.update(disasterInfoLambdaUpdateWrapper));
}
@ -498,11 +574,11 @@ public class DisasterInfoController {
}
@GetMapping("/statisticsByUser")
public R statisticsByUser(String year,Long userId,String email,Long roleId) {
if (roleId.compareTo(Long.parseLong("1123598816738675203"))==0){
return R.data(disasterInfoService.statisticsByUserNew(year,userId,email));
}else {
return R.data(disasterInfoService.statisticsByUser(year,userId,email));
public R statisticsByUser(String year, Long userId, String email, Long roleId) {
if (roleId.compareTo(Long.parseLong("1123598816738675203")) == 0) {
return R.data(disasterInfoService.statisticsByUserNew(year, userId, email));
} else {
return R.data(disasterInfoService.statisticsByUser(year, userId, email));
}
}
@ -551,8 +627,28 @@ public class DisasterInfoController {
@GetMapping("/responseEndedDisasterInfo")
public R responseEndedDisasterInfo(Long id) {
DisasterInfo disasterInfo = new DisasterInfo();
public R responseEndedDisasterInfo(Long id, Integer fraction) {
DisasterInfo disasterInfo = disasterInfoService.getById(id);
//根据灾害获取B2管理员Id
if (disasterInfo.getAdminId() != null) {
Administrator byId = administratorService.getById(disasterInfo.getAdminId());
Integer fractionUser = byId.getFraction();
Integer fractionUserNew = 0;
if (fraction == 5) {
fractionUserNew = fractionUser + 3;
} else if (fraction == 4) {
fractionUserNew = fractionUser + 2;
} else if (fraction == 3) {
fractionUserNew = fractionUser + 1;
}
byId.setFraction(fractionUserNew);
administratorService.updateById(byId);
}
disasterInfo.setId(id);
disasterInfo.setRespondStatus(3);
disasterInfo.setRespondedTime(new Date());
@ -562,13 +658,13 @@ public class DisasterInfoController {
//chief管理个人中心统计
@GetMapping("/getByUserDisasterInfoStatistics")
public R getByUserDisasterInfo(Long userId, String email) {
return R.data(disasterInfoService.getByUserDisasterInfoStatistics(userId,email));
return R.data(disasterInfoService.getByUserDisasterInfoStatistics(userId, email));
}
//普通用户个人中心统计
@GetMapping("/getByOrdinaryUserDisasterInfoStatistics")
public R getByOrdinaryUserDisasterInfoStatistics(Long userId, String email) {
return R.data(disasterInfoService.getByOrdinaryUserDisasterInfoStatistics(userId,email));
return R.data(disasterInfoService.getByOrdinaryUserDisasterInfoStatistics(userId, email));
}
//根据ID删除
@ -581,13 +677,13 @@ public class DisasterInfoController {
//个人中心列表统计
@GetMapping("/getDisasterInfoByUserId")
public R<List<DisasterInfo>> getDisasterInfoByUserId(Long userId, String email) {
return R.data(disasterInfoService.getDisasterInfoByUserId(userId,email));
return R.data(disasterInfoService.getDisasterInfoByUserId(userId, email));
}
//个人中心列表统计-根据国家分类饼状图
@GetMapping("/getDisasterInfoByUserIdCountry")
public R<Map<String, List<DisasterInfo>>> getDisasterInfoByUserIdCountry(Long userId, String email) {
List<DisasterInfo> disasterInfoByUserId = disasterInfoService.getDisasterInfoByUserId(userId,email);
List<DisasterInfo> disasterInfoByUserId = disasterInfoService.getDisasterInfoByUserId(userId, email);
Map<String, List<DisasterInfo>> collect = disasterInfoByUserId.stream().collect(Collectors.groupingBy(DisasterInfo::getDisasterCountry));
return R.data(collect);
}
@ -595,6 +691,7 @@ public class DisasterInfoController {
/**
* 根据灾害访问次数进行排序
*
* @return
*/
@GetMapping("/getTenDisasterInfo")
@ -617,6 +714,7 @@ public class DisasterInfoController {
/**
* 管理员发起灾害结束申请
*
* @param disasterInfo
* @return
*/
@ -624,14 +722,14 @@ public class DisasterInfoController {
public R<Boolean> examineDisasterInfoEnd(@RequestBody DisasterInfo disasterInfo) {
//是否发起灾害响应结束申请0未发起/1发起审批/2审批通过/3审批不通过
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
if (disasterInfo.getIsEndApply()==2){
if (disasterInfo.getIsEndApply() == 2) {
DisasterInfoVo disasterInfoVo = disasterInfoVoService.getById(disasterInfo.getId());
//发送邮件
Email email = new Email();
email.setSubject("You have a Disaster Response task pending");
String text = "The disaster reduction task of "+disasterInfoVo.getDisasterCountry()+" "+disasterInfoVo.getDictValue()+"("+simpleDateFormat.format(disasterInfoVo.getDisasterTime())+")" +" you claimed has been completed!";
String text = "The disaster reduction task of " + disasterInfoVo.getDisasterCountry() + " " + disasterInfoVo.getDictValue() + "(" + simpleDateFormat.format(disasterInfoVo.getDisasterTime()) + ")" + " you claimed has been completed!";
email.setText(text);
String[] to = new String[]{disasterInfo.getEmail()};
@ -645,7 +743,7 @@ public class DisasterInfoController {
return R.fail("Sending failed, please check if the email is correct!");
}
//审核不通过
}else if (disasterInfo.getIsEndApply()==3){
} else if (disasterInfo.getIsEndApply() == 3) {
// Administrator user = administratorService.getById(disasterInfo.getChiefId());
// DisasterInfoVo disasterInfoVo = disasterInfoVoService.getById(disasterInfo.getId());
//发送邮件
@ -673,15 +771,15 @@ public class DisasterInfoController {
@GetMapping("/getUserDisasterInfoList")
public R<IPage<DisasterInfo>> getUserDisasterInfoList(Query query, @RequestParam Map<String, String> params) {
String type = params.get("type");
if (type.equals("0")){
IPage<DisasterInfo> centerDisasterInfoIPage = disasterInfoService.getUserDisasterInfoListNCI(Condition.getPage(query),params.get("email"));
if (type.equals("0")) {
IPage<DisasterInfo> centerDisasterInfoIPage = disasterInfoService.getUserDisasterInfoListNCI(Condition.getPage(query), params.get("email"));
return R.data(centerDisasterInfoIPage);
}else {
if (params.get("respondStatus") != null){
IPage<DisasterInfo> centerDisasterInfoIPage = disasterInfoService.getUserDisasterInfoListNDRNew(Condition.getPage(query),params.get("userId"),params.get("respondStatus"));
} else {
if (params.get("respondStatus") != null) {
IPage<DisasterInfo> centerDisasterInfoIPage = disasterInfoService.getUserDisasterInfoListNDRNew(Condition.getPage(query), params.get("userId"), params.get("respondStatus"));
return R.data(centerDisasterInfoIPage);
}else {
IPage<DisasterInfo> centerDisasterInfoIPage = disasterInfoService.getUserDisasterInfoListNDR(Condition.getPage(query),params.get("userId"));
} else {
IPage<DisasterInfo> centerDisasterInfoIPage = disasterInfoService.getUserDisasterInfoListNDR(Condition.getPage(query), params.get("userId"));
return R.data(centerDisasterInfoIPage);
}

View File

@ -103,8 +103,17 @@ public class MenuController extends BladeController {
*/
@GetMapping("/role-tree-keys-new")
@ApiOperation(value = "角色所分配的树", notes = "角色所分配的树")
public R<List<Menu>> roleTreeKeysNew(String roleIds) {
return R.data(menuService.roleTreeKeysNew(roleIds));
public R<List<MenuVO>> roleTreeKeysNew(String roleIds) {
List<Menu> menuVOS = menuService.roleTreeKeysNew(roleIds);
List<MenuVO> menuVOS1 = MenuWrapper.build().listNodeVO(menuVOS);
menuVOS1.stream().forEach(menuVO -> {
if (menuVO.getChildren().isEmpty()){
menuVO.setHasChildren(false);
}else {
menuVO.setHasChildren(true);
}
});
return R.data(menuVOS1);
}
/**

View File

@ -176,16 +176,12 @@
<select id="page" parameterType="com.kening.vordm.vo.CallForHelpVo" resultType="com.kening.vordm.vo.CallForHelpVo">
SELECT
d.id,
d.chief_id,
d.chief_name,
d.admin_id,
d.admin_name,
d.vordm_id,
u.username ,
u.last_name AS lastName,
u.first_name AS firstName,
u.id as uid ,
u.email,
u.research_field,
u.organization,
d.id AS disasterId,
d.disaster_type,
d.disaster_time,
@ -198,10 +194,10 @@
d.responded_time,
d.is_end_apply,
ud.review_time AS reviewTime,
ud.sponsor_id AS sponsorId,
bdb.dict_value as dictValue
From
guest_manage_disaster_ref ud join
guest_info u on u.id = ud.sponsor_id JOIN
disaster_info d on d.id = ud.disaster_id
left join blade_dict_biz bdb on d.disaster_type = bdb.dict_key
<where>
@ -339,51 +335,51 @@
SELECT CONCAT(#{year}, '-01') as `key`, sum(t.download_count) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-01')
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-01')
union ALL
SELECT CONCAT(#{year}, '-02') as `key`, sum(t.download_count) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-02')
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-02')
union ALL
SELECT CONCAT(#{year}, '-03') as `key`, sum(t.download_count) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-03')
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-03')
union ALL
SELECT CONCAT(#{year}, '-04') as `key`, sum(t.download_count) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-04')
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-04')
union ALL
SELECT CONCAT(#{year}, '-05') as `key`, sum(t.download_count) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-05')
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-05')
union ALL
SELECT CONCAT(#{year}, '-06') as `key`, sum(t.download_count) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-06')
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-06')
union ALL
SELECT CONCAT(#{year}, '-07') as `key`, sum(t.download_count) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-07')
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-07')
union ALL
SELECT CONCAT(#{year}, '-08') as `key`, sum(t.download_count) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-08')
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-08')
union ALL
SELECT CONCAT(#{year}, '-09') as `key`, sum(t.download_count) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-09')
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-09')
union ALL
SELECT CONCAT(#{year}, '-10') as `key`, sum(t.download_count) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-10')
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-10')
union ALL
SELECT CONCAT(#{year}, '-11') as `key`, sum(t.download_count) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-11')
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-11')
union ALL
SELECT CONCAT(#{year}, '-12') as `key`, sum(t.download_count) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-12')) d
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-12')) d
GROUP BY d.`key`
ORDER BY d.`key`
</select>
@ -454,51 +450,51 @@
SELECT CONCAT(#{year}, '-01') as `key`, count(1) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-01')
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-01')
union ALL
SELECT CONCAT(#{year}, '-02') as `key`, count(1) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-02')
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-02')
union ALL
SELECT CONCAT(#{year}, '-03') as `key`, count(1) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-03')
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-03')
union ALL
SELECT CONCAT(#{year}, '-04') as `key`, count(1) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-04')
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-04')
union ALL
SELECT CONCAT(#{year}, '-05') as `key`, count(1) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-05')
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-05')
union ALL
SELECT CONCAT(#{year}, '-06') as `key`, count(1) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-06')
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-06')
union ALL
SELECT CONCAT(#{year}, '-07') as `key`, count(1) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-07')
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-07')
union ALL
SELECT CONCAT(#{year}, '-08') as `key`, count(1) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-08')
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-08')
union ALL
SELECT CONCAT(#{year}, '-09') as `key`, count(1) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-09')
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-09')
union ALL
SELECT CONCAT(#{year}, '-10') as `key`, count(1) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-10')
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-10')
union ALL
SELECT CONCAT(#{year}, '-11') as `key`, count(1) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-11')
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-11')
union ALL
SELECT CONCAT(#{year}, '-12') as `key`, count(1) as response, 0 as initiate
FROM disaster_info t
where date_format(t.respond_time, '%Y-%m') = CONCAT(#{year}, '-12')) d
where date_format(t.disaster_time, '%Y-%m') = CONCAT(#{year}, '-12')) d
GROUP BY d.`key`
ORDER BY d.`key`
</select>
@ -758,7 +754,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-01')
and gmdr.manager_id = #{userId}
@ -767,7 +763,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-02')
and gmdr.manager_id = #{userId}
@ -776,7 +772,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-03')
and gmdr.manager_id = #{userId}
@ -785,7 +781,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-04')
and gmdr.manager_id = #{userId}
@ -794,7 +790,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-05')
and gmdr.manager_id = #{userId}
@ -803,7 +799,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-06')
and gmdr.manager_id = #{userId}
@ -812,7 +808,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-07')
and gmdr.manager_id = #{userId}
@ -821,7 +817,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-08')
and gmdr.manager_id = #{userId}
@ -830,7 +826,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-09')
and gmdr.manager_id = #{userId}
@ -839,7 +835,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-10')
and gmdr.manager_id = #{userId}
@ -848,7 +844,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-11')
and gmdr.manager_id = #{userId}
@ -857,7 +853,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-12')
and gmdr.manager_id = #{userId}
@ -1561,7 +1557,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-01')
and gmdr.manager_id = #{userId}
@ -1570,7 +1566,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-02')
and gmdr.manager_id = #{userId}
@ -1579,7 +1575,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-03')
and gmdr.manager_id = #{userId}
@ -1588,7 +1584,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-04')
and gmdr.manager_id = #{userId}
@ -1597,7 +1593,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-05')
and gmdr.manager_id = #{userId}
@ -1606,7 +1602,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-06')
and gmdr.manager_id = #{userId}
@ -1615,7 +1611,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-07')
and gmdr.manager_id = #{userId}
@ -1624,7 +1620,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-08')
and gmdr.manager_id = #{userId}
@ -1633,7 +1629,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-09')
and gmdr.manager_id = #{userId}
@ -1642,7 +1638,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-10')
and gmdr.manager_id = #{userId}
@ -1651,7 +1647,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-11')
and gmdr.manager_id = #{userId}
@ -1660,7 +1656,7 @@
FROM disaster_info t
LEFT JOIN guest_manage_disaster_ref gmdr
on gmdr.disaster_id = t.id
where date_format(t.respond_time
where date_format(t.disaster_time
, '%Y-%m') = CONCAT(#{year}
, '-12')
and gmdr.manager_id = #{userId}

View File

@ -208,7 +208,7 @@
</select>
<select id="grantTreeByRole" resultMap="treeNodeResultMap">
select id, parent_id, name as title, id as "value", id as "key" from blade_menu where is_deleted = 0
select id, source, parent_id, name as title, id as "value", id as "key" from blade_menu where is_deleted = 0
and id in ( select menu_id from blade_role_menu where role_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}

View File

@ -39,6 +39,8 @@ public class DisasterInfoServiceImpl extends ServiceImpl<DisasterInfoMapper, Dis
private final GuestInfoMapper guestInfoMapper;
private final AdministratorMapper administratorMapper;
private final ToolMapper toolMapper;
private final GuestManageDisasterRefService guestManageDisasterRefService;
@ -148,7 +150,21 @@ public class DisasterInfoServiceImpl extends ServiceImpl<DisasterInfoMapper, Dis
@Override
public IPage<CallForHelpVo> page(IPage<CallForHelpVo> page, CallForHelpVo callForHelpVo) {
return page.setRecords(this.baseMapper.page(page, callForHelpVo));
List<CallForHelpVo> callForHelpVoList = this.baseMapper.page(page, callForHelpVo);
callForHelpVoList.stream().forEach(callForHelpVo1 -> {
GuestInfo guestInfo = guestInfoMapper.selectById(callForHelpVo1.getSponsorId());
if (guestInfo!=null){
callForHelpVo1.setUsername(guestInfo.getUsername());
callForHelpVo1.setEmail(guestInfo.getEmail());
callForHelpVo1.setOrganization(guestInfo.getOrganization());
}else {
Administrator administrator = administratorMapper.selectById(callForHelpVo1.getSponsorId());
callForHelpVo1.setUsername(administrator.getName());
callForHelpVo1.setEmail(administrator.getEmail());
callForHelpVo1.setOrganization(administrator.getOrganization());
}
});
return page.setRecords(callForHelpVoList);
}
@Override