parent
e1594c2f4f
commit
b4ecaf791e
|
|
@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "资料中心-行为日志")
|
||||
|
|
@ -27,6 +28,7 @@ public class DocOperateLogController {
|
|||
|
||||
@PostMapping("/add")
|
||||
public R<Boolean> addDocOperateLog(@RequestBody DocOperateLog docOperateLog) {
|
||||
docOperateLog.setCreateTime(LocalDateTime.now());
|
||||
boolean save = docOperateLogService.save(docOperateLog);
|
||||
return R.ok(save);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,66 @@
|
|||
package com.gunshi.project.ss.controller;
|
||||
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.ss.model.PropertyCertificate;
|
||||
import com.gunshi.project.ss.service.FileAssociationsService;
|
||||
import com.gunshi.project.ss.service.PropertyCertificateService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "不动产权信息")
|
||||
@RestController
|
||||
@RequestMapping("/propertyCertificate")
|
||||
public class PropertyCertificateController extends AbstractCommonFileController{
|
||||
|
||||
@Autowired
|
||||
private PropertyCertificateService propertyCertificateService;
|
||||
|
||||
@Autowired
|
||||
private FileAssociationsService fileService;
|
||||
|
||||
|
||||
@GetMapping("/list")
|
||||
public R<List<PropertyCertificate>> list(){
|
||||
List<PropertyCertificate> list = propertyCertificateService.lambdaQuery().list();
|
||||
for (PropertyCertificate propertyCertificate : list) {
|
||||
propertyCertificate.setFiles(fileService.getFiles(getGroupId(),propertyCertificate.getId().toString()));
|
||||
}
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@PostMapping("/insert")
|
||||
public R<PropertyCertificate> insert(@RequestBody PropertyCertificate propertyCertificate){
|
||||
boolean flag = propertyCertificateService.insert(propertyCertificate);
|
||||
if(flag){
|
||||
fileService.saveFile(propertyCertificate.getFiles(),getGroupId(),propertyCertificate.getId().toString());
|
||||
}
|
||||
return R.ok(propertyCertificate);
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
public R<PropertyCertificate> update(@RequestBody PropertyCertificate propertyCertificate){
|
||||
boolean flag = propertyCertificateService.updateData(propertyCertificate);
|
||||
if(flag){
|
||||
fileService.saveFile(propertyCertificate.getFiles(),getGroupId(),propertyCertificate.getId().toString());
|
||||
}
|
||||
return R.ok(propertyCertificate);
|
||||
}
|
||||
|
||||
@PostMapping("/del/{id}")
|
||||
public R<Boolean> delete(@PathVariable("id") Long id){
|
||||
boolean flag = propertyCertificateService.removeById(id);
|
||||
if(flag){
|
||||
fileService.deleteFile(getGroupId(),id.toString());
|
||||
}
|
||||
return R.ok(flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "propertyCertificate";
|
||||
}
|
||||
}
|
||||
|
|
@ -42,17 +42,15 @@ public class ReservoirDemarcationInfoController extends AbstractCommonFileContro
|
|||
|
||||
List<FileAssociations> protectionScopeAreaFile = fileService.getFiles2(protectionScopeArea, query.getId().toString());
|
||||
|
||||
List<FileAssociations> propertyCertificateAreaFile = fileService.getFiles2(propertyCertificateArea, query.getId().toString());
|
||||
|
||||
List<FileAssociations> totalUseAreaFile = fileService.getFiles2(totalUseArea, query.getId().toString());
|
||||
|
||||
query.setManagementScopeAreaFiles(managementScopeAreaFile);
|
||||
query.setProtectionScopeFiles(protectionScopeAreaFile);
|
||||
query.setPropertyCertificateAreaFiles(propertyCertificateAreaFile);
|
||||
query.setTotalUseAreaFiles(totalUseAreaFile);
|
||||
return R.ok(query);
|
||||
}
|
||||
|
||||
|
||||
@Operation(description = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ReservoirDemarcationInfo> update(@RequestBody ReservoirDemarcationInfo dto){
|
||||
|
|
@ -60,7 +58,6 @@ public class ReservoirDemarcationInfoController extends AbstractCommonFileContro
|
|||
if(flag){
|
||||
fileService.saveFile(dto.getManagementScopeAreaFiles(),managementScopeArea,dto.getId().toString());
|
||||
fileService.saveFile(dto.getProtectionScopeFiles(),protectionScopeArea,dto.getId().toString());
|
||||
fileService.saveFile(dto.getPropertyCertificateAreaFiles(), propertyCertificateArea,dto.getId().toString());
|
||||
fileService.saveFile(dto.getTotalUseAreaFiles(),totalUseArea,dto.getId().toString());
|
||||
}
|
||||
return R.ok(dto);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
package com.gunshi.project.ss.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.ss.entity.vo.ScreenByVo;
|
||||
import com.gunshi.project.ss.service.ScreenByService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Tag(name = "大屏-白蚁防治")
|
||||
@RestController
|
||||
@RequestMapping(value="/screen/byfz")
|
||||
public class ScreenByController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private ScreenByService service;
|
||||
|
||||
@GetMapping("/get/{year}")
|
||||
public R<ScreenByVo> get(@PathVariable("year") Long year) {
|
||||
ScreenByVo res = service.get(year);
|
||||
return R.ok(res);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.gunshi.project.ss.controller;
|
||||
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.ss.service.ScreenMfrService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Tag(name = "维护养护-日常养护记录")
|
||||
@RestController
|
||||
@RequestMapping(value="/screen/mfr")
|
||||
public class ScreenMfrController {
|
||||
|
||||
@Autowired
|
||||
private ScreenMfrService service;
|
||||
|
||||
|
||||
@GetMapping("/get/{year}")
|
||||
public R<Map<String,Long>> get(@PathVariable("year")Long year){
|
||||
Map<String,Long> map = service.get(year);
|
||||
return R.ok(map);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.gunshi.project.ss.controller;
|
||||
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.ss.entity.vo.ScreenReservoirDemarcationVo;
|
||||
import com.gunshi.project.ss.service.ScreenReservoirDemarcationService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Tag(name = "大屏-水库划界信息")
|
||||
@RestController
|
||||
@RequestMapping(value="/screen/reservoirDemarcationInfo")
|
||||
public class ScreenReservoirDemarcationInfoController {
|
||||
|
||||
@Autowired
|
||||
private ScreenReservoirDemarcationService service;
|
||||
|
||||
|
||||
|
||||
@GetMapping("/get")
|
||||
public R<ScreenReservoirDemarcationVo> get(){
|
||||
ScreenReservoirDemarcationVo res = service.get();
|
||||
return R.ok(res);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.gunshi.project.ss.entity.vo;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ScreenByVo {
|
||||
|
||||
//白蚁普查次数
|
||||
private Long searchCount;
|
||||
|
||||
//有白蚁
|
||||
private Long hasByCount;
|
||||
|
||||
//已处理
|
||||
private Long hasByFinish;
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.gunshi.project.ss.entity.vo;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.gunshi.project.ss.model.FileAssociations;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ScreenReservoirDemarcationVo {
|
||||
|
||||
@Schema(description = "管理范围(km²)")
|
||||
private BigDecimal managementScopeArea;
|
||||
|
||||
@Schema(description = "管理范围(km²)文件")
|
||||
private List<FileAssociations> managementScopeAreaFiles;
|
||||
|
||||
@Schema(description = "保护范围(km²)")
|
||||
private BigDecimal protectionScopeArea;
|
||||
|
||||
|
||||
@Schema(description = "保护范围(km²)文件")
|
||||
private List<FileAssociations> protectionScopeFiles;
|
||||
|
||||
|
||||
@Schema(description = "用地总面积(万亩)")
|
||||
private BigDecimal totalUseArea;
|
||||
|
||||
|
||||
@Schema(description = "用地总面积(万亩)文件")
|
||||
private List<FileAssociations> totalUseAreaFiles;
|
||||
|
||||
//不动产权名称
|
||||
private String PropertyCertificateName;
|
||||
|
||||
//不动产权面积
|
||||
private BigDecimal PropertyCertificateArea;
|
||||
|
||||
private List<FileAssociations> propertyCertificateFiles;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.gunshi.project.ss.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.ss.model.PropertyCertificate;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface PropertyCertificateMapper extends BaseMapper<PropertyCertificate> {
|
||||
}
|
||||
|
|
@ -9,6 +9,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
|||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@TableName("doc_operate_log")
|
||||
|
|
@ -35,6 +36,9 @@ public class DocOperateLog {
|
|||
@Schema(description = "档案名称")
|
||||
private String docName;
|
||||
|
||||
@TableField("doc_category_id")
|
||||
private Long docCategoryId;
|
||||
|
||||
@TableField("file_name")
|
||||
@Schema(description = "文件名称")
|
||||
private String fileName;
|
||||
|
|
@ -47,4 +51,7 @@ public class DocOperateLog {
|
|||
@TableField(exist = false)
|
||||
@Schema(description = "用户名称")
|
||||
private String userName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<String> categoryCodes;
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.gunshi.project.ss.model;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@TableName("property_certificate")
|
||||
public class PropertyCertificate {
|
||||
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField("name")
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
@TableField("area")
|
||||
@Schema(description = "面积")
|
||||
private BigDecimal area;
|
||||
|
||||
@TableField("remark")
|
||||
@Schema(description = "描述")
|
||||
private String remark;
|
||||
|
||||
@TableField("create_time")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<FileAssociations> files;
|
||||
}
|
||||
|
|
@ -26,6 +26,10 @@ public class ReservoirDemarcationInfo {
|
|||
@Schema(description = "管理范围(km²)")
|
||||
private BigDecimal managementScopeArea;
|
||||
|
||||
@TableField("management_scope_area_explain")
|
||||
@Schema(description = "管理范围(km²)说明")
|
||||
private BigDecimal managementScopeAreaExplain;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "管理范围(km²)文件")
|
||||
private List<FileAssociations> managementScopeAreaFiles;
|
||||
|
|
@ -34,22 +38,23 @@ public class ReservoirDemarcationInfo {
|
|||
@Schema(description = "保护范围(km²)")
|
||||
private BigDecimal protectionScopeArea;
|
||||
|
||||
@TableField("protection_scope_area_explain")
|
||||
@Schema(description = "保护范围(km²)说明")
|
||||
private BigDecimal protectionScopeAreaExplain;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "保护范围(km²)文件")
|
||||
private List<FileAssociations> protectionScopeFiles;
|
||||
|
||||
@TableField("property_certificate_area")
|
||||
@Schema(description = "已取得不动产权证书面积(万亩)")
|
||||
private BigDecimal propertyCertificateArea;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "已取得不动产权证书面积(万亩)文件")
|
||||
private List<FileAssociations> propertyCertificateAreaFiles;
|
||||
|
||||
@TableField("total_use_area")
|
||||
@Schema(description = "用地总面积(万亩)")
|
||||
private BigDecimal totalUseArea;
|
||||
|
||||
@TableField("total_use_area_explain")
|
||||
@Schema(description = "用地总面积(万亩)说明")
|
||||
private BigDecimal totalUseAreaExplain;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "用地总面积(万亩)文件")
|
||||
private List<FileAssociations> totalUseAreaFiles;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.gunshi.project.ss.entity.so.DocOperateLogPageSo;
|
|||
|
||||
import com.gunshi.project.ss.mapper.DocOperateLogMapper;
|
||||
|
||||
import com.gunshi.project.ss.model.DocCategory;
|
||||
import com.gunshi.project.ss.model.DocCenter;
|
||||
import com.gunshi.project.ss.model.DocOperateLog;
|
||||
import com.gunshi.project.ss.model.FileAssociations;
|
||||
|
|
@ -19,6 +20,7 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -30,6 +32,9 @@ public class DocOperateLogService extends ServiceImpl<DocOperateLogMapper, DocOp
|
|||
@Autowired
|
||||
private SysUserMapper sysUserMapper;
|
||||
|
||||
@Autowired
|
||||
private DocCategoryService docCategoryService;
|
||||
|
||||
public Page<DocOperateLog> pageInfo(DocOperateLogPageSo pageSo) {
|
||||
LambdaQueryWrapper<DocOperateLog> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if(pageSo.getDateTimeRangeSo() != null){
|
||||
|
|
@ -46,6 +51,15 @@ public class DocOperateLogService extends ServiceImpl<DocOperateLogMapper, DocOp
|
|||
if(sysUser != null){
|
||||
record.setUserName(sysUser.getNickName());
|
||||
}
|
||||
if(record.getDocCategoryId() != null){
|
||||
List<DocCategory> categoryPathRecursive = docCategoryService.findCategoryPathRecursive(record.getDocCategoryId());
|
||||
List<String> categoryCodes = new ArrayList<>();
|
||||
for (DocCategory docCategory : categoryPathRecursive) {
|
||||
categoryCodes.add(docCategory.getCategoryCode());
|
||||
}
|
||||
record.setCategoryCodes(categoryCodes);
|
||||
}
|
||||
|
||||
}
|
||||
return docOperateLogPage;
|
||||
}
|
||||
|
|
@ -57,6 +71,7 @@ public class DocOperateLogService extends ServiceImpl<DocOperateLogMapper, DocOp
|
|||
docOperateLog.setCreateTime(LocalDateTime.now());
|
||||
docOperateLog.setDocNumber(docCenter.getDocNumber());
|
||||
docOperateLog.setUserId(docCenter.getUserId());
|
||||
docOperateLog.setDocCategoryId(docCenter.getDocCategoryId());
|
||||
List<FileAssociations> files = docCenter.getFiles();
|
||||
if(files!=null && files.size()>0){
|
||||
List<String> collect = files.stream()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
package com.gunshi.project.ss.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gunshi.project.ss.mapper.PropertyCertificateMapper;
|
||||
import com.gunshi.project.ss.model.PropertyCertificate;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class PropertyCertificateService extends ServiceImpl<PropertyCertificateMapper, PropertyCertificate> {
|
||||
|
||||
public boolean insert(PropertyCertificate propertyCertificate) {
|
||||
propertyCertificate.setCreateTime(LocalDateTime.now());
|
||||
boolean save = save(propertyCertificate);
|
||||
return save;
|
||||
}
|
||||
|
||||
public boolean updateData(PropertyCertificate propertyCertificate) {
|
||||
boolean flag = updateById(propertyCertificate);
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package com.gunshi.project.ss.service;
|
||||
|
||||
|
||||
import com.gunshi.project.ss.entity.vo.ScreenByVo;
|
||||
import com.gunshi.project.ss.model.TermiteSurvey;
|
||||
import com.gunshi.project.ss.model.TermiteSurveyDetail;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ScreenByService {
|
||||
|
||||
@Autowired
|
||||
private TermiteSurveyService service;
|
||||
@Autowired
|
||||
private TermiteSurveyDetailService termiteSurveyDetailService;
|
||||
|
||||
public ScreenByVo get(Long year) {
|
||||
ScreenByVo res = new ScreenByVo();
|
||||
// 使用LocalDate设置开始和结束日期
|
||||
LocalDate startDate = LocalDate.of(year.intValue(), 1, 1); // 当年1月1日
|
||||
LocalDate endDate = LocalDate.of(year.intValue(), 12, 31); // 当年12月31日
|
||||
List<TermiteSurvey> list = service.lambdaQuery()
|
||||
.ge(TermiteSurvey::getReportDate, startDate)
|
||||
.le(TermiteSurvey::getReportDate, endDate)
|
||||
.orderByDesc(TermiteSurvey::getReportDate)
|
||||
.list();
|
||||
res.setSearchCount(Long.valueOf(list.size()));
|
||||
long hasByCount = 0l;
|
||||
long hasByFinish = 0l;
|
||||
for (TermiteSurvey termiteSurvey : list) {
|
||||
List<TermiteSurveyDetail> details = termiteSurveyDetailService
|
||||
.lambdaQuery()
|
||||
.eq(TermiteSurveyDetail::getSurveyId, termiteSurvey.getId())
|
||||
.list();
|
||||
|
||||
long isHarmCount = details.stream().filter(o -> o.getIsHarm() == 1).count();
|
||||
hasByCount += isHarmCount;
|
||||
|
||||
long isHandlerCount = details.stream().filter(o -> {
|
||||
return o.getIsHandle() != null && o.getIsHandle() == 1;
|
||||
}).count();
|
||||
hasByFinish += isHandlerCount;
|
||||
}
|
||||
res.setHasByCount(hasByCount);
|
||||
res.setHasByFinish(hasByFinish);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package com.gunshi.project.ss.service;
|
||||
|
||||
|
||||
import com.gunshi.project.ss.model.MentenceFarmerRecord;
|
||||
import com.gunshi.project.ss.model.MentenceStDetail;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ScreenMfrService {
|
||||
|
||||
@Autowired
|
||||
private MentenceFarmerRecordService mentenceFarmerRecordService;
|
||||
|
||||
@Autowired
|
||||
private MentenceStDetailService mentenceStDetailService;
|
||||
|
||||
public Map<String, Long> get(Long year) {
|
||||
Map<String, Long> map = new HashMap<>();
|
||||
Map<Long,String> idMapToName = new HashMap<>();
|
||||
LocalDateTime start = LocalDateTime.of(year.intValue(),1,1,0,0,0);
|
||||
LocalDateTime end = LocalDateTime.of(year.intValue(),12,31,23,59,59);
|
||||
List<MentenceFarmerRecord> farmerRecords = mentenceFarmerRecordService.lambdaQuery()
|
||||
.ge(MentenceFarmerRecord::getMentenceTimeBegin, start)
|
||||
.le(MentenceFarmerRecord::getMentenceTimeBegin, end)
|
||||
.list();
|
||||
if(farmerRecords.isEmpty()){
|
||||
return map;
|
||||
}
|
||||
List<Long> stDetailId = farmerRecords.stream().map(o -> o.getMentenceStDetailId()).distinct().collect(Collectors.toList());
|
||||
List<MentenceStDetail> mentenceStDetail = mentenceStDetailService.lambdaQuery()
|
||||
.in(MentenceStDetail::getId, stDetailId).list();
|
||||
for (MentenceStDetail stDetail : mentenceStDetail) {
|
||||
idMapToName.put(stDetail.getId(),stDetail.getStDetailName());
|
||||
}
|
||||
|
||||
for (MentenceFarmerRecord record : farmerRecords) {
|
||||
String name = idMapToName.get(record.getMentenceStDetailId());
|
||||
map.put(name,map.getOrDefault(name,0L)+1L);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package com.gunshi.project.ss.service;
|
||||
|
||||
|
||||
import com.gunshi.project.ss.entity.vo.ScreenReservoirDemarcationVo;
|
||||
import com.gunshi.project.ss.model.PropertyCertificate;
|
||||
import com.gunshi.project.ss.model.ReservoirDemarcationInfo;
|
||||
import com.ruoyi.common.utils.bean.BeanUtils;
|
||||
import jakarta.validation.constraints.Email;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ScreenReservoirDemarcationService {
|
||||
|
||||
@Autowired
|
||||
private ReservoirDemarcationInfoService service;
|
||||
|
||||
@Autowired
|
||||
private FileAssociationsService fileService;
|
||||
|
||||
@Autowired
|
||||
private PropertyCertificateService propertyCertificateService;
|
||||
|
||||
private static final String managementScopeArea = "managementScopeArea";
|
||||
|
||||
private static final String protectionScopeArea = "protectionScopeArea";
|
||||
|
||||
private static final String propertyCertificate = "propertyCertificate";
|
||||
|
||||
private static final String totalUseArea = "totalUseArea";
|
||||
|
||||
public ScreenReservoirDemarcationVo get() {
|
||||
ScreenReservoirDemarcationVo res = new ScreenReservoirDemarcationVo();
|
||||
ReservoirDemarcationInfo one = service.lambdaQuery().last("limit 1").one();
|
||||
if(one == null){
|
||||
return res;
|
||||
}
|
||||
BeanUtils.copyProperties(one, res);
|
||||
res.setManagementScopeAreaFiles(fileService.getFiles2(managementScopeArea,one.getId().toString()));
|
||||
res.setProtectionScopeFiles(fileService.getFiles2(protectionScopeArea,one.getId().toString()));
|
||||
res.setTotalUseAreaFiles(fileService.getFiles2(totalUseArea,one.getId().toString()));
|
||||
|
||||
PropertyCertificate two = propertyCertificateService.lambdaQuery().orderByDesc(PropertyCertificate::getCreateTime).last("limit 1").one();
|
||||
if(two == null){
|
||||
return res;
|
||||
}
|
||||
res.setPropertyCertificateName(two.getName());
|
||||
res.setPropertyCertificateArea(two.getArea());
|
||||
res.setPropertyCertificateFiles(fileService.getFiles2(propertyCertificate,two.getId().toString()));
|
||||
return res;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue