概括信息模块和图斑模块修改根据itemId进行查询和修改
| | |
| | | @GetMapping("/getPatches") |
| | | @SysLogAnnotation(operModul = "图斑", operType = "查询", operDesc = "查询图斑的全部信息") |
| | | public ResponseResult<PaginationData<LotInfo>> page(@RequestParam Integer page, |
| | | @RequestParam(name = "page_size", defaultValue = "10") Integer pageSize) { |
| | | @RequestParam(name = "page_size", defaultValue = "10") Integer pageSize, |
| | | @RequestParam String itemId) { |
| | | //调用service分页查询 |
| | | PatchesParam param=PatchesParam.builder() |
| | | .page(page) |
| | | .itemId(itemId) |
| | | .pageSize(pageSize).build(); |
| | | PaginationData<LotInfo> data = getPatchesService.limitGet(param); |
| | | return ResponseResult.success(data); |
| | |
| | | @GetMapping("/GetPhoto") |
| | | public ResponseResult<PaginationData<MediaFileEntity>> GetPatchesPhoto(@RequestParam(name = "page", defaultValue = "1") Integer page, |
| | | @RequestParam(name = "page_size", defaultValue = "10") Integer pageSize, |
| | | @RequestParam String itemId, |
| | | @RequestParam String dkbh){ |
| | | PatchesParam param=PatchesParam.builder() |
| | | .page(page) |
| | | .itemId(itemId) |
| | | .pageSize(pageSize).build(); |
| | | getPatchesService.getPhoto(param,dkbh); |
| | | return ResponseResult.success(getPatchesService.getPhoto(param,dkbh)); |
| | |
| | | @Autowired |
| | | private ShpToDataSourceServiceImpl shpToDataSourceServiceImpl; |
| | | @PostMapping("/getGeo") |
| | | public ResponseResult<List<LotInfo>> getGeo (@RequestParam("file") MultipartFile file) throws IOException { |
| | | List<LotInfo> list=shpToDataSourceServiceImpl.insertGeo(file); |
| | | public ResponseResult<List<LotInfo>> getGeo (@RequestParam("file") MultipartFile file,@RequestParam String itemId) throws IOException { |
| | | List<LotInfo> list=shpToDataSourceServiceImpl.insertGeo(file,itemId); |
| | | return ResponseResult.success(list); |
| | | } |
| | | |
| | |
| | | |
| | | @Builder.Default |
| | | private int pageSize = 10; |
| | | |
| | | private String itemId; |
| | | } |
| | |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @TableField("item_id") |
| | | private String itemId; |
| | | |
| | | @TableField("bsm") |
| | | private String bsm; |
| | | |
| | |
| | | import java.util.List; |
| | | |
| | | public interface ShpToDataSourceService { |
| | | List<LotInfo> insertGeo(MultipartFile file) throws IOException; |
| | | List<LotInfo> insertGeo(MultipartFile file ,String itemId) throws IOException; |
| | | } |
| | |
| | | import com.dji.sample.patches.model.Param.PatchesParam; |
| | | import com.dji.sample.patches.model.entity.LotInfo; |
| | | import com.dji.sample.patches.service.GetPatchesService; |
| | | import com.dji.sample.wayline.model.entity.WaylineFileEntity; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import java.util.List; |
| | |
| | | |
| | | @Override |
| | | public PaginationData<LotInfo> limitGet(PatchesParam param) { |
| | | Page<LotInfo> page = mapper.selectPage(new Page<LotInfo>(param.getPage(), param.getPageSize()), null); |
| | | Page<LotInfo> page = mapper.selectPage(new Page<LotInfo>(param.getPage(), param.getPageSize()), |
| | | new LambdaQueryWrapper<LotInfo>() |
| | | .eq(LotInfo::getItemId,param.getItemId())); |
| | | List<LotInfo> records = page.getRecords() |
| | | .stream() |
| | | .collect(Collectors.toList()); |
| | |
| | | private ShpToDataSourceMapper mapper; |
| | | String head = POLYGON; |
| | | String json; |
| | | public List<LotInfo> insertGeo(MultipartFile file) throws IOException { |
| | | public List<LotInfo> insertGeo(MultipartFile file ,String itemId) throws IOException { |
| | | List<LotInfo> list=new ArrayList<>(); |
| | | MultipartFileTOFileUtil multipartFileTOFileUtil = new MultipartFileTOFileUtil(); |
| | | File file1 = multipartFileTOFileUtil.multipartFile2File(file); |
| | |
| | | String uuid = UUID.randomUUID().toString(); |
| | | String bsm = uuid.replaceAll("-", ""); |
| | | lotInfo.setBsm(bsm); |
| | | lotInfo.setItemId(itemId); |
| | | lotInfo.setDkfw(json); |
| | | lotInfo.setDkbh("dkbh"+i); |
| | | mapper.insert(lotInfo); |
| | |
| | | @Autowired |
| | | private SummarizeService summarizeService; |
| | | @GetMapping("/getSummarize") |
| | | public ResponseResult<FlyInfo> getSummarize(){ |
| | | FlyInfo summarize=summarizeService.findData(); |
| | | public ResponseResult<FlyInfo> getSummarize(@RequestParam String itemId){ |
| | | FlyInfo summarize=summarizeService.findData(itemId); |
| | | return ResponseResult.success(summarize); |
| | | } |
| | | @PutMapping("/upSummarize") |
| | | public ResponseResult upSummarize(@RequestBody FlyInfo summarize){ |
| | | FlyInfo flyInfo= FlyInfo.builder() |
| | | .id(summarize.getId()) |
| | | .itemId(summarize.getItemId()) |
| | | .hour(summarize.getHour()) |
| | | .min(summarize.getMin()) |
| | | .flyCount(summarize.getFlyCount()) |
| | |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @TableField("item_id") |
| | | private String itemId; |
| | | |
| | | @TableField("hour") |
| | | private String hour; |
| | | |
| | |
| | | import com.dji.sample.summarize.model.entity.FlyInfo; |
| | | |
| | | public interface SummarizeService { |
| | | FlyInfo findData(); |
| | | FlyInfo findData(String itemId); |
| | | void updateData( FlyInfo flyInfo); |
| | | } |
| | |
| | | package com.dji.sample.summarize.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.dji.sample.summarize.dao.SummarizeMapper; |
| | | import com.dji.sample.summarize.model.entity.FlyInfo; |
| | | import com.dji.sample.summarize.service.SummarizeService; |
| | | import com.dji.sample.wayline.model.entity.WaylineFileEntity; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | public class SummarizeServiceImpl implements SummarizeService { |
| | | @Autowired |
| | | private SummarizeMapper mapper; |
| | | |
| | | @Override |
| | | public FlyInfo findData() { |
| | | return mapper.selectById(1); |
| | | public FlyInfo findData(String itemId) { |
| | | return mapper.selectOne(new LambdaQueryWrapper<FlyInfo>().eq(FlyInfo::getItemId,itemId)); |
| | | } |
| | | |
| | | @Override |
| | | public void updateData(FlyInfo flyInfo) { |
| | | mapper.updateById(flyInfo);} |
| | | mapper.update(flyInfo, new LambdaQueryWrapper<FlyInfo>() |
| | | .eq(FlyInfo::getItemId, flyInfo.getItemId())); |
| | | } |
| | | |
| | | } |