diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/GenerateEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/GenerateEntity.java new file mode 100644 index 0000000..1da1247 --- /dev/null +++ b/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; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/UseEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/UseEntity.java new file mode 100644 index 0000000..9611d69 --- /dev/null +++ b/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; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/vo/NotInsertUseVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/vo/GenerateVo.java similarity index 59% rename from hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/vo/NotInsertUseVo.java rename to hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/vo/GenerateVo.java index 2c7c563..b15e955 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/vo/NotInsertUseVo.java +++ b/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; -import com.hnac.hzims.operational.fill.entity.NotInsertUseEntity; +import com.hnac.hzims.operational.fill.entity.GenerateEntity; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @author ysj - * @date 2023/03/17 14:34:12 + * @date 2023/04/10 11:30:33 * @version 4.0.0 */ @Data -public class NotInsertUseVo extends NotInsertUseEntity { +public class GenerateVo extends GenerateEntity { @ApiModelProperty("用户名称") private String userName; diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/vo/NotInsertPowerVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/vo/UseVo.java similarity index 51% rename from hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/vo/NotInsertPowerVo.java rename to hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/vo/UseVo.java index ccf8697..c777be4 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/vo/NotInsertPowerVo.java +++ b/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; -import com.hnac.hzims.operational.fill.entity.NotInsertPowerEntity; -import com.hnac.hzims.operational.fill.entity.OverEntity; +import com.hnac.hzims.operational.fill.entity.UseEntity; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @author ysj - * @date 2023/03/17 14:34:12 + * @date 2023/04/10 11:30:33 * @version 4.0.0 */ @Data -public class NotInsertPowerVo extends NotInsertPowerEntity { +public class UseVo extends UseEntity { @ApiModelProperty("用户名称") private String userName; diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEntity.java index 91ddda9..a00021f 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEntity.java +++ b/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) private Long refDept; - @ApiModelProperty("数据来源") + @ApiModelProperty("数据来源: 0 - 数据采集 1 - 数据填报") + @QueryField(condition = SqlCondition.EQUAL) + private String dataOrigin; + + @ApiModelProperty("数据采集方式") @QueryField(condition = SqlCondition.EQUAL) private String dataSource; @@ -147,7 +151,4 @@ public class StationEntity extends TenantEntity implements Serializable { @ApiModelProperty("实时画面绑定账号秘钥") private String secretKey; - - @ApiModelProperty("光伏站点配置类型: 0-个体光伏站 1-厂房光伏站") - private Long photovoltaicType; } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/GenerateController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/GenerateController.java new file mode 100644 index 0000000..ea2e873 --- /dev/null +++ b/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> list(QueryVo filter, Query query) { + return service.pageCondition(filter, query); + } + +} \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/InsertPowerController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/InsertPowerController.java deleted file mode 100644 index f9ecfb7..0000000 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/InsertPowerController.java +++ /dev/null @@ -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> list(OtherVo vo, Query query) { - return service.pageCondition(vo, query); - }*/ -} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/InsertUseController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/InsertUseController.java deleted file mode 100644 index 8138d3b..0000000 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/InsertUseController.java +++ /dev/null @@ -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> list(OtherVo vo, Query query) { - return service.pageCondition(vo, query); - }*/ -} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/NotInsertPowerController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/NotInsertPowerController.java deleted file mode 100644 index c19f8a3..0000000 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/NotInsertPowerController.java +++ /dev/null @@ -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> list(QueryVo filter, Query query) { - return service.pageCondition(filter, query); - } -} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/NotInsertUseController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/NotInsertUseController.java deleted file mode 100644 index 4e0615c..0000000 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/NotInsertUseController.java +++ /dev/null @@ -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> list(QueryVo filter, Query query) { - return service.pageCondition(filter, query); - } -} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/UseController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/UseController.java new file mode 100644 index 0000000..d8ab1c0 --- /dev/null +++ b/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> list(QueryVo filter, Query query) { + return service.pageCondition(filter, query); + } + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/GenerateMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/GenerateMapper.java new file mode 100644 index 0000000..c7c9905 --- /dev/null +++ b/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 { + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertUseMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/GenerateMapper.xml similarity index 67% rename from hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertUseMapper.xml rename to hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/GenerateMapper.xml index b325207..d937e42 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertUseMapper.xml +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/GenerateMapper.xml @@ -1,5 +1,4 @@ - - + diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertPowerMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertPowerMapper.java deleted file mode 100644 index cdfbda1..0000000 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertPowerMapper.java +++ /dev/null @@ -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 { - -} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertUseMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertUseMapper.java deleted file mode 100644 index 347d75b..0000000 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertUseMapper.java +++ /dev/null @@ -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 { - -} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertPowerMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertPowerMapper.java deleted file mode 100644 index 97f39f0..0000000 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertPowerMapper.java +++ /dev/null @@ -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 { - -} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertPowerMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertPowerMapper.xml deleted file mode 100644 index 9b9758d..0000000 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertPowerMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertUseMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertUseMapper.java deleted file mode 100644 index 876157c..0000000 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertUseMapper.java +++ /dev/null @@ -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 { - -} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertUseMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertUseMapper.xml deleted file mode 100644 index b5062bb..0000000 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertUseMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/UseMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/UseMapper.java new file mode 100644 index 0000000..44f4a8b --- /dev/null +++ b/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 { + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertPowerMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/UseMapper.xml similarity index 66% rename from hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertPowerMapper.xml rename to hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/UseMapper.xml index 16bdc6f..e395e3b 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertPowerMapper.xml +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/UseMapper.xml @@ -1,5 +1,4 @@ - - + diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/GenerateService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/GenerateService.java new file mode 100644 index 0000000..0bd1f45 --- /dev/null +++ b/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 { + + // 分页查询发电量填报数据 + R> pageCondition(QueryVo filter, Query query); + + // 新增/修改发电量填报数据 + boolean saveUpdate(GenerateEntity entity); +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/InsertPowerService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/InsertPowerService.java deleted file mode 100644 index a2a8729..0000000 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/InsertPowerService.java +++ /dev/null @@ -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 { - - -} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/InsertUseService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/InsertUseService.java deleted file mode 100644 index 95fd0c3..0000000 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/InsertUseService.java +++ /dev/null @@ -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 { - - -} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/NotInsertPowerService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/NotInsertPowerService.java deleted file mode 100644 index a126cf8..0000000 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/NotInsertPowerService.java +++ /dev/null @@ -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 { - - - // 新增/修改未接入电站发电量填报数据 - boolean saveUpdate(NotInsertPowerEntity entity); - - // 分页查询未接入电站发电量填报数据 - R> pageCondition(QueryVo filter, Query query); -} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/NotInsertUseService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/NotInsertUseService.java deleted file mode 100644 index 5a52b35..0000000 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/NotInsertUseService.java +++ /dev/null @@ -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 { - - // 新增/修改未接入泵站用电量填报数据 - boolean saveUpdate(NotInsertUseEntity entity); - - // 分页查询未接入泵站用电量填报数据 - R> pageCondition(QueryVo filter, Query query); -} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/UseService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/UseService.java new file mode 100644 index 0000000..e25c60e --- /dev/null +++ b/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 { + + // 分页查询用电量填报数据 + R> pageCondition(QueryVo filter, Query query); + + // 新增/修改用电量填报数据 + boolean saveUpdate(UseEntity entity); +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/GenerateServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/GenerateServiceImpl.java new file mode 100644 index 0000000..1d1e2ae --- /dev/null +++ b/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 implements GenerateService { + + /** + * 分页查询发电量填报数据 + * @param filter + * @param query + * @return + */ + @Override + public R> pageCondition(QueryVo filter, Query query) { + QueryWrapper queryWrapper = new QueryWrapper() {{ + 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(){{ + 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); + } + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/InsertPowerServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/InsertPowerServiceImpl.java deleted file mode 100644 index 11717d9..0000000 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/InsertPowerServiceImpl.java +++ /dev/null @@ -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 implements InsertPowerService { - - -} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/InsertUseServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/InsertUseServiceImpl.java deleted file mode 100644 index 0a079c7..0000000 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/InsertUseServiceImpl.java +++ /dev/null @@ -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 implements InsertUseService { - - -} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/NotInsertPowerServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/NotInsertPowerServiceImpl.java deleted file mode 100644 index 690f29b..0000000 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/NotInsertPowerServiceImpl.java +++ /dev/null @@ -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 implements NotInsertPowerService { - - /** - * 分页查询未接入电站发电量填报数据 - * @param filter - * @param query - * @return - */ - @Override - public R> pageCondition(QueryVo filter, Query query) { - QueryWrapper queryWrapper = new QueryWrapper() {{ - 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(){{ - 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); - } -} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/NotInsertUseServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/NotInsertUseServiceImpl.java deleted file mode 100644 index d9584e6..0000000 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/NotInsertUseServiceImpl.java +++ /dev/null @@ -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 implements NotInsertUseService { - - - /** - * 分页查询未接入泵站用电量填报数据 - * @param filter - * @param query - * @return - */ - @Override - public R> pageCondition(QueryVo filter, Query query) { - QueryWrapper queryWrapper = new QueryWrapper() {{ - 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(){{ - 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); - } -} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/UseServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/UseServiceImpl.java new file mode 100644 index 0000000..5093822 --- /dev/null +++ b/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 implements UseService { + + /** + * 分页查询用电量填报数据 + * @param filter + * @param query + * @return + */ + @Override + public R> pageCondition(QueryVo filter, Query query) { + QueryWrapper queryWrapper = new QueryWrapper() {{ + 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(){{ + 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); + } + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/NotInsertUseWrapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/GenerateWrapper.java similarity index 57% rename from hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/NotInsertUseWrapper.java rename to hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/GenerateWrapper.java index deb7598..a61aaa7 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/NotInsertUseWrapper.java +++ b/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; -import com.hnac.hzims.operational.fill.entity.NotInsertUseEntity; -import com.hnac.hzims.operational.fill.vo.NotInsertUseVo; +import com.hnac.hzims.operational.fill.entity.GenerateEntity; +import com.hnac.hzims.operational.fill.vo.GenerateVo; import org.springblade.core.mp.support.BaseEntityWrapper; import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.ObjectUtil; @@ -12,18 +12,18 @@ import java.util.Optional; /** * @author ysj - * @date 2023/03/17 14:34:12 + * @date 2023/04/10 11:34:12 * @version 4.0.0 */ -public class NotInsertUseWrapper extends BaseEntityWrapper { +public class GenerateWrapper extends BaseEntityWrapper { - public static NotInsertUseWrapper build() { - return new NotInsertUseWrapper(); + public static GenerateWrapper build() { + return new GenerateWrapper(); } @Override - public NotInsertUseVo entityVO(NotInsertUseEntity entity) { - NotInsertUseVo vo = BeanUtil.copy(entity, NotInsertUseVo.class); + public GenerateVo entityVO(GenerateEntity entity) { + GenerateVo vo = BeanUtil.copy(entity, GenerateVo.class); User createUser = UserCache.getUser(entity.getCreateUser()); if(ObjectUtil.isEmpty(createUser)){ return vo; diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/NotInsertPowerWrapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/UseWrapper.java similarity index 54% rename from hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/NotInsertPowerWrapper.java rename to hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/UseWrapper.java index 1dd60e9..d8f53b6 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/NotInsertPowerWrapper.java +++ b/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; -import com.hnac.hzims.operational.fill.entity.NotInsertPowerEntity; -import com.hnac.hzims.operational.fill.vo.NotInsertPowerVo; -import com.hnac.hzims.operational.fill.vo.OverVo; +import com.hnac.hzims.operational.fill.entity.UseEntity; +import com.hnac.hzims.operational.fill.vo.UseVo; import org.springblade.core.mp.support.BaseEntityWrapper; import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.ObjectUtil; @@ -13,18 +12,18 @@ import java.util.Optional; /** * @author ysj - * @date 2023/03/17 14:34:12 + * @date 2023/04/10 11:34:12 * @version 4.0.0 */ -public class NotInsertPowerWrapper extends BaseEntityWrapper { +public class UseWrapper extends BaseEntityWrapper { - public static NotInsertPowerWrapper build() { - return new NotInsertPowerWrapper(); + public static UseWrapper build() { + return new UseWrapper(); } @Override - public NotInsertPowerVo entityVO(NotInsertPowerEntity entity) { - NotInsertPowerVo vo = BeanUtil.copy(entity, NotInsertPowerVo.class); + public UseVo entityVO(UseEntity entity) { + UseVo vo = BeanUtil.copy(entity, UseVo.class); User createUser = UserCache.getUser(entity.getCreateUser()); if(ObjectUtil.isEmpty(createUser)){ return vo;