添加茶园字段

This commit is contained in:
qdxkrs 2022-06-24 12:01:09 +08:00
parent f5b8e3c595
commit a571dd1bde
6 changed files with 108 additions and 2 deletions

View File

@ -1,6 +1,7 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.controller;
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum; import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
import com.xkrs.microservice.model.entity.IrrigationSarRecordEntity;
import com.xkrs.microservice.model.entity.TeaGardenPlotEntity; import com.xkrs.microservice.model.entity.TeaGardenPlotEntity;
import com.xkrs.microservice.model.qo.TeaGardenPlotQo; import com.xkrs.microservice.model.qo.TeaGardenPlotQo;
import com.xkrs.microservice.service.TeaGardenPlotService; import com.xkrs.microservice.service.TeaGardenPlotService;
@ -9,6 +10,8 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Locale; import java.util.Locale;
import java.util.Optional;
import static com.xkrs.microservice.common.encapsulation.OutputEncapsulation.outputEncapsulationObject; import static com.xkrs.microservice.common.encapsulation.OutputEncapsulation.outputEncapsulationObject;
/** /**
@ -34,6 +37,20 @@ public class TeaGardenPlotController {
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,list,locale); return outputEncapsulationObject(PromptMessageEnum.SUCCESS,list,locale);
} }
@RequestMapping(value="/get/id",method = RequestMethod.GET)
@CrossOrigin
public String getById(@RequestParam("id") Integer id) {
Optional<TeaGardenPlotEntity> res = teaGardenPlotService.getAllRecordById(id);
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,res,locale);
}
@RequestMapping(value="/get/status",method = RequestMethod.GET)
@CrossOrigin
public String getByStatus(@RequestParam("status") Integer status) {
Iterable<TeaGardenPlotEntity> res = teaGardenPlotService.getAllRecordByStatus(status);
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,res,locale);
}
@RequestMapping(value="/update",method = RequestMethod.POST) @RequestMapping(value="/update",method = RequestMethod.POST)
// @PreAuthorize("hasAnyAuthority('auth_system_manager','auth_general_user','auth_administor')") // @PreAuthorize("hasAnyAuthority('auth_system_manager','auth_general_user','auth_administor')")
@CrossOrigin @CrossOrigin

View File

@ -17,4 +17,11 @@ public interface TeaGardenPlotDao extends JpaRepository<TeaGardenPlotEntity,Inte
*/ */
TeaGardenPlotEntity findAllByDkbh(String dkbh); TeaGardenPlotEntity findAllByDkbh(String dkbh);
/**
* 查询所有地块根据状态
* @param status
* @return
*/
Iterable<TeaGardenPlotEntity> findAllByStatus(Integer status);
} }

View File

@ -45,6 +45,11 @@ public class TeaGardenPlotEntity {
@Column( length = 255, columnDefinition = "varchar(255)") @Column( length = 255, columnDefinition = "varchar(255)")
private String zuowu; private String zuowu;
private Integer status;
@Column( length = 255, columnDefinition = "varchar(255)")
private String remarks;
private Geometry geom; private Geometry geom;
@Transient @Transient
@ -114,6 +119,22 @@ public class TeaGardenPlotEntity {
this.zuowu = zuowu; this.zuowu = zuowu;
} }
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
@JsonIgnore @JsonIgnore
public Geometry getGeom() { public Geometry getGeom() {
return geom; return geom;
@ -140,7 +161,7 @@ public class TeaGardenPlotEntity {
@Override @Override
public String toString() { public String toString() {
return "TeaGardenPlot{" + return "TeaGardenPlotEntity{" +
"id=" + id + "id=" + id +
", dkbh='" + dkbh + '\'' + ", dkbh='" + dkbh + '\'' +
", dlmc='" + dlmc + '\'' + ", dlmc='" + dlmc + '\'' +
@ -149,6 +170,8 @@ public class TeaGardenPlotEntity {
", lxr='" + lxr + '\'' + ", lxr='" + lxr + '\'' +
", lxdh='" + lxdh + '\'' + ", lxdh='" + lxdh + '\'' +
", zuowu='" + zuowu + '\'' + ", zuowu='" + zuowu + '\'' +
", status=" + status +
", remarks='" + remarks + '\'' +
", geom=" + geom + ", geom=" + geom +
", wktGeom='" + wktGeom + '\'' + ", wktGeom='" + wktGeom + '\'' +
'}'; '}';

View File

@ -1,6 +1,8 @@
package com.xkrs.microservice.model.qo; package com.xkrs.microservice.model.qo;
import javax.persistence.Column;
/** /**
* TeaGardenPlotQo * TeaGardenPlotQo
* @author tajochen * @author tajochen
@ -23,6 +25,10 @@ public class TeaGardenPlotQo {
private String zuowu; private String zuowu;
private Integer status;
private String remarks;
private String geomStr; private String geomStr;
public Integer getId() { public Integer getId() {
@ -89,6 +95,22 @@ public class TeaGardenPlotQo {
this.zuowu = zuowu; this.zuowu = zuowu;
} }
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public String getGeomStr() { public String getGeomStr() {
return geomStr; return geomStr;
} }

View File

@ -2,7 +2,8 @@ package com.xkrs.microservice.service;
import com.xkrs.microservice.model.entity.TeaGardenPlotEntity; import com.xkrs.microservice.model.entity.TeaGardenPlotEntity;
import com.xkrs.microservice.model.qo.TeaGardenPlotQo; import com.xkrs.microservice.model.qo.TeaGardenPlotQo;
import com.xkrs.microservice.model.qo.TypicalPlotQo;
import java.util.Optional;
/** /**
@ -17,6 +18,13 @@ public interface TeaGardenPlotService {
*/ */
Iterable<TeaGardenPlotEntity> getAllRecord(); Iterable<TeaGardenPlotEntity> getAllRecord();
/**
* 获取所有典型地块记录根据编号
* @param id 编号
* @return
*/
Optional<TeaGardenPlotEntity> getAllRecordById(Integer id);
/** /**
* 获取指定地块编号记录 * 获取指定地块编号记录
* @param dkbh * @param dkbh
@ -24,6 +32,13 @@ public interface TeaGardenPlotService {
*/ */
TeaGardenPlotEntity getAllRecordByDkbh(String dkbh); TeaGardenPlotEntity getAllRecordByDkbh(String dkbh);
/**
* 获取指定地块根据状态
* @param status
* @return
*/
Iterable<TeaGardenPlotEntity> getAllRecordByStatus(Integer status);
/** /**
* 新增典型地块记录 * 新增典型地块记录

View File

@ -43,6 +43,17 @@ public class TeaGardenPlotServiceImpl implements TeaGardenPlotService {
return teaGardenPlotDao.findAll(); return teaGardenPlotDao.findAll();
} }
/**
* 获取所有典型地块记录根据编号
* @param id 编号
* @return
*/
@Cacheable(keyGenerator = "keyGenerator", unless="#result == null")
@Override
public Optional<TeaGardenPlotEntity> getAllRecordById(Integer id){
return teaGardenPlotDao.findById(id);
}
/** /**
* 获取指定地块编号记录 * 获取指定地块编号记录
* @param dkbh * @param dkbh
@ -54,6 +65,17 @@ public class TeaGardenPlotServiceImpl implements TeaGardenPlotService {
return teaGardenPlotDao.findAllByDkbh(dkbh); return teaGardenPlotDao.findAllByDkbh(dkbh);
} }
/**
* 获取指定地块根据状态
* @param status
* @return
*/
@Cacheable(keyGenerator = "keyGenerator", unless="#result == null")
@Override
public Iterable<TeaGardenPlotEntity> getAllRecordByStatus(Integer status){
return teaGardenPlotDao.findAllByStatus(status);
}
/** /**
* 新增典型地块记录 * 新增典型地块记录