Compare commits

...

10 Commits

Author SHA1 Message Date
10b89f0da0 crops智慧农业 2023-05-04 16:25:09 +08:00
RuoYi
6ad345331d 修复开启TopNav后一级菜单路由参数设置无效问题(I6T1DK) 2023-04-11 16:51:55 +08:00
RuoYi
5a634a4ecd 修复导入用户时无法更新存在用户数据的问题 2023-04-10 18:03:34 +08:00
RuoYi
f5b865a2e1 优化用户导入更新时需获取用户编号问题 2023-04-10 17:58:03 +08:00
若依
f7595e4998
!700 newInstance() 已弃用,使用clazz.getDeclaredConstructor().newInstance()
Merge pull request !700 from Nymph2333/N/A
2023-04-10 09:32:01 +00:00
若依
64e71302e4
!699 修改注释中不存在的参数 set
Merge pull request !699 from bell/N/A
2023-04-10 09:26:01 +00:00
若依
2e99c68ed0
!695 下拉图标选择组件优化:1.已选择图标高亮回显 2.滚动条采用el-scrollbar
Merge pull request !695 from 绿色心情/icon-select
2023-04-10 09:09:43 +00:00
Nymph2333
af0e0a110e
newInstance() 已弃用,使用clazz.getDeclaredConstructor().newInstance()
This method propagates any exception thrown by the nullary constructor, including a checked exception. Use of this method effectively bypasses the compile-time exception checking that would otherwise be performed by the compiler. The Constructor.newInstance method avoids this problem by wrapping any exception thrown by the constructor in a (checked) InvocationTargetException.
The call
 clazz.newInstance()
can be replaced by
 clazz.getDeclaredConstructor().newInstance()
The latter sequence of calls is inferred to be able to throw the additional exception types InvocationTargetException and NoSuchMethodException. Both of these exception types are subclasses of ReflectiveOperationException.

Signed-off-by: Nymph2333 <498092988@qq.com>
2023-04-10 06:27:40 +00:00
bell
bef86e041f
修改注释中不存在的参数 set
Signed-off-by: bell <bellaconly@qq.com>
2023-04-10 03:20:19 +00:00
尹志芳
1067567f1c 下拉图标选择组件优化:1.已选择图标高亮回显 2.滚动条采用el-scrollbar 2023-04-09 13:20:59 +08:00
107 changed files with 5103 additions and 59 deletions

11
pom.xml
View File

@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId> <artifactId>ruoyi</artifactId>
<version>3.8.5</version> <version>3.8.5</version>
@ -11,7 +11,7 @@
<name>ruoyi</name> <name>ruoyi</name>
<url>http://www.ruoyi.vip</url> <url>http://www.ruoyi.vip</url>
<description>若依管理系统</description> <description>若依管理系统</description>
<properties> <properties>
<ruoyi.version>3.8.5</ruoyi.version> <ruoyi.version>3.8.5</ruoyi.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@ -31,7 +31,7 @@
<velocity.version>2.3</velocity.version> <velocity.version>2.3</velocity.version>
<jwt.version>0.9.1</jwt.version> <jwt.version>0.9.1</jwt.version>
</properties> </properties>
<!-- 依赖声明 --> <!-- 依赖声明 -->
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
@ -180,6 +180,9 @@
<module>ruoyi-quartz</module> <module>ruoyi-quartz</module>
<module>ruoyi-generator</module> <module>ruoyi-generator</module>
<module>ruoyi-common</module> <module>ruoyi-common</module>
<module>ruoyi-pill</module>
<module>ruoyi-crops</module>
<module>01</module>
</modules> </modules>
<packaging>pom</packaging> <packaging>pom</packaging>
@ -228,4 +231,4 @@
</pluginRepository> </pluginRepository>
</pluginRepositories> </pluginRepositories>
</project> </project>

View File

@ -37,7 +37,7 @@
<version>1.6.2</version> <version>1.6.2</version>
</dependency> </dependency>
<!-- Mysql驱动包 --> <!-- Mysql驱动包 -->
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
@ -60,6 +60,33 @@
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<artifactId>ruoyi-generator</artifactId> <artifactId>ruoyi-generator</artifactId>
</dependency> </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> </dependencies>
@ -80,17 +107,17 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId> <artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version> <version>3.1.0</version>
<configuration> <configuration>
<failOnMissingWebXml>false</failOnMissingWebXml> <failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName> <warName>${project.artifactId}</warName>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
<finalName>${project.artifactId}</finalName> <finalName>${project.artifactId}</finalName>
</build> </build>
</project> </project>

View File

@ -3,12 +3,14 @@ package com.ruoyi;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.scheduling.annotation.EnableScheduling;
/** /**
* 启动程序 * 启动程序
* *
* @author ruoyi * @author ruoyi
*/ */
@EnableScheduling
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class RuoYiApplication public class RuoYiApplication
{ {

View File

@ -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));
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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));
}
}

View File

@ -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));
}
}

View File

@ -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);
}
}

View File

@ -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}")
}

View File

@ -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));
}
}

View File

@ -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));
}
}

View File

@ -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));
}
}

View File

@ -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));
}
}

View File

@ -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));
}
}

View File

@ -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次");
}
}

View File

@ -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));
}
}

View File

@ -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));
}
}

View File

@ -6,9 +6,9 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: 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 username: root
password: password password: 123456
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭

View File

@ -53,7 +53,7 @@ spring:
messages: messages:
# 国际化资源文件路径 # 国际化资源文件路径
basename: i18n/messages basename: i18n/messages
profiles: profiles:
active: druid active: druid
# 文件上传 # 文件上传
servlet: servlet:
@ -76,7 +76,7 @@ spring:
# 数据库索引 # 数据库索引
database: 0 database: 0
# 密码 # 密码
password: password:
# 连接超时时间 # 连接超时时间
timeout: 10s timeout: 10s
lettuce: lettuce:
@ -98,7 +98,7 @@ token:
secret: abcdefghijklmnopqrstuvwxyz secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期默认30分钟 # 令牌有效期默认30分钟
expireTime: 30 expireTime: 30
# MyBatis配置 # MyBatis配置
mybatis: mybatis:
# 搜索指定包别名 # 搜索指定包别名
@ -109,10 +109,10 @@ mybatis:
configLocation: classpath:mybatis/mybatis-config.xml configLocation: classpath:mybatis/mybatis-config.xml
# PageHelper分页插件 # PageHelper分页插件
pagehelper: pagehelper:
helperDialect: mysql helperDialect: mysql
supportMethodsArguments: true supportMethodsArguments: true
params: count=countSql params: count=countSql
# Swagger配置 # Swagger配置
swagger: swagger:
@ -122,10 +122,14 @@ swagger:
pathMapping: /dev-api pathMapping: /dev-api
# 防止XSS攻击 # 防止XSS攻击
xss: xss:
# 过滤开关 # 过滤开关
enabled: true enabled: true
# 排除链接(多个用逗号分隔) # 排除链接(多个用逗号分隔)
excludes: /system/notice excludes: /system/notice
# 匹配链接 # 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/* urlPatterns: /system/*,/monitor/*,/tool/*
url:
foundation: 'http://api.nonghaiiot.com/api/foundation/getFoundationByUserId.zzdy'
userInfo: 'http://api.nonghaiiot.com/admin/sys/login'

View 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);
}
}

View File

@ -325,9 +325,9 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
} }
/** /**
* 判断给定的set列表中是否包含数组array 判断给定的数组array中是否包含给定的元素value * 判断给定的collection列表中是否包含数组array 判断给定的数组array中是否包含给定的元素value
* *
* @param set 给定的集合 * @param collection 给定的集合
* @param array 给定的数组 * @param array 给定的数组
* @return boolean 结果 * @return boolean 结果
*/ */

35
ruoyi-crops/pom.xml Normal file
View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.8.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ruoyi-crops</artifactId>
<dependencies>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.7.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
</project>

View File

@ -0,0 +1,123 @@
package com.ruoyi.crops.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import java.io.Serializable;
import java.util.Date;
/**
* 作物种植结构;
* @author : http://www.chiner.pro
* @date : 2023-4-24
*/
public class CropStructure{
/** id */
private Integer id ;
/** 区域 */
private String zone ;
/** 时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date imageDate ;
/** 小麦面积 */
private Double wheatArea ;
/** 玉米面积 */
private Double cornArea ;
/** 花生面积 */
private Double peanutArea ;
/** 大豆面积 */
private Double soybeanArea ;
/** 其他面积 */
private Double otherArea ;
/** 总面积 */
private Double toalArea ;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getZone() {
return zone;
}
public void setZone(String zone) {
this.zone = zone;
}
public Date getImageDate() {
return imageDate;
}
public void setImageDate(Date imageDate) {
this.imageDate = imageDate;
}
public Double getWheatArea() {
return wheatArea;
}
public void setWheatArea(Double wheatArea) {
this.wheatArea = wheatArea;
}
public Double getCornArea() {
return cornArea;
}
public void setCornArea(Double cornArea) {
this.cornArea = cornArea;
}
public Double getPeanutArea() {
return peanutArea;
}
public void setPeanutArea(Double peanutArea) {
this.peanutArea = peanutArea;
}
public Double getSoybeanArea() {
return soybeanArea;
}
public void setSoybeanArea(Double soybeanArea) {
this.soybeanArea = soybeanArea;
}
public Double getOtherArea() {
return otherArea;
}
public void setOtherArea(Double otherArea) {
this.otherArea = otherArea;
}
public Double getToalArea() {
return toalArea;
}
public void setToalArea(Double toalArea) {
this.toalArea = toalArea;
}
@Override
public String toString() {
return "CropStructure{" +
"id=" + id +
", zone='" + zone + '\'' +
", imageDate=" + imageDate +
", wheatArea=" + wheatArea +
", cornArea=" + cornArea +
", peanutArea=" + peanutArea +
", soybeanArea=" + soybeanArea +
", otherArea=" + otherArea +
", toalArea=" + toalArea +
'}';
}
}

View File

@ -0,0 +1,319 @@
package com.ruoyi.crops.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 作物综合数据对象 crops_comprehensive_data
*
* @author my
* @date 2023-04-20
*/
public class CropsComprehensiveData extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 镇耕地面积(万亩) */
@Excel(name = "镇耕地面积(万亩)")
private Float cultivatedArea;
/** 粮食总产(万吨) */
@Excel(name = "粮食总产(万吨)")
private Float foodstuffProduction;
/** 蔬菜种植面积(亩) */
@Excel(name = "蔬菜种植面积(亩)")
private Long vegetablePlantingArea;
/** 蔬菜总产(吨) */
@Excel(name = "蔬菜总产(吨)")
private Long vegetableProduction;
/** 农产品种类 */
@Excel(name = "农产品种类")
private Long type;
/** 农产品种植面积(亩) */
@Excel(name = "农产品种植面积(亩)")
private Long agriculturalPlantingArea;
/** 特色农业总产量(吨) */
@Excel(name = "特色农业总产量(吨)")
private Long agricultureProduction;
/** 特色农业年产值(万元) */
@Excel(name = "特色农业年产值(万元)")
private Long agricultureOutputVaule;
/** 总人口(人) */
@Excel(name = "总人口(人)")
private Long totalPopulation;
/** 占地面积(平方公里) */
@Excel(name = "占地面积(平方公里)")
private Float coverArea;
/** 示范大棚数量(个) */
@Excel(name = "示范大棚数量(个)")
private Long exampleGreenhouse;
/** 村居数量(个) */
@Excel(name = "村居数量(个)")
private Long rusticate;
/** 联合社耕地面积(万亩) */
@Excel(name = "联合社耕地面积(万亩)")
private Float cultivatedAlly;
/** 大棚数量(个) */
@Excel(name = "大棚数量(个)")
private Long greenhouse;
/** 农产品产值(万元) */
@Excel(name = "农产品产值(万元)")
private Long outputValue;
/** 庞家镇矢量边界 */
@Excel(name = "庞家镇矢量边界")
private String vectorBoundary;
/** 庞家镇村庄矢量边界 */
@Excel(name = "庞家镇村庄矢量边界")
private String villageVectorBoundary;
/** 图片 */
private String img;
/** 创建人 */
@Excel(name = "创建人")
private String createdBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createdTime;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setCultivatedArea(Float cultivatedArea)
{
this.cultivatedArea = cultivatedArea;
}
public Float getCultivatedArea()
{
return cultivatedArea;
}
public void setFoodstuffProduction(Float foodstuffProduction)
{
this.foodstuffProduction = foodstuffProduction;
}
public Float getFoodstuffProduction()
{
return foodstuffProduction;
}
public void setVegetablePlantingArea(Long vegetablePlantingArea)
{
this.vegetablePlantingArea = vegetablePlantingArea;
}
public Long getVegetablePlantingArea()
{
return vegetablePlantingArea;
}
public void setVegetableProduction(Long vegetableProduction)
{
this.vegetableProduction = vegetableProduction;
}
public Long getVegetableProduction()
{
return vegetableProduction;
}
public void setType(Long type)
{
this.type = type;
}
public Long getType()
{
return type;
}
public void setAgriculturalPlantingArea(Long agriculturalPlantingArea)
{
this.agriculturalPlantingArea = agriculturalPlantingArea;
}
public Long getAgriculturalPlantingArea()
{
return agriculturalPlantingArea;
}
public void setAgricultureProduction(Long agricultureProduction)
{
this.agricultureProduction = agricultureProduction;
}
public Long getAgricultureProduction()
{
return agricultureProduction;
}
public void setAgricultureOutputVaule(Long agricultureOutputVaule)
{
this.agricultureOutputVaule = agricultureOutputVaule;
}
public Long getAgricultureOutputVaule()
{
return agricultureOutputVaule;
}
public void setTotalPopulation(Long totalPopulation)
{
this.totalPopulation = totalPopulation;
}
public Long getTotalPopulation()
{
return totalPopulation;
}
public void setCoverArea(Float coverArea)
{
this.coverArea = coverArea;
}
public Float getCoverArea()
{
return coverArea;
}
public void setExampleGreenhouse(Long exampleGreenhouse)
{
this.exampleGreenhouse = exampleGreenhouse;
}
public Long getExampleGreenhouse()
{
return exampleGreenhouse;
}
public void setRusticate(Long rusticate)
{
this.rusticate = rusticate;
}
public Long getRusticate()
{
return rusticate;
}
public void setCultivatedAlly(Float cultivatedAlly)
{
this.cultivatedAlly = cultivatedAlly;
}
public Float getCultivatedAlly()
{
return cultivatedAlly;
}
public void setGreenhouse(Long greenhouse)
{
this.greenhouse = greenhouse;
}
public Long getGreenhouse()
{
return greenhouse;
}
public void setOutputValue(Long outputValue)
{
this.outputValue = outputValue;
}
public Long getOutputValue()
{
return outputValue;
}
public void setVectorBoundary(String vectorBoundary)
{
this.vectorBoundary = vectorBoundary;
}
public String getVectorBoundary()
{
return vectorBoundary;
}
public void setVillageVectorBoundary(String villageVectorBoundary)
{
this.villageVectorBoundary = villageVectorBoundary;
}
public String getVillageVectorBoundary()
{
return villageVectorBoundary;
}
public void setCreatedBy(String createdBy)
{
this.createdBy = createdBy;
}
public String getCreatedBy()
{
return createdBy;
}
public void setCreatedTime(Date createdTime)
{
this.createdTime = createdTime;
}
public Date getCreatedTime()
{
return createdTime;
}
public String getImg() {
return img;
}
public void setImg(String img) {
this.img = img;
}
@Override
public String toString() {
return "CropsComprehensiveData{" +
"id=" + id +
", cultivatedArea=" + cultivatedArea +
", foodstuffProduction=" + foodstuffProduction +
", vegetablePlantingArea=" + vegetablePlantingArea +
", vegetableProduction=" + vegetableProduction +
", type=" + type +
", agriculturalPlantingArea=" + agriculturalPlantingArea +
", agricultureProduction=" + agricultureProduction +
", agricultureOutputVaule=" + agricultureOutputVaule +
", totalPopulation=" + totalPopulation +
", coverArea=" + coverArea +
", exampleGreenhouse=" + exampleGreenhouse +
", rusticate=" + rusticate +
", cultivatedAlly=" + cultivatedAlly +
", greenhouse=" + greenhouse +
", outputValue=" + outputValue +
", vectorBoundary='" + vectorBoundary + '\'' +
", villageVectorBoundary='" + villageVectorBoundary + '\'' +
", img='" + img + '\'' +
", createdBy='" + createdBy + '\'' +
", createdTime=" + createdTime +
'}';
}
}

View File

@ -0,0 +1,110 @@
package com.ruoyi.crops.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
/**
* 作物旱情;
* @author : http://www.chiner.pro
* @date : 2023-4-24
*/
public class CropsDrought implements Serializable,Cloneable{
/** id */
private Integer id ;
/** 区域 */
private String zone ;
/** 时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date imageDate ;
/** 严重干旱面积 */
private Double severeArea ;
/** 中度干旱面积 */
private Double modArea ;
/** 轻度干旱面积 */
private Double mildArea ;
/** 适宜面积 */
private Double suitArea ;
/** 湿润面积 */
private Double humidArea ;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getZone() {
return zone;
}
public void setZone(String zone) {
this.zone = zone;
}
public Date getImageDate() {
return imageDate;
}
public void setImageDate(Date imageDate) {
this.imageDate = imageDate;
}
public Double getSevereArea() {
return severeArea;
}
public void setSevereArea(Double severeArea) {
this.severeArea = severeArea;
}
public Double getModArea() {
return modArea;
}
public void setModArea(Double modArea) {
this.modArea = modArea;
}
public Double getMildArea() {
return mildArea;
}
public void setMildArea(Double mildArea) {
this.mildArea = mildArea;
}
public Double getSuitArea() {
return suitArea;
}
public void setSuitArea(Double suitArea) {
this.suitArea = suitArea;
}
public Double getHumidArea() {
return humidArea;
}
public void setHumidArea(Double humidArea) {
this.humidArea = humidArea;
}
@Override
public String toString() {
return "CropsDrought{" +
"id=" + id +
", zone='" + zone + '\'' +
", imageDate=" + imageDate +
", severeArea=" + severeArea +
", modArea=" + modArea +
", mildArea=" + mildArea +
", suitArea=" + suitArea +
", humidArea=" + humidArea +
'}';
}
}

View File

@ -0,0 +1,110 @@
package com.ruoyi.crops.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import java.util.Date;
/**
* 作物长势;
* @author : http://www.chiner.pro
* @date : 2023-4-24
*/
public class CropsGrowth {
/** id */
private Integer id ;
/** 区域 */
private String zone ;
/** 时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date imageDate ;
/** 长势差面积 */
private Double poorArea ;
/** 长势较差面积 */
private Double lowArea ;
/** 长势适中面积 */
private Double mediumArea ;
/** 长势较好面积 */
private Double goodArea ;
/** 长势好面积 */
private Double excellentArea ;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getZone() {
return zone;
}
public void setZone(String zone) {
this.zone = zone;
}
public Date getImageDate() {
return imageDate;
}
public void setImageDate(Date imageDate) {
this.imageDate = imageDate;
}
public Double getPoorArea() {
return poorArea;
}
public void setPoorArea(Double poorArea) {
this.poorArea = poorArea;
}
public Double getLowArea() {
return lowArea;
}
public void setLowArea(Double lowArea) {
this.lowArea = lowArea;
}
public Double getMediumArea() {
return mediumArea;
}
public void setMediumArea(Double mediumArea) {
this.mediumArea = mediumArea;
}
public Double getGoodArea() {
return goodArea;
}
public void setGoodArea(Double goodArea) {
this.goodArea = goodArea;
}
public Double getExcellentArea() {
return excellentArea;
}
public void setExcellentArea(Double excellentArea) {
this.excellentArea = excellentArea;
}
@Override
public String toString() {
return "CropsGrowth{" +
"id=" + id +
", zone='" + zone + '\'' +
", imageDate=" + imageDate +
", poorArea=" + poorArea +
", lowArea=" + lowArea +
", mediumArea=" + mediumArea +
", goodArea=" + goodArea +
", excellentArea=" + excellentArea +
'}';
}
}

View File

@ -0,0 +1,71 @@
package com.ruoyi.crops.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
public class CropsYield {
/** id */
private Integer id ;
/** 区域 */
private String zone ;
/** 时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date imageDate ;
/** 作物类型 */
private String cropType ;
/** 产量 */
private Double yield ;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getZone() {
return zone;
}
public void setZone(String zone) {
this.zone = zone;
}
public Date getImageDate() {
return imageDate;
}
public void setImageDate(Date imageDate) {
this.imageDate = imageDate;
}
public String getCropType() {
return cropType;
}
public void setCropType(String croptype) {
this.cropType = croptype;
}
public Double getYield() {
return yield;
}
public void setYield(Double yield) {
this.yield = yield;
}
@Override
public String toString() {
return "CropsYield{" +
"id=" + id +
", zone='" + zone + '\'' +
", imageDate=" + imageDate +
", cropType='" + cropType + '\'' +
", yield=" + yield +
'}';
}
}

View File

