glj-代码提交

This commit is contained in:
管李杰 2024-07-10 18:06:53 +08:00
parent 5a281ac912
commit d5f552784d
11 changed files with 62 additions and 56 deletions

View File

@ -115,7 +115,7 @@ public class EntityDataAll implements Serializable {
private Integer isDeleted; private Integer isDeleted;
/** /**
* 是否发布0未发布/1已发布 * 是否发布0未发布/1已发布w
*/ */
private Integer isPublish; private Integer isPublish;

View File

@ -41,53 +41,19 @@ public class GuestApplyDisasterRef implements Serializable {
*/ */
private Long adminId; private Long adminId;
/**
* 用户邮件
*/
@TableField(exist = false)
private String userName;
/**
* 用户邮件
*/
@TableField(exist = false)
private String userEmail;
@TableField(exist = false) @TableField(exist = false)
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
GuestApplyDisasterRef other = (GuestApplyDisasterRef) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getDisasterId() == null ? other.getDisasterId() == null : this.getDisasterId().equals(other.getDisasterId()))
&& (this.getUserStatus() == null ? other.getUserStatus() == null : this.getUserStatus().equals(other.getUserStatus()))
&& (this.getApplyTime() == null ? other.getApplyTime() == null : this.getApplyTime().equals(other.getApplyTime()))
&& (this.getAdminId() == null ? other.getAdminId() == null : this.getAdminId().equals(other.getAdminId()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getDisasterId() == null) ? 0 : getDisasterId().hashCode());
result = prime * result + ((getUserStatus() == null) ? 0 : getUserStatus().hashCode());
result = prime * result + ((getApplyTime() == null) ? 0 : getApplyTime().hashCode());
result = prime * result + ((getAdminId() == null) ? 0 : getAdminId().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", disasterId=").append(disasterId);
sb.append(", userStatus=").append(userStatus);
sb.append(", applyTime=").append(applyTime);
sb.append(", adminId=").append(adminId);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
} }

View File

@ -117,7 +117,8 @@ public class EntityDataAllController {
*/ */
//4遥感数据(Remote sensing data) type //4遥感数据(Remote sensing data) type
@PostMapping("/importTemplate") @PostMapping("/importTemplate")
public R fileExcelUpload(@RequestParam("fileDataOne") MultipartFile fileDataOne, @RequestParam("fileDataTwo") List<MultipartFile> fileDataTwo, @RequestParam("type") Integer type, @RequestParam("disasterId") Long disasterId) { public R fileExcelUpload(@RequestParam("fileDataOne") MultipartFile fileDataOne, @RequestParam("fileDataTwo") List<MultipartFile> fileDataTwo,
return entityDataAllService.fileExcelUpload(fileDataOne,fileDataTwo,type,disasterId); @RequestParam("type") Integer type, @RequestParam("disasterId") Long disasterId, @RequestParam("userId") Long userId) {
return entityDataAllService.fileExcelUpload(fileDataOne,fileDataTwo,type,disasterId,userId);
} }
} }

View File

@ -3,6 +3,7 @@ package com.kening.vordm.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.kening.vordm.entity.EntityData;
import com.kening.vordm.entity.GuestApplyDisasterRef; import com.kening.vordm.entity.GuestApplyDisasterRef;
import com.kening.vordm.service.GuestApplyDisasterRefService; import com.kening.vordm.service.GuestApplyDisasterRefService;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -14,6 +15,8 @@ import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date;
import java.util.List;
@RestController @RestController
@AllArgsConstructor @AllArgsConstructor
@ -32,6 +35,7 @@ public class GuestApplyDisasterRefController {
@ApiOperation(value = "新增", notes = "传入Influence") @ApiOperation(value = "新增", notes = "传入Influence")
@PostMapping("/save") @PostMapping("/save")
public R save(@ApiParam(value = "Influence对象", required = true) @RequestBody GuestApplyDisasterRef guestApplyDisasterRef) { public R save(@ApiParam(value = "Influence对象", required = true) @RequestBody GuestApplyDisasterRef guestApplyDisasterRef) {
guestApplyDisasterRef.setApplyTime(new Date());
return R.status(guestApplyDisasterRefService.save(guestApplyDisasterRef)); return R.status(guestApplyDisasterRefService.save(guestApplyDisasterRef));
} }
@ -57,10 +61,8 @@ public class GuestApplyDisasterRefController {
} }
@GetMapping("/detailByDisasterInfoId") @GetMapping("/detailByDisasterInfoId")
public R<GuestApplyDisasterRef> detailByDisasterInfoId(@ApiParam(value = "主键", required = true) @RequestParam String id) { public R<IPage<GuestApplyDisasterRef>> detailByDisasterInfoId(String id, Query query) {
LambdaQueryWrapper<GuestApplyDisasterRef> queryWrapper = new LambdaQueryWrapper<>(); IPage<GuestApplyDisasterRef> detail = guestApplyDisasterRefService.detailByDisasterInfoId(Condition.getPage(query), id);
queryWrapper.eq(GuestApplyDisasterRef::getDisasterId,id);
GuestApplyDisasterRef detail = guestApplyDisasterRefService.getOne(queryWrapper);
return R.data(detail); return R.data(detail);
} }
} }

View File

@ -83,7 +83,7 @@
<select id="getEntityDataList" resultType="com.kening.vordm.entity.EntityDataAll"> <select id="getEntityDataList" resultType="com.kening.vordm.entity.EntityDataAll">
select select
<include refid="Base_Column_List"/>, <include refid="Base_Column_List"/>,
bu.name AS uploaderName, bu.name AS username,
bu.email AS email, bu.email AS email,
di.vordm_id, di.vordm_id,
di.geometry di.geometry

View File

@ -1,7 +1,12 @@
package com.kening.vordm.mapper; package com.kening.vordm.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.kening.vordm.entity.EntityData;
import com.kening.vordm.entity.GuestApplyDisasterRef; import com.kening.vordm.entity.GuestApplyDisasterRef;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* @author G * @author G
@ -11,6 +16,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface GuestApplyDisasterRefMapper extends BaseMapper<GuestApplyDisasterRef> { public interface GuestApplyDisasterRefMapper extends BaseMapper<GuestApplyDisasterRef> {
IPage<GuestApplyDisasterRef> detailByDisasterInfoId(IPage<Object> page, @Param("id") String id);
} }

View File

@ -16,4 +16,17 @@
id,disaster_id,user_status, id,disaster_id,user_status,
apply_time,admin_id apply_time,admin_id
</sql> </sql>
<select id="detailByDisasterInfoId" resultType="com.kening.vordm.entity.GuestApplyDisasterRef">
select ga.id,ga.disaster_id,ga.user_status,
ga.apply_time,ga.admin_id,
bu.name AS userName,bu.email AS userEmail
from guest_apply_disaster_ref ga
left join blade_user bu on ga.admin_id = bu.id
<where>
<if test="id!=null and id!=''">
ga.disaster_id = #{id}
</if>
</where>
</select>
</mapper> </mapper>

View File

@ -23,5 +23,5 @@ public interface EntityDataAllService extends IService<EntityDataAll> {
R saveEntityData(EntityDataAll entityData); R saveEntityData(EntityDataAll entityData);
R fileExcelUpload(MultipartFile fileDataOne, List<MultipartFile> fileDataTwo, Integer type, Long disasterId); R fileExcelUpload(MultipartFile fileDataOne, List<MultipartFile> fileDataTwo, Integer type, Long disasterId, Long userId);
} }

View File

@ -1,8 +1,12 @@
package com.kening.vordm.service; package com.kening.vordm.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.kening.vordm.entity.EntityData;
import com.kening.vordm.entity.GuestApplyDisasterRef; import com.kening.vordm.entity.GuestApplyDisasterRef;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/** /**
* @author G * @author G
* @description 针对表guest_apply_disaster_ref(灾害响应表每一个灾害可能有多个用户响应-申请)的数据库操作Service * @description 针对表guest_apply_disaster_ref(灾害响应表每一个灾害可能有多个用户响应-申请)的数据库操作Service
@ -10,4 +14,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface GuestApplyDisasterRefService extends IService<GuestApplyDisasterRef> { public interface GuestApplyDisasterRefService extends IService<GuestApplyDisasterRef> {
IPage<GuestApplyDisasterRef> detailByDisasterInfoId(IPage<Object> page, String id);
} }

View File

@ -103,7 +103,7 @@ public class EntityDataAllServiceImpl extends ServiceImpl<EntityDataAllMapper, E
} }
@Override @Override
public R fileExcelUpload(MultipartFile fileDataOne, List<MultipartFile> fileDataTwo, Integer type, Long disasterId) { public R fileExcelUpload(MultipartFile fileDataOne, List<MultipartFile> fileDataTwo, Integer type, Long disasterId, Long userId) {
HashSet<String> pictureNames = new HashSet<>(); HashSet<String> pictureNames = new HashSet<>();
fileDataTwo.stream().forEach(multipartFile -> { fileDataTwo.stream().forEach(multipartFile -> {
String filename = multipartFile.getOriginalFilename(); String filename = multipartFile.getOriginalFilename();
@ -122,6 +122,7 @@ public class EntityDataAllServiceImpl extends ServiceImpl<EntityDataAllMapper, E
EntityDataAll entityDataAll = new EntityDataAll(); EntityDataAll entityDataAll = new EntityDataAll();
while (cellIterator.hasNext()) { while (cellIterator.hasNext()) {
Cell cell = cellIterator.next(); Cell cell = cellIterator.next();
//判断cell是否为空为空不进行添加操作
int columnIndex = cell.getColumnIndex(); int columnIndex = cell.getColumnIndex();
switch (columnIndex) { switch (columnIndex) {
case 0: case 0:
@ -200,7 +201,11 @@ public class EntityDataAllServiceImpl extends ServiceImpl<EntityDataAllMapper, E
} }
} }
entityDataAll.setType("4"); entityDataAll.setType("4");
entityDataAll.setSource("Other");
entityDataAll.setDisasterId(disasterId); entityDataAll.setDisasterId(disasterId);
entityDataAll.setUploaderId(userId);
entityDataAll.setUploadTime(new Date());
entityDataAll.setIsAdministration(1);
baseMapper.insert(entityDataAll); baseMapper.insert(entityDataAll);
} }
} }

View File

@ -1,11 +1,15 @@
package com.kening.vordm.service.impl; package com.kening.vordm.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kening.vordm.entity.EntityData;
import com.kening.vordm.entity.GuestApplyDisasterRef; import com.kening.vordm.entity.GuestApplyDisasterRef;
import com.kening.vordm.service.GuestApplyDisasterRefService; import com.kening.vordm.service.GuestApplyDisasterRefService;
import com.kening.vordm.mapper.GuestApplyDisasterRefMapper; import com.kening.vordm.mapper.GuestApplyDisasterRefMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* @author G * @author G
* @description 针对表guest_apply_disaster_ref(灾害响应表每一个灾害可能有多个用户响应-申请)的数据库操作Service实现 * @description 针对表guest_apply_disaster_ref(灾害响应表每一个灾害可能有多个用户响应-申请)的数据库操作Service实现
@ -15,6 +19,10 @@ import org.springframework.stereotype.Service;
public class GuestApplyDisasterRefServiceImpl extends ServiceImpl<GuestApplyDisasterRefMapper, GuestApplyDisasterRef> public class GuestApplyDisasterRefServiceImpl extends ServiceImpl<GuestApplyDisasterRefMapper, GuestApplyDisasterRef>
implements GuestApplyDisasterRefService{ implements GuestApplyDisasterRefService{
@Override
public IPage<GuestApplyDisasterRef> detailByDisasterInfoId(IPage<Object> page, String id) {
return this.baseMapper.detailByDisasterInfoId(page,id);
}
} }