Commit a271270c authored by 朱晨阳's avatar 朱晨阳

Merge remote-tracking branch 'origin/developer' into developer

parents 1d467341 3ed15676
...@@ -178,7 +178,7 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe ...@@ -178,7 +178,7 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
@Override @Override
public void customerInfoList() { public void customerInfoList() {
try { try {
String startDate = LocalDate.now().minusDays(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); String startDate = LocalDate.now().minusMonths(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
String endDate = LocalDate.now().plusDays(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); String endDate = LocalDate.now().plusDays(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
log.info("-------碳银同步项目信息开始: {} ------- ", sdf.format(new Date())); log.info("-------碳银同步项目信息开始: {} ------- ", sdf.format(new Date()));
Map<String, Object> params = MapBuilder.<String, Object>create() Map<String, Object> params = MapBuilder.<String, Object>create()
...@@ -465,7 +465,12 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe ...@@ -465,7 +465,12 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
if (jpInverter == null || StringUtils.isEmpty(jpInverter.getSnCode())) { if (jpInverter == null || StringUtils.isEmpty(jpInverter.getSnCode())) {
return; return;
} }
String startDate = LocalDate.now().minusWeeks(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); String startDate;
if (jpInverter.getUpdateTime() != null) {
startDate = new SimpleDateFormat("yyyy-MM-dd").format(jpInverter.getUpdateTime());
} else {
startDate = LocalDate.now().minusMonths(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
}
String endDate = LocalDate.now().plusDays(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); String endDate = LocalDate.now().plusDays(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
Map<String, Object> params = MapBuilder.<String, Object>create() Map<String, Object> params = MapBuilder.<String, Object>create()
.put("sn", jpInverter.getSnCode()) .put("sn", jpInverter.getSnCode())
...@@ -474,11 +479,19 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe ...@@ -474,11 +479,19 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
.put("startDate", startDate) .put("startDate", startDate)
.put("endDate", endDate).build(); .put("endDate", endDate).build();
PageInfo<TanYinAlramInfo> tanYinInveterInfo = tanYinApiUtils.postPage("电站逆变器故障信息", apiUrl + TanYinConstant.inverterAlramUrl, JSON.toJSONString(params), null, TanYinAlramInfo.class); PageInfo<TanYinAlramInfo> tanYinInveterInfo = tanYinApiUtils.postPage("电站逆变器故障信息", apiUrl + TanYinConstant.inverterAlramUrl, JSON.toJSONString(params), null, TanYinAlramInfo.class);
List<TanYinAlramInfo> tanYinAlramInfos = tanYinInveterInfo.getList(); if (tanYinInveterInfo == null || CollectionUtils.isEmpty(tanYinInveterInfo.getList())) {
if (CollectionUtils.isEmpty(tanYinAlramInfos)) {
log.warn("-------碳银同步电站逆变器故障信息结束: 未获取到逆变器故障信息 ------- "); log.warn("-------碳银同步电站逆变器故障信息结束: 未获取到逆变器故障信息 ------- ");
return; return;
} }
List<TanYinAlramInfo> tanYinAlramInfos = new ArrayList<>();
tanYinAlramInfos.addAll(tanYinInveterInfo.getList());
if (tanYinInveterInfo.getPages() > 1) {
for (int pageNum = 2; pageNum < tanYinInveterInfo.getPages(); pageNum++) {
params.put("pageNo", pageNum);
PageInfo<TanYinAlramInfo> tanYinInveterInfoPage = tanYinApiUtils.postPage("电站逆变器故障信息", apiUrl + TanYinConstant.inverterAlramUrl, JSON.toJSONString(params), null, TanYinAlramInfo.class);
tanYinAlramInfos.addAll(tanYinInveterInfoPage.getList());
}
}
for (TanYinAlramInfo tanYinAlramInfo : tanYinAlramInfos) { for (TanYinAlramInfo tanYinAlramInfo : tanYinAlramInfos) {
tanYinAlramInfo.setCreateTime(System.currentTimeMillis()); tanYinAlramInfo.setCreateTime(System.currentTimeMillis());
tanYinAlramInfoMapper.insert(tanYinAlramInfo); tanYinAlramInfoMapper.insert(tanYinAlramInfo);
...@@ -486,7 +499,9 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe ...@@ -486,7 +499,9 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
HYGFJPInverterWarn hygfjpInverterWarn = hygfjpInverterWarnMapper HYGFJPInverterWarn hygfjpInverterWarn = hygfjpInverterWarnMapper
.selectOne(new QueryWrapper<HYGFJPInverterWarn>().eq("sn_code", tanYinAlramInfo.getSn()) .selectOne(new QueryWrapper<HYGFJPInverterWarn>().eq("sn_code", tanYinAlramInfo.getSn())
.eq("warn_id", tanYinAlramInfo.getId()) .eq("warn_id", tanYinAlramInfo.getId())
.eq("third_station_id", String.valueOf(tanYinAlramInfo.getProjectNo()))); .eq("third_station_id", String.valueOf(tanYinAlramInfo.getProjectNo()))
.orderByDesc("created_time").last("limit 1")
);
if (com.baomidou.mybatisplus.core.toolkit.ObjectUtils.isEmpty(hygfjpInverterWarn)) { if (com.baomidou.mybatisplus.core.toolkit.ObjectUtils.isEmpty(hygfjpInverterWarn)) {
hygfjpInverterWarn = new HYGFJPInverterWarn(); hygfjpInverterWarn = new HYGFJPInverterWarn();
} }
...@@ -500,7 +515,6 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe ...@@ -500,7 +515,6 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
hygfjpInverterWarn.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode()); hygfjpInverterWarn.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
hygfjpInverterWarn.setStationName(jpStation.getName()); hygfjpInverterWarn.setStationName(jpStation.getName());
hygfjpInverterWarn.setStationState(jpStation.getState()); hygfjpInverterWarn.setStationState(jpStation.getState());
hygfjpInverterWarn.setCreatedTime(System.currentTimeMillis());
hygfjpInverterWarn.setThirdCode(PVProducerInfoEnum.TANYIN.getCode()); hygfjpInverterWarn.setThirdCode(PVProducerInfoEnum.TANYIN.getCode());
hygfjpInverterWarn.setContent(tanYinAlramInfo.getContent()); hygfjpInverterWarn.setContent(tanYinAlramInfo.getContent());
hygfjpInverterWarn.setTreatment(tanYinAlramInfo.getSolution()); hygfjpInverterWarn.setTreatment(tanYinAlramInfo.getSolution());
...@@ -515,7 +529,7 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe ...@@ -515,7 +529,7 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
} }
hygfjpInverterWarn.setTimeLong(null); hygfjpInverterWarn.setTimeLong(null);
if ((!ObjectUtils.isEmpty(tanYinAlramInfo.getFaultOccurTime())) && (!ObjectUtils.isEmpty(tanYinAlramInfo.getFaultEndTime()))) { if ((!ObjectUtils.isEmpty(tanYinAlramInfo.getFaultOccurTime())) && (!ObjectUtils.isEmpty(tanYinAlramInfo.getFaultEndTime()))) {
hygfjpInverterWarn.setTimeLong(this.convertDate(hygfjpInverterWarn.getRecoverTime()) - this.convertDate(hygfjpInverterWarn.getStartTime())); hygfjpInverterWarn.setTimeLong(this.convertDate(hygfjpInverterWarn.getRecoverTime()) - this.convertDate(hygfjpInverterWarn.getStartTime()));
} }
if (ObjectUtils.isEmpty(hygfjpInverterWarn.getCreatedTime())) { if (ObjectUtils.isEmpty(hygfjpInverterWarn.getCreatedTime())) {
hygfjpInverterWarn.setCreatedTime(System.currentTimeMillis()); hygfjpInverterWarn.setCreatedTime(System.currentTimeMillis());
......
...@@ -21,14 +21,14 @@ import java.util.Map; ...@@ -21,14 +21,14 @@ import java.util.Map;
public interface PersonnelBusinessMapper extends BaseMapper<PersonnelBusiness> { public interface PersonnelBusinessMapper extends BaseMapper<PersonnelBusiness> {
IPage<CompanyDtoUserDto> getCompanyDtoUserDtopage(@Param("dto") CompanyDtoUserDto dto); IPage<CompanyDtoUserDto> getCompanyDtoUserDtopage(@Param("dto") CompanyDtoUserDto dto);
Map<String,String> getorgcode(@Param("id")Long id); Map<String, String> getorgcode(@Param("id") Long id);
//根据平台userid 获取人员所属经销商 //根据平台userid 获取人员所属经销商
UserUnitInformationDto getUserUnitInformationDto(@Param("userId")String userId); UserUnitInformationDto getUserUnitInformationDto(@Param("userId") String userId);
//根据平台userid 获取运维人员信息 //根据平台userid 获取运维人员信息
UserUnitInformationDto getMaintenanceUserUnitInformationDto(@Param("userId")String userId); UserUnitInformationDto getMaintenanceUserUnitInformationDto(@Param("userId") String userId);
String selectUserInfo(Long sequenceNbr); String selectUserInfo(Long sequenceNbr);
...@@ -37,6 +37,8 @@ public interface PersonnelBusinessMapper extends BaseMapper<PersonnelBusiness> { ...@@ -37,6 +37,8 @@ public interface PersonnelBusinessMapper extends BaseMapper<PersonnelBusiness> {
void deletePguByUserId(String userId); void deletePguByUserId(String userId);
void deleteRoleByUserId(@Param("userId") String userId, @Param("roleId") Long roleId);
void deleteSubByUserId(String userId); void deleteSubByUserId(String userId);
void deleteHpbByFoundationId(Long sequenceNbr); void deleteHpbByFoundationId(Long sequenceNbr);
...@@ -47,5 +49,7 @@ public interface PersonnelBusinessMapper extends BaseMapper<PersonnelBusiness> { ...@@ -47,5 +49,7 @@ public interface PersonnelBusinessMapper extends BaseMapper<PersonnelBusiness> {
List<String> selectHygfTableName(); List<String> selectHygfTableName();
int countByUserId(@Param("tableName") String tableName, @Param("userId")String userId); int countByUserId(@Param("tableName") String tableName, @Param("userId") String userId);
void deleteOrgRoleByUserId(@Param("userId") String userId, @Param("roleId") Long roleId);
} }
...@@ -16,7 +16,7 @@ import java.util.List; ...@@ -16,7 +16,7 @@ import java.util.List;
* @date 2023-07-15 * @date 2023-07-15
*/ */
public interface PowerStationMapper extends BaseMapper<PowerStation> { public interface PowerStationMapper extends BaseMapper<PowerStation> {
@UserEmpower(field ={"regional_companies_code"} ,dealerField={"a.developer_code","a.regional_companies_code","a.developer_user_id"} ,fieldConditions ={"in","in","in"}, relationship="and") @UserEmpower(field ={"regional_companies_code"} ,dealerField={"developer_code","regional_companies_code","developer_user_id"} ,fieldConditions ={"in","in","in"}, relationship="and")
List<PowerStationDto> queryPage(@Param("powerStationCode") String powerStationCode, List<PowerStationDto> queryPage(@Param("powerStationCode") String powerStationCode,
@Param("ownersName")String ownersName, @Param("ownersName")String ownersName,
@Param("serviceAgent")String serviceAgent, @Param("serviceAgent")String serviceAgent,
......
...@@ -20,5 +20,5 @@ public interface TdHYGFInverterDayGenerateMapper extends BaseMapper<TdHYGFInvert ...@@ -20,5 +20,5 @@ public interface TdHYGFInverterDayGenerateMapper extends BaseMapper<TdHYGFInvert
List<Map<String,Object>> selectSnCodeList(String startTime, String endTime, List<String> sncodes); List<Map<String,Object>> selectSnCodeList(String startTime, String endTime, List<String> sncodes);
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and") @UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<TdHYGFInverterDayGenerate> selectListPage(List<String> snCodeList, List<String> maxCreatedTimeList); List<TdHYGFInverterDayGenerate> selectListPage(List<String> snCodeList, List<String> maxCreatedTimeList, String startTime, String endTime);
} }
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
</where> </where>
ORDER BY ORDER BY
FIELD(hbga.grid_status, '1', '2', '4', '3'), FIELD(hbga.grid_status, '1', '2', '4', '3'),
hogaa.grid_connection_time desc hogaa.grid_connection_time desc, hbga.sequence_nbr desc
</select> </select>
......
...@@ -52,7 +52,8 @@ ...@@ -52,7 +52,8 @@
ifnull(icbc.id_card, ph.id_card) as idCard, ifnull(icbc.id_card, ph.id_card) as idCard,
ph.amos_user_id, ph.amos_user_id,
icbc.open_account_status, icbc.open_account_status,
icbc.protocol_status icbc.protocol_status,
ph.rec_date
FROM FROM
hygf_peasant_household ph LEFT JOIN hygf_icbc_record icbc ON ph.amos_user_id = icbc.amos_user_id hygf_peasant_household ph LEFT JOIN hygf_icbc_record icbc ON ph.amos_user_id = icbc.amos_user_id
<where> <where>
...@@ -86,8 +87,6 @@ ...@@ -86,8 +87,6 @@
<if test="param.offset != null and param.offset != '' and param.limit != null and param.limit != ''"> <if test="param.offset != null and param.offset != '' and param.limit != null and param.limit != ''">
LIMIT ${param.offset}, ${param.limit} LIMIT ${param.offset}, ${param.limit}
</if> </if>
GROUP BY
ph.amos_user_id
ORDER BY ORDER BY
ph.rec_date DESC ph.rec_date DESC
</select> </select>
......
...@@ -385,7 +385,7 @@ ...@@ -385,7 +385,7 @@
<if test="dto.amosCompanyCode!=null"> <if test="dto.amosCompanyCode!=null">
and hygf_jp_station.amos_company_code =#{dto.amosCompanyCode} and hygf_jp_station.amos_company_code =#{dto.amosCompanyCode}
</if> </if>
and hygf_jp_station.`state` is not null and hygf_jp_station.`state` in ("在线","报警","离线") and hygf_jp_station.`state` is not null and hygf_jp_station.`state` in ('在线','报警','离线')
GROUP BY state GROUP BY state
</where> </where>
......
...@@ -132,6 +132,14 @@ select ORG_CODE orgCode from privilege_company where privilege_company.SEQUEN ...@@ -132,6 +132,14 @@ select ORG_CODE orgCode from privilege_company where privilege_company.SEQUEN
DELETE FROM privilege_group_user WHERE USER_ID=#{userId} DELETE FROM privilege_group_user WHERE USER_ID=#{userId}
</select> </select>
<delete id="deleteRoleByUserId">
DELETE FROM privilege_group_user WHERE USER_ID=#{userId} AND GROUP_SEQ = #{roleId}
</delete>
<delete id="deleteOrgRoleByUserId">
DELETE FROM privilege_user_org_role WHERE USER_ID=#{userId} AND ROLE_SEQ = #{roleId}
</delete>
<select id="deleteSubByUserId"> <select id="deleteSubByUserId">
DELETE FROM std_user_biz WHERE amos_user_id=#{userId} DELETE FROM std_user_biz WHERE amos_user_id=#{userId}
</select> </select>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<select id="getMonthPowerint" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.MonthPower"> <select id="getMonthPowerint" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.MonthPower">
SELECT SELECT
avg(power) power, avg(power) power,
third_station_id thirdStationId third_sthird_station_id thirdStationId
FROM house_pv_data.td_hygf_jp_station_power_history where created_time <![CDATA[>=]]> today()-1d-8h and created_time <![CDATA[<]]> today()-8h GROUP BY third_station_id FROM house_pv_data.td_hygf_jp_station_power_history where created_time <![CDATA[>=]]> today()-1d-8h and created_time <![CDATA[<]]> today()-8h GROUP BY third_station_id
</select> </select>
...@@ -14,15 +14,15 @@ ...@@ -14,15 +14,15 @@
<select id="getSumMonthPower" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.YearPower"> <select id="getSumMonthPower" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.YearPower">
SELECT SELECT
sum(power) power, sum(power) power,
tation_id thirdStationId third_station_id thirdStationId
FROM house_pv_data.td_hygf_month_power where year_month=#{date} GROUP BY tation_id FROM house_pv_data.td_hygf_station_power_month where year_month=#{date} GROUP BY third_station_id
</select> </select>
<select id="getSumYearPower" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.AllPower"> <select id="getSumYearPower" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.AllPower">
SELECT SELECT
sum(power) power, sum(power) power,
tation_id thirdStationId third_station_id thirdStationId
FROM house_pv_data.td_hygf_year_power where year=#{date} GROUP BY tation_id FROM house_pv_data.td_hygf_station_power_year where year=#{date} GROUP BY third_station_id
</select> </select>
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
SELECT SELECT
sum(power)num, sum(power)num,
`day` date `day` date
FROM house_pv_data.td_hygf_month_power where tation_id in FROM house_pv_data.td_hygf_station_power_month where third_station_id in
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")"> <foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
SELECT SELECT
sum(power)num, sum(power)num,
`month` date `month` date
FROM house_pv_data.td_hygf_year_power where tation_id in FROM house_pv_data.td_hygf_station_power_year where third_station_id in
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")"> <foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
SELECT SELECT
sum(power)num, sum(power)num,
`year` date `year` date
FROM house_pv_data.td_hygf_all_power where tation_id in FROM house_pv_data.td_hygf_station_power_all where third_station_id in
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")"> <foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
...@@ -77,18 +77,18 @@ ...@@ -77,18 +77,18 @@
SELECT SELECT
sum(power)num, sum(power)num,
`hour` date `hour` date
FROM house_pv_data.td_hygf_day_power FROM house_pv_data.td_hygf_station_power_day
<where> <where>
<if test="dto!=null"> <if test="dto!=null">
tation_id in third_station_id in
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")"> <foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="thirdStationId!=null and thirdStationId != ''"> <if test="thirdStationId!=null and thirdStationId != ''">
and tation_id = #{thirdStationId} and third_station_id = #{thirdStationId}
</if> </if>
</where> </where>
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<where> <where>
created_time >= #{startTime} and created_time &lt;= #{endTime} created_time >= #{startTime} and created_time &lt;= #{endTime}
<if test="sncodes != null and sncodes.size>0"> <if test="sncodes != null and sncodes.size>0">
sn_code in and sn_code in
<foreach collection="sncodes" item="sncode" open="(" close=")" separator=","> <foreach collection="sncodes" item="sncode" open="(" close=")" separator=",">
#{sncode} #{sncode}
</foreach> </foreach>
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
house_pv_data.td_hygf_inverter_day_generate house_pv_data.td_hygf_inverter_day_generate
<where> <where>
<if test="snCodeList != null and snCodeList.size>0"> <if test="snCodeList != null and snCodeList.size>0">
sn_code in and sn_code in
<foreach collection="snCodeList" item="sncode" open="(" close=")" separator=","> <foreach collection="snCodeList" item="sncode" open="(" close=")" separator=",">
#{sncode} #{sncode}
</foreach> </foreach>
...@@ -74,6 +74,12 @@ ...@@ -74,6 +74,12 @@
#{maxCreatedTime} #{maxCreatedTime}
</foreach> </foreach>
</if> </if>
<if test="startTime != null">
and created_time >= #{startTime}
</if>
<if test="endTime != null">
and created_time &lt;= #{endTime}
</if>
</where> </where>
order by created_time desc order by created_time desc
</select> </select>
......
...@@ -179,7 +179,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter ...@@ -179,7 +179,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
}); });
PageHelper.startPage(current, size); PageHelper.startPage(current, size);
List<TdHYGFInverterDayGenerate> tdHYGFInverterDayGenerates = tdHYGFInverterDayGenerateMapper.selectListPage(snCodeList, maxCreatedTimeList); List<TdHYGFInverterDayGenerate> tdHYGFInverterDayGenerates = tdHYGFInverterDayGenerateMapper.selectListPage(snCodeList, null, startTime, endTime);
tdHYGFInverterDayGenerates.forEach(tdHYGFInverterDayGenerate -> { tdHYGFInverterDayGenerates.forEach(tdHYGFInverterDayGenerate -> {
Date date1 = new Date(tdHYGFInverterDayGenerate.getCreatedTime()); Date date1 = new Date(tdHYGFInverterDayGenerate.getCreatedTime());
......
...@@ -25,6 +25,7 @@ import com.yeejoin.amos.component.feign.model.FeignClientResult; ...@@ -25,6 +25,7 @@ import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel; import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.GroupUserModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel; import com.yeejoin.amos.feign.privilege.model.RoleModel;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -342,11 +343,13 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD ...@@ -342,11 +343,13 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
LambdaQueryWrapper<PublicAgencyUser> qud = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PublicAgencyUser> qud = new LambdaQueryWrapper<>();
qud.eq(PublicAgencyUser::getSequenceNbr, id); qud.eq(PublicAgencyUser::getSequenceNbr, id);
PublicAgencyUser publicAgencyUse = publicAgencyUserMapper.selectOne(qud); PublicAgencyUser publicAgencyUse = publicAgencyUserMapper.selectOne(qud);
LambdaQueryWrapper<PersonnelBusiness> qug = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PersonnelBusiness> qug = new LambdaQueryWrapper<>();
qug.eq(PersonnelBusiness::getFoundationId, publicAgencyUse.getSequenceNbr()); qug.eq(PersonnelBusiness::getFoundationId, publicAgencyUse.getSequenceNbr());
PersonnelBusiness personnelBusines = personnelBusinessMapper.selectOne(qug); PersonnelBusiness personnelBusines = personnelBusinessMapper.selectOne(qug);
personnelBusines.setUserType("2"); personnelBusines.setUserType("2");
personnelBusinessMapper.updateById(personnelBusines); personnelBusinessMapper.updateById(personnelBusines);
//获取经销商管理员 //获取经销商管理员
LambdaQueryWrapper<UnitInfo> qudg = new LambdaQueryWrapper<>(); LambdaQueryWrapper<UnitInfo> qudg = new LambdaQueryWrapper<>();
qudg.eq(UnitInfo::getAmosCompanySeq, personnelBusines.getAmosDealerId()); qudg.eq(UnitInfo::getAmosCompanySeq, personnelBusines.getAmosDealerId());
...@@ -355,17 +358,19 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD ...@@ -355,17 +358,19 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
LambdaQueryWrapper<PublicAgencyUser> qudx = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PublicAgencyUser> qudx = new LambdaQueryWrapper<>();
qudx.eq(PublicAgencyUser::getAmosUserId, unitInfo.getAdminUserId()); qudx.eq(PublicAgencyUser::getAmosUserId, unitInfo.getAdminUserId());
PublicAgencyUser publicAgencyUsex = publicAgencyUserMapper.selectOne(qudx); PublicAgencyUser publicAgencyUsex = publicAgencyUserMapper.selectOne(qudx);
LambdaQueryWrapper<PersonnelBusiness> qugf = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PersonnelBusiness> qugf = new LambdaQueryWrapper<>();
qugf.eq(PersonnelBusiness::getFoundationId, publicAgencyUsex.getSequenceNbr()); qugf.eq(PersonnelBusiness::getFoundationId, publicAgencyUsex.getSequenceNbr());
PersonnelBusiness personnelBusinesx = personnelBusinessMapper.selectOne(qugf); PersonnelBusiness personnelBusinesx = personnelBusinessMapper.selectOne(qugf);
personnelBusinesx.setUserType("1"); personnelBusinesx.setUserType("1");
personnelBusinessMapper.updateById(personnelBusinesx); personnelBusinessMapper.updateById(personnelBusinesx);
unitInfo.setAdminLoginName(publicAgencyUse.getAmosUserName()); unitInfo.setAdminLoginName(publicAgencyUse.getAmosUserName());
unitInfo.setAdminPhone(publicAgencyUse.getEmergencyTelephone()); unitInfo.setAdminPhone(publicAgencyUse.getEmergencyTelephone());
unitInfo.setAdminUserId(publicAgencyUse.getAmosUserId()); unitInfo.setAdminUserId(publicAgencyUse.getAmosUserId());
unitInfo.setAdminUserName(publicAgencyUse.getRealName()); unitInfo.setAdminUserName(publicAgencyUse.getRealName());
unitInfoMapper.updateById(unitInfo); unitInfoMapper.updateById(unitInfo);
//修改管理员 //修改管理员
List<Long> roidx = JSONArray.parseArray(publicAgencyUsex.getRole(), Long.class); List<Long> roidx = JSONArray.parseArray(publicAgencyUsex.getRole(), Long.class);
...@@ -410,7 +415,10 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD ...@@ -410,7 +415,10 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
roid.add(userGroupId); roid.add(userGroupId);
if (roid.contains(userGroupempty)) { if (roid.contains(userGroupempty)) {
roid.remove(userGroupempty); roid.remove(userGroupempty);
Privilege.groupUserClient.deleteGroupUser(userGroupempty, publicAgencyUsex.getAmosUserId()); // Privilege.groupUserClient.deleteGroupUser(userGroupempty, publicAgencyUsex.getAmosUserId());
personnelBusinessMapper.deleteRoleByUserId(publicAgencyUse.getAmosUserId(),userGroupempty);
personnelBusinessMapper.deleteOrgRoleByUserId(publicAgencyUse.getAmosUserId(),userGroupempty);
} }
publicAgencyUse.setRole(JSON.toJSONString(roid)); publicAgencyUse.setRole(JSON.toJSONString(roid));
......
package com.yeejoin.amos.boot.module.jxiop.biz.controller; package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -180,6 +181,13 @@ public class IdxBizFanWeightController extends BaseController { ...@@ -180,6 +181,13 @@ public class IdxBizFanWeightController extends BaseController {
LambdaQueryWrapper<IdxBizFanWeight> qu1 = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IdxBizFanWeight> qu1 = new LambdaQueryWrapper<>();
qu1.in(!list1.isEmpty(), IdxBizFanWeight::getSequenceNbr, list1); qu1.in(!list1.isEmpty(), IdxBizFanWeight::getSequenceNbr, list1);
List<IdxBizFanWeight> list = idxBizFanWeightMapper.selectList(qu1); List<IdxBizFanWeight> list = idxBizFanWeightMapper.selectList(qu1);
//如果区域为一个,则权重只能为1
Integer araeCount = idxBizFanWeightMapper.selectCount(new LambdaQueryWrapper<IdxBizFanWeight>().eq(IdxBizFanWeight::getType, "1"));
if(araeCount == 1 && CollectionUtil.isNotEmpty(list) && list.size()==1 && list.get(0).getType().equals("1")){
if(!"1.0000".equals(value.get("data").toString())){
throw new BadRequest("该区域权重只能配置为1");
}
}
IdxBizFanWeight reviewDto = list.get(0); IdxBizFanWeight reviewDto = list.get(0);
LambdaQueryWrapper<IdxBizFanWeight> qu = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IdxBizFanWeight> qu = new LambdaQueryWrapper<>();
//获取所属,同类指标 //获取所属,同类指标
......
package com.yeejoin.amos.boot.module.jxiop.biz.controller; package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...@@ -9,6 +10,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -9,6 +10,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.constants.BizConstant;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jxiop.biz.amosprojectentity.StdUserEmpower; import com.yeejoin.amos.boot.module.jxiop.biz.amosprojectentity.StdUserEmpower;
import com.yeejoin.amos.boot.module.jxiop.biz.amosprojectmapper.UserEmpowerMapper; import com.yeejoin.amos.boot.module.jxiop.biz.amosprojectmapper.UserEmpowerMapper;
...@@ -191,6 +193,13 @@ public class IdxBizPvWeightController extends BaseController { ...@@ -191,6 +193,13 @@ public class IdxBizPvWeightController extends BaseController {
LambdaQueryWrapper<IdxBizPvWeight> qu1 = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IdxBizPvWeight> qu1 = new LambdaQueryWrapper<>();
qu1.in(!list1.isEmpty(), IdxBizPvWeight::getSequenceNbr, list1); qu1.in(!list1.isEmpty(), IdxBizPvWeight::getSequenceNbr, list1);
List<IdxBizPvWeight> list = idxBizPvWeightMapper.selectList(qu1); List<IdxBizPvWeight> list = idxBizPvWeightMapper.selectList(qu1);
//如果区域为一个,则权重只能为1
Integer araeCount = idxBizPvWeightMapper.selectCount(new LambdaQueryWrapper<IdxBizPvWeight>().eq(IdxBizPvWeight::getType, "1"));
if(araeCount == 1 &&CollectionUtil.isNotEmpty(list) && list.size()==1 && list.get(0).getType().equals("1")){
if(!"1.0000".equals(value.get("data").toString())){
throw new BadRequest("该区域权重只能配置为1");
}
}
IdxBizPvWeight reviewDto = list.get(0); IdxBizPvWeight reviewDto = list.get(0);
LambdaQueryWrapper<IdxBizPvWeight> qu = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IdxBizPvWeight> qu = new LambdaQueryWrapper<>();
//获取所属,同类指标 //获取所属,同类指标
......
...@@ -102,7 +102,6 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth ...@@ -102,7 +102,6 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC")); Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
//限制必须是区间时间段 //限制必须是区间时间段
if(startTime==null||endTime==null){ if(startTime==null||endTime==null){
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
count( 1 ) as value count( 1 ) as value
FROM FROM
sjgl_zsj_zsbtz a sjgl_zsj_zsbtz a
INNER JOIN privilege_company b on a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station' LEFT JOIN privilege_company b on a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station'
<where> <where>
<if test="parentCode != null and parentCode != ''"> <if test="parentCode != null and parentCode != ''">
b.ORG_CODE like concat(#{parentCode},'%') b.ORG_CODE like concat(#{parentCode},'%')
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
count(1) as value count(1) as value
FROM FROM
fdgl_job_main a fdgl_job_main a
INNER JOIN privilege_company b on a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station' LEFT JOIN privilege_company b on a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station'
<where> <where>
<if test="parentCode != null and parentCode != ''"> <if test="parentCode != null and parentCode != ''">
b.ORG_CODE like concat(#{parentCode},'%') b.ORG_CODE like concat(#{parentCode},'%')
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
else 3 end) as sort else 3 end) as sort
FROM FROM
sjgl_zsj_zsbtz a sjgl_zsj_zsbtz a
INNER JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station' LEFT JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station'
<where> <where>
<if test="parentCode != null and parentCode != ''"> <if test="parentCode != null and parentCode != ''">
AND b.ORG_CODE like concat(#{parentCode},'%') AND b.ORG_CODE like concat(#{parentCode},'%')
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
count(1) count(1)
FROM FROM
sjgl_zsj_zsbtz a sjgl_zsj_zsbtz a
INNER JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station' LEFT JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station'
<where> <where>
<if test="parentCode != null and parentCode != ''"> <if test="parentCode != null and parentCode != ''">
AND b.ORG_CODE like concat(#{parentCode},'%') AND b.ORG_CODE like concat(#{parentCode},'%')
...@@ -165,7 +165,7 @@ ...@@ -165,7 +165,7 @@
else 3 end as sort else 3 end as sort
FROM FROM
fdgl_job_main a fdgl_job_main a
INNER JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station' LEFT JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station'
left join sjgl_zsj_zsbtz c on a.EQUIP_DBID = c.DBID left join sjgl_zsj_zsbtz c on a.EQUIP_DBID = c.DBID
<where> <where>
<if test="parentCode != null and parentCode != ''"> <if test="parentCode != null and parentCode != ''">
...@@ -190,7 +190,7 @@ ...@@ -190,7 +190,7 @@
count(1) count(1)
FROM FROM
fdgl_job_main a fdgl_job_main a
INNER JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station' LEFT JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station'
<where> <where>
<if test="parentCode != null and parentCode != ''"> <if test="parentCode != null and parentCode != ''">
AND b.ORG_CODE like concat(#{parentCode},'%') AND b.ORG_CODE like concat(#{parentCode},'%')
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SjglZsjZsbtzMapper"> <mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SjglZsjZsbtzMapper">
<select id="getStationCapactityByStationWerks" resultType="Double"> <select id="getStationCapactityByStationWerks" resultType="Double">
select SUM(CAPACITYL) from sjgl_zsj_zsbtz where WERKS = #{WERKS} and is_del = 0 and CAPACITYL is not null select SUM(CAPACITYL) from sjgl_zsj_zsbtz where WERKS = #{WERKS} and is_del = 0 and CAPACITYL is not null and CAPACITYL != ''
</select> </select>
<select id="getStationInfoMapByStationWerks" resultType="map"> <select id="getStationInfoMapByStationWerks" resultType="map">
......
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