Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
8584168ebd
@ -40,20 +40,20 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
master:
|
master:
|
||||||
name: ruoyi-vue-pro
|
name: ruoyi-vue-pro
|
||||||
url: jdbc:mysql://400-infra.server.iocoder.cn:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://192.168.1.101:3306/${spring.datasource.dynamic.datasource.slave.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||||
driver-class-name: com.mysql.jdbc.Driver
|
driver-class-name: com.mysql.jdbc.Driver
|
||||||
username: root
|
username: root
|
||||||
password: 3WLiVUBEwTbvAfsh
|
password: yhtkj2024!
|
||||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||||
name: ruoyi-vue-pro
|
name: ruoyi-vue-pro
|
||||||
url: jdbc:mysql://400-infra.server.iocoder.cn:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://192.168.1.101:3306/${spring.datasource.dynamic.datasource.slave.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||||
driver-class-name: com.mysql.jdbc.Driver
|
driver-class-name: com.mysql.jdbc.Driver
|
||||||
username: root
|
username: root
|
||||||
password: 3WLiVUBEwTbvAfsh
|
password: yhtkj2024!
|
||||||
|
|
||||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||||
redis:
|
redis:
|
||||||
host: 400-infra.server.iocoder.cn # 地址
|
host: 192.168.1.101 # 地址
|
||||||
port: 6379 # 端口
|
port: 6379 # 端口
|
||||||
database: 1 # 数据库索引
|
database: 1 # 数据库索引
|
||||||
# password: 123456 # 密码,建议生产环境开启
|
# password: 123456 # 密码,建议生产环境开启
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
--- #################### 注册中心相关配置 ####################
|
||||||
|
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
server-addr: 192.168.1.101:8848
|
||||||
|
discovery:
|
||||||
|
namespace: dev # 命名空间。这里使用 dev 开发环境
|
||||||
|
metadata:
|
||||||
|
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
||||||
|
|
||||||
|
--- #################### 配置中心相关配置 ####################
|
||||||
|
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
# Nacos Config 配置项,对应 NacosConfigProperties 配置属性类
|
||||||
|
config:
|
||||||
|
server-addr: 192.168.1.101:8848 # Nacos 服务器地址
|
||||||
|
namespace: dev # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境
|
||||||
|
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||||
|
name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name
|
||||||
|
file-extension: yaml # 使用的 Nacos 配置集的 dataId 的文件拓展名,同时也是 Nacos 配置集的配置格式,默认为 properties
|
@ -40,20 +40,20 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
master:
|
master:
|
||||||
name: ruoyi-vue-pro
|
name: ruoyi-vue-pro
|
||||||
url: jdbc:mysql://400-infra.server.iocoder.cn:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://192.168.1.101:3306/${spring.datasource.dynamic.datasource.slave.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||||
driver-class-name: com.mysql.jdbc.Driver
|
driver-class-name: com.mysql.jdbc.Driver
|
||||||
username: root
|
username: root
|
||||||
password: 3WLiVUBEwTbvAfsh
|
password: yhtkj2024!
|
||||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||||
name: ruoyi-vue-pro
|
name: ruoyi-vue-pro
|
||||||
url: jdbc:mysql://400-infra.server.iocoder.cn:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://192.168.1.101:3306/${spring.datasource.dynamic.datasource.slave.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||||
driver-class-name: com.mysql.jdbc.Driver
|
driver-class-name: com.mysql.jdbc.Driver
|
||||||
username: root
|
username: root
|
||||||
password: 3WLiVUBEwTbvAfsh
|
password: yhtkj2024!
|
||||||
|
|
||||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||||
redis:
|
redis:
|
||||||
host: 400-infra.server.iocoder.cn # 地址
|
host: 192.168.1.101 # 地址
|
||||||
port: 6379 # 端口
|
port: 6379 # 端口
|
||||||
database: 1 # 数据库索引
|
database: 1 # 数据库索引
|
||||||
# password: 123456 # 密码,建议生产环境开启
|
# password: 123456 # 密码,建议生产环境开启
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
--- #################### 注册中心相关配置 ####################
|
||||||
|
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
server-addr: 192.168.1.101:8848
|
||||||
|
discovery:
|
||||||
|
namespace: dev # 命名空间。这里使用 dev 开发环境
|
||||||
|
metadata:
|
||||||
|
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
||||||
|
|
||||||
|
--- #################### 配置中心相关配置 ####################
|
||||||
|
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
# Nacos Config 配置项,对应 NacosConfigProperties 配置属性类
|
||||||
|
config:
|
||||||
|
server-addr: 192.168.1.101:8848 # Nacos 服务器地址
|
||||||
|
namespace: dev # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境
|
||||||
|
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||||
|
name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name
|
||||||
|
file-extension: yaml # 使用的 Nacos 配置集的 dataId 的文件拓展名,同时也是 Nacos 配置集的配置格式,默认为 properties
|
@ -39,21 +39,21 @@ spring:
|
|||||||
primary: master
|
primary: master
|
||||||
datasource:
|
datasource:
|
||||||
master:
|
master:
|
||||||
name: smart_factory
|
name: ruoyi-vue-pro
|
||||||
url: jdbc:mysql://400-infra.server.iocoder.cn:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://192.168.1.101:3306/${spring.datasource.dynamic.datasource.slave.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||||
driver-class-name: com.mysql.jdbc.Driver
|
driver-class-name: com.mysql.jdbc.Driver
|
||||||
username: root
|
username: root
|
||||||
password: 3WLiVUBEwTbvAfsh
|
password: yhtkj2024!
|
||||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||||
name: ruoyi-vue-pro
|
name: ruoyi-vue-pro
|
||||||
url: jdbc:mysql://400-infra.server.iocoder.cn:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://192.168.1.101:3306/${spring.datasource.dynamic.datasource.slave.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||||
driver-class-name: com.mysql.jdbc.Driver
|
driver-class-name: com.mysql.jdbc.Driver
|
||||||
username: root
|
username: root
|
||||||
password: 3WLiVUBEwTbvAfsh
|
password: yhtkj2024!
|
||||||
|
|
||||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||||
redis:
|
redis:
|
||||||
host: 400-infra.server.iocoder.cn # 地址
|
host: 192.168.1.101 # 地址
|
||||||
port: 6379 # 端口
|
port: 6379 # 端口
|
||||||
database: 1 # 数据库索引
|
database: 1 # 数据库索引
|
||||||
# password: 123456 # 密码,建议生产环境开启
|
# password: 123456 # 密码,建议生产环境开启
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
--- #################### 注册中心相关配置 ####################
|
||||||
|
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
server-addr: 192.168.1.101:8848
|
||||||
|
discovery:
|
||||||
|
namespace: dev # 命名空间。这里使用 dev 开发环境
|
||||||
|
metadata:
|
||||||
|
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
||||||
|
|
||||||
|
--- #################### 配置中心相关配置 ####################
|
||||||
|
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
# Nacos Config 配置项,对应 NacosConfigProperties 配置属性类
|
||||||
|
config:
|
||||||
|
server-addr: 192.168.1.101:8848 # Nacos 服务器地址
|
||||||
|
namespace: dev # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境
|
||||||
|
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||||
|
name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name
|
||||||
|
file-extension: yaml # 使用的 Nacos 配置集的 dataId 的文件拓展名,同时也是 Nacos 配置集的配置格式,默认为 properties
|
@ -0,0 +1,93 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.factory;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.factory.vo.SfFactoryInfoPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.factory.vo.SfFactoryInfoRespVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.factory.vo.SfFactoryInfoSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factory.SfFactoryInfoDO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.service.factory.SfFactoryInfoService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 工厂信息")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/factory/sf-factory-info")
|
||||||
|
@Validated
|
||||||
|
public class SfFactoryInfoController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SfFactoryInfoService sfFactoryInfoService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建工厂信息")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:sf-factory-info:create')")
|
||||||
|
public CommonResult<Long> createSfFactoryInfo(@Valid @RequestBody SfFactoryInfoSaveReqVO createReqVO) {
|
||||||
|
return success(sfFactoryInfoService.createSfFactoryInfo(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新工厂信息")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:sf-factory-info:update')")
|
||||||
|
public CommonResult<Boolean> updateSfFactoryInfo(@Valid @RequestBody SfFactoryInfoSaveReqVO updateReqVO) {
|
||||||
|
sfFactoryInfoService.updateSfFactoryInfo(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除工厂信息")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:sf-factory-info:delete')")
|
||||||
|
public CommonResult<Boolean> deleteSfFactoryInfo(@RequestParam("id") Long id) {
|
||||||
|
sfFactoryInfoService.deleteSfFactoryInfo(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得工厂信息")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:sf-factory-info:query')")
|
||||||
|
public CommonResult<SfFactoryInfoRespVO> getSfFactoryInfo(@RequestParam("id") Long id) {
|
||||||
|
SfFactoryInfoDO sfFactoryInfo = sfFactoryInfoService.getSfFactoryInfo(id);
|
||||||
|
return success(BeanUtils.toBean(sfFactoryInfo, SfFactoryInfoRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得工厂信息分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:sf-factory-info:query')")
|
||||||
|
public CommonResult<PageResult<SfFactoryInfoRespVO>> getSfFactoryInfoPage(@Valid SfFactoryInfoPageReqVO pageReqVO) {
|
||||||
|
PageResult<SfFactoryInfoDO> pageResult = sfFactoryInfoService.getSfFactoryInfoPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, SfFactoryInfoRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出工厂信息 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:sf-factory-info:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportSfFactoryInfoExcel(@Valid SfFactoryInfoPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<SfFactoryInfoDO> list = sfFactoryInfoService.getSfFactoryInfoPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "工厂信息.xls", "数据", SfFactoryInfoRespVO.class,
|
||||||
|
BeanUtils.toBean(list, SfFactoryInfoRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,83 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.factory.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 工厂信息分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class SfFactoryInfoPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "工厂全名", example = "赵六")
|
||||||
|
private String fullName;
|
||||||
|
|
||||||
|
@Schema(description = "工厂简称", example = "王五")
|
||||||
|
private String shortName;
|
||||||
|
|
||||||
|
@Schema(description = "工厂代号")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "工厂简介", example = "你猜")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Schema(description = "所在省id", example = "16166")
|
||||||
|
private Long provinceId;
|
||||||
|
|
||||||
|
@Schema(description = "所在省名称", example = "赵六")
|
||||||
|
private String provinceName;
|
||||||
|
|
||||||
|
@Schema(description = "所在城市id", example = "16909")
|
||||||
|
private Long cityId;
|
||||||
|
|
||||||
|
@Schema(description = "所在城市名称", example = "赵六")
|
||||||
|
private String cityName;
|
||||||
|
|
||||||
|
@Schema(description = "所在区县id", example = "16699")
|
||||||
|
private Long districtId;
|
||||||
|
|
||||||
|
@Schema(description = "所在区县名称", example = "李四")
|
||||||
|
private String districtName;
|
||||||
|
|
||||||
|
@Schema(description = "经度")
|
||||||
|
private BigDecimal lng;
|
||||||
|
|
||||||
|
@Schema(description = "纬度")
|
||||||
|
private BigDecimal lat;
|
||||||
|
|
||||||
|
@Schema(description = "详细地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你说的对")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "电动车总量")
|
||||||
|
private Integer vehicleNum;
|
||||||
|
|
||||||
|
@Schema(description = "单个电动车碳排放")
|
||||||
|
private BigDecimal vehicleCo2;
|
||||||
|
|
||||||
|
@Schema(description = "排序")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
@Schema(description = "海康安防接口访问地址端口")
|
||||||
|
private String hikServerHost;
|
||||||
|
|
||||||
|
@Schema(description = "海康appkey")
|
||||||
|
private String hikAppKey;
|
||||||
|
|
||||||
|
@Schema(description = "海康密钥")
|
||||||
|
private String hikAppSecret;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,105 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.factory.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 工厂信息 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class SfFactoryInfoRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15034")
|
||||||
|
@ExcelProperty("主键id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "工厂全名", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||||
|
@ExcelProperty("工厂全名")
|
||||||
|
private String fullName;
|
||||||
|
|
||||||
|
@Schema(description = "工厂简称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||||
|
@ExcelProperty("工厂简称")
|
||||||
|
private String shortName;
|
||||||
|
|
||||||
|
@Schema(description = "工厂代号")
|
||||||
|
@ExcelProperty("工厂代号")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "工厂简介", example = "你猜")
|
||||||
|
@ExcelProperty("工厂简介")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Schema(description = "所在省id", example = "16166")
|
||||||
|
@ExcelProperty("所在省id")
|
||||||
|
private Long provinceId;
|
||||||
|
|
||||||
|
@Schema(description = "所在省名称", example = "赵六")
|
||||||
|
@ExcelProperty("所在省名称")
|
||||||
|
private String provinceName;
|
||||||
|
|
||||||
|
@Schema(description = "所在城市id", example = "16909")
|
||||||
|
@ExcelProperty("所在城市id")
|
||||||
|
private Long cityId;
|
||||||
|
|
||||||
|
@Schema(description = "所在城市名称", example = "赵六")
|
||||||
|
@ExcelProperty("所在城市名称")
|
||||||
|
private String cityName;
|
||||||
|
|
||||||
|
@Schema(description = "所在区县id", example = "16699")
|
||||||
|
@ExcelProperty("所在区县id")
|
||||||
|
private Long districtId;
|
||||||
|
|
||||||
|
@Schema(description = "所在区县名称", example = "李四")
|
||||||
|
@ExcelProperty("所在区县名称")
|
||||||
|
private String districtName;
|
||||||
|
|
||||||
|
@Schema(description = "经度")
|
||||||
|
@ExcelProperty("经度")
|
||||||
|
private BigDecimal lng;
|
||||||
|
|
||||||
|
@Schema(description = "纬度")
|
||||||
|
@ExcelProperty("纬度")
|
||||||
|
private BigDecimal lat;
|
||||||
|
|
||||||
|
@Schema(description = "详细地址")
|
||||||
|
@ExcelProperty("详细地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你说的对")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "电动车总量")
|
||||||
|
@ExcelProperty("电动车总量")
|
||||||
|
private Integer vehicleNum;
|
||||||
|
|
||||||
|
@Schema(description = "单个电动车碳排放")
|
||||||
|
@ExcelProperty("单个电动车碳排放")
|
||||||
|
private BigDecimal vehicleCo2;
|
||||||
|
|
||||||
|
@Schema(description = "排序")
|
||||||
|
@ExcelProperty("排序")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
@Schema(description = "海康安防接口访问地址端口")
|
||||||
|
@ExcelProperty("海康安防接口访问地址端口")
|
||||||
|
private String hikServerHost;
|
||||||
|
|
||||||
|
@Schema(description = "海康appkey")
|
||||||
|
@ExcelProperty("海康appkey")
|
||||||
|
private String hikAppKey;
|
||||||
|
|
||||||
|
@Schema(description = "海康密钥")
|
||||||
|
@ExcelProperty("海康密钥")
|
||||||
|
private String hikAppSecret;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,79 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.factory.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 工厂信息新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class SfFactoryInfoSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15034")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "工厂全名", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||||
|
@NotEmpty(message = "工厂全名不能为空")
|
||||||
|
private String fullName;
|
||||||
|
|
||||||
|
@Schema(description = "工厂简称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||||
|
@NotEmpty(message = "工厂简称不能为空")
|
||||||
|
private String shortName;
|
||||||
|
|
||||||
|
@Schema(description = "工厂代号")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "工厂简介", example = "你猜")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Schema(description = "所在省id", example = "16166")
|
||||||
|
private Long provinceId;
|
||||||
|
|
||||||
|
@Schema(description = "所在省名称", example = "赵六")
|
||||||
|
private String provinceName;
|
||||||
|
|
||||||
|
@Schema(description = "所在城市id", example = "16909")
|
||||||
|
private Long cityId;
|
||||||
|
|
||||||
|
@Schema(description = "所在城市名称", example = "赵六")
|
||||||
|
private String cityName;
|
||||||
|
|
||||||
|
@Schema(description = "所在区县id", example = "16699")
|
||||||
|
private Long districtId;
|
||||||
|
|
||||||
|
@Schema(description = "所在区县名称", example = "李四")
|
||||||
|
private String districtName;
|
||||||
|
|
||||||
|
@Schema(description = "经度")
|
||||||
|
private BigDecimal lng;
|
||||||
|
|
||||||
|
@Schema(description = "纬度")
|
||||||
|
private BigDecimal lat;
|
||||||
|
|
||||||
|
@Schema(description = "详细地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你说的对")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "电动车总量")
|
||||||
|
private Integer vehicleNum;
|
||||||
|
|
||||||
|
@Schema(description = "单个电动车碳排放")
|
||||||
|
private BigDecimal vehicleCo2;
|
||||||
|
|
||||||
|
@Schema(description = "排序")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
@Schema(description = "海康安防接口访问地址端口")
|
||||||
|
private String hikServerHost;
|
||||||
|
|
||||||
|
@Schema(description = "海康appkey")
|
||||||
|
private String hikAppKey;
|
||||||
|
|
||||||
|
@Schema(description = "海康密钥")
|
||||||
|
private String hikAppSecret;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,93 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.packagedata;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.packagedata.vo.PackageDataPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.packagedata.vo.PackageDataRespVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.packagedata.vo.PackageDataSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.packagedata.PackageDataDO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.service.packagedata.PackageDataService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 打包线数据")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/factory/package-data")
|
||||||
|
@Validated
|
||||||
|
public class PackageDataController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PackageDataService packageDataService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建打包线数据")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:package-data:create')")
|
||||||
|
public CommonResult<Long> createPackageData(@Valid @RequestBody PackageDataSaveReqVO createReqVO) {
|
||||||
|
return success(packageDataService.createPackageData(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新打包线数据")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:package-data:update')")
|
||||||
|
public CommonResult<Boolean> updatePackageData(@Valid @RequestBody PackageDataSaveReqVO updateReqVO) {
|
||||||
|
packageDataService.updatePackageData(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除打包线数据")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:package-data:delete')")
|
||||||
|
public CommonResult<Boolean> deletePackageData(@RequestParam("id") Long id) {
|
||||||
|
packageDataService.deletePackageData(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得打包线数据")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:package-data:query')")
|
||||||
|
public CommonResult<PackageDataRespVO> getPackageData(@RequestParam("id") Long id) {
|
||||||
|
PackageDataDO packageData = packageDataService.getPackageData(id);
|
||||||
|
return success(BeanUtils.toBean(packageData, PackageDataRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得打包线数据分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:package-data:query')")
|
||||||
|
public CommonResult<PageResult<PackageDataRespVO>> getPackageDataPage(@Valid PackageDataPageReqVO pageReqVO) {
|
||||||
|
PageResult<PackageDataDO> pageResult = packageDataService.getPackageDataPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, PackageDataRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出打包线数据 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:package-data:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportPackageDataExcel(@Valid PackageDataPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<PackageDataDO> list = packageDataService.getPackageDataPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "打包线数据.xls", "数据", PackageDataRespVO.class,
|
||||||
|
BeanUtils.toBean(list, PackageDataRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.packagedata.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 打包线数据分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class PackageDataPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "工厂id", example = "29256")
|
||||||
|
private Long factoryId;
|
||||||
|
|
||||||
|
@Schema(description = "规格id", example = "5911")
|
||||||
|
private Long sizeId;
|
||||||
|
|
||||||
|
@Schema(description = "规格名称", example = "王五")
|
||||||
|
private String sizeName;
|
||||||
|
|
||||||
|
@Schema(description = "打包线id", example = "31120")
|
||||||
|
private Long packageId;
|
||||||
|
|
||||||
|
@Schema(description = "打包线名称", example = "李四")
|
||||||
|
private String packageName;
|
||||||
|
|
||||||
|
@Schema(description = "打包数量")
|
||||||
|
private Integer num;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.packagedata.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 打包线数据 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class PackageDataRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "18914")
|
||||||
|
@ExcelProperty("主键id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "工厂id", requiredMode = Schema.RequiredMode.REQUIRED, example = "29256")
|
||||||
|
@ExcelProperty("工厂id")
|
||||||
|
private Long factoryId;
|
||||||
|
|
||||||
|
@Schema(description = "规格id", requiredMode = Schema.RequiredMode.REQUIRED, example = "5911")
|
||||||
|
@ExcelProperty("规格id")
|
||||||
|
private Long sizeId;
|
||||||
|
|
||||||
|
@Schema(description = "规格名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||||
|
@ExcelProperty("规格名称")
|
||||||
|
private String sizeName;
|
||||||
|
|
||||||
|
@Schema(description = "打包线id", requiredMode = Schema.RequiredMode.REQUIRED, example = "31120")
|
||||||
|
@ExcelProperty("打包线id")
|
||||||
|
private Long packageId;
|
||||||
|
|
||||||
|
@Schema(description = "打包线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
||||||
|
@ExcelProperty("打包线名称")
|
||||||
|
private String packageName;
|
||||||
|
|
||||||
|
@Schema(description = "打包数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("打包数量")
|
||||||
|
private Integer num;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.packagedata.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 打包线数据新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class PackageDataSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "18914")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "工厂id", requiredMode = Schema.RequiredMode.REQUIRED, example = "29256")
|
||||||
|
@NotNull(message = "工厂id不能为空")
|
||||||
|
private Long factoryId;
|
||||||
|
|
||||||
|
@Schema(description = "规格id", requiredMode = Schema.RequiredMode.REQUIRED, example = "5911")
|
||||||
|
@NotNull(message = "规格id不能为空")
|
||||||
|
private Long sizeId;
|
||||||
|
|
||||||
|
@Schema(description = "规格名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||||
|
@NotEmpty(message = "规格名称不能为空")
|
||||||
|
private String sizeName;
|
||||||
|
|
||||||
|
@Schema(description = "打包线id", requiredMode = Schema.RequiredMode.REQUIRED, example = "31120")
|
||||||
|
@NotNull(message = "打包线id不能为空")
|
||||||
|
private Long packageId;
|
||||||
|
|
||||||
|
@Schema(description = "打包线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
||||||
|
@NotEmpty(message = "打包线名称不能为空")
|
||||||
|
private String packageName;
|
||||||
|
|
||||||
|
@Schema(description = "打包数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "打包数量不能为空")
|
||||||
|
private Integer num;
|
||||||
|
|
||||||
|
}
|
@ -1,17 +1,20 @@
|
|||||||
package cn.iocoder.yudao.module.smartfactory.controller.screendata.factory;
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
import cn.iocoder.yudao.module.smartfactory.controller.screendata.factory.vo.*;
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.packagedata.PackageDataDO;
|
||||||
import cn.iocoder.yudao.module.smartfactory.service.screendata.ScreenDataService;
|
import cn.iocoder.yudao.module.smartfactory.service.screendata.ScreenDataService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.annotation.security.PermitAll;
|
import javax.annotation.security.PermitAll;
|
||||||
import javax.validation.Valid;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
@ -26,26 +29,23 @@ public class FactoryScreenDataController {
|
|||||||
private ScreenDataService screenDataService;
|
private ScreenDataService screenDataService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* @param type 1: 省,2 市,3区
|
||||||
* @param type 1: 省,2 市,3区
|
|
||||||
* @param adcode
|
* @param adcode
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getProvincesData")
|
@GetMapping("/getProvincesData")
|
||||||
@PermitAll
|
|
||||||
@Operation(summary = "大屏全局省份/省/市工厂数据(包函工厂基本信息)")
|
@Operation(summary = "大屏全局省份/省/市工厂数据(包函工厂基本信息)")
|
||||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
public CommonResult<List<ProvincesDataRespVO>> getProvincesData(@RequestParam Integer type, @RequestParam String code) {
|
||||||
public CommonResult<List<ProvincesDataRespVO>> getProvincesData(Integer type, String adcode) {
|
List<ProvincesDataRespVO> provincesDataList = screenDataService.getProvincesData(type, code);
|
||||||
List<ProvincesDataRespVO> provincesDatas = screenDataService.getProvincesData(type,adcode) ;
|
return success(provincesDataList);
|
||||||
return success(provincesDatas);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/getStaffData")
|
@GetMapping("/getStaffData")
|
||||||
@PermitAll
|
@PermitAll
|
||||||
@Operation(summary = "大屏员工信息数据")
|
@Operation(summary = "大屏员工信息数据")
|
||||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||||
public CommonResult<StaffDataRespVO> getStaffData(Long factoryId) {
|
public CommonResult<StaffDataRespVO> getStaffData(@RequestParam Long factoryId) {
|
||||||
StaffDataRespVO staffDataRespVO = screenDataService.getStaffData(factoryId) ;
|
StaffDataRespVO staffDataRespVO = screenDataService.getStaffData(factoryId);
|
||||||
return success(staffDataRespVO);
|
return success(staffDataRespVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,17 +53,17 @@ public class FactoryScreenDataController {
|
|||||||
@PermitAll
|
@PermitAll
|
||||||
@Operation(summary = "大屏资产数据")
|
@Operation(summary = "大屏资产数据")
|
||||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||||
public CommonResult<PropertyDataRespVO> getPropertyData(Long factoryId) {
|
public CommonResult<PropertyDataRespVO> getPropertyData(@RequestParam Long factoryId) {
|
||||||
PropertyDataRespVO propertyDataRespVO = screenDataService.getPropertyData(factoryId) ;
|
PropertyDataRespVO propertyDataRespVO = screenDataService.getPropertyData(factoryId);
|
||||||
return success(propertyDataRespVO);
|
return success(propertyDataRespVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/getFactoryOperateData")
|
@GetMapping("/getFactoryOperateData")
|
||||||
@PermitAll
|
@PermitAll
|
||||||
@Operation(summary = "大屏工厂运营数据")
|
@Operation(summary = "大屏工厂运营数据 调用接口 http://znkj.ispt.com.cn/prod-api/screen/detail/dateList?factoryId=10000011")
|
||||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||||
public CommonResult<OperateDataRespVO> getFactoryOperateData(Long factoryId) {
|
public CommonResult<OperateDataRespVO> getFactoryOperateData(@RequestParam Long factoryId) {
|
||||||
OperateDataRespVO factoryOperateDataRespVO = screenDataService.getFactoryOperateData(factoryId) ;
|
OperateDataRespVO factoryOperateDataRespVO = screenDataService.getFactoryOperateData(factoryId);
|
||||||
return success(factoryOperateDataRespVO);
|
return success(factoryOperateDataRespVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,17 +71,17 @@ public class FactoryScreenDataController {
|
|||||||
@PermitAll
|
@PermitAll
|
||||||
@Operation(summary = "大屏工厂滚动数据")
|
@Operation(summary = "大屏工厂滚动数据")
|
||||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||||
public CommonResult<FactoryRollDataRespVO> getFactoryRollData() {
|
public CommonResult<List<FactoryRollDataRespVO>> getFactoryRollData() {
|
||||||
FactoryRollDataRespVO factoryRollDataRespVO = screenDataService.getFactoryRollData() ;
|
List<FactoryRollDataRespVO> list = screenDataService.getFactoryRollData();
|
||||||
return success(factoryRollDataRespVO);
|
return success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/getFactoryCamerasData")
|
@GetMapping("/getFactoryCamerasData")
|
||||||
@PermitAll
|
@PermitAll
|
||||||
@Operation(summary = "大屏工厂监控视频数据")
|
@Operation(summary = "大屏工厂监控视频数据")
|
||||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||||
public CommonResult<List<FactoryCameraDataRespVO>> getFactoryCamerasData(Long factoryId) {
|
public CommonResult<List<FactoryCameraDataRespVO>> getFactoryCamerasData(@RequestParam Long factoryId) {
|
||||||
List<FactoryCameraDataRespVO> factoryCameraDatas = screenDataService.getFactoryCamerasData(factoryId) ;
|
List<FactoryCameraDataRespVO> factoryCameraDatas = screenDataService.getFactoryCamerasData(factoryId);
|
||||||
return success(factoryCameraDatas);
|
return success(factoryCameraDatas);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,13 +89,13 @@ public class FactoryScreenDataController {
|
|||||||
@PermitAll
|
@PermitAll
|
||||||
@Operation(summary = "大屏工厂天气数据")
|
@Operation(summary = "大屏工厂天气数据")
|
||||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||||
public CommonResult<FactoryWeatherDataRespVO> getFactoryWeatherInfo(Long factoryId) {
|
public CommonResult<FactoryWeatherDataRespVO> getFactoryWeatherInfo(@RequestParam Long factoryId) {
|
||||||
return success(screenDataService.getFactoryWeatherInfo(factoryId));
|
return success(screenDataService.getFactoryWeatherInfo(factoryId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 大屏工厂打包线数据
|
* 大屏工厂打包线数据
|
||||||
* @param type
|
*
|
||||||
* @param factoryId
|
* @param factoryId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -103,8 +103,8 @@ public class FactoryScreenDataController {
|
|||||||
@PermitAll
|
@PermitAll
|
||||||
@Operation(summary = "大屏工厂打包线数据")
|
@Operation(summary = "大屏工厂打包线数据")
|
||||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||||
public CommonResult<List<FactoryPackLineDataRespVO>> getFactoryPackLineInfo(Integer type,Long factoryId ) {
|
public CommonResult<List<PackageDataDO>> getFactoryPackLineInfo(@RequestParam Long factoryId) {
|
||||||
return success(screenDataService.getFactoryPackLineInfo(type,factoryId));
|
return success(screenDataService.getFactoryPackLineInfo(factoryId));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.module.smartfactory.controller.screendata.factory.vo;
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -13,7 +13,7 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class FactoryCameraDataRespVO {
|
public class FactoryCameraDataRespVO {
|
||||||
|
|
||||||
@Schema(description = "设备id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
@Schema(description = "工厂id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
private Long factoryId;
|
private Long factoryId;
|
||||||
|
|
||||||
@Schema(description = "设备id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
@Schema(description = "设备id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.module.smartfactory.controller.screendata.factory.vo;
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -16,16 +16,19 @@ public class FactoryPackLineDataRespVO {
|
|||||||
@Schema(description = "打包线id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
@Schema(description = "打包线id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
private Long packLineId;
|
private Long packLineId;
|
||||||
|
|
||||||
@Schema(description = "规格id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
@Schema(description = "打包线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
private String standardsId;
|
private String packLineName;
|
||||||
|
|
||||||
@Schema(description = "规格标准", requiredMode = Schema.RequiredMode.REQUIRED, example = "800 * 400")
|
@Schema(description = "规格id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
private String standards;
|
private String sizeId;
|
||||||
|
|
||||||
|
@Schema(description = "规格名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "800 * 400")
|
||||||
|
private String sizeName;
|
||||||
|
|
||||||
@Schema(description = "打包数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
@Schema(description = "打包数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||||
private Integer total;
|
private Integer total;
|
||||||
|
|
||||||
@Schema(description = "日期", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-03-04")
|
@Schema(description = "日期", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-03-04")
|
||||||
private String date ;
|
private String date;
|
||||||
|
|
||||||
}
|
}
|
@ -1,6 +1,5 @@
|
|||||||
package cn.iocoder.yudao.module.smartfactory.controller.screendata.factory.vo;
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo;
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@ -30,15 +29,15 @@ public class FactoryRollDataRespVO {
|
|||||||
private Integer kilnTotal;
|
private Integer kilnTotal;
|
||||||
|
|
||||||
@Schema(description = "打包线数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
|
@Schema(description = "打包线数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
|
||||||
private Integer packLineTotal ;
|
private Integer packLineTotal;
|
||||||
|
|
||||||
@Schema(description = "托盘数", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
@Schema(description = "托盘数", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
private Integer trayTotal ;
|
private Integer trayTotal;
|
||||||
|
|
||||||
@Schema(description = "绑带", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
@Schema(description = "绑带", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
private Integer tieTotal ;
|
private Integer tieTotal;
|
||||||
|
|
||||||
@Schema(description = "叉车数", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
@Schema(description = "叉车数", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
private Integer forkliftTotal ;
|
private Integer forkliftTotal;
|
||||||
|
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.module.smartfactory.controller.screendata.factory.vo;
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.module.smartfactory.controller.screendata.factory.vo;
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
@ -0,0 +1,37 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述
|
||||||
|
*
|
||||||
|
* @author: yj
|
||||||
|
* @date: 2024年03月05日 13:55
|
||||||
|
*/
|
||||||
|
@Schema(description = "大屏数据 - 资产数据 Response VO")
|
||||||
|
@Data
|
||||||
|
public class PropertyDataRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "窑炉数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||||
|
private Integer kilnTotal = 0;
|
||||||
|
|
||||||
|
@Schema(description = "打包线数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
|
||||||
|
private Integer packLineTotal = 0;
|
||||||
|
|
||||||
|
@Schema(description = "托盘数", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer trayTotal = 0;
|
||||||
|
|
||||||
|
@Schema(description = "绑带", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer tieTotal = 0;
|
||||||
|
|
||||||
|
@Schema(description = "叉车数", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer forkliftTotal = 0;
|
||||||
|
|
||||||
|
@Schema(description = "运行中", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer onlineTotal = 0;
|
||||||
|
|
||||||
|
@Schema(description = "离线", requiredMode = Schema.RequiredMode.REQUIRED, example = "3")
|
||||||
|
private Integer outLineTotal = 0;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factoryinfo.FactoryInfoDO;
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述
|
||||||
|
*
|
||||||
|
* @author: yj
|
||||||
|
* @date: 2024年03月05日 13:55
|
||||||
|
*/
|
||||||
|
@Schema(description = "大屏数据 - 省份工厂数据 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class ProvincesDataRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "区域代码", requiredMode = Schema.RequiredMode.REQUIRED, example = "810000")
|
||||||
|
private Long adCode;
|
||||||
|
|
||||||
|
@Schema(description = "工厂数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
||||||
|
private Integer value;
|
||||||
|
|
||||||
|
@Schema(description = "工厂列表", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
||||||
|
private List<FactoryInfoDO> vos;
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.smartfactory.controller.screendata.factory.vo;
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo;
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.staff.StaffDO;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@ -20,19 +20,13 @@ public class StaffDataRespVO {
|
|||||||
private Integer total;
|
private Integer total;
|
||||||
|
|
||||||
@Schema(description = "男员工", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
|
@Schema(description = "男员工", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
|
||||||
private Integer maleTotal ;
|
private Integer maleTotal;
|
||||||
|
|
||||||
@Schema(description = "女员工", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
@Schema(description = "女员工", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
private Integer femaleTotal ;
|
private Integer femaleTotal;
|
||||||
|
|
||||||
@Schema(description = "员工信息", requiredMode = Schema.RequiredMode.REQUIRED, example = "阿依塔洪·阿依提巴依 搬运工")
|
@Schema(description = "员工信息", requiredMode = Schema.RequiredMode.REQUIRED, example = "阿依塔洪·阿依提巴依 搬运工")
|
||||||
private List<StaffInfo> staffInfos ;
|
private List<StaffDO> staffInfos;
|
||||||
|
|
||||||
class StaffInfo {
|
|
||||||
@Schema(description = "员工名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "马龙")
|
|
||||||
private String name ;
|
|
||||||
@Schema(description = "岗位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "叉车司机")
|
|
||||||
private String postName ;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,93 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.screenfactoryextra;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.screenfactoryextra.vo.ScreenFactoryExtraPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.screenfactoryextra.vo.ScreenFactoryExtraRespVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.screenfactoryextra.vo.ScreenFactoryExtraSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.screenfactoryextra.ScreenFactoryExtraDO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.service.screenfactoryextra.ScreenFactoryExtraService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 工厂大屏额外字段")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/factory/screen-factory-extra")
|
||||||
|
@Validated
|
||||||
|
public class ScreenFactoryExtraController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ScreenFactoryExtraService screenFactoryExtraService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建工厂大屏额外字段")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:screen-factory-extra:create')")
|
||||||
|
public CommonResult<Long> createScreenFactoryExtra(@Valid @RequestBody ScreenFactoryExtraSaveReqVO createReqVO) {
|
||||||
|
return success(screenFactoryExtraService.createScreenFactoryExtra(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新工厂大屏额外字段")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:screen-factory-extra:update')")
|
||||||
|
public CommonResult<Boolean> updateScreenFactoryExtra(@Valid @RequestBody ScreenFactoryExtraSaveReqVO updateReqVO) {
|
||||||
|
screenFactoryExtraService.updateScreenFactoryExtra(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除工厂大屏额外字段")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:screen-factory-extra:delete')")
|
||||||
|
public CommonResult<Boolean> deleteScreenFactoryExtra(@RequestParam("id") Long id) {
|
||||||
|
screenFactoryExtraService.deleteScreenFactoryExtra(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得工厂大屏额外字段")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:screen-factory-extra:query')")
|
||||||
|
public CommonResult<ScreenFactoryExtraRespVO> getScreenFactoryExtra(@RequestParam("id") Long id) {
|
||||||
|
ScreenFactoryExtraDO screenFactoryExtra = screenFactoryExtraService.getScreenFactoryExtra(id);
|
||||||
|
return success(BeanUtils.toBean(screenFactoryExtra, ScreenFactoryExtraRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得工厂大屏额外字段分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:screen-factory-extra:query')")
|
||||||
|
public CommonResult<PageResult<ScreenFactoryExtraRespVO>> getScreenFactoryExtraPage(@Valid ScreenFactoryExtraPageReqVO pageReqVO) {
|
||||||
|
PageResult<ScreenFactoryExtraDO> pageResult = screenFactoryExtraService.getScreenFactoryExtraPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, ScreenFactoryExtraRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出工厂大屏额外字段 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:screen-factory-extra:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportScreenFactoryExtraExcel(@Valid ScreenFactoryExtraPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<ScreenFactoryExtraDO> list = screenFactoryExtraService.getScreenFactoryExtraPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "工厂大屏额外字段.xls", "数据", ScreenFactoryExtraRespVO.class,
|
||||||
|
BeanUtils.toBean(list, ScreenFactoryExtraRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.screenfactoryextra.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 工厂大屏额外字段分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class ScreenFactoryExtraPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "工厂id", example = "7332")
|
||||||
|
private Long factoryId;
|
||||||
|
|
||||||
|
@Schema(description = "日产能数")
|
||||||
|
private Integer dateNum;
|
||||||
|
|
||||||
|
@Schema(description = "叉车运行数量")
|
||||||
|
private Integer truckOnNum;
|
||||||
|
|
||||||
|
@Schema(description = "叉车未运行数量")
|
||||||
|
private Integer truckOffNum;
|
||||||
|
|
||||||
|
@Schema(description = "叉车总数量")
|
||||||
|
private Integer truckTotalNum;
|
||||||
|
|
||||||
|
@Schema(description = "窑炉数量")
|
||||||
|
private Integer ylNum;
|
||||||
|
|
||||||
|
@Schema(description = "打包线数量")
|
||||||
|
private Integer dbxNum;
|
||||||
|
|
||||||
|
@Schema(description = "托盘数量")
|
||||||
|
private Integer tpNum;
|
||||||
|
|
||||||
|
@Schema(description = "绑带数量")
|
||||||
|
private Integer bdNum;
|
||||||
|
|
||||||
|
@Schema(description = "作业人数")
|
||||||
|
private Integer workerNum;
|
||||||
|
|
||||||
|
@Schema(description = "电动车数量")
|
||||||
|
private Integer vehicleNum;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.screenfactoryextra.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 工厂大屏额外字段 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class ScreenFactoryExtraRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "21735")
|
||||||
|
@ExcelProperty("主键id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "工厂id", requiredMode = Schema.RequiredMode.REQUIRED, example = "7332")
|
||||||
|
@ExcelProperty("工厂id")
|
||||||
|
private Long factoryId;
|
||||||
|
|
||||||
|
@Schema(description = "日产能数")
|
||||||
|
@ExcelProperty("日产能数")
|
||||||
|
private Integer dateNum;
|
||||||
|
|
||||||
|
@Schema(description = "叉车运行数量")
|
||||||
|
@ExcelProperty("叉车运行数量")
|
||||||
|
private Integer truckOnNum;
|
||||||
|
|
||||||
|
@Schema(description = "叉车未运行数量")
|
||||||
|
@ExcelProperty("叉车未运行数量")
|
||||||
|
private Integer truckOffNum;
|
||||||
|
|
||||||
|
@Schema(description = "叉车总数量")
|
||||||
|
@ExcelProperty("叉车总数量")
|
||||||
|
private Integer truckTotalNum;
|
||||||
|
|
||||||
|
@Schema(description = "窑炉数量")
|
||||||
|
@ExcelProperty("窑炉数量")
|
||||||
|
private Integer ylNum;
|
||||||
|
|
||||||
|
@Schema(description = "打包线数量")
|
||||||
|
@ExcelProperty("打包线数量")
|
||||||
|
private Integer dbxNum;
|
||||||
|
|
||||||
|
@Schema(description = "托盘数量")
|
||||||
|
@ExcelProperty("托盘数量")
|
||||||
|
private Integer tpNum;
|
||||||
|
|
||||||
|
@Schema(description = "绑带数量")
|
||||||
|
@ExcelProperty("绑带数量")
|
||||||
|
private Integer bdNum;
|
||||||
|
|
||||||
|
@Schema(description = "作业人数")
|
||||||
|
@ExcelProperty("作业人数")
|
||||||
|
private Integer workerNum;
|
||||||
|
|
||||||
|
@Schema(description = "电动车数量")
|
||||||
|
@ExcelProperty("电动车数量")
|
||||||
|
private Integer vehicleNum;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,50 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.screenfactoryextra.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 工厂大屏额外字段新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ScreenFactoryExtraSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "21735")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "工厂id", requiredMode = Schema.RequiredMode.REQUIRED, example = "7332")
|
||||||
|
@NotNull(message = "工厂id不能为空")
|
||||||
|
private Long factoryId;
|
||||||
|
|
||||||
|
@Schema(description = "日产能数")
|
||||||
|
private Integer dateNum;
|
||||||
|
|
||||||
|
@Schema(description = "叉车运行数量")
|
||||||
|
private Integer truckOnNum;
|
||||||
|
|
||||||
|
@Schema(description = "叉车未运行数量")
|
||||||
|
private Integer truckOffNum;
|
||||||
|
|
||||||
|
@Schema(description = "叉车总数量")
|
||||||
|
private Integer truckTotalNum;
|
||||||
|
|
||||||
|
@Schema(description = "窑炉数量")
|
||||||
|
private Integer ylNum;
|
||||||
|
|
||||||
|
@Schema(description = "打包线数量")
|
||||||
|
private Integer dbxNum;
|
||||||
|
|
||||||
|
@Schema(description = "托盘数量")
|
||||||
|
private Integer tpNum;
|
||||||
|
|
||||||
|
@Schema(description = "绑带数量")
|
||||||
|
private Integer bdNum;
|
||||||
|
|
||||||
|
@Schema(description = "作业人数")
|
||||||
|
private Integer workerNum;
|
||||||
|
|
||||||
|
@Schema(description = "电动车数量")
|
||||||
|
private Integer vehicleNum;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,93 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.staff;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.staff.vo.StaffPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.staff.vo.StaffRespVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.staff.vo.StaffSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.staff.StaffDO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.service.staff.StaffService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 员工")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/factory/staff")
|
||||||
|
@Validated
|
||||||
|
public class StaffController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private StaffService staffService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建员工")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:staff:create')")
|
||||||
|
public CommonResult<Long> createStaff(@Valid @RequestBody StaffSaveReqVO createReqVO) {
|
||||||
|
return success(staffService.createStaff(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新员工")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:staff:update')")
|
||||||
|
public CommonResult<Boolean> updateStaff(@Valid @RequestBody StaffSaveReqVO updateReqVO) {
|
||||||
|
staffService.updateStaff(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除员工")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:staff:delete')")
|
||||||
|
public CommonResult<Boolean> deleteStaff(@RequestParam("id") Long id) {
|
||||||
|
staffService.deleteStaff(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得员工")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:staff:query')")
|
||||||
|
public CommonResult<StaffRespVO> getStaff(@RequestParam("id") Long id) {
|
||||||
|
StaffDO staff = staffService.getStaff(id);
|
||||||
|
return success(BeanUtils.toBean(staff, StaffRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得员工分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:staff:query')")
|
||||||
|
public CommonResult<PageResult<StaffRespVO>> getStaffPage(@Valid StaffPageReqVO pageReqVO) {
|
||||||
|
PageResult<StaffDO> pageResult = staffService.getStaffPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, StaffRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出员工 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:staff:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportStaffExcel(@Valid StaffPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<StaffDO> list = staffService.getStaffPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "员工.xls", "数据", StaffRespVO.class,
|
||||||
|
BeanUtils.toBean(list, StaffRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.staff.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 员工分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class StaffPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "员工编号")
|
||||||
|
private String staffNo;
|
||||||
|
|
||||||
|
@Schema(description = "员工昵称")
|
||||||
|
private String nickName;
|
||||||
|
|
||||||
|
@Schema(description = "年龄")
|
||||||
|
private Integer age;
|
||||||
|
|
||||||
|
@Schema(description = "用户性别(0男 1女 2未知)")
|
||||||
|
private Integer sex;
|
||||||
|
|
||||||
|
@Schema(description = "岗位id", example = "28091")
|
||||||
|
private Long postId;
|
||||||
|
|
||||||
|
@Schema(description = "工种id", example = "6971")
|
||||||
|
private Long workTypeId;
|
||||||
|
|
||||||
|
@Schema(description = "工厂id", example = "6971")
|
||||||
|
private Long factoryId;
|
||||||
|
|
||||||
|
@Schema(description = "身份证号")
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
|
@Schema(description = "0离职 1在职", example = "1")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.staff.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 员工 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class StaffRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "8717")
|
||||||
|
@ExcelProperty("主键id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "员工编号")
|
||||||
|
@ExcelProperty("员工编号")
|
||||||
|
private String staffNo;
|
||||||
|
|
||||||
|
@Schema(description = "员工昵称")
|
||||||
|
private String nickName;
|
||||||
|
|
||||||
|
@Schema(description = "年龄")
|
||||||
|
@ExcelProperty("年龄")
|
||||||
|
private Integer age;
|
||||||
|
|
||||||
|
@Schema(description = "用户性别(0男 1女 2未知)")
|
||||||
|
private Integer sex;
|
||||||
|
|
||||||
|
@Schema(description = "岗位id", example = "28091")
|
||||||
|
@ExcelProperty("岗位id")
|
||||||
|
private Long postId;
|
||||||
|
|
||||||
|
@Schema(description = "工种id", example = "6971")
|
||||||
|
@ExcelProperty("工种id")
|
||||||
|
private Long workTypeId;
|
||||||
|
|
||||||
|
@Schema(description = "工厂id", example = "6971")
|
||||||
|
private Long factoryId;
|
||||||
|
|
||||||
|
@Schema(description = "身份证号")
|
||||||
|
@ExcelProperty("身份证号")
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
|
@Schema(description = "0离职 1在职", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
@ExcelProperty("0离职 1在职")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.staff.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 员工新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class StaffSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "8717")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "员工编号")
|
||||||
|
private String staffNo;
|
||||||
|
|
||||||
|
@Schema(description = "员工昵称")
|
||||||
|
private String nickName;
|
||||||
|
|
||||||
|
@Schema(description = "年龄")
|
||||||
|
private Integer age;
|
||||||
|
|
||||||
|
@Schema(description = "用户性别(0男 1女 2未知)")
|
||||||
|
private Integer sex;
|
||||||
|
|
||||||
|
@Schema(description = "岗位id", example = "28091")
|
||||||
|
private Long postId;
|
||||||
|
|
||||||
|
@Schema(description = "工种id", example = "6971")
|
||||||
|
private Long workTypeId;
|
||||||
|
|
||||||
|
@Schema(description = "工厂id", example = "6971")
|
||||||
|
private Long factoryId;
|
||||||
|
|
||||||
|
@Schema(description = "身份证号")
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
|
@Schema(description = "0离职 1在职", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
@NotNull(message = "0离职 1在职不能为空")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,93 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.worktype;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.worktype.vo.WorkTypePageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.worktype.vo.WorkTypeRespVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.worktype.vo.WorkTypeSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.worktype.WorkTypeDO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.service.worktype.WorkTypeService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 工种")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/factory/work-type")
|
||||||
|
@Validated
|
||||||
|
public class WorkTypeController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WorkTypeService workTypeService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建工种")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:work-type:create')")
|
||||||
|
public CommonResult<Long> createWorkType(@Valid @RequestBody WorkTypeSaveReqVO createReqVO) {
|
||||||
|
return success(workTypeService.createWorkType(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新工种")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:work-type:update')")
|
||||||
|
public CommonResult<Boolean> updateWorkType(@Valid @RequestBody WorkTypeSaveReqVO updateReqVO) {
|
||||||
|
workTypeService.updateWorkType(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除工种")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:work-type:delete')")
|
||||||
|
public CommonResult<Boolean> deleteWorkType(@RequestParam("id") Long id) {
|
||||||
|
workTypeService.deleteWorkType(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得工种")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:work-type:query')")
|
||||||
|
public CommonResult<WorkTypeRespVO> getWorkType(@RequestParam("id") Long id) {
|
||||||
|
WorkTypeDO workType = workTypeService.getWorkType(id);
|
||||||
|
return success(BeanUtils.toBean(workType, WorkTypeRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得工种分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:work-type:query')")
|
||||||
|
public CommonResult<PageResult<WorkTypeRespVO>> getWorkTypePage(@Valid WorkTypePageReqVO pageReqVO) {
|
||||||
|
PageResult<WorkTypeDO> pageResult = workTypeService.getWorkTypePage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, WorkTypeRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出工种 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('factory:work-type:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportWorkTypeExcel(@Valid WorkTypePageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<WorkTypeDO> list = workTypeService.getWorkTypePage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "工种.xls", "数据", WorkTypeRespVO.class,
|
||||||
|
BeanUtils.toBean(list, WorkTypeRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.worktype.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 工种分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WorkTypePageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "岗位id", example = "30476")
|
||||||
|
private Long postId;
|
||||||
|
|
||||||
|
@Schema(description = "名称", example = "赵六")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.worktype.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 工种 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class WorkTypeRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16669")
|
||||||
|
@ExcelProperty("主键id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "岗位id", requiredMode = Schema.RequiredMode.REQUIRED, example = "30476")
|
||||||
|
@ExcelProperty("岗位id")
|
||||||
|
private Long postId;
|
||||||
|
|
||||||
|
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||||
|
@ExcelProperty("名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.worktype.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 工种新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class WorkTypeSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16669")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "岗位id", requiredMode = Schema.RequiredMode.REQUIRED, example = "30476")
|
||||||
|
@NotNull(message = "岗位id不能为空")
|
||||||
|
private Long postId;
|
||||||
|
|
||||||
|
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||||
|
@NotEmpty(message = "名称不能为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
}
|
@ -1,47 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.smartfactory.controller.screendata.factory.vo;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 功能描述
|
|
||||||
*
|
|
||||||
* @author: yj
|
|
||||||
* @date: 2024年03月05日 13:55
|
|
||||||
*/
|
|
||||||
@Schema(description = "大屏数据 - 资产数据 Response VO")
|
|
||||||
@Data
|
|
||||||
public class PropertyDataRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "窑炉数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
|
||||||
private Integer kilnTotal;
|
|
||||||
|
|
||||||
@Schema(description = "打包线数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
|
|
||||||
private Integer packLineTotal ;
|
|
||||||
|
|
||||||
@Schema(description = "托盘数", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
|
||||||
private Integer trayTotal ;
|
|
||||||
|
|
||||||
@Schema(description = "绑带", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
|
||||||
private Integer tieTotal ;
|
|
||||||
|
|
||||||
@Schema(description = "叉车数据", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private ForkliftInfo forkliftInfo ;
|
|
||||||
|
|
||||||
class ForkliftInfo {
|
|
||||||
@Schema(description = "叉车数", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
|
||||||
private Integer forkliftTotal ;
|
|
||||||
|
|
||||||
@Schema(description = "运行中", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
|
||||||
private Integer onlineTotal ;
|
|
||||||
|
|
||||||
@Schema(description = "离线", requiredMode = Schema.RequiredMode.REQUIRED, example = "3")
|
|
||||||
private Integer outLineTotal ;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,43 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.smartfactory.controller.screendata.factory.vo;
|
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 功能描述
|
|
||||||
*
|
|
||||||
* @author: yj
|
|
||||||
* @date: 2024年03月05日 13:55
|
|
||||||
*/
|
|
||||||
@Schema(description = "大屏数据 - 省份工厂数据 Response VO")
|
|
||||||
@Data
|
|
||||||
@ExcelIgnoreUnannotated
|
|
||||||
public class ProvincesDataRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "区域名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "江西省 or 高安市")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "区域标记点", requiredMode = Schema.RequiredMode.REQUIRED, example = "[114.173355, 22.320048]")
|
|
||||||
private List<Double> center;
|
|
||||||
|
|
||||||
@Schema(description = "区域标记点oid", requiredMode = Schema.RequiredMode.REQUIRED, example = "[114.134357, 22.377366]")
|
|
||||||
private List<Double> centroid;
|
|
||||||
|
|
||||||
@Schema(description = "区域代码", requiredMode = Schema.RequiredMode.REQUIRED, example = "810000")
|
|
||||||
private Integer adcode;
|
|
||||||
|
|
||||||
@Schema(description = "英文名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "jiangxi")
|
|
||||||
private String enName;
|
|
||||||
|
|
||||||
@Schema(description = "工厂数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
|
||||||
private Integer value;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 只有到第三层 district_id 区县的时候,需要输出工厂ID
|
|
||||||
*/
|
|
||||||
@Schema(description = "工厂Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
|
||||||
private Long factoryId;
|
|
||||||
}
|
|
@ -0,0 +1,114 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.dal.dataobject.factory;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂信息 DO
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@TableName("sf_factory_info")
|
||||||
|
@KeySequence("sf_factory_info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SfFactoryInfoDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 工厂全名
|
||||||
|
*/
|
||||||
|
private String fullName;
|
||||||
|
/**
|
||||||
|
* 工厂简称
|
||||||
|
*/
|
||||||
|
private String shortName;
|
||||||
|
/**
|
||||||
|
* 工厂代号
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
/**
|
||||||
|
* 工厂简介
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
/**
|
||||||
|
* 所在省id
|
||||||
|
*/
|
||||||
|
private Long provinceId;
|
||||||
|
/**
|
||||||
|
* 所在省名称
|
||||||
|
*/
|
||||||
|
private String provinceName;
|
||||||
|
/**
|
||||||
|
* 所在城市id
|
||||||
|
*/
|
||||||
|
private Long cityId;
|
||||||
|
/**
|
||||||
|
* 所在城市名称
|
||||||
|
*/
|
||||||
|
private String cityName;
|
||||||
|
/**
|
||||||
|
* 所在区县id
|
||||||
|
*/
|
||||||
|
private Long districtId;
|
||||||
|
/**
|
||||||
|
* 所在区县名称
|
||||||
|
*/
|
||||||
|
private String districtName;
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
private BigDecimal lng;
|
||||||
|
/**
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
private BigDecimal lat;
|
||||||
|
/**
|
||||||
|
* 详细地址
|
||||||
|
*/
|
||||||
|
private String address;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 电动车总量
|
||||||
|
*/
|
||||||
|
private Integer vehicleNum;
|
||||||
|
/**
|
||||||
|
* 单个电动车碳排放
|
||||||
|
*/
|
||||||
|
private BigDecimal vehicleCo2;
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
/**
|
||||||
|
* 海康安防接口访问地址端口
|
||||||
|
*/
|
||||||
|
private String hikServerHost;
|
||||||
|
/**
|
||||||
|
* 海康appkey
|
||||||
|
*/
|
||||||
|
private String hikAppKey;
|
||||||
|
/**
|
||||||
|
* 海康密钥
|
||||||
|
*/
|
||||||
|
private String hikAppSecret;
|
||||||
|
|
||||||
|
}
|
@ -1,13 +1,12 @@
|
|||||||
package cn.iocoder.yudao.module.smartfactory.dal.dataobject.factoryinfo;
|
package cn.iocoder.yudao.module.smartfactory.dal.dataobject.factoryinfo;
|
||||||
|
|
||||||
import lombok.*;
|
|
||||||
import java.util.*;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工厂信息 DO
|
* 工厂信息 DO
|
||||||
@ -24,6 +23,14 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class FactoryInfoDO extends BaseDO {
|
public class FactoryInfoDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1: 省,2 市,3区
|
||||||
|
*/
|
||||||
|
public static final Integer ADDRESS_TYPE_PROVINCE = 1;
|
||||||
|
public static final Integer ADDRESS_TYPE_CITY = 2;
|
||||||
|
public static final Integer ADDRESS_TYPE_DISTRICT_NAME = 3;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编号
|
* 编号
|
||||||
*/
|
*/
|
||||||
@ -47,19 +54,19 @@ public class FactoryInfoDO extends BaseDO {
|
|||||||
private String description;
|
private String description;
|
||||||
/**
|
/**
|
||||||
* 省id
|
* 省id
|
||||||
*
|
* <p>
|
||||||
* 枚举 {@link TODO infra_codegen_template_type 对应的类}
|
* 枚举 {@link TODO infra_codegen_template_type 对应的类}
|
||||||
*/
|
*/
|
||||||
private Long provinceId;
|
private Long provinceId;
|
||||||
/**
|
/**
|
||||||
* 城市id
|
* 城市id
|
||||||
*
|
* <p>
|
||||||
* 枚举 {@link TODO infra_codegen_template_type 对应的类}
|
* 枚举 {@link TODO infra_codegen_template_type 对应的类}
|
||||||
*/
|
*/
|
||||||
private Long cityId;
|
private Long cityId;
|
||||||
/**
|
/**
|
||||||
* 区县id
|
* 区县id
|
||||||
*
|
* <p>
|
||||||
* 枚举 {@link TODO infra_codegen_template_type 对应的类}
|
* 枚举 {@link TODO infra_codegen_template_type 对应的类}
|
||||||
*/
|
*/
|
||||||
private Long districtId;
|
private Long districtId;
|
||||||
@ -93,7 +100,7 @@ public class FactoryInfoDO extends BaseDO {
|
|||||||
private Integer sort;
|
private Integer sort;
|
||||||
/**
|
/**
|
||||||
* 状态
|
* 状态
|
||||||
*
|
* <p>
|
||||||
* 枚举 {@link TODO common_status 对应的类}
|
* 枚举 {@link TODO common_status 对应的类}
|
||||||
*/
|
*/
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
@ -0,0 +1,55 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.dal.dataobject.packagedata;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打包线数据 DO
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@TableName("sf_package_data")
|
||||||
|
@KeySequence("sf_package_data_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PackageDataDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 工厂id
|
||||||
|
*/
|
||||||
|
private Long factoryId;
|
||||||
|
/**
|
||||||
|
* 规格id
|
||||||
|
*/
|
||||||
|
private Long sizeId;
|
||||||
|
/**
|
||||||
|
* 规格名称
|
||||||
|
*/
|
||||||
|
private String sizeName;
|
||||||
|
/**
|
||||||
|
* 打包线id
|
||||||
|
*/
|
||||||
|
private Long packageId;
|
||||||
|
/**
|
||||||
|
* 打包线名称
|
||||||
|
*/
|
||||||
|
private String packageName;
|
||||||
|
/**
|
||||||
|
* 打包数量
|
||||||
|
*/
|
||||||
|
private Integer num;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,75 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.dal.dataobject.screenfactoryextra;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂大屏额外字段 DO
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@TableName("sf_screen_factory_extra")
|
||||||
|
@KeySequence("sf_screen_factory_extra_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ScreenFactoryExtraDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 工厂id
|
||||||
|
*/
|
||||||
|
private Long factoryId;
|
||||||
|
/**
|
||||||
|
* 日产能数
|
||||||
|
*/
|
||||||
|
private Integer dateNum;
|
||||||
|
/**
|
||||||
|
* 叉车运行数量
|
||||||
|
*/
|
||||||
|
private Integer truckOnNum;
|
||||||
|
/**
|
||||||
|
* 叉车未运行数量
|
||||||
|
*/
|
||||||
|
private Integer truckOffNum;
|
||||||
|
/**
|
||||||
|
* 叉车总数量
|
||||||
|
*/
|
||||||
|
private Integer truckTotalNum;
|
||||||
|
/**
|
||||||
|
* 窑炉数量
|
||||||
|
*/
|
||||||
|
private Integer ylNum;
|
||||||
|
/**
|
||||||
|
* 打包线数量
|
||||||
|
*/
|
||||||
|
private Integer dbxNum;
|
||||||
|
/**
|
||||||
|
* 托盘数量
|
||||||
|
*/
|
||||||
|
private Integer tpNum;
|
||||||
|
/**
|
||||||
|
* 绑带数量
|
||||||
|
*/
|
||||||
|
private Integer bdNum;
|
||||||
|
/**
|
||||||
|
* 作业人数
|
||||||
|
*/
|
||||||
|
private Integer workerNum;
|
||||||
|
/**
|
||||||
|
* 电动车数量
|
||||||
|
*/
|
||||||
|
private Integer vehicleNum;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,73 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.dal.dataobject.staff;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工 DO
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@TableName("sf_staff")
|
||||||
|
@KeySequence("sf_staff_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class StaffDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 员工编号
|
||||||
|
*/
|
||||||
|
private String staffNo;
|
||||||
|
/**
|
||||||
|
* 员工昵称
|
||||||
|
*/
|
||||||
|
private String nickName;
|
||||||
|
/**
|
||||||
|
* 年龄
|
||||||
|
*/
|
||||||
|
private Integer age;
|
||||||
|
/**
|
||||||
|
* 用户性别(0男 1女 2未知)
|
||||||
|
*/
|
||||||
|
private Integer sex;
|
||||||
|
/**
|
||||||
|
* 岗位id
|
||||||
|
*/
|
||||||
|
private Long postId;
|
||||||
|
/**
|
||||||
|
* 工种id
|
||||||
|
*/
|
||||||
|
private Long workTypeId;
|
||||||
|
/**
|
||||||
|
* 工厂id
|
||||||
|
*/
|
||||||
|
private Long factoryId;
|
||||||
|
/**
|
||||||
|
* 身份证号
|
||||||
|
*/
|
||||||
|
private String idCard;
|
||||||
|
/**
|
||||||
|
* 0离职 1在职
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岗位名称
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String postName;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.dal.dataobject.worktype;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工种 DO
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@TableName("sf_work_type")
|
||||||
|
@KeySequence("sf_work_type_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class WorkTypeDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 岗位id
|
||||||
|
*/
|
||||||
|
private Long postId;
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.dal.mysql.factory;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.factory.vo.SfFactoryInfoPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factory.SfFactoryInfoDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂信息 Mapper
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SfFactoryInfoMapper extends BaseMapperX<SfFactoryInfoDO> {
|
||||||
|
|
||||||
|
default PageResult<SfFactoryInfoDO> selectPage(SfFactoryInfoPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<SfFactoryInfoDO>()
|
||||||
|
.likeIfPresent(SfFactoryInfoDO::getFullName, reqVO.getFullName())
|
||||||
|
.likeIfPresent(SfFactoryInfoDO::getShortName, reqVO.getShortName())
|
||||||
|
.eqIfPresent(SfFactoryInfoDO::getCode, reqVO.getCode())
|
||||||
|
.eqIfPresent(SfFactoryInfoDO::getDescription, reqVO.getDescription())
|
||||||
|
.eqIfPresent(SfFactoryInfoDO::getProvinceId, reqVO.getProvinceId())
|
||||||
|
.likeIfPresent(SfFactoryInfoDO::getProvinceName, reqVO.getProvinceName())
|
||||||
|
.eqIfPresent(SfFactoryInfoDO::getCityId, reqVO.getCityId())
|
||||||
|
.likeIfPresent(SfFactoryInfoDO::getCityName, reqVO.getCityName())
|
||||||
|
.eqIfPresent(SfFactoryInfoDO::getDistrictId, reqVO.getDistrictId())
|
||||||
|
.likeIfPresent(SfFactoryInfoDO::getDistrictName, reqVO.getDistrictName())
|
||||||
|
.eqIfPresent(SfFactoryInfoDO::getLng, reqVO.getLng())
|
||||||
|
.eqIfPresent(SfFactoryInfoDO::getLat, reqVO.getLat())
|
||||||
|
.eqIfPresent(SfFactoryInfoDO::getAddress, reqVO.getAddress())
|
||||||
|
.eqIfPresent(SfFactoryInfoDO::getRemark, reqVO.getRemark())
|
||||||
|
.eqIfPresent(SfFactoryInfoDO::getVehicleNum, reqVO.getVehicleNum())
|
||||||
|
.eqIfPresent(SfFactoryInfoDO::getVehicleCo2, reqVO.getVehicleCo2())
|
||||||
|
.eqIfPresent(SfFactoryInfoDO::getSort, reqVO.getSort())
|
||||||
|
.eqIfPresent(SfFactoryInfoDO::getHikServerHost, reqVO.getHikServerHost())
|
||||||
|
.eqIfPresent(SfFactoryInfoDO::getHikAppKey, reqVO.getHikAppKey())
|
||||||
|
.eqIfPresent(SfFactoryInfoDO::getHikAppSecret, reqVO.getHikAppSecret())
|
||||||
|
.betweenIfPresent(SfFactoryInfoDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(SfFactoryInfoDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,13 +1,14 @@
|
|||||||
package cn.iocoder.yudao.module.smartfactory.dal.mysql.factoryinfo;
|
package cn.iocoder.yudao.module.smartfactory.dal.mysql.factoryinfo;
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.factoryinfo.vo.FactoryInfoPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo.FactoryRollDataRespVO;
|
||||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factoryinfo.FactoryInfoDO;
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factoryinfo.FactoryInfoDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.factoryinfo.vo.*;
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工厂信息 Mapper
|
* 工厂信息 Mapper
|
||||||
@ -27,4 +28,10 @@ public interface FactoryInfoMapper extends BaseMapperX<FactoryInfoDO> {
|
|||||||
.orderByDesc(FactoryInfoDO::getSort));
|
.orderByDesc(FactoryInfoDO::getSort));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 大屏数据 - 工厂基础滚动数据
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<FactoryRollDataRespVO> getFactoryRollData();
|
||||||
}
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.dal.mysql.packagedata;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.packagedata.vo.PackageDataPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.packagedata.PackageDataDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打包线数据 Mapper
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface PackageDataMapper extends BaseMapperX<PackageDataDO> {
|
||||||
|
|
||||||
|
default PageResult<PackageDataDO> selectPage(PackageDataPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<PackageDataDO>()
|
||||||
|
.eqIfPresent(PackageDataDO::getFactoryId, reqVO.getFactoryId())
|
||||||
|
.eqIfPresent(PackageDataDO::getSizeId, reqVO.getSizeId())
|
||||||
|
.likeIfPresent(PackageDataDO::getSizeName, reqVO.getSizeName())
|
||||||
|
.eqIfPresent(PackageDataDO::getPackageId, reqVO.getPackageId())
|
||||||
|
.likeIfPresent(PackageDataDO::getPackageName, reqVO.getPackageName())
|
||||||
|
.eqIfPresent(PackageDataDO::getNum, reqVO.getNum())
|
||||||
|
.betweenIfPresent(PackageDataDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(PackageDataDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.dal.mysql.screenfactoryextra;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.screenfactoryextra.vo.ScreenFactoryExtraPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.screenfactoryextra.ScreenFactoryExtraDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂大屏额外字段 Mapper
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ScreenFactoryExtraMapper extends BaseMapperX<ScreenFactoryExtraDO> {
|
||||||
|
|
||||||
|
default PageResult<ScreenFactoryExtraDO> selectPage(ScreenFactoryExtraPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<ScreenFactoryExtraDO>()
|
||||||
|
.eqIfPresent(ScreenFactoryExtraDO::getFactoryId, reqVO.getFactoryId())
|
||||||
|
.eqIfPresent(ScreenFactoryExtraDO::getDateNum, reqVO.getDateNum())
|
||||||
|
.eqIfPresent(ScreenFactoryExtraDO::getTruckOnNum, reqVO.getTruckOnNum())
|
||||||
|
.eqIfPresent(ScreenFactoryExtraDO::getTruckOffNum, reqVO.getTruckOffNum())
|
||||||
|
.eqIfPresent(ScreenFactoryExtraDO::getTruckTotalNum, reqVO.getTruckTotalNum())
|
||||||
|
.eqIfPresent(ScreenFactoryExtraDO::getYlNum, reqVO.getYlNum())
|
||||||
|
.eqIfPresent(ScreenFactoryExtraDO::getDbxNum, reqVO.getDbxNum())
|
||||||
|
.eqIfPresent(ScreenFactoryExtraDO::getTpNum, reqVO.getTpNum())
|
||||||
|
.eqIfPresent(ScreenFactoryExtraDO::getBdNum, reqVO.getBdNum())
|
||||||
|
.eqIfPresent(ScreenFactoryExtraDO::getWorkerNum, reqVO.getWorkerNum())
|
||||||
|
.eqIfPresent(ScreenFactoryExtraDO::getVehicleNum, reqVO.getVehicleNum())
|
||||||
|
.betweenIfPresent(ScreenFactoryExtraDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(ScreenFactoryExtraDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.dal.mysql.staff;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.staff.vo.StaffPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.staff.StaffDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工 Mapper
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface StaffMapper extends BaseMapperX<StaffDO> {
|
||||||
|
|
||||||
|
default PageResult<StaffDO> selectPage(StaffPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<StaffDO>()
|
||||||
|
.eqIfPresent(StaffDO::getStaffNo, reqVO.getStaffNo())
|
||||||
|
.eqIfPresent(StaffDO::getAge, reqVO.getAge())
|
||||||
|
.eqIfPresent(StaffDO::getPostId, reqVO.getPostId())
|
||||||
|
.eqIfPresent(StaffDO::getWorkTypeId, reqVO.getWorkTypeId())
|
||||||
|
.eqIfPresent(StaffDO::getIdCard, reqVO.getIdCard())
|
||||||
|
.eqIfPresent(StaffDO::getStatus, reqVO.getStatus())
|
||||||
|
.betweenIfPresent(StaffDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(StaffDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过工厂id获取员工信息
|
||||||
|
*
|
||||||
|
* @param factoryId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<StaffDO> getStaffData(@Param("factoryId") Long factoryId);
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.dal.mysql.worktype;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.worktype.vo.WorkTypePageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.worktype.WorkTypeDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工种 Mapper
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface WorkTypeMapper extends BaseMapperX<WorkTypeDO> {
|
||||||
|
|
||||||
|
default PageResult<WorkTypeDO> selectPage(WorkTypePageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<WorkTypeDO>()
|
||||||
|
.eqIfPresent(WorkTypeDO::getPostId, reqVO.getPostId())
|
||||||
|
.likeIfPresent(WorkTypeDO::getName, reqVO.getName())
|
||||||
|
.betweenIfPresent(WorkTypeDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(WorkTypeDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.service.factory;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.*;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.factory.vo.SfFactoryInfoPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.factory.vo.SfFactoryInfoSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factory.SfFactoryInfoDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂信息 Service 接口
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
public interface SfFactoryInfoService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建工厂信息
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createSfFactoryInfo(@Valid SfFactoryInfoSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新工厂信息
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateSfFactoryInfo(@Valid SfFactoryInfoSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除工厂信息
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteSfFactoryInfo(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得工厂信息
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 工厂信息
|
||||||
|
*/
|
||||||
|
SfFactoryInfoDO getSfFactoryInfo(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得工厂信息分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 工厂信息分页
|
||||||
|
*/
|
||||||
|
PageResult<SfFactoryInfoDO> getSfFactoryInfoPage(SfFactoryInfoPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,59 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.service.factory;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.factory.vo.SfFactoryInfoPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.factory.vo.SfFactoryInfoSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factory.SfFactoryInfoDO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.mysql.factory.SfFactoryInfoMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂信息 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class SfFactoryInfoServiceImpl implements SfFactoryInfoService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SfFactoryInfoMapper sfFactoryInfoMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createSfFactoryInfo(SfFactoryInfoSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
SfFactoryInfoDO sfFactoryInfo = BeanUtils.toBean(createReqVO, SfFactoryInfoDO.class);
|
||||||
|
sfFactoryInfoMapper.insert(sfFactoryInfo);
|
||||||
|
// 返回
|
||||||
|
return sfFactoryInfo.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateSfFactoryInfo(SfFactoryInfoSaveReqVO updateReqVO) {
|
||||||
|
// 更新
|
||||||
|
SfFactoryInfoDO updateObj = BeanUtils.toBean(updateReqVO, SfFactoryInfoDO.class);
|
||||||
|
sfFactoryInfoMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteSfFactoryInfo(Long id) {
|
||||||
|
// 删除
|
||||||
|
sfFactoryInfoMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SfFactoryInfoDO getSfFactoryInfo(Long id) {
|
||||||
|
return sfFactoryInfoMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<SfFactoryInfoDO> getSfFactoryInfoPage(SfFactoryInfoPageReqVO pageReqVO) {
|
||||||
|
return sfFactoryInfoMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,11 +1,14 @@
|
|||||||
package cn.iocoder.yudao.module.smartfactory.service.factoryinfo;
|
package cn.iocoder.yudao.module.smartfactory.service.factoryinfo;
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import javax.validation.*;
|
|
||||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.factoryinfo.vo.*;
|
|
||||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factoryinfo.FactoryInfoDO;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.factoryinfo.vo.FactoryInfoPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.factoryinfo.vo.FactoryInfoSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo.FactoryRollDataRespVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo.ProvincesDataRespVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factoryinfo.FactoryInfoDO;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工厂信息 Service 接口
|
* 工厂信息 Service 接口
|
||||||
@ -52,4 +55,19 @@ public interface FactoryInfoService {
|
|||||||
*/
|
*/
|
||||||
PageResult<FactoryInfoDO> getFactoryInfoPage(FactoryInfoPageReqVO pageReqVO);
|
PageResult<FactoryInfoDO> getFactoryInfoPage(FactoryInfoPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省市区类型 + code 搜索工厂
|
||||||
|
*
|
||||||
|
* @param type
|
||||||
|
* @param code
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ProvincesDataRespVO> getProvincesData(Integer type, String code);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 大屏数据 - 工厂基础滚动数据
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<FactoryRollDataRespVO> getFactoryRollData();
|
||||||
}
|
}
|
@ -1,21 +1,26 @@
|
|||||||
package cn.iocoder.yudao.module.smartfactory.service.factoryinfo;
|
package cn.iocoder.yudao.module.smartfactory.service.factoryinfo;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.factoryinfo.vo.*;
|
|
||||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factoryinfo.FactoryInfoDO;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.factoryinfo.vo.FactoryInfoPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.factoryinfo.vo.FactoryInfoSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo.FactoryRollDataRespVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo.ProvincesDataRespVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factoryinfo.FactoryInfoDO;
|
||||||
import cn.iocoder.yudao.module.smartfactory.dal.mysql.factoryinfo.FactoryInfoMapper;
|
import cn.iocoder.yudao.module.smartfactory.dal.mysql.factoryinfo.FactoryInfoMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static cn.iocoder.yudao.module.smartfactory.enums.ErrorCodeConstants.*;
|
import static cn.iocoder.yudao.module.smartfactory.enums.ErrorCodeConstants.FACTORY_INFO_NOT_EXISTS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工厂信息 Service 实现类
|
* 工厂信息 Service 实现类
|
||||||
@ -71,4 +76,37 @@ public class FactoryInfoServiceImpl implements FactoryInfoService {
|
|||||||
return factoryInfoMapper.selectPage(pageReqVO);
|
return factoryInfoMapper.selectPage(pageReqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ProvincesDataRespVO> getProvincesData(Integer type, String code) {
|
||||||
|
List<ProvincesDataRespVO> vos = new ArrayList<>();
|
||||||
|
List<FactoryInfoDO> dos = factoryInfoMapper.selectList(new LambdaQueryWrapperX<FactoryInfoDO>()
|
||||||
|
.eq(FactoryInfoDO.ADDRESS_TYPE_PROVINCE.equals(type), FactoryInfoDO::getProvinceId, code)
|
||||||
|
.eq(FactoryInfoDO.ADDRESS_TYPE_CITY.equals(type), FactoryInfoDO::getCityId, code)
|
||||||
|
.eq(FactoryInfoDO.ADDRESS_TYPE_DISTRICT_NAME.equals(type), FactoryInfoDO::getDistrictId, code)
|
||||||
|
);
|
||||||
|
Map<Long, List<FactoryInfoDO>> map = new HashMap<>();
|
||||||
|
if (FactoryInfoDO.ADDRESS_TYPE_PROVINCE.equals(type)){
|
||||||
|
map = dos.stream().collect(Collectors.groupingBy(FactoryInfoDO::getProvinceId));
|
||||||
|
}
|
||||||
|
if (FactoryInfoDO.ADDRESS_TYPE_CITY.equals(type)){
|
||||||
|
map = dos.stream().collect(Collectors.groupingBy(FactoryInfoDO::getCityId));
|
||||||
|
}
|
||||||
|
if (FactoryInfoDO.ADDRESS_TYPE_DISTRICT_NAME.equals(type)){
|
||||||
|
map = dos.stream().collect(Collectors.groupingBy(FactoryInfoDO::getDistrictId));
|
||||||
|
}
|
||||||
|
for (Map.Entry<Long, List<FactoryInfoDO>> entry : map.entrySet()) {
|
||||||
|
ProvincesDataRespVO vo = new ProvincesDataRespVO();
|
||||||
|
vo.setAdCode(entry.getKey());
|
||||||
|
vo.setValue(entry.getValue().size());
|
||||||
|
vo.setVos(dos);
|
||||||
|
vos.add(vo);
|
||||||
|
}
|
||||||
|
return vos;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FactoryRollDataRespVO> getFactoryRollData() {
|
||||||
|
return factoryInfoMapper.getFactoryRollData();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.service.packagedata;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.packagedata.vo.PackageDataPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.packagedata.vo.PackageDataSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo.FactoryPackLineDataRespVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.packagedata.PackageDataDO;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打包线数据 Service 接口
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
public interface PackageDataService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建打包线数据
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createPackageData(@Valid PackageDataSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新打包线数据
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updatePackageData(@Valid PackageDataSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除打包线数据
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deletePackageData(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得打包线数据
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 打包线数据
|
||||||
|
*/
|
||||||
|
PackageDataDO getPackageData(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得打包线数据分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 打包线数据分页
|
||||||
|
*/
|
||||||
|
PageResult<PackageDataDO> getPackageDataPage(PackageDataPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表
|
||||||
|
*
|
||||||
|
* @param factoryId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<PackageDataDO> getFactoryPackLineInfo(Long factoryId);
|
||||||
|
}
|
@ -0,0 +1,67 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.service.packagedata;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.packagedata.vo.PackageDataPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.packagedata.vo.PackageDataSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo.FactoryPackLineDataRespVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.packagedata.PackageDataDO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.mysql.packagedata.PackageDataMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打包线数据 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class PackageDataServiceImpl implements PackageDataService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PackageDataMapper packageDataMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createPackageData(PackageDataSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
PackageDataDO packageData = BeanUtils.toBean(createReqVO, PackageDataDO.class);
|
||||||
|
packageDataMapper.insert(packageData);
|
||||||
|
// 返回
|
||||||
|
return packageData.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updatePackageData(PackageDataSaveReqVO updateReqVO) {
|
||||||
|
// 更新
|
||||||
|
PackageDataDO updateObj = BeanUtils.toBean(updateReqVO, PackageDataDO.class);
|
||||||
|
packageDataMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deletePackageData(Long id) {
|
||||||
|
// 删除
|
||||||
|
packageDataMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PackageDataDO getPackageData(Long id) {
|
||||||
|
return packageDataMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<PackageDataDO> getPackageDataPage(PackageDataPageReqVO pageReqVO) {
|
||||||
|
return packageDataMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PackageDataDO> getFactoryPackLineInfo(Long factoryId) {
|
||||||
|
return packageDataMapper.selectList(new LambdaQueryWrapperX<PackageDataDO>().eq(PackageDataDO::getFactoryId, factoryId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.smartfactory.service.screendata;
|
package cn.iocoder.yudao.module.smartfactory.service.screendata;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.smartfactory.controller.screendata.factory.vo.*;
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.packagedata.PackageDataDO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -14,62 +15,67 @@ public interface ScreenDataService {
|
|||||||
/**
|
/**
|
||||||
* 大屏全局省份/省/市工厂数据
|
* 大屏全局省份/省/市工厂数据
|
||||||
* adcode是null,就查询全部省份数据
|
* adcode是null,就查询全部省份数据
|
||||||
* @param adcode 省/市/区编码
|
*
|
||||||
|
* @param code 省/市/区编码
|
||||||
* @return 显示数据
|
* @return 显示数据
|
||||||
*/
|
*/
|
||||||
List<ProvincesDataRespVO> getProvincesData(Integer type, String adcode) ;
|
List<ProvincesDataRespVO> getProvincesData(Integer type, String code);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询员工数据
|
* 查询员工数据
|
||||||
* factoryId是null,查询所有工厂员工数据
|
* factoryId是null,查询所有工厂员工数据
|
||||||
|
*
|
||||||
* @param factoryId 工厂ID ,
|
* @param factoryId 工厂ID ,
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
StaffDataRespVO getStaffData(Long factoryId) ;
|
StaffDataRespVO getStaffData(Long factoryId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询资产数据
|
* 查询资产数据
|
||||||
* @param factoryId
|
*
|
||||||
* factoryId是null,查询所有工厂资产数据
|
* @param factoryId factoryId是null,查询所有工厂资产数据
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
PropertyDataRespVO getPropertyData(Long factoryId) ;
|
PropertyDataRespVO getPropertyData(Long factoryId);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询工厂运营数据
|
* 查询工厂运营数据
|
||||||
* @param factoryId
|
*
|
||||||
* factoryId是null,查询所有工厂运营数据
|
* @param factoryId factoryId是null,查询所有工厂运营数据
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
OperateDataRespVO getFactoryOperateData(Long factoryId) ;
|
OperateDataRespVO getFactoryOperateData(Long factoryId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 大屏工厂滚屏数据查询
|
* 大屏工厂滚屏数据查询
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
FactoryRollDataRespVO getFactoryRollData() ;
|
List<FactoryRollDataRespVO> getFactoryRollData();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取工厂监控设备集合
|
* 获取工厂监控设备集合
|
||||||
|
*
|
||||||
* @param factoryId
|
* @param factoryId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<FactoryCameraDataRespVO> getFactoryCamerasData(Long factoryId) ;
|
List<FactoryCameraDataRespVO> getFactoryCamerasData(Long factoryId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取工厂对应城市的天气数据
|
* 获取工厂对应城市的天气数据
|
||||||
|
*
|
||||||
* @param factoryId
|
* @param factoryId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
FactoryWeatherDataRespVO getFactoryWeatherInfo(Long factoryId) ;
|
FactoryWeatherDataRespVO getFactoryWeatherInfo(Long factoryId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据类型获取工厂打包线数据
|
* 根据类型获取工厂打包线数据
|
||||||
* @param type 1= 今日 2= 本周
|
*
|
||||||
* @param factoryId
|
* @param factoryId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<FactoryPackLineDataRespVO> getFactoryPackLineInfo(Integer type,Long factoryId) ;
|
List<PackageDataDO> getFactoryPackLineInfo(Long factoryId);
|
||||||
}
|
}
|
@ -1,15 +1,18 @@
|
|||||||
package cn.iocoder.yudao.module.smartfactory.service.screendata;
|
package cn.iocoder.yudao.module.smartfactory.service.screendata;
|
||||||
|
|
||||||
import cn.hutool.json.JSON;
|
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo.*;
|
||||||
import cn.iocoder.yudao.module.smartfactory.controller.screendata.factory.vo.*;
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.packagedata.PackageDataDO;
|
||||||
import cn.iocoder.yudao.module.smartfactory.framework.util.HttpUtil;
|
import cn.iocoder.yudao.module.smartfactory.framework.util.HttpUtil;
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import cn.iocoder.yudao.module.smartfactory.service.factoryinfo.FactoryInfoService;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.service.packagedata.PackageDataService;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.service.screenfactoryextra.ScreenFactoryExtraService;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.service.staff.StaffService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -22,20 +25,29 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Validated
|
@Validated
|
||||||
public class ScreenDataServiceImpl implements ScreenDataService{
|
public class ScreenDataServiceImpl implements ScreenDataService {
|
||||||
|
@Resource
|
||||||
|
private FactoryInfoService factoryInfoService;
|
||||||
|
@Resource
|
||||||
|
private ScreenFactoryExtraService screenFactoryExtraService;
|
||||||
|
@Resource
|
||||||
|
private StaffService staffService;
|
||||||
|
@Resource
|
||||||
|
private PackageDataService packageDataService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ProvincesDataRespVO> getProvincesData(Integer type,String adcode) {
|
public List<ProvincesDataRespVO> getProvincesData(Integer type, String code) {
|
||||||
return null;
|
return factoryInfoService.getProvincesData(type, code);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StaffDataRespVO getStaffData(Long factoryId) {
|
public StaffDataRespVO getStaffData(Long factoryId) {
|
||||||
return null;
|
return staffService.getStaffData(factoryId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PropertyDataRespVO getPropertyData(Long factoryId) {
|
public PropertyDataRespVO getPropertyData(Long factoryId) {
|
||||||
return null;
|
return screenFactoryExtraService.getPropertyData(factoryId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -44,8 +56,8 @@ public class ScreenDataServiceImpl implements ScreenDataService{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FactoryRollDataRespVO getFactoryRollData() {
|
public List<FactoryRollDataRespVO> getFactoryRollData() {
|
||||||
return null;
|
return factoryInfoService.getFactoryRollData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -61,28 +73,29 @@ public class ScreenDataServiceImpl implements ScreenDataService{
|
|||||||
|
|
||||||
public FactoryWeatherDataRespVO getFactoryWeatherInfo(Long factoryId) {
|
public FactoryWeatherDataRespVO getFactoryWeatherInfo(Long factoryId) {
|
||||||
//根据factoryId 查询areaCode;
|
//根据factoryId 查询areaCode;
|
||||||
String areaCode = "101190101" ;
|
String areaCode = "101190101";
|
||||||
String url = WEATHER_URL + areaCode + ".html";
|
String url = WEATHER_URL + areaCode + ".html";
|
||||||
Map<String, String> headers = new HashMap<>();
|
Map<String, String> headers = new HashMap<>();
|
||||||
headers.put(REFERER, REFERER_URL);
|
headers.put(REFERER, REFERER_URL);
|
||||||
String result = HttpUtil.doGetSetHeader(url, headers);
|
String result = HttpUtil.doGetSetHeader(url, headers);
|
||||||
String[] str = result.split(WEATHER_SPLIT);
|
String[] str = result.split(WEATHER_SPLIT);
|
||||||
if(str.length > 1) {
|
if (str.length > 1) {
|
||||||
FactoryWeatherDataRespVO vo = new FactoryWeatherDataRespVO();
|
FactoryWeatherDataRespVO vo = new FactoryWeatherDataRespVO();
|
||||||
JSONObject jsonObject = JSONUtil.parseObj(str[1]) ;
|
JSONObject jsonObject = JSONUtil.parseObj(str[1]);
|
||||||
vo.setFactoryId(factoryId);
|
vo.setFactoryId(factoryId);
|
||||||
vo.setAreaCode(areaCode) ;
|
vo.setAreaCode(areaCode);
|
||||||
vo.setTemperature(jsonObject.getStr("temp")) ; //温度
|
vo.setTemperature(jsonObject.getStr("temp")); //温度
|
||||||
vo.setHumidity(jsonObject.getStr("sd")); //湿度
|
vo.setHumidity(jsonObject.getStr("sd")); //湿度
|
||||||
vo.setWeather(jsonObject.getStr("weather")) ; //天气
|
vo.setWeather(jsonObject.getStr("weather")); //天气
|
||||||
vo.setDate(jsonObject.getStr("date")); //日期
|
vo.setDate(jsonObject.getStr("date")); //日期
|
||||||
return vo ;
|
return vo;
|
||||||
}else {
|
} else {
|
||||||
return null ;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<FactoryPackLineDataRespVO> getFactoryPackLineInfo(Integer type, Long factoryId) {
|
@Override
|
||||||
return null ;
|
public List<PackageDataDO> getFactoryPackLineInfo(Long factoryId) {
|
||||||
|
return packageDataService.getFactoryPackLineInfo(factoryId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,57 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.service.screenfactoryextra;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.screenfactoryextra.vo.ScreenFactoryExtraPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.screenfactoryextra.vo.ScreenFactoryExtraSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo.PropertyDataRespVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.screenfactoryextra.ScreenFactoryExtraDO;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂大屏额外字段 Service 接口
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
public interface ScreenFactoryExtraService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建工厂大屏额外字段
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createScreenFactoryExtra(@Valid ScreenFactoryExtraSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新工厂大屏额外字段
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateScreenFactoryExtra(@Valid ScreenFactoryExtraSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除工厂大屏额外字段
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteScreenFactoryExtra(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得工厂大屏额外字段
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 工厂大屏额外字段
|
||||||
|
*/
|
||||||
|
ScreenFactoryExtraDO getScreenFactoryExtra(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得工厂大屏额外字段分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 工厂大屏额外字段分页
|
||||||
|
*/
|
||||||
|
PageResult<ScreenFactoryExtraDO> getScreenFactoryExtraPage(ScreenFactoryExtraPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
PropertyDataRespVO getPropertyData(Long factoryId);
|
||||||
|
}
|
@ -0,0 +1,90 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.service.screenfactoryextra;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo.PropertyDataRespVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.screenfactoryextra.vo.ScreenFactoryExtraPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.screenfactoryextra.vo.ScreenFactoryExtraSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.screenfactoryextra.ScreenFactoryExtraDO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.mysql.screenfactoryextra.ScreenFactoryExtraMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.module.smartfactory.enums.ErrorCodeConstants.FACTORY_INFO_NOT_EXISTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂大屏额外字段 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class ScreenFactoryExtraServiceImpl implements ScreenFactoryExtraService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ScreenFactoryExtraMapper screenFactoryExtraMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createScreenFactoryExtra(ScreenFactoryExtraSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
ScreenFactoryExtraDO screenFactoryExtra = BeanUtils.toBean(createReqVO, ScreenFactoryExtraDO.class);
|
||||||
|
screenFactoryExtraMapper.insert(screenFactoryExtra);
|
||||||
|
// 返回
|
||||||
|
return screenFactoryExtra.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateScreenFactoryExtra(ScreenFactoryExtraSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateScreenFactoryExtraExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
ScreenFactoryExtraDO updateObj = BeanUtils.toBean(updateReqVO, ScreenFactoryExtraDO.class);
|
||||||
|
screenFactoryExtraMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteScreenFactoryExtra(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateScreenFactoryExtraExists(id);
|
||||||
|
// 删除
|
||||||
|
screenFactoryExtraMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateScreenFactoryExtraExists(Long id) {
|
||||||
|
if (screenFactoryExtraMapper.selectById(id) == null) {
|
||||||
|
throw exception(FACTORY_INFO_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ScreenFactoryExtraDO getScreenFactoryExtra(Long id) {
|
||||||
|
return screenFactoryExtraMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<ScreenFactoryExtraDO> getScreenFactoryExtraPage(ScreenFactoryExtraPageReqVO pageReqVO) {
|
||||||
|
return screenFactoryExtraMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PropertyDataRespVO getPropertyData(Long factoryId) {
|
||||||
|
PropertyDataRespVO vo = new PropertyDataRespVO();
|
||||||
|
ScreenFactoryExtraDO screenFactoryExtraDO = screenFactoryExtraMapper.selectOne(new LambdaQueryWrapperX<ScreenFactoryExtraDO>()
|
||||||
|
.eq(ScreenFactoryExtraDO::getFactoryId, factoryId));
|
||||||
|
if (screenFactoryExtraDO != null) {
|
||||||
|
vo.setKilnTotal(screenFactoryExtraDO.getYlNum());
|
||||||
|
vo.setPackLineTotal(screenFactoryExtraDO.getDbxNum());
|
||||||
|
vo.setTrayTotal(screenFactoryExtraDO.getTpNum());
|
||||||
|
vo.setTieTotal(screenFactoryExtraDO.getBdNum());
|
||||||
|
vo.setForkliftTotal(screenFactoryExtraDO.getTruckTotalNum());
|
||||||
|
vo.setOnlineTotal(screenFactoryExtraDO.getTruckOnNum());
|
||||||
|
vo.setOutLineTotal(screenFactoryExtraDO.getTruckOffNum());
|
||||||
|
}
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,63 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.service.staff;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.staff.vo.StaffPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.staff.vo.StaffSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo.StaffDataRespVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.staff.StaffDO;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工 Service 接口
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
public interface StaffService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建员工
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createStaff(@Valid StaffSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新员工
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateStaff(@Valid StaffSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除员工
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteStaff(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得员工
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 员工
|
||||||
|
*/
|
||||||
|
StaffDO getStaff(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得员工分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 员工分页
|
||||||
|
*/
|
||||||
|
PageResult<StaffDO> getStaffPage(StaffPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工厂员工信息
|
||||||
|
*
|
||||||
|
* @param factoryId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
StaffDataRespVO getStaffData(Long factoryId);
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.service.staff;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.staff.vo.StaffPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.staff.vo.StaffSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo.StaffDataRespVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.staff.StaffDO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.mysql.staff.StaffMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class StaffServiceImpl implements StaffService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private StaffMapper staffMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createStaff(StaffSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
StaffDO staff = BeanUtils.toBean(createReqVO, StaffDO.class);
|
||||||
|
staffMapper.insert(staff);
|
||||||
|
// 返回
|
||||||
|
return staff.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateStaff(StaffSaveReqVO updateReqVO) {
|
||||||
|
// 更新
|
||||||
|
StaffDO updateObj = BeanUtils.toBean(updateReqVO, StaffDO.class);
|
||||||
|
staffMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteStaff(Long id) {
|
||||||
|
// 删除
|
||||||
|
staffMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StaffDO getStaff(Long id) {
|
||||||
|
return staffMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<StaffDO> getStaffPage(StaffPageReqVO pageReqVO) {
|
||||||
|
return staffMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StaffDataRespVO getStaffData(Long factoryId) {
|
||||||
|
StaffDataRespVO vo = new StaffDataRespVO();
|
||||||
|
List<StaffDO> dos = staffMapper.getStaffData(factoryId);
|
||||||
|
vo.setTotal(dos.size());
|
||||||
|
vo.setMaleTotal((int) dos.stream().filter(a -> a.getSex() == 0).count());
|
||||||
|
vo.setFemaleTotal((int) dos.stream().filter(a -> a.getSex() == 1).count());
|
||||||
|
vo.setStaffInfos(dos);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.service.worktype;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.worktype.vo.WorkTypePageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.worktype.vo.WorkTypeSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.worktype.WorkTypeDO;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工种 Service 接口
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
public interface WorkTypeService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建工种
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createWorkType(@Valid WorkTypeSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新工种
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateWorkType(@Valid WorkTypeSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除工种
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteWorkType(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得工种
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 工种
|
||||||
|
*/
|
||||||
|
WorkTypeDO getWorkType(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得工种分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 工种分页
|
||||||
|
*/
|
||||||
|
PageResult<WorkTypeDO> getWorkTypePage(WorkTypePageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,59 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.service.worktype;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.worktype.vo.WorkTypePageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.worktype.vo.WorkTypeSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.worktype.WorkTypeDO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.mysql.worktype.WorkTypeMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工种 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class WorkTypeServiceImpl implements WorkTypeService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WorkTypeMapper workTypeMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createWorkType(WorkTypeSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
WorkTypeDO workType = BeanUtils.toBean(createReqVO, WorkTypeDO.class);
|
||||||
|
workTypeMapper.insert(workType);
|
||||||
|
// 返回
|
||||||
|
return workType.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateWorkType(WorkTypeSaveReqVO updateReqVO) {
|
||||||
|
// 更新
|
||||||
|
WorkTypeDO updateObj = BeanUtils.toBean(updateReqVO, WorkTypeDO.class);
|
||||||
|
workTypeMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteWorkType(Long id) {
|
||||||
|
// 删除
|
||||||
|
workTypeMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WorkTypeDO getWorkType(Long id) {
|
||||||
|
return workTypeMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<WorkTypeDO> getWorkTypePage(WorkTypePageReqVO pageReqVO) {
|
||||||
|
return workTypeMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -40,20 +40,20 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
master:
|
master:
|
||||||
name: ruoyi-vue-pro
|
name: ruoyi-vue-pro
|
||||||
url: jdbc:mysql://400-infra.server.iocoder.cn:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://192.168.1.101:3306/${spring.datasource.dynamic.datasource.slave.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||||
driver-class-name: com.mysql.jdbc.Driver
|
driver-class-name: com.mysql.jdbc.Driver
|
||||||
username: root
|
username: root
|
||||||
password: 3WLiVUBEwTbvAfsh
|
password: yhtkj2024!
|
||||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||||
name: ruoyi-vue-pro
|
name: ruoyi-vue-pro
|
||||||
url: jdbc:mysql://400-infra.server.iocoder.cn:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://192.168.1.101:3306/${spring.datasource.dynamic.datasource.slave.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||||
driver-class-name: com.mysql.jdbc.Driver
|
driver-class-name: com.mysql.jdbc.Driver
|
||||||
username: root
|
username: root
|
||||||
password: 3WLiVUBEwTbvAfsh
|
password: yhtkj2024!
|
||||||
|
|
||||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||||
redis:
|
redis:
|
||||||
host: 400-infra.server.iocoder.cn # 地址
|
host: 192.168.1.101 # 地址
|
||||||
port: 6379 # 端口
|
port: 6379 # 端口
|
||||||
database: 1 # 数据库索引
|
database: 1 # 数据库索引
|
||||||
# password: 123456 # 密码,建议生产环境开启
|
# password: 123456 # 密码,建议生产环境开启
|
||||||
@ -144,7 +144,17 @@ yudao:
|
|||||||
pay-notify-url: http://niubi.natapp1.cc/api/pay/order/notify
|
pay-notify-url: http://niubi.natapp1.cc/api/pay/order/notify
|
||||||
pay-return-url: http://niubi.natapp1.cc/api/pay/order/return
|
pay-return-url: http://niubi.natapp1.cc/api/pay/order/return
|
||||||
refund-notify-url: http://niubi.natapp1.cc/api/pay/refund/notify
|
refund-notify-url: http://niubi.natapp1.cc/api/pay/refund/notify
|
||||||
demo: true # 开启演示模式
|
|
||||||
|
env: # 多环境的配置项
|
||||||
|
tag: ${HOSTNAME}
|
||||||
|
security:
|
||||||
|
mock-enable: true
|
||||||
|
access-log: # 访问日志的配置项
|
||||||
|
enable: false
|
||||||
|
error-code: # 错误码相关配置项
|
||||||
|
enable: false
|
||||||
|
constantsClassList: []
|
||||||
|
demo: false # 关闭演示模式
|
||||||
|
|
||||||
justauth:
|
justauth:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
@ -128,4 +128,5 @@ yudao:
|
|||||||
enable: false
|
enable: false
|
||||||
error-code: # 错误码相关配置项
|
error-code: # 错误码相关配置项
|
||||||
enable: false
|
enable: false
|
||||||
|
constantsClassList: []
|
||||||
demo: false # 关闭演示模式
|
demo: false # 关闭演示模式
|
@ -149,4 +149,5 @@ yudao:
|
|||||||
enable: false
|
enable: false
|
||||||
error-code: # 错误码相关配置项
|
error-code: # 错误码相关配置项
|
||||||
enable: false
|
enable: false
|
||||||
|
constantsClassList: []
|
||||||
demo: false # 关闭演示模式
|
demo: false # 关闭演示模式
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
--- #################### 注册中心相关配置 ####################
|
||||||
|
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
server-addr: 192.168.1.101:8848
|
||||||
|
discovery:
|
||||||
|
namespace: dev # 命名空间。这里使用 dev 开发环境
|
||||||
|
metadata:
|
||||||
|
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
||||||
|
|
||||||
|
--- #################### 配置中心相关配置 ####################
|
||||||
|
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
# Nacos Config 配置项,对应 NacosConfigProperties 配置属性类
|
||||||
|
config:
|
||||||
|
server-addr: 192.168.1.101:8848 # Nacos 服务器地址
|
||||||
|
namespace: dev # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境
|
||||||
|
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||||
|
name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name
|
||||||
|
file-extension: yaml # 使用的 Nacos 配置集的 dataId 的文件拓展名,同时也是 Nacos 配置集的配置格式,默认为 properties
|
@ -0,0 +1,12 @@
|
|||||||
|
<?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="cn.iocoder.yudao.module.smartfactory.dal.mysql.factory.SfFactoryInfoMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
@ -9,4 +9,18 @@
|
|||||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
<select id="getFactoryRollData"
|
||||||
|
resultType="cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo.FactoryRollDataRespVO">
|
||||||
|
SELECT a.name as name,
|
||||||
|
a.short_name as shortName,
|
||||||
|
a.city_name as cityName,
|
||||||
|
(select count(1) from sf_staff where factory_id = a.id and `status` = 1) as total,
|
||||||
|
b.yl_num AS kilnTotal,
|
||||||
|
b.dbx_num AS packLineTotal,
|
||||||
|
b.tp_num AS trayTotal,
|
||||||
|
b.bd_num AS tieTotal,
|
||||||
|
b.truck_total_num AS forkliftTotal
|
||||||
|
FROM sf_factory_info AS a
|
||||||
|
LEFT JOIN sf_screen_factory_extra AS b ON a.id = b.factory_id
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
@ -0,0 +1,12 @@
|
|||||||
|
<?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="cn.iocoder.yudao.module.smartfactory.dal.mysql.packagedata.PackageDataMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,12 @@
|
|||||||
|
<?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="cn.iocoder.yudao.module.smartfactory.dal.mysql.screenfactoryextra.ScreenFactoryExtraMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
@ -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="cn.iocoder.yudao.module.smartfactory.dal.mysql.staff.StaffMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
<select id="getStaffData" resultType="cn.iocoder.yudao.module.smartfactory.dal.dataobject.staff.StaffDO">
|
||||||
|
select
|
||||||
|
a.*,
|
||||||
|
ifnull( t3.NAME, t2.post_name ) AS postName
|
||||||
|
from sf_staff as a
|
||||||
|
LEFT JOIN sf_post t2 ON a.post_id = t2.id
|
||||||
|
LEFT JOIN sf_work_type t3 ON a.work_type_id = t3.id
|
||||||
|
<where>
|
||||||
|
a.status = 1
|
||||||
|
and a.deleted = 0
|
||||||
|
<if test="factoryId != null">
|
||||||
|
and a.factory_id = #{factoryId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
@ -0,0 +1,12 @@
|
|||||||
|
<?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="cn.iocoder.yudao.module.smartfactory.dal.mysql.worktype.WorkTypeMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue
Block a user