@ -0,0 +1,116 @@
package com.ruoyi.crops.domain;
/**
* 环境数据;
* @author : http://www.chiner.pro
* @date : 2023-4-27
*/
public class EnvironmentalData{
/** id */
private Integer id ;
/**
* 大棚编号
*/
private Integer greenhouseNumber;
/** 土壤温度 */
private Double soilTemperature ;
/** 土壤湿度 */
private Double soilHumidity ;
/** 氮含量 */
private Integer nitrogenContent ;
/** 磷含量 */
private Integer phosphorusContent ;
/** 钾含量 */
private Integer potassiumContent ;
/** 空气温度 */
private Double airTemperature ;
/** 空气湿度 */
private Double airHumidity ;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getGreenhouseNumber() {
return greenhouseNumber;
}
public void setGreenhouseNumber(Integer greenhouseNumber) {
this.greenhouseNumber = greenhouseNumber;
}
public Double getSoilTemperature() {
return soilTemperature;
}
public void setSoilTemperature(Double soilTemperature) {
this.soilTemperature = soilTemperature;
}
public Double getSoilHumidity() {
return soilHumidity;
}
public void setSoilHumidity(Double soilHumidity) {
this.soilHumidity = soilHumidity;
}
public Integer getNitrogenContent() {
return nitrogenContent;
}
public void setNitrogenContent(Integer nitrogenContent) {
this.nitrogenContent = nitrogenContent;
}
public Integer getPhosphorusContent() {
return phosphorusContent;
}
public void setPhosphorusContent(Integer phosphorusContent) {
this.phosphorusContent = phosphorusContent;
}
public Integer getPotassiumContent() {
return potassiumContent;
}
public void setPotassiumContent(Integer potassiumContent) {
this.potassiumContent = potassiumContent;
}
public Double getAirTemperature() {
return airTemperature;
}
public void setAirTemperature(Double airTemperature) {
this.airTemperature = airTemperature;
}
public Double getAirHumidity() {
return airHumidity;
}
public void setAirHumidity(Double airHumidity) {
this.airHumidity = airHumidity;
}
@Override
public String toString() {
return "EnvironmentalData{" +
"id=" + id +
", greenhouseNumber=" + greenhouseNumber +
", soilTemperature=" + soilTemperature +
", soilHumidity=" + soilHumidity +
", nitrogenContent=" + nitrogenContent +
", phosphorusContent=" + phosphorusContent +
", potassiumContent=" + potassiumContent +
", airTemperature=" + airTemperature +
", airHumidity=" + airHumidity +
'}';
}
}

View File

@ -0,0 +1,59 @@
package com.ruoyi.crops.domain;
/**
* 大棚信息;
* @author : http://www.chiner.pro
* @date : 2023-4-27
*/
public class GreenhouseInformation {
/** id */
private Integer id ;
/** 区域 */
private String zone ;
/** 经营模式 */
private String managementModel ;
/** 园区介绍 */
private String introduce ;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getZone() {
return zone;
}
public void setZone(String zone) {
this.zone = zone;
}
public String getManagementModel() {
return managementModel;
}
public void setManagementModel(String managementModel) {
this.managementModel = managementModel;
}
public String getIntroduce() {
return introduce;
}
public void setIntroduce(String introduce) {
this.introduce = introduce;
}
@Override
public String toString() {
return "GreenhouseInformation{" +
"id=" + id +
", zone='" + zone + '\'' +
", managementModel='" + managementModel + '\'' +
", introduce='" + introduce + '\'' +
'}';
}
}

View File

@ -0,0 +1,21 @@
package com.ruoyi.crops.domain;
import javax.xml.crypto.Data;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class GsonParseFoundationBean {
public Integer code;
public ArrayList<Foundation> data;
public String msg;
public Boolean result;
public String time;
public class Foundation {
public Integer foundationId;
public String foundationName;
}
}

View File

@ -0,0 +1,82 @@
package com.ruoyi.crops.domain;
import java.io.Serializable;
/**
* 水肥一体机智能控制;
* @author : http://www.chiner.pro
* @date : 2023-4-27
*/
public class IntelligentControl{
/** id */
private Integer id ;
/** 大棚名称 */
private String greenhouseName ;
/** 阀门编号 */
private Integer valveNumber ;
/** 阀门状态 */
private Integer valveStatus ;
/** 开关 */
private Integer disjunctor ;
/** 进度 */
private Double schedule;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getGreenhouseName() {
return greenhouseName;
}
public void setGreenhouseName(String greenhouseName) {
this.greenhouseName = greenhouseName;
}
public Integer getValveNumber() {
return valveNumber;
}
public void setValveNumber(Integer valveNumber) {
this.valveNumber = valveNumber;
}
public Integer getValveStatus() {
return valveStatus;
}
public void setValveStatus(Integer valveStatus) {
this.valveStatus = valveStatus;
}
public Integer getDisjunctor() {
return disjunctor;
}
public void setDisjunctor(Integer option) {
this.disjunctor = option;
}
public Double getSchedule() {
return schedule;
}
public void setSchedule(Double schedule) {
this.schedule = schedule;
}
@Override
public String toString() {
return "IntelligentControl{" +
"id=" + id +
", greenhouseName='" + greenhouseName + '\'' +
", valveNumber=" + valveNumber +
", valveStatus=" + valveStatus +
", option=" + disjunctor +
", schedule=" + schedule +
'}';
}
}

View File

@ -0,0 +1,70 @@
package com.ruoyi.crops.domain;
/**
* 水肥一体机参数;
* @author : http://www.chiner.pro
* @date : 2023-4-27
*/
public class MachineParameter{
/** id */
private String id ;
/** 大棚名称 */
private String greenhouseName ;
/** 压力 */
private Double pressure ;
/** 流量 */
private Double flow ;
/** 电导率 */
private Double conductivity ;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getGreenhouseName() {
return greenhouseName;
}
public void setGreenhouseName(String greenhouseName) {
this.greenhouseName = greenhouseName;
}
public Double getPressure() {
return pressure;
}
public void setPressure(Double pressure) {
this.pressure = pressure;
}
public Double getFlow() {
return flow;
}
public void setFlow(Double flow) {
this.flow = flow;
}
public Double getConductivity() {
return conductivity;
}
public void setConductivity(Double conductivity) {
this.conductivity = conductivity;
}
@Override
public String toString() {
return "MachineParameter{" +
"id='" + id + '\'' +
", greenhouseName='" + greenhouseName + '\'' +
", pressure=" + pressure +
", flow=" + flow +
", conductivity=" + conductivity +
'}';
}
}

View File

