Browse Source

jiahan.wu[CR] bi大屏集团

develop
eric777 9 months ago
parent
commit
8012a8b992
  1. 7
      lzbi-common/src/main/java/com/lzbi/common/core/domain/entity/SysDept.java
  2. 27
      lzbi-common/src/main/java/com/lzbi/common/enums/ReportNameEnum.java
  3. 200
      lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenMainController.java
  4. 131
      lzbi-module/src/main/java/com/lzbi/bi/controller/SysDeptLocationController.java
  5. 16
      lzbi-module/src/main/java/com/lzbi/bi/domain/DcBusiReportTargetConfig.java
  6. 62
      lzbi-module/src/main/java/com/lzbi/bi/domain/SysDeptLocation.java
  7. 2
      lzbi-module/src/main/java/com/lzbi/bi/mapper/DcBusiDataScreenMainMapper.java
  8. 63
      lzbi-module/src/main/java/com/lzbi/bi/mapper/SysDeptLocationMapper.java
  9. 268
      lzbi-module/src/main/java/com/lzbi/bi/service/DcBusiDataScreenMainService.java
  10. 92
      lzbi-module/src/main/java/com/lzbi/bi/service/SysDeptLocationService.java
  11. 9
      lzbi-module/src/main/java/com/lzbi/draft/domain/vo/TargetDraftDaynewReqVo.java
  12. 5
      lzbi-module/src/main/java/com/lzbi/draft/domain/vo/TargetDraftDaynewResVo.java
  13. 78
      lzbi-module/src/main/java/com/lzbi/module/base/BaseEntity.java
  14. 98
      lzbi-module/src/main/resources/mapper/SysDeptLocationMapper.xml
  15. 6
      lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftDaynewMapper.xml
  16. 2
      lzbi-system/src/main/java/com/lzbi/system/service/ISysDeptService.java
  17. 4
      lzbi-system/src/main/java/com/lzbi/system/service/impl/SysDeptServiceImpl.java

7
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;

27
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;
}

200
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<DcBusiDataScreenVo> 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<String> 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<DcBusiDataScreenVo> maps = dcBusiDataScreenMainService.selectPowerAll(qdate);
JSONArray list=new JSONArray();
AtomicReference<String> 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<DcBusiDataScreenVo> real = dcBusiDataScreenMainService.selectSquareRealDetail(qdate);
List<DcBusiDataScreenVo> self = dcBusiDataScreenMainService.selectSquareSelfDetail(qdate);
List<DcBusiDataScreenVo> group = dcBusiDataScreenMainService.selectSquareGroup(qdate);
JSONArray product=new JSONArray();
JSONArray realcost=new JSONArray();
product.add("real_name");
realcost.add("在网面积");
AtomicReference<String> 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<DcBusiDataScreenVo> real = dcBusiDataScreenMainService.selectSquareRealDetail(qdate);
List<DcBusiDataScreenVo> self = dcBusiDataScreenMainService.selectSquareSelfDetail(qdate);
List<DcBusiDataScreenVo> 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<DcBusiDataScreenVo> data = dcBusiDataScreenMainService.selectDataPowerLost(qdate);
JSONArray product=new JSONArray();
JSONArray realcost=new JSONArray();
product.add("product");
realcost.add("总电耗");
AtomicReference<String> 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<DcBusiDataScreenVo> data_1 = dcBusiDataScreenMainService.selectDataWaterLostFirst(qdate);
List<DcBusiDataScreenVo> data_2 = dcBusiDataScreenMainService.selectDataWaterLostSecond(qdate);
List<DcBusiDataScreenVo> data_3 = dcBusiDataScreenMainService.selectDataWaterLostStationAll(qdate);
@PostMapping("/waterInfo")
public AjaxResult getWaterInfo(@RequestBody TargetDraftDaynewReqVo vo){
AtomicReference<String> unit = new AtomicReference<>();
Map<String,JSONObject> 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()));
return AjaxResult.success(dcBusiDataScreenMainService.getWaterInfo(vo));
}
});
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);
@PostMapping("/mapInfo")
public AjaxResult getMapInfo(@RequestBody TargetDraftDaynewReqVo vo){
return AjaxResult.success(dcBusiDataScreenMainService.getMapInfo(vo));
}
@GetMapping("/company/tree/{depId}")

131
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<SysDeptLocation> list = sysDeptLocationService.selectSysDeptLocationList(SysDeptLocation);
ExcelUtil<SysDeptLocation> util = new ExcelUtil<SysDeptLocation>(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));
}
}

16
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;

62
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;
}

2
lzbi-module/src/main/java/com/lzbi/bi/mapper/DcBusiDataScreenMainMapper.java

@ -21,7 +21,7 @@ public interface DcBusiDataScreenMainMapper extends BaseMapper<DcBusiDataScreenD
List<DcBusiDataScreenVo> selectDataWaterLostFirst(String qdate);
List<DcBusiDataScreenVo> selectDataWaterLostSecond(String qdate);
List<DcBusiDataScreenVo> selectDataWaterLostStationAll(String qdate);
List<DcBusiDataScreenVo> selectPowerAll(String qdate);
List<DcBusiDataScreenVo> selectPowerAll(List<String> reportNames, String assetCode);
List<DcBusiDataScreenVo> selectSquareRealDetail(String qdate);
List<DcBusiDataScreenVo> selectSquareSelfDetail(String qdate);
List<DcBusiDataScreenVo> selectSquareGroup(String qdate);

63
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<SysDeptLocation>
{
/**
* 查询部门位置
*
* @param id 部门位置主键
* @return 部门位置
*/
public SysDeptLocation selectSysDeptLocationById(Long id);
/**
* 查询部门位置列表
*
* @param sysDeptLocation 部门位置
* @return 部门位置集合
*/
public List<SysDeptLocation> 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);
}

268
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<DcBusiDataScreenMainMapper, DcBusiDataScreenDto> implements IService<DcBusiDataScreenDto> {
@Resource
private SysDeptLocationService sysDeptLocationService;
@Resource
private ISysDeptService iSysDeptService;
@Resource
private DcBusiTargetDraftDaynewService dcBusiTargetDraftDaynewService;
public List<DcBusiDataScreenVo> selectCoalLostByDate(String qdate){
return baseMapper.selectCoalLostByDate(qdate);
}
@ -35,9 +66,242 @@ public class DcBusiDataScreenMainService extends ServiceImpl<DcBusiDataScreenMai
public List<DcBusiDataScreenVo> selectDataWaterLostStationAll(String qdate){
return baseMapper.selectDataWaterLostStationAll(qdate);
}
public List<DcBusiDataScreenVo> selectPowerAll(String qdate){
return baseMapper.selectPowerAll(qdate);
public JSONObject selectPowerAll(TargetDraftDaynewReqVo vo){
JSONObject ret=new JSONObject();
List<String> 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<TargetDraftDaynewResVo> 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<SysDept> sysDepts = iSysDeptService.selecttList(SysDept.builder().parentId(vo.getOrgId()).orgType(BizConstants.DcDeptAttr.COMANY).build());
if (CollUtil.isEmpty(sysDepts)) {
return ret;
}
List<String> reportNames = Stream.of(ReportNameEnum.NET_AREA.getName(), ReportNameEnum.NETWORK_AREA.getName()).collect(Collectors.toList());
List<Long> orgIds = sysDepts.stream().map(SysDept::getDeptId).distinct().collect(Collectors.toList());
vo.setAssetType("0").setAssetLevel("10").setReportNames(reportNames).setOrgIds(orgIds);
List<TargetDraftDaynewResVo> 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<SysDept> sysDepts = iSysDeptService.selecttList(SysDept.builder().parentId(vo.getOrgId()).orgType(BizConstants.DcDeptAttr.COMANY).build());
if (CollUtil.isEmpty(sysDepts)) {
return ret;
}
List<String> reportNames = Stream.of(ReportNameEnum.NET_AREA.getName(), ReportNameEnum.NETWORK_AREA.getName()).collect(Collectors.toList());
List<Long> orgIds = sysDepts.stream().map(SysDept::getDeptId).distinct().collect(Collectors.toList());
vo.setAssetType("0").setAssetLevel("10").setReportNames(reportNames).setOrgIds(orgIds);
List<TargetDraftDaynewResVo> 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<SysDept> sysDepts = iSysDeptService.selecttList(SysDept.builder().parentId(vo.getOrgId()).orgType(BizConstants.DcDeptAttr.COMANY).build());
if (CollUtil.isEmpty(sysDepts)) {
return ret;
}
List<String> reportNames = Stream.of(ReportNameEnum.COAL_CONSUMPTION.getName(), ReportNameEnum.COAL_CONSUMPTION_PER_UNIT.getName()).collect(Collectors.toList());
List<Long> orgIds = sysDepts.stream().map(SysDept::getDeptId).distinct().collect(Collectors.toList());
vo.setAssetType("0").setAssetLevel("10").setReportNames(reportNames).setOrgIds(orgIds);
List<TargetDraftDaynewResVo> 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<SysDept> sysDepts = iSysDeptService.selecttList(SysDept.builder().parentId(vo.getOrgId()).orgType(BizConstants.DcDeptAttr.COMANY).build());
if (CollUtil.isEmpty(sysDepts)) {
return ret;
}
List<String> 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<Long> orgIds = sysDepts.stream().map(SysDept::getDeptId).distinct().collect(Collectors.toList());
vo.setAssetType("0").setAssetLevel("10").setReportNames(reportNames).setOrgIds(orgIds);
List<TargetDraftDaynewResVo> 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<SysDept> sysDepts = iSysDeptService.selecttList(SysDept.builder().parentId(vo.getOrgId()).orgType(BizConstants.DcDeptAttr.COMANY).build());
if (CollUtil.isEmpty(sysDepts)) {
return ret;
}
List<String> reportNames = Stream.of(ReportNameEnum.POWER_CONSUMPTION_RATE_OF_HEAT_SOURCE_PLANT.getName(), ReportNameEnum.TOTAL_ELECTRICITY_CONSUMPTION.getName()).collect(Collectors.toList());
List<Long> orgIds = sysDepts.stream().map(SysDept::getDeptId).distinct().collect(Collectors.toList());
vo.setAssetType("0").setAssetLevel("10").setReportNames(reportNames).setOrgIds(orgIds);
List<TargetDraftDaynewResVo> 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<SysDept> sysDepts = iSysDeptService.selecttList(SysDept.builder().parentId(vo.getOrgId()).orgType(BizConstants.DcDeptAttr.COMANY).build());
if (CollUtil.isEmpty(sysDepts)) {
return ret;
}
List<Long> orgIds = sysDepts.stream().map(SysDept::getDeptId).distinct().collect(Collectors.toList());
QueryWrapper<SysDeptLocation> queryWrapper = new QueryWrapper<>();
queryWrapper.in("org_id", orgIds);
List<SysDeptLocation> sysDeptLocations = sysDeptLocationService.list(queryWrapper);
if (CollUtil.isEmpty(sysDeptLocations)) {
return ret;
}
orgIds = sysDeptLocations.stream().map(SysDeptLocation::getOrgId).distinct().collect(Collectors.toList());
List<String> 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<TargetDraftDaynewResVo> targetDraftDaynewResVos = dcBusiTargetDraftDaynewService.selectTargetDraftDaynewList(vo);
if (CollUtil.isEmpty(targetDraftDaynewResVos)) {
return ret;
}
Map<String, List<TargetDraftDaynewResVo>> map = targetDraftDaynewResVos.stream().collect(groupingBy(TargetDraftDaynewResVo::getOrganizeId));
JSONArray jsonArray = new JSONArray();
map.entrySet().forEach(entry->{
JSONObject jo = new JSONObject();
JSONArray ja = new JSONArray();
List<TargetDraftDaynewResVo> 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<DcBusiDataScreenVo> selectSquareRealDetail(String qdate) {
return baseMapper.selectSquareRealDetail(qdate);
}

92
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<SysDeptLocationMapper, SysDeptLocation> implements IService<SysDeptLocation>
{
/**
* 查询部门位置
*
* @param id 部门位置主键
* @return 部门位置
*/
public SysDeptLocation selectSysDeptLocationById(Long id)
{
return baseMapper.selectSysDeptLocationById(id);
}
/**
* 查询部门位置列表
*
* @param sysDeptLocation 部门位置
* @return 部门位置
*/
public List<SysDeptLocation> 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);
}
}

9
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<String> reportNames;
@NotNull
private String dateYear;
@NotNull
private String dateMonth;
@NotNull
private String dateDay;
@NotNull
private Long orgId;
private List<Long> orgIds;
private String assetLevel;
private String assetType;

5
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;

78
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;
}

98
lzbi-module/src/main/resources/mapper/SysDeptLocationMapper.xml

@ -0,0 +1,98 @@
<?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.lzbi.bi.mapper.SysDeptLocationMapper">
<resultMap type="com.lzbi.bi.domain.SysDeptLocation" id="SysDeptLocationResult">
<result property="tenantId" column="tenant_id" />
<result property="revision" column="revision" />
<result property="createdBy" column="created_by" />
<result property="createdTime" column="created_time" />
<result property="updatedBy" column="updated_by" />
<result property="updatedTime" column="updated_time" />
<result property="deleteBy" column="delete_by" />
<result property="deleteTime" column="delete_time" />
<result property="id" column="id" />
<result property="orgId" column="org_id" />
<result property="latValue" column="lat_value" />
<result property="lonValue" column="lon_value" />
</resultMap>
<sql id="selectSysDeptLocationVo">
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
</sql>
<select id="selectSysDeptLocationList" parameterType="SysDeptLocation" resultMap="SysDeptLocationResult">
<include refid="selectSysDeptLocationVo"/>
<where>
<if test="orgId != null "> and org_id = #{orgId}</if>
<if test="latValue != null and latValue != ''"> and lat_value = #{latValue}</if>
<if test="lonValue != null and lonValue != ''"> and lon_value = #{lonValue}</if>
</where>
</select>
<select id="selectSysDeptLocationById" parameterType="Long" resultMap="SysDeptLocationResult">
<include refid="selectSysDeptLocationVo"/>
where id = #{id}
</select>
<insert id="insertSysDeptLocation" parameterType="SysDeptLocation" useGeneratedKeys="true" keyProperty="id">
insert into sys_dept_location
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="tenantId != null">tenant_id,</if>
<if test="revision != null">revision,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedTime != null">updated_time,</if>
<if test="deleteBy != null">delete_by,</if>
<if test="deleteTime != null">delete_time,</if>
<if test="orgId != null">org_id,</if>
<if test="latValue != null and latValue != ''">lat_value,</if>
<if test="lonValue != null and lonValue != ''">lon_value,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="tenantId != null">#{tenantId},</if>
<if test="revision != null">#{revision},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</if>
<if test="deleteBy != null">#{deleteBy},</if>
<if test="deleteTime != null">#{deleteTime},</if>
<if test="orgId != null">#{orgId},</if>
<if test="latValue != null and latValue != ''">#{latValue},</if>
<if test="lonValue != null and lonValue != ''">#{lonValue},</if>
</trim>
</insert>
<update id="updateSysDeptLocation" parameterType="SysDeptLocation">
update sys_dept_location
<trim prefix="SET" suffixOverrides=",">
<if test="tenantId != null">tenant_id = #{tenantId},</if>
<if test="revision != null">revision = #{revision},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
<if test="deleteBy != null">delete_by = #{deleteBy},</if>
<if test="deleteTime != null">delete_time = #{deleteTime},</if>
<if test="orgId != null">org_id = #{orgId},</if>
<if test="latValue != null and latValue != ''">lat_value = #{latValue},</if>
<if test="lonValue != null and lonValue != ''">lon_value = #{lonValue},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSysDeptLocationById" parameterType="Long">
delete from sys_dept_location where id = #{id}
</delete>
<delete id="deleteSysDeptLocationByIds" parameterType="String">
delete from sys_dept_location where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

6
lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftDaynewMapper.xml

@ -276,7 +276,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectTargetDraftDaynewList" parameterType="com.lzbi.draft.domain.vo.TargetDraftDaynewReqVo" resultType="com.lzbi.draft.domain.vo.TargetDraftDaynewResVo">
select
d.organize_name ,c.report_name ,d.value_result ,m.target_unit
d.organize_name, d.organize_id, c.report_name, d.value_result, m.target_unit
from
dc_busi_target_draft_daynew d,
dc_busi_report_target_config c,
@ -300,7 +300,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) md,
(
select
asset_code
max(asset_code) asset_code
from
dc_base_asset_info
where
@ -310,7 +310,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
and asset_level = #{assetLevel}
and asset_type = #{assetType}
limit 1
group by org_id
) a
where
d.asset_code = a.asset_code

2
lzbi-system/src/main/java/com/lzbi/system/service/ISysDeptService.java

@ -20,6 +20,8 @@ public interface ISysDeptService
*/
public List<SysDept> selectDeptList(SysDept dept);
List<SysDept> selecttList(SysDept dept);
/**
* 查询部门树结构信息
*

4
lzbi-system/src/main/java/com/lzbi/system/service/impl/SysDeptServiceImpl.java

@ -48,6 +48,10 @@ public class SysDeptServiceImpl implements ISysDeptService {
return deptMapper.selectDeptList(dept);
}
public List<SysDept> selecttList(SysDept dept) {
return deptMapper.selectDeptList(dept);
}
/**
* 查询部门树结构信息
*

Loading…
Cancel
Save