crops智慧农业
This commit is contained in:
@ -37,7 +37,7 @@
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql驱动包 -->
|
||||
<!-- Mysql驱动包 -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
@ -60,6 +60,33 @@
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-generator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-pill</artifactId>
|
||||
<version>3.8.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-crops</artifactId>
|
||||
<version>3.8.5</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!--HuTool工具类-->
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.7.1</version>
|
||||
</dependency>
|
||||
<!--Gson工具类-->
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.10.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@ -80,17 +107,17 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<configuration>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
<warName>${project.artifactId}</warName>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
@ -3,12 +3,14 @@ package com.ruoyi;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
* 启动程序
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@EnableScheduling
|
||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||
public class RuoYiApplication
|
||||
{
|
||||
|
@ -0,0 +1,98 @@
|
||||
package com.ruoyi.web.controller.crops;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.crops.domain.CropsComprehensiveData;
|
||||
import com.ruoyi.crops.service.ICropsComprehensiveDataService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作物综合数据Controller
|
||||
*
|
||||
* @author my
|
||||
* @date 2023-04-19
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/crops/data")
|
||||
public class CropsComprehensiveDataController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICropsComprehensiveDataService cropsComprehensiveDataService;
|
||||
|
||||
/**
|
||||
* 查询作物综合数据列表
|
||||
*/
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CropsComprehensiveData cropsComprehensiveData)
|
||||
{
|
||||
// startPage();
|
||||
List<CropsComprehensiveData> list = cropsComprehensiveDataService.selectCropsComprehensiveDataList(cropsComprehensiveData);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出作物综合数据列表
|
||||
*/
|
||||
|
||||
@Log(title = "作物综合数据", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CropsComprehensiveData cropsComprehensiveData)
|
||||
{
|
||||
List<CropsComprehensiveData> list = cropsComprehensiveDataService.selectCropsComprehensiveDataList(cropsComprehensiveData);
|
||||
ExcelUtil<CropsComprehensiveData> util = new ExcelUtil<CropsComprehensiveData>(CropsComprehensiveData.class);
|
||||
util.exportExcel(response, list, "作物综合数据数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取作物综合数据详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(cropsComprehensiveDataService.selectCropsComprehensiveDataById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增作物综合数据
|
||||
*/
|
||||
|
||||
@Log(title = "作物综合数据", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CropsComprehensiveData cropsComprehensiveData)
|
||||
{
|
||||
return toAjax(cropsComprehensiveDataService.insertCropsComprehensiveData(cropsComprehensiveData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改作物综合数据
|
||||
*/
|
||||
|
||||
@Log(title = "作物综合数据", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CropsComprehensiveData cropsComprehensiveData)
|
||||
{
|
||||
return toAjax(cropsComprehensiveDataService.updateCropsComprehensiveData(cropsComprehensiveData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除作物综合数据
|
||||
*/
|
||||
|
||||
@Log(title = "作物综合数据", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(cropsComprehensiveDataService.deleteCropsComprehensiveDataByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.ruoyi.web.controller.crops;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.crops.domain.CropsDrought;
|
||||
import com.ruoyi.crops.service.ICropsDroughtService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 作物旱情controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/crops/drought")
|
||||
public class CropsDroughtController extends BaseController {
|
||||
@Autowired
|
||||
private ICropsDroughtService iCropsDroughtService;
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/insertBatch")
|
||||
public AjaxResult insertBatch(@RequestBody Map<String, List<CropsDrought>> map){
|
||||
List<CropsDrought> cropDroughtList = map.get("cropDroughtList");
|
||||
return toAjax(iCropsDroughtService.insertBatch(cropDroughtList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据时间查询
|
||||
* @param time
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{time}")
|
||||
public List<CropsDrought> selectByTime(@PathVariable("time")Date time){
|
||||
return iCropsDroughtService.selectByTime(time);
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package com.ruoyi.web.controller.crops;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.crops.domain.CropStructure;
|
||||
import com.ruoyi.crops.domain.CropsGrowth;
|
||||
import com.ruoyi.crops.service.ICropsGrowthService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 作物长势controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/crops/growth")
|
||||
public class CropsGrowthController extends BaseController {
|
||||
@Autowired
|
||||
private ICropsGrowthService iCropsGrowthService;
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/insertBatch")
|
||||
public AjaxResult insertBatch(@RequestBody Map<String, List<CropsGrowth>> map){
|
||||
List<CropsGrowth> cropGrowthList = map.get("cropGrowthList");
|
||||
return toAjax(iCropsGrowthService.insertBatch(cropGrowthList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据时间查询
|
||||
* @param time
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{time}")
|
||||
public List<CropsGrowth> selectByTime(@PathVariable("time") Date time){
|
||||
return iCropsGrowthService.selectByTime(time);
|
||||
}
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.ruoyi.web.controller.crops;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.crops.domain.CropStructure;
|
||||
import com.ruoyi.crops.service.ICropsStructureService;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.aspectj.weaver.loadtime.Aj;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.core.parameters.P;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 种植结构controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/crops/structure")
|
||||
public class CropsStructureController extends BaseController {
|
||||
@Autowired
|
||||
private ICropsStructureService iCropsStructureService;
|
||||
/**
|
||||
* 新增数据
|
||||
* @param cropStructure
|
||||
* @return
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CropStructure cropStructure){
|
||||
return toAjax(iCropsStructureService.insertCropsStructure(cropStructure));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增数据
|
||||
* @param map map集合方式存放数组json字符串
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/insertBatch")
|
||||
public AjaxResult insertBatch(@RequestBody Map<String,List<CropStructure>> map){
|
||||
List<CropStructure> cropStructureList = map.get("cropStructureList");
|
||||
return toAjax(iCropsStructureService.insertBatch(cropStructureList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据时间查询
|
||||
* @param time
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{time}")
|
||||
public List<CropStructure> selectByTime(@PathVariable Date time){
|
||||
return iCropsStructureService.selectByTime(time);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package com.ruoyi.web.controller.crops;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.crops.domain.CropsYield;
|
||||
import com.ruoyi.crops.service.ICropsYieldService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 作物产量查询
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/crops/yield")
|
||||
public class CropsYieldConeroller extends BaseController {
|
||||
@Autowired
|
||||
private ICropsYieldService iCropsYieldService;
|
||||
|
||||
/**
|
||||
* 根据年份查询
|
||||
* @param year
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{year}")
|
||||
public List<CropsYield> selectByYear(@PathVariable Integer year){
|
||||
return iCropsYieldService.selectByYear(year);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/insertBatch")
|
||||
public AjaxResult insertBatch(@RequestBody Map<String,List<CropsYield>> map){
|
||||
List<CropsYield> cropYieldList = map.get("cropYieldList");
|
||||
return toAjax(iCropsYieldService.insertBatch(cropYieldList));
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.ruoyi.web.controller.crops;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.crops.domain.EnvironmentalData;
|
||||
import com.ruoyi.crops.service.IEnvironmentalService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.core.parameters.P;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 环境数据controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/environmental")
|
||||
public class EnvironmentalController extends BaseController {
|
||||
@Autowired
|
||||
private IEnvironmentalService iEnvironmentalService;
|
||||
|
||||
/**
|
||||
* 根据大棚编号查询
|
||||
* @param number
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{number}")
|
||||
private List<EnvironmentalData> selectByNumber(@PathVariable Integer number){
|
||||
return iEnvironmentalService.selectByNumber(number);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增单条数据
|
||||
* @param environmentalData
|
||||
* @return
|
||||
*/
|
||||
@PostMapping
|
||||
private AjaxResult insert(@RequestBody EnvironmentalData environmentalData){
|
||||
return toAjax(iEnvironmentalService.insert(environmentalData));
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.ruoyi.web.controller.crops;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.google.gson.Gson;
|
||||
import com.ruoyi.crops.domain.GsonParseFoundationBean;
|
||||
import com.ruoyi.crops.service.IFoundationService;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.security.core.parameters.P;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/foundation")
|
||||
public class FoundationController {
|
||||
@Autowired
|
||||
private IFoundationService foundationService;
|
||||
|
||||
@PostMapping("/{id}")
|
||||
public String Foundation(@PathVariable String id){
|
||||
return foundationService.getFoundation(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.ruoyi.web.controller.crops;
|
||||
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController("/workspaces/PJZ/coveragestores/")
|
||||
@RequestMapping
|
||||
public class Geoservercontroller {
|
||||
// @PutMapping("/{store}/{method}.{format}")
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.ruoyi.web.controller.crops;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.crops.domain.GreenhouseInformation;
|
||||
import com.ruoyi.crops.service.IGreenhouseService;
|
||||
import org.aspectj.weaver.loadtime.Aj;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 大棚信息controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/greenhouse/information")
|
||||
public class GreenhouseController extends BaseController {
|
||||
@Autowired
|
||||
private IGreenhouseService iGreenhouseService;
|
||||
|
||||
@GetMapping("/{name}")
|
||||
public List<GreenhouseInformation> selectByName(@PathVariable String name){
|
||||
return iGreenhouseService.selectByName(name);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public AjaxResult insert(@RequestBody GreenhouseInformation greenhouseInformation){
|
||||
return toAjax(iGreenhouseService.insert(greenhouseInformation));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,45 @@
|
||||
package com.ruoyi.web.controller.crops;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.crops.domain.IntelligentControl;
|
||||
import com.ruoyi.crops.service.IIntelligentControlService;
|
||||
import org.aspectj.weaver.loadtime.Aj;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 水肥一体机智能控制controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/intelligent")
|
||||
public class IntelligentController extends BaseController {
|
||||
@Autowired
|
||||
private IIntelligentControlService iIntelligentControlService;
|
||||
|
||||
/**
|
||||
* 新增单条数据
|
||||
* @param intelligentControl
|
||||
* @return
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult insert(@RequestBody IntelligentControl intelligentControl){
|
||||
return toAjax(iIntelligentControlService.insert(intelligentControl));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public List<IntelligentControl> selectAll(){
|
||||
return iIntelligentControlService.selectAll();
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody IntelligentControl intelligentControl){
|
||||
return toAjax(iIntelligentControlService.edit(intelligentControl));
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.ruoyi.web.controller.crops;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.crops.domain.MachineParameter;
|
||||
import com.ruoyi.crops.service.IMachineParameterService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 水肥一体机参数controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/machine/parameter")
|
||||
public class MachineParameterController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IMachineParameterService machineParameterService;
|
||||
|
||||
/**
|
||||
* 根据大棚名称进行查询
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{name}")
|
||||
public List<MachineParameter> selectByName(@PathVariable String name){
|
||||
return machineParameterService.selectByName(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增单条数据
|
||||
* @param machineParameter
|
||||
* @return
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult insert(@RequestBody MachineParameter machineParameter){
|
||||
return toAjax(machineParameterService.insert(machineParameter));
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.ruoyi.web.controller.crops;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.crops.domain.OperationRecords;
|
||||
import com.ruoyi.crops.service.IOperationRecordsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 操作记录controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("operation/records")
|
||||
public class OperationRecordsController extends BaseController {
|
||||
@Autowired
|
||||
private IOperationRecordsService iOperationRecordsService;
|
||||
|
||||
/**
|
||||
* 查询全部记录
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public List<OperationRecords> listAll (){
|
||||
return iOperationRecordsService.selectAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增单条数据
|
||||
* @param operationRecords
|
||||
* @return
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult insert(@RequestBody OperationRecords operationRecords){
|
||||
return toAjax(iOperationRecordsService.insert(operationRecords));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package com.ruoyi.web.controller.crops;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.crops.domain.ServiceType;
|
||||
import com.ruoyi.crops.service.IServiceTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 服务类型controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/service/type")
|
||||
public class ServiceTypeController extends BaseController {
|
||||
@Autowired
|
||||
private IServiceTypeService typeService;
|
||||
|
||||
/**
|
||||
* 根据类型查询(有参)
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{type}")
|
||||
public List<ServiceType> selectByType(@PathVariable String type){
|
||||
return typeService.selectByType(type);
|
||||
}
|
||||
|
||||
/**
|
||||
* 无参查询全部展示
|
||||
* @return
|
||||
*/
|
||||
@GetMapping
|
||||
public List<ServiceType> selectAll(){
|
||||
return typeService.selectAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增单条数据
|
||||
* @param serviceType
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("insert")
|
||||
public AjaxResult insert(@RequestBody ServiceType serviceType){
|
||||
return toAjax(typeService.insert(serviceType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据数组批量删除数据
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping("/{ids}")
|
||||
private AjaxResult remove(@PathVariable Long[] ids){
|
||||
return toAjax(typeService.deleteByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.ruoyi.web.controller.crops;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.crops.domain.User;
|
||||
import com.ruoyi.crops.domain.UserInfo;
|
||||
import com.ruoyi.crops.service.IUserInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/user/info")
|
||||
|
||||
|
||||
public class UserInfoController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IUserInfoService userInfoService;
|
||||
// @Scheduled(fixedDelay = 30*1000)
|
||||
@PostMapping
|
||||
public String userInfo(@RequestBody User user){
|
||||
return userInfoService.login(user);
|
||||
// System.out.println("执行1次");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.ruoyi.web.controller.crops;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.crops.domain.WarningInformation;
|
||||
import com.ruoyi.crops.service.IWarningService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 预警信息controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("warning/information")
|
||||
public class WarningController extends BaseController {
|
||||
@Autowired
|
||||
private IWarningService iWarningService;
|
||||
|
||||
/**
|
||||
* 根据大棚编号查询
|
||||
* @param number
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{number}")
|
||||
public List<WarningInformation> selectByNumber(@PathVariable Integer number){
|
||||
return iWarningService.selectByNumber(number);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增单条数据
|
||||
* @param warningInformation
|
||||
* @return
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult insert(@RequestBody WarningInformation warningInformation){
|
||||
return toAjax(iWarningService.insert(warningInformation));
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,98 @@
|
||||
package com.ruoyi.web.controller.pill;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.pill.domain.PillFactory;
|
||||
import com.ruoyi.pill.service.IPillFactoryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生产厂家信息Controller
|
||||
*
|
||||
* @author my
|
||||
* @date 2023-04-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pill/factory")
|
||||
public class PillFactoryController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IPillFactoryService pillFactoryService;
|
||||
|
||||
/**
|
||||
* 查询生产厂家信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pill:factory:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(PillFactory pillFactory)
|
||||
{
|
||||
startPage();
|
||||
List<PillFactory> list = pillFactoryService.selectPillFactoryList(pillFactory);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出生产厂家信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pill:factory:export')")
|
||||
@Log(title = "生产厂家信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, PillFactory pillFactory)
|
||||
{
|
||||
List<PillFactory> list = pillFactoryService.selectPillFactoryList(pillFactory);
|
||||
ExcelUtil<PillFactory> util = new ExcelUtil<PillFactory>(PillFactory.class);
|
||||
util.exportExcel(response, list, "生产厂家信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取生产厂家信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pill:factory:query')")
|
||||
@GetMapping(value = "/{factoryId}")
|
||||
public AjaxResult getInfo(@PathVariable("factoryId") Long factoryId)
|
||||
{
|
||||
return success(pillFactoryService.selectPillFactoryByFactoryId(factoryId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产厂家信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pill:factory:add')")
|
||||
@Log(title = "生产厂家信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody PillFactory pillFactory)
|
||||
{
|
||||
return toAjax(pillFactoryService.insertPillFactory(pillFactory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产厂家信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pill:factory:edit')")
|
||||
@Log(title = "生产厂家信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody PillFactory pillFactory)
|
||||
{
|
||||
return toAjax(pillFactoryService.updatePillFactory(pillFactory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产厂家信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pill:factory:remove')")
|
||||
@Log(title = "生产厂家信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{factoryIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] factoryIds)
|
||||
{
|
||||
return toAjax(pillFactoryService.deletePillFactoryByFactoryIds(factoryIds));
|
||||
}
|
||||
}
|
@ -6,9 +6,9 @@ spring:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://localhost:3306/ruoyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: password
|
||||
password: 123456
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
|
@ -53,7 +53,7 @@ spring:
|
||||
messages:
|
||||
# 国际化资源文件路径
|
||||
basename: i18n/messages
|
||||
profiles:
|
||||
profiles:
|
||||
active: druid
|
||||
# 文件上传
|
||||
servlet:
|
||||
@ -76,7 +76,7 @@ spring:
|
||||
# 数据库索引
|
||||
database: 0
|
||||
# 密码
|
||||
password:
|
||||
password:
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
lettuce:
|
||||
@ -98,7 +98,7 @@ token:
|
||||
secret: abcdefghijklmnopqrstuvwxyz
|
||||
# 令牌有效期(默认30分钟)
|
||||
expireTime: 30
|
||||
|
||||
|
||||
# MyBatis配置
|
||||
mybatis:
|
||||
# 搜索指定包别名
|
||||
@ -109,10 +109,10 @@ mybatis:
|
||||
configLocation: classpath:mybatis/mybatis-config.xml
|
||||
|
||||
# PageHelper分页插件
|
||||
pagehelper:
|
||||
pagehelper:
|
||||
helperDialect: mysql
|
||||
supportMethodsArguments: true
|
||||
params: count=countSql
|
||||
params: count=countSql
|
||||
|
||||
# Swagger配置
|
||||
swagger:
|
||||
@ -122,10 +122,14 @@ swagger:
|
||||
pathMapping: /dev-api
|
||||
|
||||
# 防止XSS攻击
|
||||
xss:
|
||||
xss:
|
||||
# 过滤开关
|
||||
enabled: true
|
||||
# 排除链接(多个用逗号分隔)
|
||||
excludes: /system/notice
|
||||
# 匹配链接
|
||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||
|
||||
url:
|
||||
foundation: 'http://api.nonghaiiot.com/api/foundation/getFoundationByUserId.zzdy'
|
||||
userInfo: 'http://api.nonghaiiot.com/admin/sys/login'
|
||||
|
21
ruoyi-admin/src/test/java/com/ruoyi/web/PssTest.java
Normal file
21
ruoyi-admin/src/test/java/com/ruoyi/web/PssTest.java
Normal file
@ -0,0 +1,21 @@
|
||||
package com.ruoyi.web;
|
||||
|
||||
import com.ruoyi.pill.domain.PillFactory;
|
||||
import com.ruoyi.pill.service.IPillFactoryService;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest
|
||||
public class PssTest {
|
||||
@Autowired
|
||||
private IPillFactoryService IpillFactoryService;
|
||||
|
||||
@Test
|
||||
public void testSelectFactory(){
|
||||
PillFactory pillFactory = new PillFactory();
|
||||
pillFactory.setFactoryName("云南");
|
||||
IpillFactoryService.selectPillFactoryList(pillFactory);
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user