haungxing
2 years ago
43 changed files with 546 additions and 769 deletions
@ -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; |
||||
} |
@ -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; |
||||
} |
@ -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; |
@ -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; |
@ -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); |
||||
} |
||||
|
||||
} |
@ -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); |
||||
}*/ |
||||
} |
@ -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); |
||||
}*/ |
||||
} |
@ -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); |
||||
} |
||||
} |
@ -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); |
||||
} |
||||
} |
@ -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); |
||||
} |
||||
|
||||
} |
@ -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> { |
||||
|
||||
} |
@ -1,5 +1,4 @@
|
||||
<?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.InsertUseMapper"> |
||||
|
||||
<mapper namespace="com.hnac.hzims.operational.fill.mapper.GenerateMapper"> |
||||
</mapper> |
@ -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> { |
||||
|
||||
} |
@ -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> { |
||||
|
||||
} |
@ -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> { |
||||
|
||||
} |
@ -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> |
@ -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> { |
||||
|
||||
} |
@ -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> |
@ -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> { |
||||
|
||||
} |
@ -1,5 +1,4 @@
|
||||
<?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.InsertPowerMapper"> |
||||
|
||||
<mapper namespace="com.hnac.hzims.operational.fill.mapper.UseMapper"> |
||||
</mapper> |
@ -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); |
||||
} |
@ -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> { |
||||
|
||||
|
||||
} |
@ -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> { |
||||
|
||||
|
||||
} |
@ -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); |
||||
} |
@ -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); |
||||
} |
@ -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); |
||||
} |
@ -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); |
||||
} |
||||
|
||||
} |
@ -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 { |
||||
|
||||
|
||||
} |
@ -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 { |
||||
|
||||
|
||||
} |
@ -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); |
||||
} |
||||
} |
@ -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); |
||||
} |
||||
} |
@ -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); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue