Commit 315e9dc7 authored by caotao's avatar caotao

户用光伏-运维工单代码调整。

parent fdd6fa0b
......@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
import java.util.List;
/**
* 第三方场站
......@@ -218,4 +219,7 @@ public class JpStation extends BaseEntity {
@TableField("amos_company_code")
private String amosCompanyCode;
@TableField(exist = false)
private List<String> snCodes;
}
......@@ -27,6 +27,8 @@ public interface JpStationMapper extends BaseMapper<JpStation> {
@UserEmpower(field ={"regional_companies_code","amos_company_code"} ,fieldConditions ={"in","in"} ,relationship="and")
List<JpStation> getJpStation(@Param("dto") JpStationDto reviewDto);
List<JpStation> getJpStationList(@Param("dto") JpStationDto reviewDto);
@UserEmpower(field ={"ORG_CODE"} ,fieldConditions ={"in"} ,relationship="")
List<DropDown> getRegion();
......
......@@ -200,6 +200,47 @@
</where>
</select>
<select id="getJpStationList" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.JpStation">
select
*
from hygf_jp_station
<where>
is_delete=0
<if test="dto.name!=null">
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
</if>
<if test="dto.userName!=null">
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%")
</if>
<if test="dto.address!=null">
and hygf_jp_station.address like concat(concat("%",#{dto.address}),"%")
</if>
<if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
</if>
<if test="dto.thirdStationIds!=null and dto.thirdStationIds.size()> 0 ">
and hygf_jp_station.third_station_id in
<foreach collection="dto.thirdStationIds" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="dto.thirdStationId!=null">
and hygf_jp_station.third_station_id =#{dto.thirdStationId}
</if>
<if test="dto.regionalCompaniesCode!=null and dto.regionalCompaniesCode!=''">
and hygf_jp_station.regional_companies_code =#{dto.regionalCompaniesCode}
</if>
<if test="dto.amosCompanyCode!=null and dto.amosCompanyCode!=''">
and hygf_jp_station.amos_company_code =#{dto.amosCompanyCode}
</if>
<if test="dto.state!=null">
and hygf_jp_station.`state` =#{dto.state}
</if>
</where>
</select>
<select id="getRegion" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.DropDown">
SELECT privilege_company.ORG_CODE orgCode ,
privilege_company.COMPANY_NAME name
......
......@@ -4,15 +4,14 @@ import cn.hutool.core.date.DateUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.support.ExcelTypeEnum;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yeejoin.amos.boot.module.hygf.api.config.UserLimits;
import com.yeejoin.amos.boot.module.hygf.api.dto.*;
import com.yeejoin.amos.boot.module.hygf.api.entity.DayGenerate;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpStation;
import com.yeejoin.amos.boot.module.hygf.api.entity.MonthGenerate;
import com.yeejoin.amos.boot.module.hygf.api.entity.YearGenerate;
import com.yeejoin.amos.boot.module.hygf.api.entity.*;
import com.yeejoin.amos.boot.module.hygf.api.mapper.JpInverterMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.JpStationMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IJpStationService;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.DayGenerateMapper;
......@@ -46,6 +45,8 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
@Autowired
JpStationMapper jpStationMapper;
@Autowired
JpInverterMapper jpInverterMapper;
@Autowired
MonthPowerMapper monthPowerMapper;
@Autowired
MonthPowerServiceImpl monthPowerServiceImpl;
......@@ -175,6 +176,16 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
return jpStationMapper.getcountStatetc(reviewDto);
}
public List<JpStation>getJpStationList (JpStationDto reviewDto){
List<JpInverter> dataJpInverter=jpInverterMapper.selectList(new QueryWrapper<JpInverter>().isNotNull("third_station_id"));
Map<String,List<String>> inverterMap=dataJpInverter.stream().collect(Collectors.groupingBy(JpInverter::getThirdStationId,Collectors.mapping(JpInverter::getSnCode,Collectors.toList())));
List<JpStation> list= jpStationMapper.getJpStationList(reviewDto);
list.forEach(jpStation -> {
jpStation.setSnCodes(inverterMap.get(jpStation.getThirdStationId()));
});
return list;
}
@Override
@UserLimits
public Map<String, Object> getcountStatejs(JpStationDto reviewDto) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment