glj-代码提交
This commit is contained in:
parent
5a281ac912
commit
d5f552784d
|
@ -115,7 +115,7 @@ public class EntityDataAll implements Serializable {
|
|||
private Integer isDeleted;
|
||||
|
||||
/**
|
||||
* 是否发布(0未发布/1已发布)
|
||||
* 是否发布(0未发布/1已发布)w
|
||||
*/
|
||||
private Integer isPublish;
|
||||
|
||||
|
|
|
@ -41,53 +41,19 @@ public class GuestApplyDisasterRef implements Serializable {
|
|||
*/
|
||||
private Long adminId;
|
||||
|
||||
/**
|
||||
* 用户邮件
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 用户邮件
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String userEmail;
|
||||
|
||||
@TableField(exist = false)
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,7 +117,8 @@ public class EntityDataAllController {
|
|||
*/
|
||||
//4遥感数据(Remote sensing data) type
|
||||
@PostMapping("/importTemplate")
|
||||
public R fileExcelUpload(@RequestParam("fileDataOne") MultipartFile fileDataOne, @RequestParam("fileDataTwo") List<MultipartFile> fileDataTwo, @RequestParam("type") Integer type, @RequestParam("disasterId") Long disasterId) {
|
||||
return entityDataAllService.fileExcelUpload(fileDataOne,fileDataTwo,type,disasterId);
|
||||
public R fileExcelUpload(@RequestParam("fileDataOne") MultipartFile fileDataOne, @RequestParam("fileDataTwo") List<MultipartFile> fileDataTwo,
|
||||
@RequestParam("type") Integer type, @RequestParam("disasterId") Long disasterId, @RequestParam("userId") Long userId) {
|
||||
return entityDataAllService.fileExcelUpload(fileDataOne,fileDataTwo,type,disasterId,userId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.kening.vordm.controller;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.kening.vordm.entity.EntityData;
|
||||
import com.kening.vordm.entity.GuestApplyDisasterRef;
|
||||
import com.kening.vordm.service.GuestApplyDisasterRefService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
@ -14,6 +15,8 @@ import org.springblade.core.tool.api.R;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
|
@ -32,6 +35,7 @@ public class GuestApplyDisasterRefController {
|
|||
@ApiOperation(value = "新增", notes = "传入Influence")
|
||||
@PostMapping("/save")
|
||||
public R save(@ApiParam(value = "Influence对象", required = true) @RequestBody GuestApplyDisasterRef guestApplyDisasterRef) {
|
||||
guestApplyDisasterRef.setApplyTime(new Date());
|
||||
return R.status(guestApplyDisasterRefService.save(guestApplyDisasterRef));
|
||||
}
|
||||
|
||||
|
@ -57,10 +61,8 @@ public class GuestApplyDisasterRefController {
|
|||
}
|
||||
|
||||
@GetMapping("/detailByDisasterInfoId")
|
||||
public R<GuestApplyDisasterRef> detailByDisasterInfoId(@ApiParam(value = "主键", required = true) @RequestParam String id) {
|
||||
LambdaQueryWrapper<GuestApplyDisasterRef> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(GuestApplyDisasterRef::getDisasterId,id);
|
||||
GuestApplyDisasterRef detail = guestApplyDisasterRefService.getOne(queryWrapper);
|
||||
public R<IPage<GuestApplyDisasterRef>> detailByDisasterInfoId(String id, Query query) {
|
||||
IPage<GuestApplyDisasterRef> detail = guestApplyDisasterRefService.detailByDisasterInfoId(Condition.getPage(query), id);
|
||||
return R.data(detail);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
<select id="getEntityDataList" resultType="com.kening.vordm.entity.EntityDataAll">
|
||||
select
|
||||
<include refid="Base_Column_List"/>,
|
||||
bu.name AS uploaderName,
|
||||
bu.name AS username,
|
||||
bu.email AS email,
|
||||
di.vordm_id,
|
||||
di.geometry
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
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.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author G
|
||||
|
@ -11,6 +16,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
*/
|
||||
public interface GuestApplyDisasterRefMapper extends BaseMapper<GuestApplyDisasterRef> {
|
||||
|
||||
IPage<GuestApplyDisasterRef> detailByDisasterInfoId(IPage<Object> page, @Param("id") String id);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -16,4 +16,17 @@
|
|||
id,disaster_id,user_status,
|
||||
apply_time,admin_id
|
||||
</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>
|
||||
|
|
|
@ -23,5 +23,5 @@ public interface EntityDataAllService extends IService<EntityDataAll> {
|
|||
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
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.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author G
|
||||
* @description 针对表【guest_apply_disaster_ref(灾害响应表,每一个灾害可能有多个用户响应-申请)】的数据库操作Service
|
||||
|
@ -10,4 +14,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
*/
|
||||
public interface GuestApplyDisasterRefService extends IService<GuestApplyDisasterRef> {
|
||||
|
||||
IPage<GuestApplyDisasterRef> detailByDisasterInfoId(IPage<Object> page, String id);
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ public class EntityDataAllServiceImpl extends ServiceImpl<EntityDataAllMapper, E
|
|||
}
|
||||
|
||||
@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<>();
|
||||
fileDataTwo.stream().forEach(multipartFile -> {
|
||||
String filename = multipartFile.getOriginalFilename();
|
||||
|
@ -122,6 +122,7 @@ public class EntityDataAllServiceImpl extends ServiceImpl<EntityDataAllMapper, E
|
|||
EntityDataAll entityDataAll = new EntityDataAll();
|
||||
while (cellIterator.hasNext()) {
|
||||
Cell cell = cellIterator.next();
|
||||
//判断cell是否为空,为空不进行添加操作
|
||||
int columnIndex = cell.getColumnIndex();
|
||||
switch (columnIndex) {
|
||||
case 0:
|
||||
|
@ -200,7 +201,11 @@ public class EntityDataAllServiceImpl extends ServiceImpl<EntityDataAllMapper, E
|
|||
}
|
||||
}
|
||||
entityDataAll.setType("4");
|
||||
entityDataAll.setSource("Other");
|
||||
entityDataAll.setDisasterId(disasterId);
|
||||
entityDataAll.setUploaderId(userId);
|
||||
entityDataAll.setUploadTime(new Date());
|
||||
entityDataAll.setIsAdministration(1);
|
||||
baseMapper.insert(entityDataAll);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
package com.kening.vordm.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.kening.vordm.entity.EntityData;
|
||||
import com.kening.vordm.entity.GuestApplyDisasterRef;
|
||||
import com.kening.vordm.service.GuestApplyDisasterRefService;
|
||||
import com.kening.vordm.mapper.GuestApplyDisasterRefMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author G
|
||||
* @description 针对表【guest_apply_disaster_ref(灾害响应表,每一个灾害可能有多个用户响应-申请)】的数据库操作Service实现
|
||||
|
@ -15,6 +19,10 @@ import org.springframework.stereotype.Service;
|
|||
public class GuestApplyDisasterRefServiceImpl extends ServiceImpl<GuestApplyDisasterRefMapper, GuestApplyDisasterRef>
|
||||
implements GuestApplyDisasterRefService{
|
||||
|
||||
@Override
|
||||
public IPage<GuestApplyDisasterRef> detailByDisasterInfoId(IPage<Object> page, String id) {
|
||||
return this.baseMapper.detailByDisasterInfoId(page,id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue