From 8012a8b99256bd714f5ad48d9a1c75ba4c5fb779 Mon Sep 17 00:00:00 2001 From: eric777 Date: Wed, 31 Jan 2024 11:14:26 +0800 Subject: [PATCH] =?UTF-8?q?jiahan.wu[CR]=20bi=E5=A4=A7=E5=B1=8F=E9=9B=86?= =?UTF-8?q?=E5=9B=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/core/domain/entity/SysDept.java | 7 + .../com/lzbi/common/enums/ReportNameEnum.java | 27 ++ .../DcBusiDataScreenMainController.java | 202 ++----------- .../controller/SysDeptLocationController.java | 131 +++++++++ .../bi/domain/DcBusiReportTargetConfig.java | 16 +- .../com/lzbi/bi/domain/SysDeptLocation.java | 62 ++++ .../bi/mapper/DcBusiDataScreenMainMapper.java | 2 +- .../lzbi/bi/mapper/SysDeptLocationMapper.java | 63 ++++ .../service/DcBusiDataScreenMainService.java | 268 +++++++++++++++++- .../bi/service/SysDeptLocationService.java | 92 ++++++ .../domain/vo/TargetDraftDaynewReqVo.java | 9 + .../domain/vo/TargetDraftDaynewResVo.java | 5 +- .../java/com/lzbi/module/base/BaseEntity.java | 78 +++++ .../mapper/SysDeptLocationMapper.xml | 98 +++++++ .../asset/DcBusiTargetDraftDaynewMapper.xml | 20 +- .../lzbi/system/service/ISysDeptService.java | 2 + .../service/impl/SysDeptServiceImpl.java | 4 + 17 files changed, 885 insertions(+), 201 deletions(-) create mode 100644 lzbi-common/src/main/java/com/lzbi/common/enums/ReportNameEnum.java create mode 100644 lzbi-module/src/main/java/com/lzbi/bi/controller/SysDeptLocationController.java create mode 100644 lzbi-module/src/main/java/com/lzbi/bi/domain/SysDeptLocation.java create mode 100644 lzbi-module/src/main/java/com/lzbi/bi/mapper/SysDeptLocationMapper.java create mode 100644 lzbi-module/src/main/java/com/lzbi/bi/service/SysDeptLocationService.java create mode 100644 lzbi-module/src/main/java/com/lzbi/module/base/BaseEntity.java create mode 100644 lzbi-module/src/main/resources/mapper/SysDeptLocationMapper.xml diff --git a/lzbi-common/src/main/java/com/lzbi/common/core/domain/entity/SysDept.java b/lzbi-common/src/main/java/com/lzbi/common/core/domain/entity/SysDept.java index bff42e7..db9c545 100644 --- a/lzbi-common/src/main/java/com/lzbi/common/core/domain/entity/SysDept.java +++ b/lzbi-common/src/main/java/com/lzbi/common/core/domain/entity/SysDept.java @@ -6,6 +6,10 @@ import javax.validation.constraints.Email; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.NoArgsConstructor; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.lzbi.common.core.domain.BaseEntity; @@ -15,6 +19,9 @@ import com.lzbi.common.core.domain.BaseEntity; * * @author ruoyi */ +@Builder +@NoArgsConstructor +@AllArgsConstructor public class SysDept extends BaseEntity { private static final long serialVersionUID = 1L; diff --git a/lzbi-common/src/main/java/com/lzbi/common/enums/ReportNameEnum.java b/lzbi-common/src/main/java/com/lzbi/common/enums/ReportNameEnum.java new file mode 100644 index 0000000..d452176 --- /dev/null +++ b/lzbi-common/src/main/java/com/lzbi/common/enums/ReportNameEnum.java @@ -0,0 +1,27 @@ +package com.lzbi.common.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum ReportNameEnum +{ + + TOTAL_GENERATING_CAPACITY("总发电量"), + TOTAL_ELECTRICITY_CONSUMPTION("总用电量"), + NET_AREA("在网面积"), + NETWORK_AREA("联网面积"), + TOTAL_HEAT_PRODUCTION("总产热量"), + HEAT_RATE("热耗率"), + COAL_CONSUMPTION("实际煤耗"), + COAL_CONSUMPTION_PER_UNIT("标煤单耗"), + FIRST_NETWORK_WATER_CONSUMPTION_RATE("一次网耗水率"), + SECOND_NETWORK_WATER_CONSUMPTION_RATE("二次网耗水率"), + PRIMARY_NET_RECHARGE_WATER("一次网补水量"), + DATANG_PRIMARY_NET_RECHARGE_WATER("从大唐补一次网水量"), + POWER_CONSUMPTION_RATE_OF_HEAT_SOURCE_PLANT("热源厂电耗率"); + + private final String name; + +} diff --git a/lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenMainController.java b/lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenMainController.java index b70c3f7..e4edc73 100644 --- a/lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenMainController.java +++ b/lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenMainController.java @@ -13,6 +13,7 @@ import com.lzbi.common.core.domain.AjaxResult; import com.lzbi.common.core.domain.TreeSelect; import com.lzbi.common.core.domain.entity.SysDept; import com.lzbi.common.utils.StringUtils; +import com.lzbi.draft.domain.vo.TargetDraftDaynewReqVo; import com.lzbi.system.service.impl.SysDeptServiceImpl; import io.swagger.annotations.Api; import lombok.extern.slf4j.Slf4j; @@ -58,131 +59,36 @@ public class DcBusiDataScreenMainController extends BaseController{ * 大屏数据煤耗 * @return */ - @GetMapping("/coalLostRate") - public AjaxResult getCoalLostRate() + @PostMapping("/coalLostRate") + public AjaxResult getCoalLostRate(@RequestBody TargetDraftDaynewReqVo vo) { - String qdate= "2023-11";//DateUtil.format(DateUtil.date(),"yyyy-MM"); - List maps = dcBusiDataScreenMainService.selectCoalLostByDate(qdate); - JSONArray product=new JSONArray(); - JSONArray realcost=new JSONArray(); - //JSONArray plancost=new JSONArray(); - //company_name,'总煤耗' as coallost,count_date,target_unit monthAll - product.add("product"); - realcost.add("实际煤耗"); - AtomicReference unit = new AtomicReference<>(); - maps.forEach(item->{ - product.add(item.getCompanyName()); - realcost.add(item.getMonthAll()); - unit.set(item.getTargetUnit()); - }); - JSONArray list=new JSONArray(); - list.add(product); - list.add(realcost); - JSONObject ret=new JSONObject(); - ret.put("source",list); - ret.put("unit",unit.get()); - return AjaxResult.success(ret); + return AjaxResult.success(dcBusiDataScreenMainService.getCoalLostRate(vo)); } /** * 总发电量和总耗电量 * * */ - @GetMapping("/powerInfoAll") - public AjaxResult getPowerInfoAll() + @PostMapping("/powerInfoAll") + public AjaxResult getPowerInfoAll(@RequestBody TargetDraftDaynewReqVo vo) { - String qdate= "2023-11"; //DateUtil.format(DateUtil.date(),"yyyy-MM"); - List maps = dcBusiDataScreenMainService.selectPowerAll(qdate); - JSONArray list=new JSONArray(); - AtomicReference unit = new AtomicReference<>(); - maps.forEach(item->{ - JSONObject jsb=new JSONObject(); - jsb.put("name",item.getCompanyName()); - jsb.put("value",StringUtils.getfomatDouble(item.getMonthAll())); - jsb.put("unit",item.getTargetUnit()); - list.add(jsb); - }); - JSONObject ret=new JSONObject(); - ret.put("source",list); - return AjaxResult.success(ret); + return AjaxResult.success(dcBusiDataScreenMainService.selectPowerAll(vo)); } /** * 供热公司面积 * * */ - @GetMapping("/squareInfoCompany") - public AjaxResult getSquareInfoCompany() + @PostMapping("/squareInfoCompany") + public AjaxResult getSquareInfoCompany(@RequestBody TargetDraftDaynewReqVo vo) { - String qdate= "2023-11"; //DateUtil.format(DateUtil.date(),"yyyy-MM"); - List real = dcBusiDataScreenMainService.selectSquareRealDetail(qdate); - List self = dcBusiDataScreenMainService.selectSquareSelfDetail(qdate); - List group = dcBusiDataScreenMainService.selectSquareGroup(qdate); - JSONArray product=new JSONArray(); - JSONArray realcost=new JSONArray(); - product.add("real_name"); - realcost.add("在网面积"); - AtomicReference unit = new AtomicReference<>(); - real.forEach(item->{ - product.add(item.getCompanyName()); - realcost.add(StringUtils.getfomatDouble(item.getMonthAll())); - unit.set(item.getTargetUnit()); - }); - //JSONArray product_2=new JSONArray(); - JSONArray realcost_2=new JSONArray(); - //product_2.add("self_name"); - realcost_2.add("联网面积"); - self.forEach(item->{ - //product_2.add(item.getCompanyName()); - realcost_2.add(StringUtils.getfomatDouble(item.getMonthAll())); - //unit.set(item.getTargetUnit()); - }); - JSONArray list=new JSONArray(); - list.add(product); - list.add(realcost); - list.add(realcost_2); - JSONObject ret=new JSONObject(); - ret.put("source",list); - ret.put("unit",unit.get()); - group.forEach(item->{ - ret.put(item.getCoallost(),StringUtils.getfomatDouble(item.getMonthAll())); - }); - return AjaxResult.success(ret); + return AjaxResult.success(dcBusiDataScreenMainService.getSquareInfoCompany(vo)); } /** * 集团面积饼状图 * */ - @GetMapping("/squareInfoGroup") - public AjaxResult getSquareInfoGroup() + @PostMapping("/squareInfoGroup") + public AjaxResult getSquareInfoGroup(@RequestBody TargetDraftDaynewReqVo vo) { - String qdate= "2023-11";//DateUtil.format(DateUtil.date(),"yyyy-MM"); - List real = dcBusiDataScreenMainService.selectSquareRealDetail(qdate); - List self = dcBusiDataScreenMainService.selectSquareSelfDetail(qdate); - List group = dcBusiDataScreenMainService.selectSquareGroup(qdate); - JSONObject all=new JSONObject(); - group.forEach(item->{ - all.put(item.getCoallost(),StringUtils.getfomatDouble(item.getMonthAll())); - all.put("unit",item.getTargetUnit()); - }); - JSONArray out=new JSONArray(); - real.forEach(item->{ - JSONObject tmp=new JSONObject(); - tmp.put("name",item.getCompanyName()); - tmp.put("value",StringUtils.getfomatDouble(item.getMonthAll())); - tmp.put("unit",item.getTargetUnit()); - out.add(tmp); - }); - JSONArray in=new JSONArray(); - self.forEach(item->{ - JSONObject tmp=new JSONObject(); - tmp.put("name",item.getCompanyName()); - tmp.put("value",StringUtils.getfomatDouble(item.getMonthAll())); - tmp.put("unit",item.getTargetUnit()); - in.add(tmp); - }); - JSONObject ret=new JSONObject(); - ret.put("all",all); - ret.put("outCircle",out); - ret.put("inCircle",in); - return AjaxResult.success(ret); + return AjaxResult.success(dcBusiDataScreenMainService.getSquareInfoGroup(vo)); } /** * 获取天气信息 @@ -232,82 +138,22 @@ public class DcBusiDataScreenMainController extends BaseController{ /** * 获取电耗 * */ - @GetMapping("/powerLostRate") - public AjaxResult getPowerLostRate(){ - String qdate= "2023-11";//DateUtil.format(DateUtil.date(),"yyyy-MM"); - List data = dcBusiDataScreenMainService.selectDataPowerLost(qdate); - JSONArray product=new JSONArray(); - JSONArray realcost=new JSONArray(); - product.add("product"); - realcost.add("总电耗"); - AtomicReference unit = new AtomicReference<>(); - data.forEach(item->{ - product.add(item.getCompanyName()); - realcost.add(item.getMonthAll()); - unit.set(item.getTargetUnit()); - }); - JSONArray list=new JSONArray(); - list.add(product); - list.add(realcost); - JSONObject ret=new JSONObject(); - ret.put("source",list); - ret.put("unit",unit.get()); - return AjaxResult.success(ret); + @PostMapping("/powerLostRate") + public AjaxResult getPowerLostRate(@RequestBody TargetDraftDaynewReqVo vo){ + return AjaxResult.success(dcBusiDataScreenMainService.getPowerLostRate(vo)); } /** * 获取水耗 * */ - @GetMapping("/waterInfo") - public AjaxResult getWaterInfo(){ - String qdate= "2023-11";// DateUtil.format(DateUtil.date(),"yyyy-MM"); - List data_1 = dcBusiDataScreenMainService.selectDataWaterLostFirst(qdate); - List data_2 = dcBusiDataScreenMainService.selectDataWaterLostSecond(qdate); - List data_3 = dcBusiDataScreenMainService.selectDataWaterLostStationAll(qdate); + @PostMapping("/waterInfo") + public AjaxResult getWaterInfo(@RequestBody TargetDraftDaynewReqVo vo){ - AtomicReference unit = new AtomicReference<>(); - Map company=new HashMap<>(); - data_1.forEach(item->{ - JSONObject jsb=new JSONObject(); - jsb.put("name",item.getCompanyName()); - jsb.put("field1",StringUtils.getfomatDouble(item.getMonthAll())); - jsb.put("field2","0.00"); - jsb.put("field3","0.00"); - company.put(item.getCompanyName(),jsb); - }); - data_2.forEach(item->{ - JSONObject jsb=company.get(item.getCompanyName()); - if(StringUtils.isNull(jsb)){ - jsb=new JSONObject(); - jsb.put("name",item.getCompanyName()); - jsb.put("field1","0.00"); - jsb.put("field2",StringUtils.getfomatDouble(item.getMonthAll())); - jsb.put("field3","0.00"); - company.put(item.getCompanyName(),jsb); - }else{ - jsb.put("field2",StringUtils.getfomatDouble(item.getMonthAll())); - } - }); - data_3.forEach(item->{ - JSONObject jsb=company.get(item.getCompanyName()); - if(StringUtils.isNull(jsb)){ - jsb=new JSONObject(); - jsb.put("name",item.getCompanyName()); - jsb.put("field1","0.00"); - jsb.put("field3",StringUtils.getfomatDouble(item.getMonthAll())); - jsb.put("field2","0.00"); - company.put(item.getCompanyName(),jsb); - }else{ - jsb.put("field3",StringUtils.getfomatDouble(item.getMonthAll())); - } - }); - JSONObject ret=new JSONObject(); - JSONArray jsonArray=new JSONArray(); - company.entrySet().forEach(item->{ - jsonArray.add(item.getValue()); - }); - ret.put("source",jsonArray); - //ret.put("unit",unit.get()); - return AjaxResult.success(ret); + return AjaxResult.success(dcBusiDataScreenMainService.getWaterInfo(vo)); + } + @PostMapping("/mapInfo") + public AjaxResult getMapInfo(@RequestBody TargetDraftDaynewReqVo vo){ + + return AjaxResult.success(dcBusiDataScreenMainService.getMapInfo(vo)); } @GetMapping("/company/tree/{depId}") diff --git a/lzbi-module/src/main/java/com/lzbi/bi/controller/SysDeptLocationController.java b/lzbi-module/src/main/java/com/lzbi/bi/controller/SysDeptLocationController.java new file mode 100644 index 0000000..5e4ece8 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bi/controller/SysDeptLocationController.java @@ -0,0 +1,131 @@ +package com.lzbi.bi.controller; +import com.lzbi.bi.domain.SysDeptLocation; +import com.lzbi.bi.service.SysDeptLocationService; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.lzbi.common.annotation.Log; +import com.lzbi.common.core.controller.BaseController; +import com.lzbi.common.core.domain.AjaxResult; +import com.lzbi.common.enums.BusinessType; +import com.lzbi.common.utils.poi.ExcelUtil; +import com.lzbi.common.core.page.TableDataInfo; + +/** + * 部门位置Controller + * + * @author win + * @date 2024-01-30 + */ +@RestController +@RequestMapping("/lzbi/location") +public class SysDeptLocationController extends BaseController +{ + @Autowired + private SysDeptLocationService sysDeptLocationService; + + /** + * 查询部门位置列表 + */ + @ApiOperation("查询部门位置列表") + @ApiImplicitParams({ + @ApiImplicitParam(name = "SysDeptLocation", value = "", dataType = "SysDeptLocation", dataTypeClass = SysDeptLocation.class), + }) + @PreAuthorize("@ss.hasPermi('lzbi:location:list')") + @GetMapping("/list") + public TableDataInfo list(SysDeptLocation SysDeptLocation) + { + startPage(); + List< SysDeptLocation> list = sysDeptLocationService.selectSysDeptLocationList(SysDeptLocation); + return getDataTable(list); + } + + /** + * 导出部门位置列表 + */ + @ApiOperation("导出部门位置列表") + @ApiImplicitParams({ + @ApiImplicitParam(name = "SysDeptLocation", value = "", dataType = "SysDeptLocation", dataTypeClass = SysDeptLocation.class), + }) + @PreAuthorize("@ss.hasPermi('lzbi:location:export')") + @Log(title = "部门位置", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response,SysDeptLocation SysDeptLocation) + { + List list = sysDeptLocationService.selectSysDeptLocationList(SysDeptLocation); + ExcelUtil util = new ExcelUtil(SysDeptLocation.class); + util.exportExcel(response, list, "部门位置数据"); + } + + /** + * 获取部门位置详细信息 + */ + @ApiOperation("获取部门位置详细信息") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "", dataType = "Long", dataTypeClass = Long.class), + }) + @PreAuthorize("@ss.hasPermi('lzbi:location:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(sysDeptLocationService.selectSysDeptLocationById(id)); + } + + /** + * 新增部门位置 + */ + @ApiOperation("新增部门位置") + @ApiImplicitParams({ + @ApiImplicitParam(name = "SysDeptLocation", value = "", dataType = "SysDeptLocation", dataTypeClass = SysDeptLocation.class), + }) + @PreAuthorize("@ss.hasPermi('lzbi:location:add')") + @Log(title = "部门位置", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody SysDeptLocation SysDeptLocation) + { + return toAjax(sysDeptLocationService.insertSysDeptLocation(SysDeptLocation)); + } + + /** + * 修改部门位置 + */ + + @ApiOperation("修改部门位置") + @ApiImplicitParams({ + @ApiImplicitParam(name = "SysDeptLocation", value = "", dataType = "SysDeptLocation", dataTypeClass = SysDeptLocation.class), + }) + @PreAuthorize("@ss.hasPermi('lzbi:location:edit')") + @Log(title = "部门位置", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SysDeptLocation SysDeptLocation) + { + return toAjax(sysDeptLocationService.updateSysDeptLocation(SysDeptLocation)); + } + + /** + * 删除部门位置 + */ + @ApiOperation("删除部门位置") + @ApiImplicitParams({ + @ApiImplicitParam(name = "ids", value = "", dataType = "Long", dataTypeClass =Long.class), + }) + @PreAuthorize("@ss.hasPermi('lzbi:location:remove')") + @Log(title = "部门位置", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(sysDeptLocationService.deleteSysDeptLocationByIds(ids)); + } +} diff --git a/lzbi-module/src/main/java/com/lzbi/bi/domain/DcBusiReportTargetConfig.java b/lzbi-module/src/main/java/com/lzbi/bi/domain/DcBusiReportTargetConfig.java index 57d746f..78f9638 100644 --- a/lzbi-module/src/main/java/com/lzbi/bi/domain/DcBusiReportTargetConfig.java +++ b/lzbi-module/src/main/java/com/lzbi/bi/domain/DcBusiReportTargetConfig.java @@ -1,17 +1,15 @@ package com.lzbi.bi.domain; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; +import com.lzbi.common.annotation.Excel; +import com.lzbi.module.base.BaseEntity; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Builder; -import lombok.NoArgsConstructor; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; import lombok.Data; -import io.swagger.annotations.ApiModelProperty; +import lombok.NoArgsConstructor; import lombok.experimental.Accessors; -import com.lzbi.common.annotation.Excel; -import com.lzbi.module.base.BaseModuleEntity; + +import java.util.Date; /** * 图指标配置对象 dc_busi_report_target_config @@ -24,7 +22,7 @@ import com.lzbi.module.base.BaseModuleEntity; @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) -public class DcBusiReportTargetConfig extends BaseModuleEntity +public class DcBusiReportTargetConfig extends BaseEntity { private static final long serialVersionUID = 1L; diff --git a/lzbi-module/src/main/java/com/lzbi/bi/domain/SysDeptLocation.java b/lzbi-module/src/main/java/com/lzbi/bi/domain/SysDeptLocation.java new file mode 100644 index 0000000..4f1fa3a --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bi/domain/SysDeptLocation.java @@ -0,0 +1,62 @@ +package com.lzbi.bi.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.lzbi.module.base.BaseEntity; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import lombok.Data; +import io.swagger.annotations.ApiModelProperty; +import lombok.experimental.Accessors; +import com.lzbi.common.annotation.Excel; +import com.lzbi.module.base.BaseModuleEntity; + +/** + * 部门位置对象 sys_dept_location + * + * @author win + * @date 2024-01-30 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Accessors(chain = true) +public class SysDeptLocation extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 创建人 */ + private String createdBy; + + /** 创建时间 */ + private Date createdTime; + + /** 更新人 */ + private String updatedBy; + + /** 更新时间 */ + private Date updatedTime; + + /** ID */ + private Long id; + + /** 组织ID */ + @Excel(name = "组织ID") + @ApiModelProperty(name = "组织ID",notes = "orgId") + private Long orgId; + + /** 纬度 */ + @Excel(name = "纬度") + @ApiModelProperty(name = "纬度",notes = "latValue") + private String latValue; + + /** 经度 */ + @Excel(name = "经度") + @ApiModelProperty(name = "经度",notes = "lonValue") + private String lonValue; + +} diff --git a/lzbi-module/src/main/java/com/lzbi/bi/mapper/DcBusiDataScreenMainMapper.java b/lzbi-module/src/main/java/com/lzbi/bi/mapper/DcBusiDataScreenMainMapper.java index 222343c..31fdbcb 100644 --- a/lzbi-module/src/main/java/com/lzbi/bi/mapper/DcBusiDataScreenMainMapper.java +++ b/lzbi-module/src/main/java/com/lzbi/bi/mapper/DcBusiDataScreenMainMapper.java @@ -21,7 +21,7 @@ public interface DcBusiDataScreenMainMapper extends BaseMapper selectDataWaterLostFirst(String qdate); List selectDataWaterLostSecond(String qdate); List selectDataWaterLostStationAll(String qdate); - List selectPowerAll(String qdate); + List selectPowerAll(List reportNames, String assetCode); List selectSquareRealDetail(String qdate); List selectSquareSelfDetail(String qdate); List selectSquareGroup(String qdate); diff --git a/lzbi-module/src/main/java/com/lzbi/bi/mapper/SysDeptLocationMapper.java b/lzbi-module/src/main/java/com/lzbi/bi/mapper/SysDeptLocationMapper.java new file mode 100644 index 0000000..2fe7b93 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bi/mapper/SysDeptLocationMapper.java @@ -0,0 +1,63 @@ +package com.lzbi.bi.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.lzbi.bi.domain.SysDeptLocation; + +/** + * 部门位置Mapper接口 + * + * @author win + * @date 2024-01-30 + */ + +public interface SysDeptLocationMapper extends BaseMapper +{ + /** + * 查询部门位置 + * + * @param id 部门位置主键 + * @return 部门位置 + */ + public SysDeptLocation selectSysDeptLocationById(Long id); + + /** + * 查询部门位置列表 + * + * @param sysDeptLocation 部门位置 + * @return 部门位置集合 + */ + public List selectSysDeptLocationList(SysDeptLocation sysDeptLocation); + + /** + * 新增部门位置 + * + * @param sysDeptLocation 部门位置 + * @return 结果 + */ + public int insertSysDeptLocation(SysDeptLocation sysDeptLocation); + + /** + * 修改部门位置 + * + * @param sysDeptLocation 部门位置 + * @return 结果 + */ + public int updateSysDeptLocation(SysDeptLocation sysDeptLocation); + + /** + * 删除部门位置 + * + * @param id 部门位置主键 + * @return 结果 + */ + public int deleteSysDeptLocationById(Long id); + + /** + * 批量删除部门位置 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteSysDeptLocationByIds(Long[] ids); +} diff --git a/lzbi-module/src/main/java/com/lzbi/bi/service/DcBusiDataScreenMainService.java b/lzbi-module/src/main/java/com/lzbi/bi/service/DcBusiDataScreenMainService.java index 1fabe54..1f4f429 100644 --- a/lzbi-module/src/main/java/com/lzbi/bi/service/DcBusiDataScreenMainService.java +++ b/lzbi-module/src/main/java/com/lzbi/bi/service/DcBusiDataScreenMainService.java @@ -1,13 +1,37 @@ package com.lzbi.bi.service; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjUtil; +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.lzbi.asset.service.DcBaseAssetInfoService; import com.lzbi.bi.domain.DcBusiDataScreenDto; import com.lzbi.bi.domain.DcBusiDataScreenVo; +import com.lzbi.bi.domain.SysDeptLocation; import com.lzbi.bi.mapper.DcBusiDataScreenMainMapper; +import com.lzbi.common.constant.BizConstants; +import com.lzbi.common.core.domain.entity.SysDept; +import com.lzbi.common.enums.ReportNameEnum; +import com.lzbi.common.utils.StringUtils; +import com.lzbi.draft.domain.vo.TargetDraftDaynewReqVo; +import com.lzbi.draft.domain.vo.TargetDraftDaynewResVo; +import com.lzbi.draft.service.DcBusiTargetDraftDaynewService; +import com.lzbi.system.service.ISysDeptService; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.Comparator; import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static java.util.stream.Collectors.groupingBy; /** * 资产指标调整单;(dc_busi_target_adjust)表服务接口 @@ -17,6 +41,13 @@ import java.util.List; @Service public class DcBusiDataScreenMainService extends ServiceImpl implements IService { + @Resource + private SysDeptLocationService sysDeptLocationService; + @Resource + private ISysDeptService iSysDeptService; + @Resource + private DcBusiTargetDraftDaynewService dcBusiTargetDraftDaynewService; + public List selectCoalLostByDate(String qdate){ return baseMapper.selectCoalLostByDate(qdate); } @@ -35,9 +66,242 @@ public class DcBusiDataScreenMainService extends ServiceImpl selectDataWaterLostStationAll(String qdate){ return baseMapper.selectDataWaterLostStationAll(qdate); } - public List selectPowerAll(String qdate){ - return baseMapper.selectPowerAll(qdate); + public JSONObject selectPowerAll(TargetDraftDaynewReqVo vo){ + JSONObject ret=new JSONObject(); + List reportNames = Stream.of(ReportNameEnum.TOTAL_GENERATING_CAPACITY.getName(), ReportNameEnum.TOTAL_ELECTRICITY_CONSUMPTION.getName()).collect(Collectors.toList()); + vo.setAssetType("0").setAssetLevel("0").setReportNames(reportNames).setOrgIds(Stream.of(vo.getOrgId()).collect(Collectors.toList())); + List targetDraftDaynewResVos = dcBusiTargetDraftDaynewService.selectTargetDraftDaynewList(vo); + if (CollUtil.isEmpty(targetDraftDaynewResVos)) { + return ret; + } + JSONArray list=new JSONArray(); + targetDraftDaynewResVos.forEach(item->{ + JSONObject jsb=new JSONObject(); + jsb.put("name",item.getReportName()); + jsb.put("value", item.getValueResult().toString()); + jsb.put("unit",item.getTargetUnit()); + list.add(jsb); + }); + ret.put("source",list); + return ret; + } + public JSONObject getSquareInfoCompany(TargetDraftDaynewReqVo vo){ + JSONObject ret=new JSONObject(); + List sysDepts = iSysDeptService.selecttList(SysDept.builder().parentId(vo.getOrgId()).orgType(BizConstants.DcDeptAttr.COMANY).build()); + if (CollUtil.isEmpty(sysDepts)) { + return ret; + } + List reportNames = Stream.of(ReportNameEnum.NET_AREA.getName(), ReportNameEnum.NETWORK_AREA.getName()).collect(Collectors.toList()); + List orgIds = sysDepts.stream().map(SysDept::getDeptId).distinct().collect(Collectors.toList()); + vo.setAssetType("0").setAssetLevel("10").setReportNames(reportNames).setOrgIds(orgIds); + List targetDraftDaynewResVos = dcBusiTargetDraftDaynewService.selectTargetDraftDaynewList(vo); + if (CollUtil.isEmpty(targetDraftDaynewResVos)) { + return ret; + } + JSONArray product=new JSONArray(); + JSONArray realcost=new JSONArray(); + JSONArray realcost_2=new JSONArray(); + product.add("real_name"); + realcost.add(ReportNameEnum.NET_AREA.getName()); + realcost_2.add(ReportNameEnum.NETWORK_AREA.getName()); + targetDraftDaynewResVos.stream().collect(Collectors.toList()).sort(Comparator.comparing(TargetDraftDaynewResVo::getOrganizeName)); + product.addAll(targetDraftDaynewResVos.stream().map(TargetDraftDaynewResVo::getOrganizeName).distinct().collect(Collectors.toList())); + for (int i = 1; i < product.size(); i++) { + int finalI = i; + realcost.add(targetDraftDaynewResVos.stream().filter(t->ReportNameEnum.NET_AREA.getName().equals(t.getReportName())&&t.getOrganizeName().equals(product.get(finalI))).findFirst().orElse(new TargetDraftDaynewResVo()).getValueResult()); + realcost_2.add(targetDraftDaynewResVos.stream().filter(t->ReportNameEnum.NETWORK_AREA.getName().equals(t.getReportName())&&t.getOrganizeName().equals(product.get(finalI))).findFirst().orElse(new TargetDraftDaynewResVo()).getValueResult()); + } + JSONArray list=new JSONArray(); + list.add(product); + list.add(realcost); + list.add(realcost_2); + ret.put("source",list); + ret.put("unit",targetDraftDaynewResVos.get(0).getTargetUnit()); + ret.put("concatSquare",targetDraftDaynewResVos.stream().filter(x->ReportNameEnum.NET_AREA.getName().equals(x.getReportName())).map(TargetDraftDaynewResVo::getValueResult).reduce(BigDecimal.ZERO,BigDecimal::add)); + ret.put("realSquare",targetDraftDaynewResVos.stream().filter(x->ReportNameEnum.NETWORK_AREA.getName().equals(x.getReportName())).map(TargetDraftDaynewResVo::getValueResult).reduce(BigDecimal.ZERO,BigDecimal::add)); + return ret; + } + + public JSONObject getSquareInfoGroup(TargetDraftDaynewReqVo vo){ + JSONObject ret=new JSONObject(); + List sysDepts = iSysDeptService.selecttList(SysDept.builder().parentId(vo.getOrgId()).orgType(BizConstants.DcDeptAttr.COMANY).build()); + if (CollUtil.isEmpty(sysDepts)) { + return ret; + } + List reportNames = Stream.of(ReportNameEnum.NET_AREA.getName(), ReportNameEnum.NETWORK_AREA.getName()).collect(Collectors.toList()); + List orgIds = sysDepts.stream().map(SysDept::getDeptId).distinct().collect(Collectors.toList()); + vo.setAssetType("0").setAssetLevel("10").setReportNames(reportNames).setOrgIds(orgIds); + List targetDraftDaynewResVos = dcBusiTargetDraftDaynewService.selectTargetDraftDaynewList(vo); + if (CollUtil.isEmpty(targetDraftDaynewResVos)) { + return ret; + } + JSONArray inCircle=new JSONArray(); + JSONArray outCircle=new JSONArray(); + targetDraftDaynewResVos.stream().filter(x->ReportNameEnum.NET_AREA.getName().equals(x.getReportName())).forEach(x->{ + JSONObject jo = new JSONObject(); + jo.put("name", x.getOrganizeName()); + jo.put("unit", x.getTargetUnit()); + jo.put("value", x.getValueResult()); + inCircle.add(jo); + }); + targetDraftDaynewResVos.stream().filter(x->ReportNameEnum.NETWORK_AREA.getName().equals(x.getReportName())).forEach(x->{ + JSONObject jo = new JSONObject(); + jo.put("name", x.getOrganizeName()); + jo.put("unit", x.getTargetUnit()); + jo.put("value", x.getValueResult()); + outCircle.add(jo); + });; + ret.put("inCircle",inCircle); + ret.put("outCircle",outCircle); + JSONObject allJo=new JSONObject(); + allJo.put("unit",targetDraftDaynewResVos.get(0).getTargetUnit()); + allJo.put("concatSquare",targetDraftDaynewResVos.stream().filter(x->ReportNameEnum.NET_AREA.getName().equals(x.getReportName())).map(TargetDraftDaynewResVo::getValueResult).reduce(BigDecimal.ZERO,BigDecimal::add)); + allJo.put("realSquare",targetDraftDaynewResVos.stream().filter(x->ReportNameEnum.NETWORK_AREA.getName().equals(x.getReportName())).map(TargetDraftDaynewResVo::getValueResult).reduce(BigDecimal.ZERO,BigDecimal::add)); + ret.put("all", allJo); + return ret; + } + + public JSONObject getCoalLostRate(TargetDraftDaynewReqVo vo){ + JSONObject ret=new JSONObject(); + List sysDepts = iSysDeptService.selecttList(SysDept.builder().parentId(vo.getOrgId()).orgType(BizConstants.DcDeptAttr.COMANY).build()); + if (CollUtil.isEmpty(sysDepts)) { + return ret; + } + List reportNames = Stream.of(ReportNameEnum.COAL_CONSUMPTION.getName(), ReportNameEnum.COAL_CONSUMPTION_PER_UNIT.getName()).collect(Collectors.toList()); + List orgIds = sysDepts.stream().map(SysDept::getDeptId).distinct().collect(Collectors.toList()); + vo.setAssetType("0").setAssetLevel("10").setReportNames(reportNames).setOrgIds(orgIds); + List targetDraftDaynewResVos = dcBusiTargetDraftDaynewService.selectTargetDraftDaynewList(vo); + if (CollUtil.isEmpty(targetDraftDaynewResVos)) { + return ret; + } + JSONArray product=new JSONArray(); + JSONArray realcost=new JSONArray(); + JSONArray realcost_2=new JSONArray(); + product.add("name"); + realcost.add(ReportNameEnum.COAL_CONSUMPTION.getName()); + realcost_2.add(ReportNameEnum.COAL_CONSUMPTION_PER_UNIT.getName()); + targetDraftDaynewResVos.stream().collect(Collectors.toList()).sort(Comparator.comparing(TargetDraftDaynewResVo::getOrganizeName)); + product.addAll(targetDraftDaynewResVos.stream().map(TargetDraftDaynewResVo::getOrganizeName).distinct().collect(Collectors.toList())); + for (int i = 1; i < product.size(); i++) { + int finalI = i; + realcost.add(targetDraftDaynewResVos.stream().filter(t->ReportNameEnum.COAL_CONSUMPTION.getName().equals(t.getReportName())&&t.getOrganizeName().equals(product.get(finalI))).findFirst().orElse(new TargetDraftDaynewResVo()).getValueResult()); + realcost_2.add(targetDraftDaynewResVos.stream().filter(t->ReportNameEnum.COAL_CONSUMPTION_PER_UNIT.getName().equals(t.getReportName())&&t.getOrganizeName().equals(product.get(finalI))).findFirst().orElse(new TargetDraftDaynewResVo()).getValueResult()); + } + JSONArray list=new JSONArray(); + list.add(product); + list.add(realcost); + list.add(realcost_2); + ret.put("source",list); + ret.put("unit",targetDraftDaynewResVos.get(0).getTargetUnit()); + return ret; + } + + public JSONObject getWaterInfo(TargetDraftDaynewReqVo vo){ + JSONObject ret=new JSONObject(); + List sysDepts = iSysDeptService.selecttList(SysDept.builder().parentId(vo.getOrgId()).orgType(BizConstants.DcDeptAttr.COMANY).build()); + if (CollUtil.isEmpty(sysDepts)) { + return ret; + } + List reportNames = Stream.of(ReportNameEnum.FIRST_NETWORK_WATER_CONSUMPTION_RATE.getName(), ReportNameEnum.SECOND_NETWORK_WATER_CONSUMPTION_RATE.getName(), + ReportNameEnum.PRIMARY_NET_RECHARGE_WATER.getName(), ReportNameEnum.DATANG_PRIMARY_NET_RECHARGE_WATER.getName()).collect(Collectors.toList()); + List orgIds = sysDepts.stream().map(SysDept::getDeptId).distinct().collect(Collectors.toList()); + vo.setAssetType("0").setAssetLevel("10").setReportNames(reportNames).setOrgIds(orgIds); + List targetDraftDaynewResVos = dcBusiTargetDraftDaynewService.selectTargetDraftDaynewList(vo); + if (CollUtil.isEmpty(targetDraftDaynewResVos)) { + return ret; + } + JSONArray list=new JSONArray(); + targetDraftDaynewResVos.stream().collect(groupingBy(TargetDraftDaynewResVo::getOrganizeName)).entrySet().forEach(entry->{ + JSONObject jo = new JSONObject(); + jo.put("name", entry.getKey()); + jo.put("field1", entry.getValue().stream().filter(x -> x.getReportName().equals(ReportNameEnum.FIRST_NETWORK_WATER_CONSUMPTION_RATE.getName())).findFirst().orElse(new TargetDraftDaynewResVo()).getValueResult()); + jo.put("field2", entry.getValue().stream().filter(x -> x.getReportName().equals(ReportNameEnum.SECOND_NETWORK_WATER_CONSUMPTION_RATE.getName())).findFirst().orElse(new TargetDraftDaynewResVo()).getValueResult()); + BigDecimal primary_net_recharge_water_value = entry.getValue().stream().filter(x -> x.getReportName().equals(ReportNameEnum.PRIMARY_NET_RECHARGE_WATER.getName())).findFirst().orElse(new TargetDraftDaynewResVo()).getValueResult(); + BigDecimal datang_primary_net_recharge_water_value = entry.getValue().stream().filter(x -> x.getReportName().equals(ReportNameEnum.PRIMARY_NET_RECHARGE_WATER.getName())).findFirst().orElse(new TargetDraftDaynewResVo()).getValueResult(); + primary_net_recharge_water_value = ObjUtil.isNotEmpty(primary_net_recharge_water_value)?primary_net_recharge_water_value:BigDecimal.ZERO; + datang_primary_net_recharge_water_value = ObjUtil.isNotEmpty(datang_primary_net_recharge_water_value)?datang_primary_net_recharge_water_value:BigDecimal.ZERO; + jo.put("field3", primary_net_recharge_water_value.add(datang_primary_net_recharge_water_value)); + list.add(jo); + }); + ret.put("source",list); + return ret; + } + + public JSONObject getPowerLostRate(TargetDraftDaynewReqVo vo){ + JSONObject ret=new JSONObject(); + List sysDepts = iSysDeptService.selecttList(SysDept.builder().parentId(vo.getOrgId()).orgType(BizConstants.DcDeptAttr.COMANY).build()); + if (CollUtil.isEmpty(sysDepts)) { + return ret; + } + List reportNames = Stream.of(ReportNameEnum.POWER_CONSUMPTION_RATE_OF_HEAT_SOURCE_PLANT.getName(), ReportNameEnum.TOTAL_ELECTRICITY_CONSUMPTION.getName()).collect(Collectors.toList()); + List orgIds = sysDepts.stream().map(SysDept::getDeptId).distinct().collect(Collectors.toList()); + vo.setAssetType("0").setAssetLevel("10").setReportNames(reportNames).setOrgIds(orgIds); + List targetDraftDaynewResVos = dcBusiTargetDraftDaynewService.selectTargetDraftDaynewList(vo); + if (CollUtil.isEmpty(targetDraftDaynewResVos)) { + return ret; + } + JSONArray product=new JSONArray(); + JSONArray realcost=new JSONArray(); + JSONArray realcost_2=new JSONArray(); + product.add("name"); + realcost.add(ReportNameEnum.POWER_CONSUMPTION_RATE_OF_HEAT_SOURCE_PLANT.getName()); + realcost_2.add(ReportNameEnum.TOTAL_ELECTRICITY_CONSUMPTION.getName()); + targetDraftDaynewResVos.stream().collect(Collectors.toList()).sort(Comparator.comparing(TargetDraftDaynewResVo::getOrganizeName)); + product.addAll(targetDraftDaynewResVos.stream().map(TargetDraftDaynewResVo::getOrganizeName).distinct().collect(Collectors.toList())); + for (int i = 1; i < product.size(); i++) { + int finalI = i; + realcost.add(targetDraftDaynewResVos.stream().filter(t->ReportNameEnum.POWER_CONSUMPTION_RATE_OF_HEAT_SOURCE_PLANT.getName().equals(t.getReportName())&&t.getOrganizeName().equals(product.get(finalI))).findFirst().orElse(new TargetDraftDaynewResVo()).getValueResult()); + realcost_2.add(targetDraftDaynewResVos.stream().filter(t->ReportNameEnum.TOTAL_ELECTRICITY_CONSUMPTION.getName().equals(t.getReportName())&&t.getOrganizeName().equals(product.get(finalI))).findFirst().orElse(new TargetDraftDaynewResVo()).getValueResult()); + } + JSONArray list=new JSONArray(); + list.add(product); + list.add(realcost); + list.add(realcost_2); + ret.put("source",list); + ret.put("unit",targetDraftDaynewResVos.get(0).getTargetUnit()); + return ret; } + + public JSONObject getMapInfo(TargetDraftDaynewReqVo vo){ + JSONObject ret=new JSONObject(); + List sysDepts = iSysDeptService.selecttList(SysDept.builder().parentId(vo.getOrgId()).orgType(BizConstants.DcDeptAttr.COMANY).build()); + if (CollUtil.isEmpty(sysDepts)) { + return ret; + } + List orgIds = sysDepts.stream().map(SysDept::getDeptId).distinct().collect(Collectors.toList()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.in("org_id", orgIds); + List sysDeptLocations = sysDeptLocationService.list(queryWrapper); + if (CollUtil.isEmpty(sysDeptLocations)) { + return ret; + } + orgIds = sysDeptLocations.stream().map(SysDeptLocation::getOrgId).distinct().collect(Collectors.toList()); + List reportNames = Stream.of(ReportNameEnum.NET_AREA.getName(), ReportNameEnum.HEAT_RATE.getName(), ReportNameEnum.TOTAL_HEAT_PRODUCTION.getName()).collect(Collectors.toList()); + vo.setAssetType("0").setAssetLevel("10").setReportNames(reportNames).setOrgIds(orgIds); + List targetDraftDaynewResVos = dcBusiTargetDraftDaynewService.selectTargetDraftDaynewList(vo); + if (CollUtil.isEmpty(targetDraftDaynewResVos)) { + return ret; + } + Map> map = targetDraftDaynewResVos.stream().collect(groupingBy(TargetDraftDaynewResVo::getOrganizeId)); + JSONArray jsonArray = new JSONArray(); + map.entrySet().forEach(entry->{ + JSONObject jo = new JSONObject(); + JSONArray ja = new JSONArray(); + List list = entry.getValue(); + SysDeptLocation sysDeptLocation = sysDeptLocations.stream().filter(x -> x.getOrgId().toString().equals(entry.getKey())).findFirst().orElse(new SysDeptLocation()); + ja.add(sysDeptLocation.getLonValue()); + ja.add(sysDeptLocation.getLatValue()); + jo.put("value",ja); + jo.put("name", list.get(0).getOrganizeName()); + jo.put("value1", list.stream().filter(x->x.getReportName().equals(ReportNameEnum.NET_AREA.getName())).findFirst().orElse(new TargetDraftDaynewResVo()).getValueResult()); + jo.put("value2", list.stream().filter(x->x.getReportName().equals(ReportNameEnum.HEAT_RATE.getName())).findFirst().orElse(new TargetDraftDaynewResVo()).getValueResult()); + jo.put("value3", list.stream().filter(x->x.getReportName().equals(ReportNameEnum.TOTAL_HEAT_PRODUCTION.getName())).findFirst().orElse(new TargetDraftDaynewResVo()).getValueResult()); + jsonArray.add(jo); + }); + ret.put("source", jsonArray); + return ret; + } + public List selectSquareRealDetail(String qdate) { return baseMapper.selectSquareRealDetail(qdate); } diff --git a/lzbi-module/src/main/java/com/lzbi/bi/service/SysDeptLocationService.java b/lzbi-module/src/main/java/com/lzbi/bi/service/SysDeptLocationService.java new file mode 100644 index 0000000..ccf41ce --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bi/service/SysDeptLocationService.java @@ -0,0 +1,92 @@ +package com.lzbi.bi.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.lzbi.bi.domain.SysDeptLocation; +import com.lzbi.bi.mapper.SysDeptLocationMapper; +import com.lzbi.common.utils.DateUtils; +import org.springframework.stereotype.Service; + +import java.util.List; +/** + * 部门位置Service业务层处理 + * + * @author win + * @date 2024-01-30 + */ +@Service +public class SysDeptLocationService extends ServiceImpl implements IService +{ + + /** + * 查询部门位置 + * + * @param id 部门位置主键 + * @return 部门位置 + */ + public SysDeptLocation selectSysDeptLocationById(Long id) + { + return baseMapper.selectSysDeptLocationById(id); + } + + /** + * 查询部门位置列表 + * + * @param sysDeptLocation 部门位置 + * @return 部门位置 + */ + public List selectSysDeptLocationList(SysDeptLocation sysDeptLocation) + { + return baseMapper.selectSysDeptLocationList(sysDeptLocation); + } + + /** + * 新增部门位置 + * + * @param sysDeptLocation 部门位置 + * @return 结果 + */ + + public int insertSysDeptLocation(SysDeptLocation sysDeptLocation) + { + sysDeptLocation.setCreatedTime(DateUtils.getNowDate()); + return baseMapper.insertSysDeptLocation(sysDeptLocation); + } + + /** + * 修改部门位置 + * + * @param sysDeptLocation 部门位置 + * @return 结果 + */ + + public int updateSysDeptLocation(SysDeptLocation sysDeptLocation) + { + sysDeptLocation.setUpdatedTime(DateUtils.getNowDate()); + return baseMapper.updateSysDeptLocation(sysDeptLocation); + } + + /** + * 批量删除部门位置 + * + * @param ids 需要删除的部门位置主键 + * @return 结果 + */ + + public int deleteSysDeptLocationByIds(Long[] ids) + { + return baseMapper.deleteSysDeptLocationByIds(ids); + } + + /** + * 删除部门位置信息 + * + * @param id 部门位置主键 + * @return 结果 + */ + + public int deleteSysDeptLocationById(Long id) + { + return baseMapper.deleteSysDeptLocationById(id); + } +} diff --git a/lzbi-module/src/main/java/com/lzbi/draft/domain/vo/TargetDraftDaynewReqVo.java b/lzbi-module/src/main/java/com/lzbi/draft/domain/vo/TargetDraftDaynewReqVo.java index d5f0d91..8b0d591 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/domain/vo/TargetDraftDaynewReqVo.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/domain/vo/TargetDraftDaynewReqVo.java @@ -4,25 +4,34 @@ import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; +import javax.validation.constraints.NotNull; import java.util.List; @Data @Builder @NoArgsConstructor @AllArgsConstructor +@Accessors(chain = true) public class TargetDraftDaynewReqVo { private List reportNames; + @NotNull private String dateYear; + @NotNull private String dateMonth; + @NotNull private String dateDay; + @NotNull private Long orgId; + private List orgIds; + private String assetLevel; private String assetType; diff --git a/lzbi-module/src/main/java/com/lzbi/draft/domain/vo/TargetDraftDaynewResVo.java b/lzbi-module/src/main/java/com/lzbi/draft/domain/vo/TargetDraftDaynewResVo.java index 63941f7..6e237ed 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/domain/vo/TargetDraftDaynewResVo.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/domain/vo/TargetDraftDaynewResVo.java @@ -14,6 +14,9 @@ import java.util.List; @AllArgsConstructor public class TargetDraftDaynewResVo { + @ApiModelProperty(name = "组织Id",notes = "organizeId") + private String organizeId; + @ApiModelProperty(name = "组织名称",notes = "organizeName") private String organizeName; @@ -21,7 +24,7 @@ public class TargetDraftDaynewResVo { private String reportName; @ApiModelProperty(name = "指标结果值",notes = "valueResult") - private BigDecimal valueResult; + private BigDecimal valueResult = BigDecimal.ZERO; @Excel(name = "单位") private String targetUnit; diff --git a/lzbi-module/src/main/java/com/lzbi/module/base/BaseEntity.java b/lzbi-module/src/main/java/com/lzbi/module/base/BaseEntity.java new file mode 100644 index 0000000..c2f2dda --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/module/base/BaseEntity.java @@ -0,0 +1,78 @@ +package com.lzbi.module.base; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + * @auth create by Administrator + * @date 2023/11/16 + * BaseModuleEntity + */ +@Data +@Accessors(chain = true) +public class BaseEntity implements Serializable, Cloneable { + + /** + * 主键 + */ + @ApiModelProperty(name = "主键", notes = "") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + /** + * 租户号 + */ + @ApiModelProperty(name = "租户号", notes = "") + private String tenantId; + /** + * 乐观锁 + */ + @ApiModelProperty(name = "乐观锁", notes = "") + private Integer revision; + /** + * 创建人 + */ + @ApiModelProperty(name = "创建人", notes = "") + private String createdBy; + /** + * 创建时间 + */ + @ApiModelProperty(name = "创建时间", notes = "") + private Date createdTime; + /** + * 更新人 + */ + @ApiModelProperty(name = "更新人", notes = "") + private String updatedBy; + /** + * 更新时间 + */ + @ApiModelProperty(name = "更新时间", notes = "") + private Date updatedTime; + /** + * 删除人 + */ + @ApiModelProperty(name = "删除人", notes = "") + private String deleteBy; + /** + * 删除时间 + */ + @ApiModelProperty(name = "删除时间", notes = "") + private Date deleteTime; + /** + * 部门id + */ + @ApiModelProperty(name = "部门id", notes = "") + private Long deptId; + /** + * 用户id + */ + @ApiModelProperty(name = "用户id", notes = "") + private Long userId; + +} diff --git a/lzbi-module/src/main/resources/mapper/SysDeptLocationMapper.xml b/lzbi-module/src/main/resources/mapper/SysDeptLocationMapper.xml new file mode 100644 index 0000000..0b31bff --- /dev/null +++ b/lzbi-module/src/main/resources/mapper/SysDeptLocationMapper.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + select tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, id, org_id, lat_value, lon_value from sys_dept_location + + + + + + + + insert into sys_dept_location + + tenant_id, + revision, + created_by, + created_time, + updated_by, + updated_time, + delete_by, + delete_time, + org_id, + lat_value, + lon_value, + + + #{tenantId}, + #{revision}, + #{createdBy}, + #{createdTime}, + #{updatedBy}, + #{updatedTime}, + #{deleteBy}, + #{deleteTime}, + #{orgId}, + #{latValue}, + #{lonValue}, + + + + + update sys_dept_location + + tenant_id = #{tenantId}, + revision = #{revision}, + created_by = #{createdBy}, + created_time = #{createdTime}, + updated_by = #{updatedBy}, + updated_time = #{updatedTime}, + delete_by = #{deleteBy}, + delete_time = #{deleteTime}, + org_id = #{orgId}, + lat_value = #{latValue}, + lon_value = #{lonValue}, + + where id = #{id} + + + + delete from sys_dept_location where id = #{id} + + + + delete from sys_dept_location where id in + + #{id} + + + \ No newline at end of file diff --git a/lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftDaynewMapper.xml b/lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftDaynewMapper.xml index bac5199..e3f01a5 100644 --- a/lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftDaynewMapper.xml +++ b/lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftDaynewMapper.xml @@ -276,7 +276,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"