Browse Source

#站点填报

zhongwei
yang_shj 2 years ago
parent
commit
0f77ebc404
  1. 30
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/GenerateEntity.java
  2. 30
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/UseEntity.java
  3. 6
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/vo/GenerateVo.java
  4. 7
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/vo/UseVo.java
  5. 9
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEntity.java
  6. 65
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/GenerateController.java
  7. 74
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/InsertPowerController.java
  8. 69
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/InsertUseController.java
  9. 66
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/NotInsertPowerController.java
  10. 66
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/NotInsertUseController.java
  11. 64
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/UseController.java
  12. 13
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/GenerateMapper.java
  13. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/GenerateMapper.xml
  14. 13
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertPowerMapper.java
  15. 13
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertUseMapper.java
  16. 13
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertPowerMapper.java
  17. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertPowerMapper.xml
  18. 13
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertUseMapper.java
  19. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertUseMapper.xml
  20. 13
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/UseMapper.java
  21. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/UseMapper.xml
  22. 25
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/GenerateService.java
  23. 17
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/InsertPowerService.java
  24. 18
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/InsertUseService.java
  25. 29
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/NotInsertPowerService.java
  26. 27
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/NotInsertUseService.java
  27. 23
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/UseService.java
  28. 81
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/GenerateServiceImpl.java
  29. 22
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/InsertPowerServiceImpl.java
  30. 22
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/InsertUseServiceImpl.java
  31. 82
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/NotInsertPowerServiceImpl.java
  32. 84
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/NotInsertUseServiceImpl.java
  33. 81
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/UseServiceImpl.java
  34. 16
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/GenerateWrapper.java
  35. 17
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/UseWrapper.java

30
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/GenerateEntity.java

@ -0,0 +1,30 @@
package com.hnac.hzims.operational.fill.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
@TableName("hzims_fill_generate")
@ApiModel(value="GenerateEntity", description="保存发电量填报数据对象")
public class GenerateEntity extends TenantEntity implements Serializable {
@ApiModelProperty("站点编号")
private String stationCode;
@ApiModelProperty("站点名称")
private String stationName;
@ApiModelProperty("发电量")
private BigDecimal generate;
@ApiModelProperty("填报月份")
private String fillDate;
}

30
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/UseEntity.java

@ -0,0 +1,30 @@
package com.hnac.hzims.operational.fill.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
@TableName("hzims_fill_use")
@ApiModel(value="UseEntity", description="保存用电量填报数据对象")
public class UseEntity extends TenantEntity implements Serializable {
@ApiModelProperty("站点编号")
private String stationCode;
@ApiModelProperty("站点名称")
private String stationName;
@ApiModelProperty("发电量")
private BigDecimal use;
@ApiModelProperty("填报月份")
private String fillDate;
}

6
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/vo/NotInsertUseVo.java → hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/vo/GenerateVo.java

@ -1,16 +1,16 @@
package com.hnac.hzims.operational.fill.vo; package com.hnac.hzims.operational.fill.vo;
import com.hnac.hzims.operational.fill.entity.NotInsertUseEntity; import com.hnac.hzims.operational.fill.entity.GenerateEntity;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
/** /**
* @author ysj * @author ysj
* @date 2023/03/17 14:34:12 * @date 2023/04/10 11:30:33
* @version 4.0.0 * @version 4.0.0
*/ */
@Data @Data
public class NotInsertUseVo extends NotInsertUseEntity { public class GenerateVo extends GenerateEntity {
@ApiModelProperty("用户名称") @ApiModelProperty("用户名称")
private String userName; private String userName;

7
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/vo/NotInsertPowerVo.java → hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/vo/UseVo.java

@ -1,17 +1,16 @@
package com.hnac.hzims.operational.fill.vo; package com.hnac.hzims.operational.fill.vo;
import com.hnac.hzims.operational.fill.entity.NotInsertPowerEntity; import com.hnac.hzims.operational.fill.entity.UseEntity;
import com.hnac.hzims.operational.fill.entity.OverEntity;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
/** /**
* @author ysj * @author ysj
* @date 2023/03/17 14:34:12 * @date 2023/04/10 11:30:33
* @version 4.0.0 * @version 4.0.0
*/ */
@Data @Data
public class NotInsertPowerVo extends NotInsertPowerEntity { public class UseVo extends UseEntity {
@ApiModelProperty("用户名称") @ApiModelProperty("用户名称")
private String userName; private String userName;

9
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEntity.java

@ -59,7 +59,11 @@ public class StationEntity extends TenantEntity implements Serializable {
@JsonSerialize(nullsUsing = NullSerializer.class) @JsonSerialize(nullsUsing = NullSerializer.class)
private Long refDept; private Long refDept;
@ApiModelProperty("数据来源") @ApiModelProperty("数据来源: 0 - 数据采集 1 - 数据填报")
@QueryField(condition = SqlCondition.EQUAL)
private String dataOrigin;
@ApiModelProperty("数据采集方式")
@QueryField(condition = SqlCondition.EQUAL) @QueryField(condition = SqlCondition.EQUAL)
private String dataSource; private String dataSource;
@ -147,7 +151,4 @@ public class StationEntity extends TenantEntity implements Serializable {
@ApiModelProperty("实时画面绑定账号秘钥") @ApiModelProperty("实时画面绑定账号秘钥")
private String secretKey; private String secretKey;
@ApiModelProperty("光伏站点配置类型: 0-个体光伏站 1-厂房光伏站")
private Long photovoltaicType;
} }

65
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/GenerateController.java

@ -0,0 +1,65 @@
package com.hnac.hzims.operational.fill.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.operational.fill.entity.GenerateEntity;
import com.hnac.hzims.operational.fill.service.GenerateService;
import com.hnac.hzims.operational.fill.vo.GenerateVo;
import com.hnac.hzims.operational.fill.vo.QueryVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
/**
* @author ysj
* @date 2023/04/10 11:16:07
* @version 4.0.0
*/
@RestController
@AllArgsConstructor
@RequestMapping("/generate")
@Api(value = "发电量填报", tags = "发电量填报")
public class GenerateController extends BladeController {
private final GenerateService service;
/**
* 新增
*/
@PostMapping("/saveOrUpdate")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "新增", notes = "传入InsertPowerEntity对象")
public R saveOrUpdate(@RequestBody GenerateEntity entity) {
return R.status(service.saveUpdate(entity));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "逻辑删除", notes = "传入id字符串以逗号分隔")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(service.deleteLogic(Func.toLongList(ids)));
}
/**
* 分页
*/
@ApiLog
@GetMapping("/list")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "分页", notes = "查询条件::startTime,endTime,stationCode")
public R<IPage<GenerateVo>> list(QueryVo filter, Query query) {
return service.pageCondition(filter, query);
}
}

74
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/InsertPowerController.java

@ -1,74 +0,0 @@
package com.hnac.hzims.operational.fill.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.operational.fill.entity.InsertPowerEntity;
import com.hnac.hzims.operational.fill.entity.OtherEntity;
import com.hnac.hzims.operational.fill.service.InsertPowerService;
import com.hnac.hzims.operational.fill.service.OtherService;
import com.hnac.hzims.operational.fill.vo.OtherVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
* @author ysj
* @date 2023/03/09 16:12:22
* @version 4.0.0
*/
@RestController
@AllArgsConstructor
@RequestMapping("/insert/power")
@Api(value = "电站填报", tags = "接入电站发电量填报")
public class InsertPowerController extends BladeController {
private final InsertPowerService service;
/**
* 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "新增", notes = "传入InsertPowerEntity对象")
public R save(@RequestBody InsertPowerEntity entity) {
return R.status(service.save(entity));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "逻辑删除", notes = "传入id字符串以逗号分隔")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(service.deleteLogic(Func.toLongList(ids)));
}
/**
* 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "修改")
public R update(@Valid @RequestBody InsertPowerEntity entity) {
return R.status(service.updateById(entity));
}
/**
* 分页
*//*
@GetMapping("/list")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "分页", notes = "查询条件:createDept,fileName,startTime,endTime")
public R<IPage<OtherVo>> list(OtherVo vo, Query query) {
return service.pageCondition(vo, query);
}*/
}

69
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/InsertUseController.java

@ -1,69 +0,0 @@
package com.hnac.hzims.operational.fill.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.operational.fill.entity.InsertPowerEntity;
import com.hnac.hzims.operational.fill.service.InsertPowerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
* @author ysj
* @date 2023/03/09 16:12:22
* @version 4.0.0
*/
@RestController
@AllArgsConstructor
@RequestMapping("/insert/use")
@Api(value = "泵站用电量填报", tags = "接入泵站用电量填报")
public class InsertUseController extends BladeController {
private final InsertPowerService service;
/**
* 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "新增", notes = "传入InsertPowerEntity对象")
public R save(@RequestBody InsertPowerEntity entity) {
return R.status(service.save(entity));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "逻辑删除", notes = "传入id字符串以逗号分隔")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(service.deleteLogic(Func.toLongList(ids)));
}
/**
* 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "修改")
public R update(@Valid @RequestBody InsertPowerEntity entity) {
return R.status(service.updateById(entity));
}
/**
* 分页
*//*
@GetMapping("/list")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "分页", notes = "查询条件:createDept,fileName,startTime,endTime")
public R<IPage<OtherVo>> list(OtherVo vo, Query query) {
return service.pageCondition(vo, query);
}*/
}

66
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/NotInsertPowerController.java

@ -1,66 +0,0 @@
package com.hnac.hzims.operational.fill.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.operational.fill.entity.NotInsertPowerEntity;
import com.hnac.hzims.operational.fill.entity.RainfallEntity;
import com.hnac.hzims.operational.fill.service.NotInsertPowerService;
import com.hnac.hzims.operational.fill.vo.NotInsertPowerVo;
import com.hnac.hzims.operational.fill.vo.QueryVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
* @author ysj
* @date 2023/03/09 16:12:22
* @version 4.0.0
*/
@RestController
@AllArgsConstructor
@RequestMapping("/notInsert/power")
@Api(value = "水电站发电量填报", tags = "未接入电站历史发电量填报")
public class NotInsertPowerController extends BladeController {
private final NotInsertPowerService service;
/**
* 新增
*/
@PostMapping("/saveOrUpdate")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "新增", notes = "传入InsertPowerEntity对象")
public R saveOrUpdate(@RequestBody NotInsertPowerEntity entity) {
return R.status(service.saveUpdate(entity));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "逻辑删除", notes = "传入id字符串以逗号分隔")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(service.deleteLogic(Func.toLongList(ids)));
}
/**
* 分页
*/
@ApiLog
@GetMapping("/list")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "分页", notes = "查询条件::startTime,endTime,stationCode")
public R<IPage<NotInsertPowerVo>> list(QueryVo filter, Query query) {
return service.pageCondition(filter, query);
}
}

66
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/NotInsertUseController.java

@ -1,66 +0,0 @@
package com.hnac.hzims.operational.fill.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.operational.fill.entity.NotInsertUseEntity;
import com.hnac.hzims.operational.fill.entity.RainfallEntity;
import com.hnac.hzims.operational.fill.service.NotInsertUseService;
import com.hnac.hzims.operational.fill.vo.NotInsertUseVo;
import com.hnac.hzims.operational.fill.vo.QueryVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
* @author ysj
* @date 2023/03/09 16:12:22
* @version 4.0.0
*/
@RestController
@AllArgsConstructor
@RequestMapping("/notInsert/use")
@Api(value = "泵站用电量填报", tags = "未接入泵站历史用电量填报")
public class NotInsertUseController extends BladeController {
private final NotInsertUseService service;
/**
* 新增
*/
@PostMapping("/saveOrUpdate")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "新增", notes = "传入InsertPowerEntity对象")
public R saveOrUpdate(@RequestBody NotInsertUseEntity entity) {
return R.status(service.saveUpdate(entity));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "逻辑删除", notes = "传入id字符串以逗号分隔")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(service.deleteLogic(Func.toLongList(ids)));
}
/**
* 分页
*/
@ApiLog
@GetMapping("/list")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "分页", notes = "查询条件::startTime,endTime,stationCode")
public R<IPage<NotInsertUseVo>> list(QueryVo filter, Query query) {
return service.pageCondition(filter, query);
}
}

64
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/UseController.java

@ -0,0 +1,64 @@
package com.hnac.hzims.operational.fill.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.operational.fill.entity.UseEntity;
import com.hnac.hzims.operational.fill.service.UseService;
import com.hnac.hzims.operational.fill.vo.QueryVo;
import com.hnac.hzims.operational.fill.vo.UseVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
/**
* @author ysj
* @date 2023/04/10 11:16:07
* @version 4.0.0
*/
@RestController
@AllArgsConstructor
@RequestMapping("/use")
@Api(value = "用电量填报", tags = "用电量填报")
public class UseController extends BladeController {
private final UseService service;
/**
* 新增
*/
@PostMapping("/saveOrUpdate")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "新增", notes = "传入InsertPowerEntity对象")
public R saveOrUpdate(@RequestBody UseEntity entity) {
return R.status(service.saveUpdate(entity));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "逻辑删除", notes = "传入id字符串以逗号分隔")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(service.deleteLogic(Func.toLongList(ids)));
}
/**
* 分页
*/
@ApiLog
@GetMapping("/list")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "分页", notes = "查询条件::startTime,endTime,stationCode")
public R<IPage<UseVo>> list(QueryVo filter, Query query) {
return service.pageCondition(filter, query);
}
}

13
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/GenerateMapper.java

@ -0,0 +1,13 @@
package com.hnac.hzims.operational.fill.mapper;
import com.hnac.hzims.operational.fill.entity.GenerateEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
* @date 2023/04/10 11:22:14
* @version 4.0.0
*/
public interface GenerateMapper extends UserDataScopeBaseMapper<GenerateEntity> {
}

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertUseMapper.xml → hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/GenerateMapper.xml

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?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" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.hnac.hzims.operational.fill.mapper.InsertUseMapper"> <mapper namespace="com.hnac.hzims.operational.fill.mapper.GenerateMapper">
</mapper> </mapper>

13
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertPowerMapper.java

@ -1,13 +0,0 @@
package com.hnac.hzims.operational.fill.mapper;
import com.hnac.hzims.operational.fill.entity.InsertPowerEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
* @date 2023/03/09 16:12:22
* @version 4.0.0
*/
public interface InsertPowerMapper extends UserDataScopeBaseMapper<InsertPowerEntity> {
}

13
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertUseMapper.java

@ -1,13 +0,0 @@
package com.hnac.hzims.operational.fill.mapper;
import com.hnac.hzims.operational.fill.entity.InsertUseEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
* @date 2023/03/09 16:12:22
* @version 4.0.0
*/
public interface InsertUseMapper extends UserDataScopeBaseMapper<InsertUseEntity> {
}

13
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertPowerMapper.java

@ -1,13 +0,0 @@
package com.hnac.hzims.operational.fill.mapper;
import com.hnac.hzims.operational.fill.entity.NotInsertPowerEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
* @date 2023/03/09 16:12:22
* @version 4.0.0
*/
public interface NotInsertPowerMapper extends UserDataScopeBaseMapper<NotInsertPowerEntity> {
}

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertPowerMapper.xml

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.hnac.hzims.operational.fill.mapper.NotInsertPowerMapper">
</mapper>

13
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertUseMapper.java

@ -1,13 +0,0 @@
package com.hnac.hzims.operational.fill.mapper;
import com.hnac.hzims.operational.fill.entity.NotInsertUseEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
* @date 2023/03/09 16:12:22
* @version 4.0.0
*/
public interface NotInsertUseMapper extends UserDataScopeBaseMapper<NotInsertUseEntity> {
}

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertUseMapper.xml

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.hnac.hzims.operational.fill.mapper.NotInsertUseMapper">
</mapper>

13
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/UseMapper.java

@ -0,0 +1,13 @@
package com.hnac.hzims.operational.fill.mapper;
import com.hnac.hzims.operational.fill.entity.UseEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author ysj
* @date 2023/04/10 11:22:14
* @version 4.0.0
*/
public interface UseMapper extends UserDataScopeBaseMapper<UseEntity> {
}

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertPowerMapper.xml → hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/UseMapper.xml

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?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" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.hnac.hzims.operational.fill.mapper.InsertPowerMapper"> <mapper namespace="com.hnac.hzims.operational.fill.mapper.UseMapper">
</mapper> </mapper>

25
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/GenerateService.java

@ -0,0 +1,25 @@
package com.hnac.hzims.operational.fill.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.fill.entity.GenerateEntity;
import com.hnac.hzims.operational.fill.entity.RainfallEntity;
import com.hnac.hzims.operational.fill.vo.GenerateVo;
import com.hnac.hzims.operational.fill.vo.QueryVo;
import com.hnac.hzims.operational.fill.vo.RainfallVo;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
/**
* @author ysj
* @date 2023/04/10 11:16:07
* @version 4.0.0
*/
public interface GenerateService extends BaseService<GenerateEntity> {
// 分页查询发电量填报数据
R<IPage<GenerateVo>> pageCondition(QueryVo filter, Query query);
// 新增/修改发电量填报数据
boolean saveUpdate(GenerateEntity entity);
}

17
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/InsertPowerService.java

@ -1,17 +0,0 @@
package com.hnac.hzims.operational.fill.service;
import com.hnac.hzims.operational.fill.entity.InsertPowerEntity;
import org.springblade.core.mp.base.BaseService;
/**
* @author ysj
* @date 2023/03/09 16:12:22
* @version 4.0.0
*/
/**
* 接入电站历史发电量填报
*/
public interface InsertPowerService extends BaseService<InsertPowerEntity> {
}

18
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/InsertUseService.java

@ -1,18 +0,0 @@
package com.hnac.hzims.operational.fill.service;
import com.hnac.hzims.operational.fill.entity.InsertUseEntity;
import org.springblade.core.mp.base.BaseService;
/**
* @author ysj
* @date 2023/03/09 16:12:22
* @version 4.0.0
*/
/**
* 接入电站历史发电量填报
*/
public interface InsertUseService extends BaseService<InsertUseEntity> {
}

29
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/NotInsertPowerService.java

@ -1,29 +0,0 @@
package com.hnac.hzims.operational.fill.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.fill.entity.InsertPowerEntity;
import com.hnac.hzims.operational.fill.entity.NotInsertPowerEntity;
import com.hnac.hzims.operational.fill.vo.NotInsertPowerVo;
import com.hnac.hzims.operational.fill.vo.QueryVo;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
/**
* @author ysj
* @date 2023/03/09 16:12:22
* @version 4.0.0
*/
/**
* 接入电站历史发电量填报
*/
public interface NotInsertPowerService extends BaseService<NotInsertPowerEntity> {
// 新增/修改未接入电站发电量填报数据
boolean saveUpdate(NotInsertPowerEntity entity);
// 分页查询未接入电站发电量填报数据
R<IPage<NotInsertPowerVo>> pageCondition(QueryVo filter, Query query);
}

27
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/NotInsertUseService.java

@ -1,27 +0,0 @@
package com.hnac.hzims.operational.fill.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.fill.entity.NotInsertUseEntity;
import com.hnac.hzims.operational.fill.vo.NotInsertUseVo;
import com.hnac.hzims.operational.fill.vo.QueryVo;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
/**
* @author ysj
* @date 2023/03/09 16:12:22
* @version 4.0.0
*/
/**
* 接入电站历史发电量填报
*/
public interface NotInsertUseService extends BaseService<NotInsertUseEntity> {
// 新增/修改未接入泵站用电量填报数据
boolean saveUpdate(NotInsertUseEntity entity);
// 分页查询未接入泵站用电量填报数据
R<IPage<NotInsertUseVo>> pageCondition(QueryVo filter, Query query);
}

23
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/UseService.java

@ -0,0 +1,23 @@
package com.hnac.hzims.operational.fill.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.fill.entity.UseEntity;
import com.hnac.hzims.operational.fill.vo.QueryVo;
import com.hnac.hzims.operational.fill.vo.UseVo;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
/**
* @author ysj
* @date 2023/04/10 11:16:07
* @version 4.0.0
*/
public interface UseService extends BaseService<UseEntity> {
// 分页查询用电量填报数据
R<IPage<UseVo>> pageCondition(QueryVo filter, Query query);
// 新增/修改用电量填报数据
boolean saveUpdate(UseEntity entity);
}

81
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/GenerateServiceImpl.java

@ -0,0 +1,81 @@
package com.hnac.hzims.operational.fill.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.fill.entity.GenerateEntity;
import com.hnac.hzims.operational.fill.mapper.GenerateMapper;
import com.hnac.hzims.operational.fill.service.GenerateService;
import com.hnac.hzims.operational.fill.vo.GenerateVo;
import com.hnac.hzims.operational.fill.vo.QueryVo;
import com.hnac.hzims.operational.fill.wrapper.GenerateWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author ysj
* @date 2023/04/10 11:16:07
* @version 4.0.0
*/
@Slf4j
@Service
@AllArgsConstructor
public class GenerateServiceImpl extends BaseServiceImpl<GenerateMapper, GenerateEntity> implements GenerateService {
/**
* 分页查询发电量填报数据
* @param filter
* @param query
* @return
*/
@Override
public R<IPage<GenerateVo>> pageCondition(QueryVo filter, Query query) {
QueryWrapper<GenerateEntity> queryWrapper = new QueryWrapper<GenerateEntity>() {{
if(!StringUtil.isEmpty(filter.getStationCode())){
eq("STATION_CODE",filter.getStationCode());
}
if(!ObjectUtil.isEmpty(filter.getStartTime())){
ge("FILL_DATE",filter.getStartTime());
}
if(!ObjectUtil.isEmpty(filter.getEndTime())){
le("FILL_DATE",filter.getEndTime());
}
orderByDesc("create_time");
}};
IPage pages = super.page(Condition.getPage(query), queryWrapper);
List list = GenerateWrapper.build().listVO(pages.getRecords());
return R.data(pages.setRecords(list));
}
/**
* 新增/修改发电量填报数据
* @param entity
* @return
*/
@Override
public boolean saveUpdate(GenerateEntity entity) {
// 查询是否存在历史记录
GenerateEntity history = this.getOne(new LambdaQueryWrapper<GenerateEntity>(){{
eq(GenerateEntity::getStationCode, entity.getStationCode());
eq(GenerateEntity::getFillDate,entity.getFillDate());
}});
if(ObjectUtil.isNotEmpty(history) && (ObjectUtil.isEmpty(entity.getId()) || !entity.getId().equals(history.getId()))){
throw new ServiceException("日期已经存在填报数据!");
}
if(ObjectUtil.isEmpty(history)){
return this.save(entity);
}
return this.updateById(entity);
}
}

22
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/InsertPowerServiceImpl.java

@ -1,22 +0,0 @@
package com.hnac.hzims.operational.fill.service.impl;
import com.hnac.hzims.operational.fill.entity.InsertPowerEntity;
import com.hnac.hzims.operational.fill.mapper.InsertPowerMapper;
import com.hnac.hzims.operational.fill.service.InsertPowerService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
/**
* @author ysj
* @date 2023/03/09 16:12:22
* @version 4.0.0
*/
@Slf4j
@Service
@AllArgsConstructor
public class InsertPowerServiceImpl extends BaseServiceImpl<InsertPowerMapper, InsertPowerEntity> implements InsertPowerService {
}

22
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/InsertUseServiceImpl.java

@ -1,22 +0,0 @@
package com.hnac.hzims.operational.fill.service.impl;
import com.hnac.hzims.operational.fill.entity.InsertUseEntity;
import com.hnac.hzims.operational.fill.mapper.InsertUseMapper;
import com.hnac.hzims.operational.fill.service.InsertUseService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
/**
* @author ysj
* @date 2023/03/09 16:12:22
* @version 4.0.0
*/
@Slf4j
@Service
@AllArgsConstructor
public class InsertUseServiceImpl extends BaseServiceImpl<InsertUseMapper, InsertUseEntity> implements InsertUseService {
}

82
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/NotInsertPowerServiceImpl.java

@ -1,82 +0,0 @@
package com.hnac.hzims.operational.fill.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.fill.entity.NotInsertPowerEntity;
import com.hnac.hzims.operational.fill.entity.RainfallEntity;
import com.hnac.hzims.operational.fill.mapper.NotInsertPowerMapper;
import com.hnac.hzims.operational.fill.service.NotInsertPowerService;
import com.hnac.hzims.operational.fill.vo.NotInsertPowerVo;
import com.hnac.hzims.operational.fill.vo.QueryVo;
import com.hnac.hzims.operational.fill.wrapper.NotInsertPowerWrapper;
import com.hnac.hzims.operational.fill.wrapper.OverWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author ysj
* @date 2023/03/09 16:12:22
* @version 4.0.0
*/
@Slf4j
@Service
@AllArgsConstructor
public class NotInsertPowerServiceImpl extends BaseServiceImpl<NotInsertPowerMapper, NotInsertPowerEntity> implements NotInsertPowerService {
/**
* 分页查询未接入电站发电量填报数据
* @param filter
* @param query
* @return
*/
@Override
public R<IPage<NotInsertPowerVo>> pageCondition(QueryVo filter, Query query) {
QueryWrapper<NotInsertPowerEntity> queryWrapper = new QueryWrapper<NotInsertPowerEntity>() {{
if(!StringUtil.isEmpty(filter.getStationCode())){
eq("STATION_CODE",filter.getStationCode());
}
if(!ObjectUtil.isEmpty(filter.getStartTime())){
ge("FILL_DATE",filter.getStartTime());
}
if(!ObjectUtil.isEmpty(filter.getEndTime())){
le("FILL_DATE",filter.getEndTime());
}
orderByDesc("create_time");
}};
IPage pages = super.page(Condition.getPage(query), queryWrapper);
List list = NotInsertPowerWrapper.build().listVO(pages.getRecords());
return R.data(pages.setRecords(list));
}
/**
* 新增/修改未接入电站发电量填报数据
* @param entity
* @return
*/
@Override
public boolean saveUpdate(NotInsertPowerEntity entity) {
// 查询是否存在历史记录
NotInsertPowerEntity history = this.getOne(new LambdaQueryWrapper<NotInsertPowerEntity>(){{
eq(NotInsertPowerEntity::getStationCode, entity.getStationCode());
eq(NotInsertPowerEntity::getFillDate,entity.getFillDate());
}});
if(ObjectUtil.isNotEmpty(history) && (ObjectUtil.isEmpty(entity.getId()) || !entity.getId().equals(history.getId()))){
throw new ServiceException("日期已经存在填报数据!");
}
if(ObjectUtil.isEmpty(history)){
return this.save(entity);
}
return this.updateById(entity);
}
}

84
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/NotInsertUseServiceImpl.java

@ -1,84 +0,0 @@
package com.hnac.hzims.operational.fill.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.fill.entity.NotInsertUseEntity;
import com.hnac.hzims.operational.fill.entity.RainfallEntity;
import com.hnac.hzims.operational.fill.mapper.NotInsertUseMapper;
import com.hnac.hzims.operational.fill.service.NotInsertUseService;
import com.hnac.hzims.operational.fill.vo.NotInsertUseVo;
import com.hnac.hzims.operational.fill.vo.QueryVo;
import com.hnac.hzims.operational.fill.wrapper.NotInsertPowerWrapper;
import com.hnac.hzims.operational.fill.wrapper.NotInsertUseWrapper;
import com.hnac.hzims.operational.fill.wrapper.OverWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author ysj
* @date 2023/03/09 16:12:22
* @version 4.0.0
*/
@Slf4j
@Service
@AllArgsConstructor
public class NotInsertUseServiceImpl extends BaseServiceImpl<NotInsertUseMapper, NotInsertUseEntity> implements NotInsertUseService {
/**
* 分页查询未接入泵站用电量填报数据
* @param filter
* @param query
* @return
*/
@Override
public R<IPage<NotInsertUseVo>> pageCondition(QueryVo filter, Query query) {
QueryWrapper<NotInsertUseEntity> queryWrapper = new QueryWrapper<NotInsertUseEntity>() {{
if(!StringUtil.isEmpty(filter.getStationCode())){
eq("STATION_CODE",filter.getStationCode());
}
if(!ObjectUtil.isEmpty(filter.getStartTime())){
ge("FILL_DATE",filter.getStartTime());
}
if(!ObjectUtil.isEmpty(filter.getEndTime())){
le("FILL_DATE",filter.getEndTime());
}
orderByDesc("create_time");
}};
IPage pages = super.page(Condition.getPage(query), queryWrapper);
List list = NotInsertUseWrapper.build().listVO(pages.getRecords());
return R.data(pages.setRecords(list));
}
/**
* 新增/修改未接入泵站用电量填报数据
* @param entity
* @return
*/
@Override
public boolean saveUpdate(NotInsertUseEntity entity) {
// 查询是否存在历史记录
NotInsertUseEntity history = this.getOne(new LambdaQueryWrapper<NotInsertUseEntity>(){{
eq(NotInsertUseEntity::getStationCode, entity.getStationCode());
eq(NotInsertUseEntity::getFillDate,entity.getFillDate());
}});
if(ObjectUtil.isNotEmpty(history) && (ObjectUtil.isEmpty(entity.getId()) || !entity.getId().equals(history.getId()))){
throw new ServiceException("日期已经存在填报数据!");
}
if(ObjectUtil.isEmpty(history)){
return this.save(entity);
}
return this.updateById(entity);
}
}

81
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/UseServiceImpl.java

@ -0,0 +1,81 @@
package com.hnac.hzims.operational.fill.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.fill.entity.UseEntity;
import com.hnac.hzims.operational.fill.mapper.UseMapper;
import com.hnac.hzims.operational.fill.service.UseService;
import com.hnac.hzims.operational.fill.vo.QueryVo;
import com.hnac.hzims.operational.fill.vo.UseVo;
import com.hnac.hzims.operational.fill.wrapper.UseWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author ysj
* @date 2023/04/10 11:16:07
* @version 4.0.0
*/
@Slf4j
@Service
@AllArgsConstructor
public class UseServiceImpl extends BaseServiceImpl<UseMapper, UseEntity> implements UseService {
/**
* 分页查询用电量填报数据
* @param filter
* @param query
* @return
*/
@Override
public R<IPage<UseVo>> pageCondition(QueryVo filter, Query query) {
QueryWrapper<UseEntity> queryWrapper = new QueryWrapper<UseEntity>() {{
if(!StringUtil.isEmpty(filter.getStationCode())){
eq("STATION_CODE",filter.getStationCode());
}
if(!ObjectUtil.isEmpty(filter.getStartTime())){
ge("FILL_DATE",filter.getStartTime());
}
if(!ObjectUtil.isEmpty(filter.getEndTime())){
le("FILL_DATE",filter.getEndTime());
}
orderByDesc("create_time");
}};
IPage pages = super.page(Condition.getPage(query), queryWrapper);
List list = UseWrapper.build().listVO(pages.getRecords());
return R.data(pages.setRecords(list));
}
/**
* 新增/修改用电量填报数据
* @param entity
* @return
*/
@Override
public boolean saveUpdate(UseEntity entity) {
// 查询是否存在历史记录
UseEntity history = this.getOne(new LambdaQueryWrapper<UseEntity>(){{
eq(UseEntity::getStationCode, entity.getStationCode());
eq(UseEntity::getFillDate,entity.getFillDate());
}});
if(ObjectUtil.isNotEmpty(history) && (ObjectUtil.isEmpty(entity.getId()) || !entity.getId().equals(history.getId()))){
throw new ServiceException("日期已经存在填报数据!");
}
if(ObjectUtil.isEmpty(history)){
return this.save(entity);
}
return this.updateById(entity);
}
}