@ -0,0 +1,64 @@
package com.ruoyi.crops.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
/**
* 操作记录;
* @author : http://www.chiner.pro
* @date : 2023-4-27
*/
public class OperationRecords {
/** id */
private String id ;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime ;
/** 操作内容 */
private String operationContent ;
/** 更新人 */
private String updateBy ;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getOperationContent() {
return operationContent;
}
public void setOperationContent(String operationContent) {
this.operationContent = operationContent;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
@Override
public String toString() {
return "OperationRecords{" +
"id='" + id + '\'' +
", updateTime=" + updateTime +
", operationContent='" + operationContent + '\'' +
", updateBy='" + updateBy + '\'' +
'}';
}
}

View File

@ -0,0 +1,74 @@
package com.ruoyi.crops.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
/**
* 服务类型;
* @author : http://www.chiner.pro
* @date : 2023-4-26
*/
public class ServiceType {
/** id */
private Integer id ;
/** 服务类型 */
private String serviceType ;
/** 时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date time ;
/** 服务名称 */
private String serviceName ;
/** 样式 */
private String style ;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getServiceType() {
return serviceType;
}
public void setServiceType(String serviceType) {
this.serviceType = serviceType;
}
public Date getTime() {
return time;
}
public void setTime(Date time) {
this.time = time;
}
public String getServiceName() {
return serviceName;
}
public void setServiceName(String serviceName) {
this.serviceName = serviceName;
}
public String getStyle() {
return style;
}
public void setStyle(String style) {
this.style = style;
}
@Override
public String toString() {
return "ServiceType{" +
"id=" + id +
", serviceType='" + serviceType + '\'' +
", time=" + time +
", serviceName='" + serviceName + '\'' +
", style='" + style + '\'' +
'}';
}
}

View File

@ -0,0 +1,30 @@
package com.ruoyi.crops.domain;
public class User {
private String username;
private String password;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String toString() {
return "User{" +
"username='" + username + '\'' +
", password='" + password + '\'' +
'}';
}
}

View File

@ -0,0 +1,52 @@
package com.ruoyi.crops.domain;
import java.util.Date;
public class UserInfo {
private String id;
private String token;
private Long expire;
private String userInfo;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public Long getExpire() {
return expire;
}
public void setExpire(Long expire) {
this.expire = expire;
}
public String getUserInfo() {
return userInfo;
}
public void setUserInfo(String userInfo) {
this.userInfo = userInfo;
}
@Override
public String toString() {
return "UserInfo{" +
"id=" + id +
", token='" + token + '\'' +
", expire=" + expire +
", userInfo='" + userInfo + '\'' +
'}';
}
}

View File

@ -0,0 +1,86 @@
package com.ruoyi.crops.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
/**
* 预警信息统计;
* @author : http://www.chiner.pro
* @date : 2023-4-27
*/
public class WarningInformation{
/** id */
private Integer id ;
/** 大棚编号 */
private Integer greenhouseNumber ;
/** 监测指标 */
private String monitoringIndicators ;
/** 监测数值 */
private Double monitoringValues ;
/** 异常原因 */
private String abnormalCause ;
/** 预警时间 */
@JsonFormat(pattern = "yyyy/MM/dd")
private Date warningTime ;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getGreenhouseNumber() {
return greenhouseNumber;
}
public void setGreenhouseName(Integer greenhouseNumber) {
this.greenhouseNumber = greenhouseNumber;
}
public String getMonitoringIndicators() {
return monitoringIndicators;
}
public void setMonitoringIndicators(String monitoringIndicators) {
this.monitoringIndicators = monitoringIndicators;
}
public Double getMonitoringValues() {
return monitoringValues;
}
public void setMonitoringValues(Double monitoringValues) {
this.monitoringValues = monitoringValues;
}
public String getAbnormalCause() {
return abnormalCause;
}
public void setAbnormalCause(String abnormalCause) {
this.abnormalCause = abnormalCause;
}
public Date getWarningTime() {
return warningTime;
}
public void setWarningTime(Date warningTime) {
this.warningTime = warningTime;
}
@Override
public String toString() {
return "WarningInformation{" +
"id=" + id +
", greenhouseName=" + greenhouseNumber +
", monitoringIndicators='" + monitoringIndicators + '\'' +
", monitoringValues=" + monitoringValues +
", abnormalCause='" + abnormalCause + '\'' +
", warningTime=" + warningTime +
'}';
}
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.crops.mapper;
import java.util.List;
import com.ruoyi.crops.domain.CropsComprehensiveData;
/**
* 作物综合数据Mapper接口
*
* @author my
* @date 2023-04-20
*/
public interface CropsComprehensiveDataMapper
{
/**
* 查询作物综合数据
*
* @param id 作物综合数据主键
* @return 作物综合数据
*/
public CropsComprehensiveData selectCropsComprehensiveDataById(Long id);
/**
* 查询作物综合数据列表
*
* @param cropsComprehensiveData 作物综合数据
* @return 作物综合数据集合
*/
public List<CropsComprehensiveData> selectCropsComprehensiveDataList(CropsComprehensiveData cropsComprehensiveData);
/**
* 新增作物综合数据
*
* @param cropsComprehensiveData 作物综合数据
* @return 结果
*/
public int insertCropsComprehensiveData(CropsComprehensiveData cropsComprehensiveData);
/**
* 修改作物综合数据
*
* @param cropsComprehensiveData 作物综合数据
* @return 结果
*/
public int updateCropsComprehensiveData(CropsComprehensiveData cropsComprehensiveData);
/**
* 删除作物综合数据
*
* @param id 作物综合数据主键
* @return 结果
*/
public int deleteCropsComprehensiveDataById(Long id);
/**
* 批量删除作物综合数据
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteCropsComprehensiveDataByIds(Long[] ids);
}

View File

@ -0,0 +1,13 @@
package com.ruoyi.crops.mapper;
import com.ruoyi.crops.domain.CropsDrought;
import org.springframework.data.repository.query.Param;
import java.util.Date;
import java.util.List;
public interface CropsDroughtMapper {
public int insertBatch(@Param("list") List<CropsDrought> cropsDroughtList);
List<CropsDrought> selectByTime(Date time);
}

View File

@ -0,0 +1,14 @@
package com.ruoyi.crops.mapper;
import com.ruoyi.crops.domain.CropsGrowth;
import org.springframework.data.repository.query.Param;
import java.util.Date;
import java.util.List;
public interface CropsGrowthMapper {
public int insertBatch(@Param("list")List<CropsGrowth> list);
public List<CropsGrowth> selectByTime(Date time);
}

View File

@ -0,0 +1,20 @@
package com.ruoyi.crops.mapper;
import com.ruoyi.crops.domain.CropStructure;
import org.springframework.data.repository.query.Param;
import java.util.Date;
import java.util.List;
public interface CropsStructureMapper {
/**
* 新增作物种植结构
* @param cropStructure
* @return
*/
public int insertCropsStructure(CropStructure cropStructure);
public int insertBatch(@Param("list") List<CropStructure> list);
public List<CropStructure> selectByTime(Date time);
}

View File

@ -0,0 +1,13 @@
package com.ruoyi.crops.mapper;
import com.ruoyi.crops.domain.CropsYield;
import org.springframework.data.repository.query.Param;
import java.util.Date;
import java.util.List;
public interface CropsYieldMapper {
public List<CropsYield> selectByYear(Integer year);
public int insertBatch(@Param("list") List<CropsYield> list);
}

View File

@ -0,0 +1,11 @@
package com.ruoyi.crops.mapper;
import com.ruoyi.crops.domain.EnvironmentalData;
import java.util.List;
public interface EnvironmentalMapper {
List<EnvironmentalData> selectByNumber(Integer number);
int insert(EnvironmentalData environmentalData);
}

View File

@ -0,0 +1,11 @@
package com.ruoyi.crops.mapper;
import com.ruoyi.crops.domain.GreenhouseInformation;
import java.util.List;
public interface GreenhouseMapper {
List<GreenhouseInformation> selectByName(String name);
int insert(GreenhouseInformation greenhouseInformation);
}

View File

@ -0,0 +1,13 @@
package com.ruoyi.crops.mapper;
import com.ruoyi.crops.domain.IntelligentControl;
import java.util.List;
public interface IntelligentControlMapper {
int insert(IntelligentControl intelligentControl);
List<IntelligentControl> selectAll();
int edit(IntelligentControl intelligentControl);
}

View File

@ -0,0 +1,11 @@
package com.ruoyi.crops.mapper;
import com.ruoyi.crops.domain.MachineParameter;
import java.util.List;
public interface MachineParameterMapper {
List<MachineParameter> selectByName(String name);
int insert(MachineParameter machineParameter);
}

View File

@ -0,0 +1,11 @@
package com.ruoyi.crops.mapper;
import com.ruoyi.crops.domain.OperationRecords;
import java.util.List;
public interface OperationRecordsMapper {
List<OperationRecords> selectAll();
int insert(OperationRecords operationRecords);
}

View File

@ -0,0 +1,16 @@
package com.ruoyi.crops.mapper;
import com.ruoyi.crops.domain.ServiceType;
import java.util.List;
public interface ServiceTypeMapper {
List<ServiceType> selectByType(String type);
int insert(ServiceType serviceType);
List<ServiceType> selectAll();
int deleteByIds(Long[] ids);
}

View File

@ -0,0 +1,12 @@
package com.ruoyi.crops.mapper;
import com.ruoyi.crops.domain.WarningInformation;
import java.util.List;
public interface WarningMapper {
List<WarningInformation> selectByNumber(Integer number);
int insert(WarningInformation warningInformation);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.crops.service;
import java.util.List;
import com.ruoyi.crops.domain.CropsComprehensiveData;
/**
* 作物综合数据Service接口
*
* @author my
* @date 2023-04-20
*/
public interface ICropsComprehensiveDataService
{
/**
* 查询作物综合数据
*
* @param id 作物综合数据主键
* @return 作物综合数据
*/
public CropsComprehensiveData selectCropsComprehensiveDataById(Long id);
/**
* 查询作物综合数据列表
*
* @param cropsComprehensiveData 作物综合数据
* @return 作物综合数据集合
*/
public List<CropsComprehensiveData> selectCropsComprehensiveDataList(CropsComprehensiveData cropsComprehensiveData);
/**
* 新增作物综合数据
*
* @param cropsComprehensiveData 作物综合数据
* @return 结果
*/
public int insertCropsComprehensiveData(CropsComprehensiveData cropsComprehensiveData);
/**
* 修改作物综合数据
*
* @param cropsComprehensiveData 作物综合数据
* @return 结果
*/
public int updateCropsComprehensiveData(CropsComprehensiveData cropsComprehensiveData);
/**
* 批量删除作物综合数据
*
* @param ids 需要删除的作物综合数据主键集合
* @return 结果
*/
public int deleteCropsComprehensiveDataByIds(Long[] ids);
/**
* 删除作物综合数据信息
*
* @param id 作物综合数据主键
* @return 结果
*/
public int deleteCropsComprehensiveDataById(Long id);
}

View File

@ -0,0 +1,14 @@
package com.ruoyi.crops.service;
import com.ruoyi.crops.domain.CropsDrought;
import com.ruoyi.crops.domain.CropsYield;
import java.util.Date;
import java.util.List;
public interface ICropsDroughtService {
public int insertBatch(List<CropsDrought> cropsYieldList);
public List<CropsDrought> selectByTime(Date time);
}

View File

@ -0,0 +1,18 @@
package com.ruoyi.crops.service;
import com.ruoyi.crops.domain.CropsGrowth;
import javax.xml.crypto.Data;
import java.util.Date;
import java.util.List;
public interface ICropsGrowthService {
/**
* 批量新增
* @param cropGrowth
* @return
*/
public int insertBatch(List<CropsGrowth> cropGrowth);
public List<CropsGrowth> selectByTime(Date time);
}

View File

@ -0,0 +1,29 @@
package com.ruoyi.crops.service;
import com.ruoyi.crops.domain.CropStructure;
import java.util.Date;
import java.util.List;
public interface ICropsStructureService {
/**
* 新增作物种植结构
* @param cropStructure
* @return
*/
public int insertCropsStructure(CropStructure cropStructure);
/**
* 批量新增作物种植结构
* @param cropStructureList
* @return
*/
public int insertBatch(List<CropStructure> cropStructureList);
/**
* 根据时间查询
* @param time
* @return
*/
public List<CropStructure> selectByTime(Date time);
}

View File

@ -0,0 +1,12 @@
package com.ruoyi.crops.service;
import com.ruoyi.crops.domain.CropsYield;
import java.util.Date;
import java.util.List;
public interface ICropsYieldService {
public List<CropsYield> selectByYear(Integer year);
public int insertBatch (List<CropsYield> cropYieldList);
}

View File

@ -0,0 +1,12 @@
package com.ruoyi.crops.service;
import com.ruoyi.crops.domain.EnvironmentalData;
import java.util.List;
public interface IEnvironmentalService {
List<EnvironmentalData> selectByNumber(Integer number);
int insert(EnvironmentalData environmentalData);
}

View File

@ -0,0 +1,5 @@
package com.ruoyi.crops.service;
public interface IFoundationService {
String getFoundation(String id);
}

View File

@ -0,0 +1,11 @@
package com.ruoyi.crops.service;
import com.ruoyi.crops.domain.GreenhouseInformation;
import java.util.List;
public interface IGreenhouseService {
List<GreenhouseInformation> selectByName(String name);
int insert(GreenhouseInformation greenhouseInformation);
}

View File

@ -0,0 +1,13 @@
package com.ruoyi.crops.service;
import com.ruoyi.crops.domain.IntelligentControl;
import java.util.List;
public interface IIntelligentControlService {
int insert(IntelligentControl intelligentControl);
List<IntelligentControl> selectAll();
int edit(IntelligentControl intelligentControl);
}

View File

@ -0,0 +1,11 @@
package com.ruoyi.crops.service;
import com.ruoyi.crops.domain.MachineParameter;
import java.util.List;
public interface IMachineParameterService {
List<MachineParameter> selectByName(String name);
int insert(MachineParameter machineParameter);
}

View File

@ -0,0 +1,11 @@
package com.ruoyi.crops.service;
import com.ruoyi.crops.domain.OperationRecords;
import java.util.List;
public interface IOperationRecordsService {
List<OperationRecords> selectAll();
int insert(OperationRecords operationRecords);
}

View File

@ -0,0 +1,16 @@
package com.ruoyi.crops.service;
import com.ruoyi.crops.domain.ServiceType;
import java.util.List;
public interface IServiceTypeService {
List<ServiceType> selectByType(String type);
int insert(ServiceType serviceType);
List<ServiceType> selectAll();
int deleteByIds(Long[] ids);
}

View File

@ -0,0 +1,8 @@
package com.ruoyi.crops.service;
import com.ruoyi.crops.domain.User;
public interface IUserInfoService {
String login(User user);
}

View File

@ -0,0 +1,11 @@
package com.ruoyi.crops.service;
import com.ruoyi.crops.domain.WarningInformation;
import java.util.List;
public interface IWarningService {
List<WarningInformation> selectByNumber(Integer number);
int insert(WarningInformation warningInformation);
}

View File

@ -0,0 +1,93 @@
package com.ruoyi.crops.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.crops.mapper.CropsComprehensiveDataMapper;
import com.ruoyi.crops.domain.CropsComprehensiveData;
import com.ruoyi.crops.service.ICropsComprehensiveDataService;
/**
* 作物综合数据Service业务层处理
*
* @author my
* @date 2023-04-20
*/
@Service
public class CropsComprehensiveDataServiceImpl implements ICropsComprehensiveDataService
{
@Autowired
private CropsComprehensiveDataMapper cropsComprehensiveDataMapper;
/**
* 查询作物综合数据
*
* @param id 作物综合数据主键
* @return 作物综合数据
*/
@Override
public CropsComprehensiveData selectCropsComprehensiveDataById(Long id)
{
return cropsComprehensiveDataMapper.selectCropsComprehensiveDataById(id);
}
/**
* 查询作物综合数据列表
*
* @param cropsComprehensiveData 作物综合数据
* @return 作物综合数据
*/
@Override
public List<CropsComprehensiveData> selectCropsComprehensiveDataList(CropsComprehensiveData cropsComprehensiveData)
{
return cropsComprehensiveDataMapper.selectCropsComprehensiveDataList(cropsComprehensiveData);
}
/**
* 新增作物综合数据
*
* @param cropsComprehensiveData 作物综合数据
* @return 结果
*/
@Override
public int insertCropsComprehensiveData(CropsComprehensiveData cropsComprehensiveData)
{
return cropsComprehensiveDataMapper.insertCropsComprehensiveData(cropsComprehensiveData);
}
/**
* 修改作物综合数据
*
* @param cropsComprehensiveData 作物综合数据
* @return 结果
*/
@Override
public int updateCropsComprehensiveData(CropsComprehensiveData cropsComprehensiveData)
{
return cropsComprehensiveDataMapper.updateCropsComprehensiveData(cropsComprehensiveData);
}
/**
* 批量删除作物综合数据
*
* @param ids 需要删除的作物综合数据主键
* @return 结果
*/
@Override
public int deleteCropsComprehensiveDataByIds(Long[] ids)
{
return cropsComprehensiveDataMapper.deleteCropsComprehensiveDataByIds(ids);
}
/**
* 删除作物综合数据信息
*
* @param id 作物综合数据主键
* @return 结果
*/
@Override
public int deleteCropsComprehensiveDataById(Long id)
{
return cropsComprehensiveDataMapper.deleteCropsComprehensiveDataById(id);
}
}

View File

@ -0,0 +1,26 @@
package com.ruoyi.crops.service.impl;
import com.ruoyi.crops.domain.CropsDrought;
import com.ruoyi.crops.domain.CropsYield;
import com.ruoyi.crops.mapper.CropsDroughtMapper;
import com.ruoyi.crops.service.ICropsDroughtService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
public class CropsDroughtServiceImpl implements ICropsDroughtService {
@Autowired
private CropsDroughtMapper cropsDroughtMapper;
@Override
public int insertBatch(List<CropsDrought> cropsYieldList) {
return cropsDroughtMapper.insertBatch(cropsYieldList);
}
@Override
public List<CropsDrought> selectByTime(Date time) {
return cropsDroughtMapper.selectByTime(time);
}
}

View File

@ -0,0 +1,25 @@
package com.ruoyi.crops.service.impl;
import com.ruoyi.crops.domain.CropsGrowth;
import com.ruoyi.crops.mapper.CropsGrowthMapper;
import com.ruoyi.crops.service.ICropsGrowthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
public class CropsGrowthServiceImpl implements ICropsGrowthService {
@Autowired
private CropsGrowthMapper cropsGrowthMapper;
@Override
public int insertBatch(List<CropsGrowth> cropGrowth) {
return cropsGrowthMapper.insertBatch(cropGrowth);
}
@Override
public List<CropsGrowth> selectByTime(Date time) {
return cropsGrowthMapper.selectByTime(time);
}
}

View File

@ -0,0 +1,41 @@
package com.ruoyi.crops.service.impl;
import com.ruoyi.crops.domain.CropStructure;
import com.ruoyi.crops.mapper.CropsStructureMapper;
import com.ruoyi.crops.service.ICropsStructureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
public class CropsStructureServiceImpl implements ICropsStructureService {
@Autowired
private CropsStructureMapper cropsStructureMapper;
/**
* 新增作物种植结构
* @param cropStructure
* @return
*/
@Override
public int insertCropsStructure(CropStructure cropStructure) {
return cropsStructureMapper.insertCropsStructure(cropStructure);
}
/**
* 批量新增
* @param cropStructureList
* @return
*/
@Override
public int insertBatch(List<CropStructure> cropStructureList) {
return cropsStructureMapper.insertBatch(cropStructureList);
}
@Override
public List<CropStructure> selectByTime(Date time) {
return cropsStructureMapper.selectByTime(time);
}
}

View File

@ -0,0 +1,25 @@
package com.ruoyi.crops.service.impl;
import com.ruoyi.crops.domain.CropsYield;
import com.ruoyi.crops.mapper.CropsYieldMapper;
import com.ruoyi.crops.service.ICropsYieldService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
public class CropsYieldServiceImpl implements ICropsYieldService {
@Autowired
private CropsYieldMapper cropsYieldMapper;
@Override
public List<CropsYield> selectByYear(Integer year) {
return cropsYieldMapper.selectByYear(year);
}
@Override
public int insertBatch(List<CropsYield> cropYieldList) {
return cropsYieldMapper.insertBatch(cropYieldList);
}
}

View File

@ -0,0 +1,24 @@
package com.ruoyi.crops.service.impl;
import com.ruoyi.crops.domain.EnvironmentalData;
import com.ruoyi.crops.mapper.EnvironmentalMapper;
import com.ruoyi.crops.service.IEnvironmentalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class EnvironmentalServiceImpl implements IEnvironmentalService {
@Autowired
private EnvironmentalMapper environmentalMapper;
@Override
public List<EnvironmentalData> selectByNumber(Integer number) {
return environmentalMapper.selectByNumber(number);
}
@Override
public int insert(EnvironmentalData environmentalData) {
return environmentalMapper.insert(environmentalData);
}
}

View File

@ -0,0 +1,44 @@
package com.ruoyi.crops.service.impl;
import cn.hutool.http.HttpUtil;
import com.google.gson.Gson;
import com.ruoyi.crops.domain.GsonParseFoundationBean;
import com.ruoyi.crops.service.IFoundationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
@Service
public class FoundationServiceImpl implements IFoundationService {
@Autowired
private RedisTemplate redisTemplate;
@Autowired
private Gson gson;
@Value("${url.foundation}")
private String url;
@Override
public String getFoundation(String id) {
Map<String, Object> map = new HashMap<>();//存放参数
map.put("id", id);
HashMap<String, String> headers = new HashMap<>();//存放请求头可以存放多个请求头
String token = (String) redisTemplate.opsForValue().get(id);
headers.put("token", token);
String result = HttpUtil.createPost(url).addHeaders(headers).form(map).execute().body();
GsonParseFoundationBean model = gson.fromJson(result, GsonParseFoundationBean.class);
ArrayList<GsonParseFoundationBean.Foundation> foundations = model.data;
for (GsonParseFoundationBean.Foundation Foundation : foundations) {
Integer foundationId = Foundation.foundationId;
String foundationName = Foundation.foundationName;
// insert(foundationId,foundationName);
}
return token;
}
}

View File

@ -0,0 +1,24 @@
package com.ruoyi.crops.service.impl;
import com.ruoyi.crops.domain.GreenhouseInformation;
import com.ruoyi.crops.mapper.GreenhouseMapper;
import com.ruoyi.crops.service.IGreenhouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class GreenhouseServiceImpl implements IGreenhouseService {
@Autowired
private GreenhouseMapper greenhouseMapper;
@Override
public List<GreenhouseInformation> selectByName(String name) {
return greenhouseMapper.selectByName(name);
}
@Override
public int insert(GreenhouseInformation greenhouseInformation) {
return greenhouseMapper.insert(greenhouseInformation);
}
}

View File

@ -0,0 +1,29 @@
package com.ruoyi.crops.service.impl;
import com.ruoyi.crops.domain.IntelligentControl;
import com.ruoyi.crops.mapper.IntelligentControlMapper;
import com.ruoyi.crops.service.IIntelligentControlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class IntelligentControlServiceImpl implements IIntelligentControlService {
@Autowired
private IntelligentControlMapper intelligentControlMapper;
@Override
public int insert(IntelligentControl intelligentControl) {
return intelligentControlMapper.insert(intelligentControl);
}
@Override
public List<IntelligentControl> selectAll() {
return intelligentControlMapper.selectAll();
}
@Override
public int edit(IntelligentControl intelligentControl) {
return intelligentControlMapper.edit(intelligentControl);
}
}

View File

@ -0,0 +1,24 @@
package com.ruoyi.crops.service.impl;
import com.ruoyi.crops.domain.MachineParameter;
import com.ruoyi.crops.mapper.MachineParameterMapper;
import com.ruoyi.crops.service.IMachineParameterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class MachineParameterServiceImpl implements IMachineParameterService {
@Autowired
private MachineParameterMapper machineParameterMapper;
@Override
public List<MachineParameter> selectByName(String name) {
return machineParameterMapper.selectByName(name);
}
@Override
public int insert(MachineParameter machineParameter) {
return machineParameterMapper.insert(machineParameter);
}
}

View File

@ -0,0 +1,24 @@
package com.ruoyi.crops.service.impl;
import com.ruoyi.crops.domain.OperationRecords;
import com.ruoyi.crops.mapper.OperationRecordsMapper;
import com.ruoyi.crops.service.IOperationRecordsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class OperationRecordsServiceImppl implements IOperationRecordsService {
@Autowired
private OperationRecordsMapper operationRecordsMapper;
@Override
public List<OperationRecords> selectAll() {
return operationRecordsMapper.selectAll();
}
@Override
public int insert(OperationRecords operationRecords) {
return operationRecordsMapper.insert(operationRecords);
}
}

View File

@ -0,0 +1,35 @@
package com.ruoyi.crops.service.impl;
import com.ruoyi.crops.domain.ServiceType;
import com.ruoyi.crops.mapper.ServiceTypeMapper;
import com.ruoyi.crops.service.IServiceTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class ServiceTypeServiceImpl implements IServiceTypeService {
@Autowired
private ServiceTypeMapper serviceTypeMapper;
@Override
public List<ServiceType> selectByType(String type) {
return serviceTypeMapper.selectByType(type);
}
@Override
public int insert(ServiceType serviceType) {
return serviceTypeMapper.insert(serviceType);
}
@Override
public List<ServiceType> selectAll() {
return serviceTypeMapper.selectAll();
}
@Override
public int deleteByIds(Long[] ids) {
return serviceTypeMapper.deleteByIds(ids);
}
}

View File

@ -0,0 +1,35 @@
package com.ruoyi.crops.service.impl;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson2.JSONObject;
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.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.time.Duration;
import java.util.HashMap;
@Service
public class UserInfoServiceImpl implements IUserInfoService {
@Autowired
private RedisTemplate redisTemplate;
@Value("${url.userInfo}")
private String url;
@Override
public String login(User user) {
HashMap<String, Object> paramMap = new HashMap<>();
paramMap.put("username", user.getUsername());
paramMap.put("password", user.getPassword());
String result = HttpUtil.post(url, paramMap);
UserInfo userInfo = JSONObject.parseObject(result, UserInfo.class);
redisTemplate.opsForValue().set(userInfo.getId(), userInfo.getToken(), Duration.ofMillis(userInfo.getExpire()) );
return userInfo.toString();
}
}

View File

@ -0,0 +1,23 @@
package com.ruoyi.crops.service.impl;
import com.ruoyi.crops.domain.WarningInformation;
import com.ruoyi.crops.mapper.WarningMapper;
import com.ruoyi.crops.service.IWarningService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class WarningServiceImpl implements IWarningService {
@Autowired
private WarningMapper warningMapper;
@Override
public List<WarningInformation> selectByNumber(Integer number) {
return warningMapper.selectByNumber(number);
}
@Override
public int insert(WarningInformation warningInformation) {
return warningMapper.insert(warningInformation);
}
}

View File

@ -0,0 +1,151 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.crops.mapper.CropsComprehensiveDataMapper">
<resultMap type="com.ruoyi.crops.domain.CropsComprehensiveData" id="CropsComprehensiveDataResult">
<result property="id" column="id" />
<result property="cultivatedArea" column="cultivated_area" />
<result property="foodstuffProduction" column="foodstuff_production" />
<result property="vegetablePlantingArea" column="vegetable_planting_area" />
<result property="vegetableProduction" column="vegetable_production" />
<result property="type" column="type" />
<result property="agriculturalPlantingArea" column="agricultural_planting_area" />
<result property="agricultureProduction" column="agriculture_production" />
<result property="agricultureOutputVaule" column="agriculture_output_vaule" />
<result property="totalPopulation" column="total_population" />
<result property="coverArea" column="cover_area" />
<result property="exampleGreenhouse" column="example_greenhouse" />
<result property="rusticate" column="rusticate" />
<result property="cultivatedAlly" column="cultivated_ally" />
<result property="greenhouse" column="greenhouse" />
<result property="outputValue" column="output_value" />
<result property="vectorBoundary" column="vector_boundary" />
<result property="villageVectorBoundary" column="village_vector_boundary" />
<result property="img" column="img" />
<result property="createdBy" column="created_by" />
<result property="createdTime" column="created_time" />
</resultMap>
<sql id="selectCropsComprehensiveDataVo">
select id, cultivated_area, foodstuff_production, vegetable_planting_area, vegetable_production, type, agricultural_planting_area, agriculture_production, agriculture_output_vaule, total_population, cover_area, example_greenhouse, rusticate, cultivated_ally, greenhouse, output_value, vector_boundary, village_vector_boundary,img, created_by, created_time from crops_comprehensive_data
</sql>
<select id="selectCropsComprehensiveDataList" parameterType="CropsComprehensiveData" resultMap="CropsComprehensiveDataResult">
<include refid="selectCropsComprehensiveDataVo"/>
<where>
<if test="cultivatedArea != null "> and cultivated_area = #{cultivatedArea}</if>
<if test="foodstuffProduction != null "> and foodstuff_production = #{foodstuffProduction}</if>
<if test="vegetablePlantingArea != null "> and vegetable_planting_area = #{vegetablePlantingArea}</if>
<if test="vegetableProduction != null "> and vegetable_production = #{vegetableProduction}</if>
<if test="type != null "> and type = #{type}</if>
<if test="agriculturalPlantingArea != null "> and agricultural_planting_area = #{agriculturalPlantingArea}</if>
<if test="agricultureProduction != null "> and agriculture_production = #{agricultureProduction}</if>
<if test="agricultureOutputVaule != null "> and agriculture_output_vaule = #{agricultureOutputVaule}</if>
<if test="totalPopulation != null "> and total_population = #{totalPopulation}</if>
<if test="coverArea != null "> and cover_area = #{coverArea}</if>
<if test="exampleGreenhouse != null "> and example_greenhouse = #{exampleGreenhouse}</if>
<if test="rusticate != null "> and rusticate = #{rusticate}</if>
<if test="cultivatedAlly != null "> and cultivated_ally = #{cultivatedAlly}</if>
<if test="greenhouse != null "> and greenhouse = #{greenhouse}</if>
<if test="outputValue != null "> and output_value = #{outputValue}</if>
<if test="vectorBoundary != null and vectorBoundary != ''"> and vector_boundary = #{vectorBoundary}</if>
<if test="villageVectorBoundary != null and villageVectorBoundary != ''"> and village_vector_boundary = #{villageVectorBoundary}</if>
<if test="img != null and img != ''"> and img = #{img}</if>
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
<if test="createdTime != null "> and created_time = #{createdTime}</if>
</where>
</select>
<select id="selectCropsComprehensiveDataById" parameterType="Long" resultMap="CropsComprehensiveDataResult">
<include refid="selectCropsComprehensiveDataVo"/>
where id = #{id}
</select>
<insert id="insertCropsComprehensiveData" parameterType="com.ruoyi.crops.domain.CropsComprehensiveData" useGeneratedKeys="true" keyProperty="id">
insert into ruoyi.crops_comprehensive_data
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="cultivatedArea != null">cultivated_area,</if>
<if test="foodstuffProduction != null">foodstuff_production,</if>
<if test="vegetablePlantingArea != null">vegetable_planting_area,</if>
<if test="vegetableProduction != null">vegetable_production,</if>
<if test="type != null">type,</if>
<if test="agriculturalPlantingArea != null">agricultural_planting_area,</if>
<if test="agricultureProduction != null">agriculture_production,</if>
<if test="agricultureOutputVaule != null">agriculture_output_vaule,</if>
<if test="totalPopulation != null">total_population,</if>
<if test="coverArea != null">cover_area,</if>
<if test="exampleGreenhouse != null">example_greenhouse,</if>
<if test="rusticate != null">rusticate,</if>
<if test="cultivatedAlly != null">cultivated_ally,</if>
<if test="greenhouse != null">greenhouse,</if>
<if test="outputValue != null">output_value,</if>
<if test="vectorBoundary != null">vector_boundary,</if>
<if test="villageVectorBoundary != null">village_vector_boundary,</if>
<if test="img != null">img,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="cultivatedArea != null">#{cultivatedArea},</if>
<if test="foodstuffProduction != null">#{foodstuffProduction},</if>
<if test="vegetablePlantingArea != null">#{vegetablePlantingArea},</if>
<if test="vegetableProduction != null">#{vegetableProduction},</if>
<if test="type != null">#{type},</if>
<if test="agriculturalPlantingArea != null">#{agriculturalPlantingArea},</if>
<if test="agricultureProduction != null">#{agricultureProduction},</if>
<if test="agricultureOutputVaule != null">#{agricultureOutputVaule},</if>
<if test="totalPopulation != null">#{totalPopulation},</if>
<if test="coverArea != null">#{coverArea},</if>
<if test="exampleGreenhouse != null">#{exampleGreenhouse},</if>
<if test="rusticate != null">#{rusticate},</if>
<if test="cultivatedAlly != null">#{cultivatedAlly},</if>
<if test="greenhouse != null">#{greenhouse},</if>
<if test="outputValue != null">#{outputValue},</if>
<if test="vectorBoundary != null">#{vectorBoundary},</if>
<if test="villageVectorBoundary != null">#{villageVectorBoundary},</if>
<if test="img != null">#{img},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
</trim>
</insert>
<update id="updateCropsComprehensiveData" parameterType="CropsComprehensiveData">
update crops_comprehensive_data
<trim prefix="SET" suffixOverrides=",">
<if test="cultivatedArea != null">cultivated_area = #{cultivatedArea},</if>
<if test="foodstuffProduction != null">foodstuff_production = #{foodstuffProduction},</if>
<if test="vegetablePlantingArea != null">vegetable_planting_area = #{vegetablePlantingArea},</if>
<if test="vegetableProduction != null">vegetable_production = #{vegetableProduction},</if>
<if test="type != null">type = #{type},</if>
<if test="agriculturalPlantingArea != null">agricultural_planting_area = #{agriculturalPlantingArea},</if>
<if test="agricultureProduction != null">agriculture_production = #{agricultureProduction},</if>
<if test="agricultureOutputVaule != null">agriculture_output_vaule = #{agricultureOutputVaule},</if>
<if test="totalPopulation != null">total_population = #{totalPopulation},</if>
<if test="coverArea != null">cover_area = #{coverArea},</if>
<if test="exampleGreenhouse != null">example_greenhouse = #{exampleGreenhouse},</if>
<if test="rusticate != null">rusticate = #{rusticate},</if>
<if test="cultivatedAlly != null">cultivated_ally = #{cultivatedAlly},</if>
<if test="greenhouse != null">greenhouse = #{greenhouse},</if>
<if test="outputValue != null">output_value = #{outputValue},</if>
<if test="vectorBoundary != null">vector_boundary = #{vectorBoundary},</if>
<if test="villageVectorBoundary != null">village_vector_boundary = #{villageVectorBoundary},</if>
<if test="img != null">village_vector_boundary = #{img},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteCropsComprehensiveDataById" parameterType="Long">
delete from crops_comprehensive_data where id = #{id}
</delete>
<delete id="deleteCropsComprehensiveDataByIds" parameterType="String">
delete from crops_comprehensive_data where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.crops.mapper.CropsDroughtMapper">
<resultMap type="com.ruoyi.crops.domain.CropsDrought" id="CropDroughtMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="zone" column="zone" jdbcType="VARCHAR"/>
<result property="imageDate" column="imageDate" jdbcType="DATE"/>
<result property="severeArea" column="severeArea" jdbcType="DOUBLE"/>
<result property="modArea" column="modArea" jdbcType="DOUBLE"/>
<result property="mildArea" column="mildArea" jdbcType="DOUBLE"/>
<result property="suitArea" column="suitArea" jdbcType="DOUBLE"/>
<result property="humidArea" column="humidArea" jdbcType="DOUBLE"/>
</resultMap>
<insert id="insertBatch" parameterType="list" keyProperty="id" useGeneratedKeys="true" >
insert into ruoyi.crop_drought(zone,imageDate,severeArea,modArea,mildArea,suitArea,humidArea)
values
<foreach collection="list" item="entity" separator=",">
(#{entity.zone},#{entity.imageDate},#{entity.severeArea},#{entity.modArea},#{entity.mildArea},#{entity.suitArea},#{entity.humidArea})
</foreach>
</insert>
<select id="selectByTime" resultMap="CropDroughtMap">
select * from ruoyi.crop_drought
where imageDate = #{time}
</select>
</mapper>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.crops.mapper.CropsGrowthMapper">
<resultMap type="com.ruoyi.crops.domain.CropsGrowth" id="CropGrowthMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="zone" column="zone" jdbcType="VARCHAR"/>
<result property="imageDate" column="imageDate" jdbcType="DATE"/>
<result property="poorArea" column="poorArea" jdbcType="DOUBLE"/>
<result property="lowArea" column="lowArea" jdbcType="DOUBLE"/>
<result property="mediumArea" column="mediumArea" jdbcType="DOUBLE"/>
<result property="goodArea" column="goodArea" jdbcType="DOUBLE"/>
<result property="excellentArea" column="excellentArea" jdbcType="DOUBLE"/>
</resultMap>
<sql id="selectCropsCropsGrowthVo">
select id,zone,imageDate,poorArea,lowArea,mediumArea,goodArea,excellentArea from ruoyi.crop_growth
</sql>
<insert id="insertBatch" useGeneratedKeys="true" keyProperty="id">
insert into ruoyi.crop_growth(zone,imageDate,poorArea,lowArea,mediumArea,goodArea,excellentArea)
values
<foreach collection="list" item="entity" separator=",">
(#{entity.zone},#{entity.imageDate},#{entity.poorArea},#{entity.lowArea},#{entity.mediumArea},#{entity.goodArea},#{entity.excellentArea})
</foreach>
</insert>
<select id="selectByTime" resultMap="CropGrowthMap">
<include refid="selectCropsCropsGrowthVo">
</include>
where imageDate = #{time}
</select>
</mapper>

View File

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.crops.mapper.CropsStructureMapper">
<resultMap type="com.ruoyi.crops.domain.CropStructure" id="CropStructureMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="zone" column="zone" jdbcType="VARCHAR"/>
<result property="imageDate" column="imageDate" jdbcType="DATE"/>
<result property="wheatArea" column="wheatArea" jdbcType="DOUBLE"/>
<result property="cornArea" column="cornArea" jdbcType="DOUBLE"/>
<result property="peanutArea" column="peanutArea" jdbcType="DOUBLE"/>
<result property="soybeanArea" column="soybeanArea" jdbcType="DOUBLE"/>
<result property="otherArea" column="otherArea" jdbcType="DOUBLE"/>
<result property="toalArea" column="toalArea" jdbcType="DOUBLE"/>
</resultMap>
<sql id="selectCropsStructureVo">
select id, zone, imageDate, wheatArea, cornArea, peanutArea, soybeanArea,otherArea, toalArea from ruoyi.crop_structure
</sql>
<!--新增数据-->
<insert id="insertCropsStructure" parameterType="com.ruoyi.crops.domain.CropStructure" useGeneratedKeys="true" keyProperty="id">
insert into ruoyi.crop_structure
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="zone != null">zone,</if>
<if test="imageDate != null">imageDate,</if>
<if test="wheatArea != null">wheatArea,</if>
<if test="cornArea != null">cornArea,</if>
<if test="peanutArea != null">peanutArea,</if>
<if test="soybeanArea != null">soybeanArea,</if>
<if test="otherArea != null">otherArea,</if>
<if test="toalArea != null">toalArea,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="zone != null">#{zone},</if>
<if test="imageDate != null">#{imageDate},</if>
<if test="wheatArea != null">#{wheatArea},</if>
<if test="cornArea != null">#{cornArea},</if>
<if test="peanutArea != null">#{peanutArea},</if>
<if test="soybeanArea != null">#{soybeanArea},</if>
<if test="otherArea != null">#{otherArea},</if>
<if test="toalArea != null">#{toalArea},</if>
</trim>
</insert>
<!-- 批量新增数据 -->
<insert id="insertBatch" parameterType="list" keyProperty="id" useGeneratedKeys="true" >
insert into ruoyi.crop_structure(zone,imageDate,wheatArea,cornArea,peanutArea,soybeanArea,otherArea,toalArea)
values
<foreach collection="list" item="entity" separator=",">
(#{entity.zone},#{entity.imageDate},#{entity.wheatArea},#{entity.cornArea},#{entity.peanutArea},#{entity.soybeanArea},#{entity.otherArea},#{entity.toalArea})
</foreach>
</insert>
<select id="selectByTime" resultMap="CropStructureMap">
<include refid="selectCropsStructureVo">
</include>
where imageDate = #{time}
</select>
</mapper>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.crops.mapper.CropsYieldMapper">
<resultMap type="com.ruoyi.crops.domain.CropsYield" id="CropYieldMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="zone" column="zone" jdbcType="VARCHAR"/>
<result property="imageDate" column="imageDate" jdbcType="DATE"/>
<result property="cropType" column="cropType" jdbcType="VARCHAR"/>
<result property="yield" column="yield" jdbcType="DOUBLE"/>
</resultMap>
<sql id="selectCropsYieldVo">
select id,zone,imageDate,cropType,yield from ruoyi.crop_yield
</sql>
<select id="selectByYear" resultMap="CropYieldMap">
<include refid="selectCropsYieldVo">
</include>
where year(imageDate)=#{time}
</select>
<insert id="insertBatch" parameterType="list" keyProperty="id" useGeneratedKeys="true" >
insert into ruoyi.crop_yield(zone,imageDate,cropType,yield)
values
<foreach collection="list" item="entity" separator=",">
(#{entity.zone},#{entity.imageDate},#{entity.cropType},#{entity.yield})
</foreach>
</insert>
</mapper>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.crops.mapper.EnvironmentalMapper">
<resultMap type="com.ruoyi.crops.domain.EnvironmentalData" id="EnvironmentalDataMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="greenhouseNumber" column="greenhouse_number" jdbcType="INTEGER"/>
<result property="soilTemperature" column="soil_temperature" jdbcType="DOUBLE"/>
<result property="soilHumidity" column="soil_humidity" jdbcType="DOUBLE"/>
<result property="nitrogenContent" column="nitrogen_content" jdbcType="INTEGER"/>
<result property="phosphorusContent" column="phosphorus_content" jdbcType="INTEGER"/>
<result property="potassiumContent" column="potassium_content" jdbcType="INTEGER"/>
<result property="airTemperature" column="air_temperature" jdbcType="DOUBLE"/>
<result property="airHumidity" column="air_humidity" jdbcType="DOUBLE"/>
</resultMap>
<select id="selectByNumber" resultMap="EnvironmentalDataMap">
select *from ruoyi.environmental_data
where greenhouse_number=#{number}
</select>
<insert id="insert">
insert into ruoyi.environmental_data(greenhouse_number, soil_temperature, soil_humidity, nitrogen_content, phosphorus_content, potassium_content, air_temperature, air_humidity)
VALUE(#{greenhouseNumber},#{soilTemperature},#{soilHumidity},#{nitrogenContent},#{phosphorusContent},#{potassiumContent},#{airTemperature},#{airHumidity})
</insert>
</mapper>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.crops.mapper.GreenhouseMapper">
<resultMap type="com.ruoyi.crops.domain.GreenhouseInformation" id="GreenhouseInformationMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="zone" column="zone" jdbcType="VARCHAR"/>
<result property="managementModel" column="management_model" jdbcType="VARCHAR"/>
<result property="introduce" column="introduce" jdbcType="VARCHAR"/>
</resultMap>
<select id="selectByName" resultMap="GreenhouseInformationMap">
select *from ruoyi.greenhouse_information
where zone=#{name}
</select>
<insert id="insert">
insert into ruoyi.greenhouse_information(zone, management_model, introduce)
VALUE (#{zone},#{managementModel},#{introduce})
</insert>
</mapper>

View File

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.crops.mapper.IntelligentControlMapper">
<resultMap type="com.ruoyi.crops.domain.IntelligentControl" id="IntelligentControlMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="greenhouseName" column="greenhouse_name" jdbcType="VARCHAR"/>
<result property="valveNumber" column="valve_number" jdbcType="INTEGER"/>
<result property="valveStatus" column="valve_status" jdbcType="INTEGER"/>
<result property="disjunctor" column="disjunctor" jdbcType="INTEGER"/>
<result property="schedule" column="schedule" jdbcType="DOUBLE"/>
</resultMap>
<insert id="insert">
insert into ruoyi.intelligent_control (greenhouse_name, valve_number, valve_status, disjunctor , schedule)
VALUE(#{greenhouseName},#{valveNumber},#{valveStatus},#{disjunctor},#{schedule})
</insert>
<select id="selectAll" resultMap="IntelligentControlMap">
select *
from ruoyi.intelligent_control;
</select>
<!-- 更新数据 -->
<update id="edit" parameterType="com.ruoyi.crops.domain.IntelligentControl">
update Intelligent_Control
<set>
<if test="greenhouseName != null and greenhouseName != ''">
greenhouse_name = #{greenhouseName},
</if>
<if test="valveNumber != null and valveNumber != ''">
valve_number = #{valveNumber},
</if>
<if test="valveStatus != null and valveStatus != ''">
valve_status = #{valveStatus},
</if>
<if test="disjunctor != null and disjunctor != ''">
disjunctor = #{disjunctor},
</if>
<if test="schedule != null and schedule != ''">
schedule = #{schedule},
</if>
</set>
where id = #{id}
</update>
</mapper>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.crops.mapper.MachineParameterMapper">
<resultMap type="com.ruoyi.crops.domain.MachineParameter" id="MachineParameterMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="greenhouseName" column="greenhouse_name" jdbcType="VARCHAR"/>
<result property="pressure" column="pressure" jdbcType="DOUBLE"/>
<result property="flow" column="flow" jdbcType="DOUBLE"/>
<result property="conductivity" column="conductivity" jdbcType="DOUBLE"/>
</resultMap>
<sql id="selectMachineParameterVo">
select id, greenhouse_name, pressure, flow, conductivity
from ruoyi.machine_parameter
</sql>
<select id="selectByName" resultMap="MachineParameterMap">
<include refid="selectMachineParameterVo">
</include>
where greenhouse_name=#{name}
</select>
<insert id="insert">
insert into ruoyi.machine_parameter (greenhouse_name, pressure, flow, conductivity)
VALUE (#{greenhouseName},#{pressure},#{flow},#{conductivity})
</insert>
</mapper>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.crops.mapper.OperationRecordsMapper">
<resultMap type="com.ruoyi.crops.domain.OperationRecords" id="OperationRecordsMap">
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="DATETIMEOFFSET"/>
<result property="operationContent" column="operation_content" jdbcType="VARCHAR"/>
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
</resultMap>
<select id="selectAll" resultMap="OperationRecordsMap">
select *
from ruoyi.operation_records;
</select>
<insert id="insert">
insert into ruoyi.operation_records(update_time, operation_content, update_by)
VALUE(#{updateTime},#{operationContent},#{updateBy})
</insert>
</mapper>

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.crops.mapper.ServiceTypeMapper">
<resultMap type="com.ruoyi.crops.domain.ServiceType" id="ServiceTypeMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="serviceType" column="service_type" jdbcType="VARCHAR"/>
<result property="time" column="time" jdbcType="DATE"/>
<result property="serviceName" column="service_name" jdbcType="VARCHAR"/>
<result property="style" column="style" jdbcType="VARCHAR"/>
</resultMap>
<sql id="selectServiceTypeVo">
select id,service_type,time,service_name,style from ruoyi.service_type
</sql>
<select id="selectByType" resultMap="ServiceTypeMap">
<include refid="selectServiceTypeVo">
</include>
where service_type=#{type}
</select>
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into ruoyi.service_type(service_type, time, service_name, style)
value (#{serviceType},#{time},#{serviceName},#{style})
</insert>
<select id="selectAll" resultMap="ServiceTypeMap">
<include refid="selectServiceTypeVo">
</include>
</select>
<delete id="deleteByIds" parameterType="string">
delete from ruoyi.service_type where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.crops.mapper.WarningMapper">
<resultMap type="com.ruoyi.crops.domain.WarningInformation" id="WarningInformationMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="greenhouseNumber" column="greenhouse_number" jdbcType="INTEGER"/>
<result property="monitoringIndicators" column="monitoring_indicators" jdbcType="VARCHAR"/>
<result property="monitoringValues" column="monitoring_values" jdbcType="DOUBLE"/>
<result property="abnormalCause" column="abnormal_cause" jdbcType="VARCHAR"/>
<result property="warningTime" column="warning_time" jdbcType="DATE"/>
</resultMap>
<select id="selectByNumber" resultMap="WarningInformationMap">
select * from ruoyi.warning_information
where greenhouse_number= #{number}
</select>
<insert id="insert">
insert into ruoyi.warning_information(greenhouse_number, monitoring_indicators, monitoring_values, abnormal_cause, warning_time)
VALUE(#{greenhouseNumber},#{monitoringIndicators},#{monitoringValues},#{abnormalCause},#{warningTime})
</insert>
</mapper>

View File

@ -22,7 +22,7 @@ import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl;
/** /**
* spring security配置 * spring security配置
* *
* @author ruoyi * @author ruoyi
*/ */
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
@ -33,7 +33,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
*/ */
@Autowired @Autowired
private UserDetailsService userDetailsService; private UserDetailsService userDetailsService;
/** /**
* 认证失败处理类 * 认证失败处理类
*/ */
@ -51,7 +51,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
*/ */
@Autowired @Autowired
private JwtAuthenticationTokenFilter authenticationTokenFilter; private JwtAuthenticationTokenFilter authenticationTokenFilter;
/** /**
* 跨域过滤器 * 跨域过滤器
*/ */
@ -115,10 +115,11 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 静态资源可匿名访问 // 静态资源可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
// 除上面外的所有请求全部需要鉴权认证 .antMatchers("/admins/**").permitAll();
.anyRequest().authenticated() // 除上面外的所有请求全部需要鉴权认证
.and() // .anyRequest().authenticated()
.headers().frameOptions().disable(); // .and()
// .headers().frameOptions().disable();
// 添加Logout filter // 添加Logout filter
httpSecurity.logout().logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler); httpSecurity.logout().logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler);
// 添加JWT filter // 添加JWT filter

View File

@ -1,10 +1,10 @@
# 代码生成 # 代码生成
gen: gen:
# 作者 # 作者
author: ruoyi author: my
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
packageName: com.ruoyi.system packageName: com.ruoyi.crops
# 自动去除表前缀默认是false # 自动去除表前缀默认是false
autoRemovePre: false autoRemovePre: false
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔) # 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
tablePrefix: sys_ tablePrefix: crops_

25
ruoyi-pill/pom.xml Normal file
View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.8.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ruoyi-pill</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,126 @@
package com.ruoyi.pill.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 生产厂家信息对象 pill_factory
*
* @author my
* @date 2023-04-18
*/
public class PillFactory extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 厂家ID */
private Long factoryId;
/** 厂家名称 */
@Excel(name = "厂家名称")
private String factoryName;
/** 厂家编码 */
@Excel(name = "厂家编码")
private String factoryCode;
/** 联系人 */
@Excel(name = "联系人")
private String contact;
/** 电话 */
@Excel(name = "电话")
private String phone;
/** 关键字 */
@Excel(name = "关键字")
private String keyword;
/** 状态 */
@Excel(name = "状态")
private String status;
public void setFactoryId(Long factoryId)
{
this.factoryId = factoryId;
}
public Long getFactoryId()
{
return factoryId;
}
public void setFactoryName(String factoryName)
{
this.factoryName = factoryName;
}
public String getFactoryName()
{
return factoryName;
}
public void setFactoryCode(String factoryCode)
{
this.factoryCode = factoryCode;
}
public String getFactoryCode()
{
return factoryCode;
}
public void setContact(String contact)
{
this.contact = contact;
}
public String getContact()
{
return contact;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setKeyword(String keyword)
{
this.keyword = keyword;
}
public String getKeyword()
{
return keyword;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("factoryId", getFactoryId())
.append("factoryName", getFactoryName())
.append("factoryCode", getFactoryCode())
.append("contact", getContact())
.append("phone", getPhone())
.append("keyword", getKeyword())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.pill.mapper;
import java.util.List;
import com.ruoyi.pill.domain.PillFactory;
/**
* 生产厂家信息Mapper接口
*
* @author my
* @date 2023-04-18
*/
public interface PillFactoryMapper
{
/**
* 查询生产厂家信息
*
* @param factoryId 生产厂家信息主键
* @return 生产厂家信息
*/
public PillFactory selectPillFactoryByFactoryId(Long factoryId);
/**
* 查询生产厂家信息列表
*
* @param pillFactory 生产厂家信息
* @return 生产厂家信息集合
*/
public List<PillFactory> selectPillFactoryList(PillFactory pillFactory);
/**
* 新增生产厂家信息
*
* @param pillFactory 生产厂家信息
* @return 结果
*/
public int insertPillFactory(PillFactory pillFactory);
/**
* 修改生产厂家信息
*
* @param pillFactory 生产厂家信息
* @return 结果
*/
public int updatePillFactory(PillFactory pillFactory);
/**
* 删除生产厂家信息
*
* @param factoryId 生产厂家信息主键
* @return 结果
*/
public int deletePillFactoryByFactoryId(Long factoryId);
/**
* 批量删除生产厂家信息
*
* @param factoryIds 需要删除的数据主键集合
* @return 结果
*/
public int deletePillFactoryByFactoryIds(Long[] factoryIds);
}

View File

@ -0,0 +1,96 @@
package com.ruoyi.pill.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.pill.mapper.PillFactoryMapper;
import com.ruoyi.pill.domain.PillFactory;
import com.ruoyi.pill.service.IPillFactoryService;
/**
* 生产厂家信息Service业务层处理
*
* @author my
* @date 2023-04-18
*/
@Service
public class PillFactoryServiceImpl implements IPillFactoryService
{
@Autowired
private PillFactoryMapper pillFactoryMapper;
/**
* 查询生产厂家信息
*
* @param factoryId 生产厂家信息主键
* @return 生产厂家信息
*/
@Override
public PillFactory selectPillFactoryByFactoryId(Long factoryId)
{
return pillFactoryMapper.selectPillFactoryByFactoryId(factoryId);
}
/**
* 查询生产厂家信息列表
*
* @param pillFactory 生产厂家信息
* @return 生产厂家信息
*/
@Override
public List<PillFactory> selectPillFactoryList(PillFactory pillFactory)
{
return pillFactoryMapper.selectPillFactoryList(pillFactory);
}
/**
* 新增生产厂家信息
*
* @param pillFactory 生产厂家信息
* @return 结果
*/
@Override
public int insertPillFactory(PillFactory pillFactory)
{
pillFactory.setCreateTime(DateUtils.getNowDate());
return pillFactoryMapper.insertPillFactory(pillFactory);
}
/**
* 修改生产厂家信息
*
* @param pillFactory 生产厂家信息
* @return 结果
*/
@Override
public int updatePillFactory(PillFactory pillFactory)
{
pillFactory.setUpdateTime(DateUtils.getNowDate());
return pillFactoryMapper.updatePillFactory(pillFactory);
}
/**
* 批量删除生产厂家信息
*
* @param factoryIds 需要删除的生产厂家信息主键
* @return 结果
*/
@Override
public int deletePillFactoryByFactoryIds(Long[] factoryIds)
{
return pillFactoryMapper.deletePillFactoryByFactoryIds(factoryIds);
}
/**
* 删除生产厂家信息信息
*
* @param factoryId 生产厂家信息主键
* @return 结果
*/
@Override
public int deletePillFactoryByFactoryId(Long factoryId)
{
return pillFactoryMapper.deletePillFactoryByFactoryId(factoryId);
}
}

View File

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.pill.mapper.PillFactoryMapper">
<resultMap type="PillFactory" id="PillFactoryResult">
<result property="factoryId" column="factory_id" />
<result property="factoryName" column="factory_name" />
<result property="factoryCode" column="factory_code" />
<result property="contact" column="contact" />
<result property="phone" column="phone" />
<result property="keyword" column="keyword" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectPillFactoryVo">
select factory_id, factory_name, factory_code, contact, phone, keyword, status, create_by, create_time, update_by, update_time, remark from pill_factory
</sql>
<select id="selectPillFactoryList" parameterType="PillFactory" resultMap="PillFactoryResult">
<include refid="selectPillFactoryVo"/>
<where>
<if test="factoryName != null and factoryName != ''"> and factory_name like concat('%', #{factoryName}, '%')</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="contact != null and contact != ''"> and contact = #{contact}</if>
<if test="phone != null and phone != ''"> and phone like concat('%', #{phone}, '%')</if>
<if test="keyword != null and keyword != ''"> and keyword like concat('%', #{keyword}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
</select>
<select id="selectPillFactoryByFactoryId" parameterType="Long" resultMap="PillFactoryResult">
<include refid="selectPillFactoryVo"/>
where factory_id = #{factoryId}
</select>
<insert id="insertPillFactory" parameterType="PillFactory" useGeneratedKeys="true" keyProperty="factoryId">
insert into pill_factory
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="factoryName != null and factoryName != ''">factory_name,</if>
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
<if test="contact != null">contact,</if>
<if test="phone != null">phone,</if>
<if test="keyword != null">keyword,</if>
<if test="status != null">status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="factoryName != null and factoryName != ''">#{factoryName},</if>
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
<if test="contact != null">#{contact},</if>
<if test="phone != null">#{phone},</if>
<if test="keyword != null">#{keyword},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updatePillFactory" parameterType="PillFactory">
update pill_factory
<trim prefix="SET" suffixOverrides=",">
<if test="factoryName != null and factoryName != ''">factory_name = #{factoryName},</if>
<if test="factoryCode != null and factoryCode != ''">factory_code = #{factoryCode},</if>
<if test="contact != null">contact = #{contact},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="keyword != null">keyword = #{keyword},</if>
<if test="status != null">status = #{status},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where factory_id = #{factoryId}
</update>
<delete id="deletePillFactoryByFactoryId" parameterType="Long">
delete from pill_factory where factory_id = #{factoryId}
</delete>
<delete id="deletePillFactoryByFactoryIds" parameterType="String">
delete from pill_factory where factory_id in
<foreach item="factoryId" collection="array" open="(" separator="," close=")">
#{factoryId}
</foreach>
</delete>
</mapper>

View File

@ -34,7 +34,7 @@ public class JobInvokeUtil
} }
else else
{ {
Object bean = Class.forName(beanName).newInstance(); Object bean = Class.forName(beanName).getDeclaredConstructor().newInstance();
invokeMethod(bean, methodName, methodParams); invokeMethod(bean, methodName, methodParams);
} }
} }

View File

@ -501,17 +501,18 @@ public class SysUserServiceImpl implements ISysUserService
BeanValidators.validateWithException(validator, user); BeanValidators.validateWithException(validator, user);
user.setPassword(SecurityUtils.encryptPassword(password)); user.setPassword(SecurityUtils.encryptPassword(password));
user.setCreateBy(operName); user.setCreateBy(operName);
this.insertUser(user); userMapper.insertUser(user);
successNum++; successNum++;
successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 导入成功"); successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 导入成功");
} }
else if (isUpdateSupport) else if (isUpdateSupport)
{ {
BeanValidators.validateWithException(validator, user); BeanValidators.validateWithException(validator, user);
checkUserAllowed(user); checkUserAllowed(u);
checkUserDataScope(user.getUserId()); checkUserDataScope(u.getUserId());
user.setUserId(u.getUserId());
user.setUpdateBy(operName); user.setUpdateBy(operName);
this.updateUser(user); userMapper.updateUser(user);
successNum++; successNum++;
successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 更新成功"); successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 更新成功");
} }

Some files were not shown because too many files have changed in this diff Show More