glj-代码提交

This commit is contained in:
glj 2023-05-08 18:31:02 +08:00
parent 7cc3c69023
commit 525346db87
14 changed files with 41 additions and 27 deletions

View File

@ -102,5 +102,5 @@ public class CallForHelpVo extends DisasterInfo {
*/
private Long parentId;
private String roleAlias;
}

View File

@ -167,7 +167,7 @@ public class EntityDataUserVo {
/**
* 生产时间
*/
private Date productTime;
private String productTime;
/**

View File

@ -79,11 +79,11 @@ public class DisasterInfoController {
})
@GetMapping("/list")
public R<IPage<CallForHelpVo>> list(CallForHelpVo CallForHelpVo, Query query) {
CallForHelpVo userRole = disasterInfoService.getByNameRole("admin");
String userRole1 = AuthUtil.getUserRole();
if (CallForHelpVo.getChiefIdEquals()!=null){
if (userRole1.equals("TENANT_ADMIN") && CallForHelpVo.getChiefIdEquals().equals(userRole.getRoleId())){
CallForHelpVo userRole = disasterInfoService.getByUserIdRole(CallForHelpVo.getChiefIdEquals());
if (userRole1.equals("TENANT_ADMIN") && userRole.getRoleAlias().equals("TENANT_ADMIN")){
CallForHelpVo.setChiefIdEquals(null);
}
}else {

View File

@ -38,8 +38,8 @@ public class EntityDataController {
* @return
*/
@GetMapping("/getEntityDataSourceOrganization")
public R<List<UserTenantVo>> getEntityDataSourceOrganization() {
return R.data(entityDataService.getEntityDataSourceOrganization());
public R<List<UserTenantVo>> getEntityDataSourceOrganization(Long disasterId) {
return R.data(entityDataService.getEntityDataSourceOrganization(disasterId));
}

View File

@ -71,4 +71,9 @@ public class RemoteSensingSourceDataController {
qw.eq("disaster_id", disasterId);
return R.data(remoteSensingSourceDataService.page(Condition.getPage(query), qw));
}
@PostMapping("/approval")
public R approval(@RequestBody RemoteSensingSourceData remoteSensingSourceData){
return R.status(remoteSensingSourceDataService.updateById(remoteSensingSourceData));
}
}

View File

@ -81,6 +81,6 @@ public interface DisasterInfoMapper extends BaseMapper<DisasterInfo> {
List<Map<String, Long>> disasterNum(String year);
CallForHelpVo getByNameRole(@Param("admin") String admin);
CallForHelpVo getByUserIdRole(@Param("chiefIdEquals") Long chiefIdEquals);
}

View File

@ -371,8 +371,14 @@
</select>
<select id="getByNameRole" resultType="com.kening.vordm.vo.CallForHelpVo">
SELECT id AS roleId, parent_id AS parentId, role_name AS roleName FROM blade_role WHERE role_name = #{admin}
<select id="getByUserIdRole" resultType="com.kening.vordm.vo.CallForHelpVo">
SELECT br.role_alias AS roleAlias,
br.id AS roleId,
br.parent_id AS parentId,
br.role_name AS roleName
FROM blade_user bu
left JOIN blade_role br on bu.role_id = br.id
WHERE bu.id = #{chiefIdEquals}
</select>
</mapper>

View File

@ -21,6 +21,6 @@ public interface EntityDataMapper extends BaseMapper<EntityData> {
IPage<EntityData> getEntityDataList(@Param("entityData") EntityData entityData, IPage<Object> page);
List<UserTenantVo> getEntityDataSourceOrganization();
List<UserTenantVo> getEntityDataSourceOrganization(@Param("disasterId") Long disasterId);
}

View File

@ -71,6 +71,11 @@
<select id="getEntityDataSourceOrganization" resultType="com.kening.vordm.vo.UserTenantVo">
select ed.source_organization AS organizationName
from entity_data ed
<where>
<if test="disasterId != null and disasterId != ''">
ed.disaster_id = #{disasterId}
</if>
</where>
GROUP BY ed.source_organization
</select>
</mapper>

View File

@ -43,11 +43,8 @@
<select id="getByUserStatisticsOne" resultType="java.lang.Integer">
select count(di.id)
FROM disaster_info di
inner join guest_manage_disaster_ref gmdr on gmdr.disaster_id = di.id
inner join guest_info gi on gi.id = gmdr.sponsor_id
inner join blade_user bu on bu.email = gi.email
<where>
bu.id = #{userId}
di.chief_id = #{userId}
and di.respond_status = 3
</where>
</select>
@ -55,11 +52,8 @@
<select id="getByUserStatisticsTwo" resultType="java.lang.Integer">
select count(di.id)
FROM disaster_info di
inner join guest_manage_disaster_ref gmdr on gmdr.disaster_id = di.id
inner join guest_info gi on gi.id = gmdr.sponsor_id
inner join blade_user bu on bu.email = gi.email
<where>
bu.id = #{userId}
di.chief_id = #{userId}
and di.respond_status = 2
</where>

View File

@ -73,5 +73,5 @@ public interface DisasterInfoService extends IService<DisasterInfo> {
UserVo getByUserDisasterInfoStatistics(Long userId);
CallForHelpVo getByNameRole(String anmin);
CallForHelpVo getByUserIdRole(Long chiefIdEquals);
}

View File

@ -20,10 +20,10 @@ public interface EntityDataService extends IService<EntityData> {
IPage<EntityData> getEntityDataList(IPage<Object> page, EntityData entityData);
/**
* 获取所不可可视化下机构信息
* 获取所不可可视化下机构信息
* @return
*/
List<UserTenantVo> getEntityDataSourceOrganization();
List<UserTenantVo> getEntityDataSourceOrganization(Long disasterId);
/**
* Resource upload 上传实体信息

View File

@ -236,8 +236,8 @@ public class DisasterInfoServiceImpl extends ServiceImpl<DisasterInfoMapper, Dis
}
@Override
public CallForHelpVo getByNameRole(String anmin) {
return this.baseMapper.getByNameRole(anmin);
public CallForHelpVo getByUserIdRole(Long chiefIdEquals) {
return this.baseMapper.getByUserIdRole(chiefIdEquals);
}
/**

View File

@ -1,5 +1,6 @@
package com.kening.vordm.service.impl;
import cn.hutool.core.date.DateTime;
import com.alibaba.nacos.common.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -25,6 +26,8 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -64,8 +67,8 @@ public class EntityDataServiceImpl extends ServiceImpl<EntityDataMapper, EntityD
* @return
*/
@Override
public List<UserTenantVo> getEntityDataSourceOrganization() {
return this.baseMapper.getEntityDataSourceOrganization();
public List<UserTenantVo> getEntityDataSourceOrganization(Long disasterId) {
return this.baseMapper.getEntityDataSourceOrganization(disasterId);
}
@ -105,7 +108,9 @@ public class EntityDataServiceImpl extends ServiceImpl<EntityDataMapper, EntityD
remoteSensingSourceData.setSatelliteCode(entityDataUserVo.getSatelliteCode());
remoteSensingSourceData.setProductResolution(entityDataUserVo.getProductResolution());
remoteSensingSourceData.setCloudCover(entityDataUserVo.getCloudCover());
remoteSensingSourceData.setProductTime(entityDataUserVo.getProductTime());
Date date= new Date(DateTime.parse(entityDataUserVo.getProductTime()));
remoteSensingSourceData.setProductTime(date);
remoteSensingSourceData.setProductBandsNum(entityDataUserVo.getProductBandsNum());
//0-爬虫获取1-未审核2-已审核上传源数据未补充下载 链接3-已审核上传源数据已补充下载链接
remoteSensingSourceData.setStatus(1);
@ -141,5 +146,4 @@ public class EntityDataServiceImpl extends ServiceImpl<EntityDataMapper, EntityD
}
}
}