16
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/NotInsertUseWrapper.java → hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/GenerateWrapper.java

@ -1,7 +1,7 @@
package com.hnac.hzims.operational.fill.wrapper; package com.hnac.hzims.operational.fill.wrapper;
import com.hnac.hzims.operational.fill.entity.NotInsertUseEntity; import com.hnac.hzims.operational.fill.entity.GenerateEntity;
import com.hnac.hzims.operational.fill.vo.NotInsertUseVo; import com.hnac.hzims.operational.fill.vo.GenerateVo;
import org.springblade.core.mp.support.BaseEntityWrapper; import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.ObjectUtil;
@ -12,18 +12,18 @@ import java.util.Optional;
/** /**
* @author ysj * @author ysj
* @date 2023/03/17 14:34:12 * @date 2023/04/10 11:34:12
* @version 4.0.0 * @version 4.0.0
*/ */
public class NotInsertUseWrapper extends BaseEntityWrapper<NotInsertUseEntity, NotInsertUseVo> { public class GenerateWrapper extends BaseEntityWrapper<GenerateEntity, GenerateVo> {
public static NotInsertUseWrapper build() { public static GenerateWrapper build() {
return new NotInsertUseWrapper(); return new GenerateWrapper();
} }
@Override @Override
public NotInsertUseVo entityVO(NotInsertUseEntity entity) { public GenerateVo entityVO(GenerateEntity entity) {
NotInsertUseVo vo = BeanUtil.copy(entity, NotInsertUseVo.class); GenerateVo vo = BeanUtil.copy(entity, GenerateVo.class);
User createUser = UserCache.getUser(entity.getCreateUser()); User createUser = UserCache.getUser(entity.getCreateUser());
if(ObjectUtil.isEmpty(createUser)){ if(ObjectUtil.isEmpty(createUser)){
return vo; return vo;

17
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/NotInsertPowerWrapper.java → hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/UseWrapper.java

@ -1,8 +1,7 @@
package com.hnac.hzims.operational.fill.wrapper; package com.hnac.hzims.operational.fill.wrapper;
import com.hnac.hzims.operational.fill.entity.NotInsertPowerEntity; import com.hnac.hzims.operational.fill.entity.UseEntity;
import com.hnac.hzims.operational.fill.vo.NotInsertPowerVo; import com.hnac.hzims.operational.fill.vo.UseVo;
import com.hnac.hzims.operational.fill.vo.OverVo;
import org.springblade.core.mp.support.BaseEntityWrapper; import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.ObjectUtil;
@ -13,18 +12,18 @@ import java.util.Optional;
/** /**
* @author ysj * @author ysj
* @date 2023/03/17 14:34:12 * @date 2023/04/10 11:34:12
* @version 4.0.0 * @version 4.0.0
*/ */
public class NotInsertPowerWrapper extends BaseEntityWrapper<NotInsertPowerEntity, NotInsertPowerVo> { public class UseWrapper extends BaseEntityWrapper<UseEntity, UseVo> {
public static NotInsertPowerWrapper build() { public static UseWrapper build() {
return new NotInsertPowerWrapper(); return new UseWrapper();
} }
@Override @Override
public NotInsertPowerVo entityVO(NotInsertPowerEntity entity) { public UseVo entityVO(UseEntity entity) {
NotInsertPowerVo vo = BeanUtil.copy(entity, NotInsertPowerVo.class); UseVo vo = BeanUtil.copy(entity, UseVo.class);
User createUser = UserCache.getUser(entity.getCreateUser()); User createUser = UserCache.getUser(entity.getCreateUser());
if(ObjectUtil.isEmpty(createUser)){ if(ObjectUtil.isEmpty(createUser)){
return vo; return vo;
Loading…
Cancel
Save