Commit 6d11a1ea authored by 吴江's avatar 吴江

Merge branch 'dev0124' into 'developer'

Dev0124 See merge request !21
parents fedd94ca 03a22d5b
package com.yeejoin.amos.boot.module.hygf.api.Enum;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum FinancingAuditEnum {
待融资审核("FinancingAudit","待融资审核","/hygf/drzsh"),
审核不通过("AuditReject","整改待推送","/hygf/zgdts"),
待整改("WaitAbarbeitung","待整改","/hygf/dzg"),
整改待推送("AbarbeitungWaitPush","审核不通过","/hygf/shym"),
审核通过("AuditPass","审核通过","/hygf/fkym"),
放款完成("complete","放款完成","");
private String code;
private String name;
//路由r
private String routing;
/**
* 编码
*/
public static String getNameByCode(String code){
String name = null;
for (FinancingAuditEnum value : FinancingAuditEnum.values()) {
if (value.getCode().equals(code)){
name= value.getName();
}
}
return name;
}
public static String getNodeByCode(String code){
String rout = null;
for (FinancingAuditEnum value : FinancingAuditEnum.values()) {
if (value.getCode().equals(code)){
rout= value.getRouting();
}
}
return rout;
}
}
...@@ -307,7 +307,7 @@ public class UserEmpowerInterceptor implements Interceptor { ...@@ -307,7 +307,7 @@ public class UserEmpowerInterceptor implements Interceptor {
sql = sql+ getnotInData( filed,wnotdata); sql = sql+ getnotInData( filed,wnotdata);
} }
//内部全选, 外度全选 //内部全选, 外度全选
if(wdata!=null&&wdata.size()!=0&&wnotdata==null){ if(wdata!=null&&wdata.size()!=0&&(wnotdata==null||wnotdata.size() == 0)){
//返回恒等看所有 //返回恒等看所有
sql= sql+" 1=1 "; sql= sql+" 1=1 ";
} }
...@@ -323,7 +323,7 @@ public class UserEmpowerInterceptor implements Interceptor { ...@@ -323,7 +323,7 @@ public class UserEmpowerInterceptor implements Interceptor {
sql = sql+getInData( filed,data); sql = sql+getInData( filed,data);
} }
//内部选一部分 外部选一部分 //内部选一部分 外部选一部分
if(wdata!=null&&wdata.size()!=0&&wnotdata!=null){ if(wdata!=null&&wdata.size()!=0&&wnotdata!=null&&wnotdata.size()!=0){
data.addAll(wdata); data.addAll(wdata);
sql = sql+getInData( filed,data); sql = sql+getInData( filed,data);
......
...@@ -76,7 +76,7 @@ public class UserLimitsAdvice { ...@@ -76,7 +76,7 @@ public class UserLimitsAdvice {
stdUserEmpower.setFlag(false); stdUserEmpower.setFlag(false);
stdUserEmpower.setDeveloperId(userUnitInformationDto!=null?userUnitInformationDto.getAmosUnitInfoId():null); stdUserEmpower.setDeveloperId(userUnitInformationDto!=null?userUnitInformationDto.getAmosUnitInfoId():null);
stdUserEmpower.setRegionalCompaniesCode(userUnitInformationDto!=null?userUnitInformationDto.getRegionalCompaniesCode():null); stdUserEmpower.setRegionalCompaniesCode(userUnitInformationDto!=null?userUnitInformationDto.getRegionalCompaniesCode():null);
stdUserEmpower.setAmosOrgCode(Arrays.asList(userUnitInformationDto.getAmosUnitOrgCode())); stdUserEmpower.setAmosOrgCode(Arrays.asList(userUnitInformationDto.getAmosDealerOrgCode()));
int num = StringUtils.countMatches(org, ROLEFLAG); int num = StringUtils.countMatches(org, ROLEFLAG);
if (org.contains(ROLEFLDEVELOP) && num<2 ){ if (org.contains(ROLEFLDEVELOP) && num<2 ){
stdUserEmpower.setUserId(userid); stdUserEmpower.setUserId(userid);
......
package com.yeejoin.amos.boot.module.hygf.api.dto; package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.support.spring.annotation.FastJsonFilter;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* *
...@@ -34,6 +38,7 @@ public class FinancingInfoDto extends BaseDto { ...@@ -34,6 +38,7 @@ public class FinancingInfoDto extends BaseDto {
private Long peasantHouseholdId; private Long peasantHouseholdId;
@ApiModelProperty(value = "放款时间") @ApiModelProperty(value = "放款时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
private Date disbursementTime; private Date disbursementTime;
@ApiModelProperty(value = "元") @ApiModelProperty(value = "元")
...@@ -45,4 +50,12 @@ public class FinancingInfoDto extends BaseDto { ...@@ -45,4 +50,12 @@ public class FinancingInfoDto extends BaseDto {
@ApiModelProperty(value = "状态") @ApiModelProperty(value = "状态")
private String status; private String status;
@ApiModelProperty(value = "农户id")
private String peasantHouseholdIds;
private String instanceId;
@ApiModelProperty(value = "附件")
private List<Object> files;
} }
package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
/**
* 投融整改单
*
* @author system_generator
* @date 2024-04-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="FinancingRectificationOrderDto", description="投融整改单")
public class FinancingRectificationOrderDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "整改单号")
private String rectificationOrderCode;
@ApiModelProperty(value = "农户id")
private Long peasantHouseholdId;
@ApiModelProperty(value = "农户名称")
private String peasantHouseholdName;
@ApiModelProperty(value = "农户编号")
private String peasantHouseholdNo;
@ApiModelProperty(value = "地址")
private String projectAddress;
@ApiModelProperty(value = "问题描述")
private String problemDescription;
@ApiModelProperty(value = "整改状态")
private String rectificationStatus;
@ApiModelProperty(value = "整改描述")
private String rectificationDescription;
@ApiModelProperty(value = "完成日期")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
private Date completeDate;
@ApiModelProperty(value = "负责人ID")
private Long responsibleUserId;
@ApiModelProperty(value = "负责人姓名")
private String responsibleUserName;
@ApiModelProperty(value = "负责人电话")
private String responsibleUserPhone;
@ApiModelProperty(value = "整改照片")
private String rectificationPhoto;
@ApiModelProperty(value = "整改照片")
private List<Object> rectificationPhotos;
}
...@@ -30,6 +30,9 @@ public class PowerStationDto extends BaseDto { ...@@ -30,6 +30,9 @@ public class PowerStationDto extends BaseDto {
@ApiModelProperty(value = "项目地址") @ApiModelProperty(value = "项目地址")
private String projectAddress; private String projectAddress;
@ApiModelProperty(value = "项目详细地址")
private String projectAddressDetail;
@ApiModelProperty(value = "服务代理商") @ApiModelProperty(value = "服务代理商")
private String serviceAgent; private String serviceAgent;
......
package com.yeejoin.amos.boot.module.hygf.api.dto;
import lombok.Data;
@Data
public class WorkflowResultDto {
/**
* WORKFLOW实例ids
*/
String instanceId;
// /**
// * 执行人角色
// */
// String nextExecutorIds;
String executorId;
String executorName;
String createUserId;
/**
* 下一步执行人角色
*/
String nextExecutorIds;
String nextTaskId;
/**
* 下一步执行人用户id
*/
String nextExecuteUserIds;
/**
* 当前节点任务名称
*/
String taskName;
/**
* 下一节点任务名称
*/
String nextNodeName;
/**
* 下一节点code
*/
String nextNodeCode;
String nextNodeKey;
}
...@@ -51,4 +51,26 @@ public class DayGenerate { ...@@ -51,4 +51,26 @@ public class DayGenerate {
// 日收益 // 日收益
private Double income; private Double income;
@TableField("regional_companies_code")
private String regionalCompaniesCode;
@TableField("amos_company_code")
private String amosCompanyCode;
@TableField("station_name")
private String stationName;
@TableField("station_state")
private String stationState;
} }
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 投融整改单
*
* @author system_generator
* @date 2024-04-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("hygf_financing_rectification_order")
public class FinancingRectificationOrder extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 整改单号
*/
@TableField("rectification_order_code")
private String rectificationOrderCode;
/**
* 农户id
*/
@TableField("peasant_household_id")
private Long peasantHouseholdId;
/**
* 农户名称
*/
@TableField("peasant_household_name")
private String peasantHouseholdName;
/**
* 问题描述
*/
@TableField("problem_description")
private String problemDescription;
/**
* 整改状态
*/
@TableField("rectification_status")
private String rectificationStatus;
/**
* 整改描述
*/
@TableField("rectification_description")
private String rectificationDescription;
/**
* 完成日期
*/
@TableField("complete_date")
private Date completeDate;
/**
* 负责人ID
*/
@TableField("responsible_user_id")
private Long responsibleUserId;
/**
* 负责人姓名
*/
@TableField("responsible_user_name")
private String responsibleUserName;
/**
* 负责人电话
*/
@TableField("responsible_user_phone")
private String responsibleUserPhone;
/**
* 整改照片
*/
@TableField("rectification_photo")
private String rectificationPhoto;
}
...@@ -53,4 +53,16 @@ public class MonthGenerate { ...@@ -53,4 +53,16 @@ public class MonthGenerate {
// 月收益 // 月收益
@TableField("income") @TableField("income")
private Double income; private Double income;
@TableField("regional_companies_code")
private String regionalCompaniesCode;
@TableField("amos_company_code")
private String amosCompanyCode;
@TableField("station_name")
private String stationName;
@TableField("station_state")
private String stationState;
} }
...@@ -99,4 +99,13 @@ public class TdHygfJpInverterWarn { ...@@ -99,4 +99,13 @@ public class TdHygfJpInverterWarn {
@TableField("handler_status") @TableField("handler_status")
private String handlerStatus ; private String handlerStatus ;
@TableField("station_name")
private String stationName; //名称
@TableField("regional_companies_code")
private String regionalCompaniesCode; //区域公司code
@TableField("amos_company_code")
private String amosCompanyCode; //经销商code
} }
...@@ -51,4 +51,15 @@ public class YearGenerate { ...@@ -51,4 +51,15 @@ public class YearGenerate {
// 年收益 // 年收益
@TableField("income") @TableField("income")
private Double income; private Double income;
@TableField("regional_companies_code")
private String regionalCompaniesCode;
@TableField("amos_company_code")
private String amosCompanyCode;
@TableField("station_name")
private String stationName;
@TableField("station_state")
private String stationState;
} }
package com.yeejoin.amos.boot.module.hygf.api.mapper; package com.yeejoin.amos.boot.module.hygf.api.mapper;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.dto.FinancingInfoDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.FinancingInfo; import com.yeejoin.amos.boot.module.hygf.api.entity.FinancingInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -13,7 +16,14 @@ import java.util.Map; ...@@ -13,7 +16,14 @@ import java.util.Map;
* @date 2024-04-01 * @date 2024-04-01
*/ */
public interface FinancingInfoMapper extends BaseMapper<FinancingInfo> { public interface FinancingInfoMapper extends BaseMapper<FinancingInfo> {
@UserEmpower(field = {"sta.regional_companies_code"},dealerField = {"sta.developer_code","sta.regional_companies_code"},fieldConditions = {"eq","in"},relationship = {"and"})
List<Map<String,Object>> getStationFinancingInfoList(@Param(value = "params") Map<String,Object> params,@Param(value = "amosOrgCodes")List<String> amosOrgCodes);
List<Map<String,String>> getStationFinancingInfoList();
FinancingInfoDto selectDataInfo(@Param("peasantHouseholdId")Long peasantHouseholdId);
List<Map<String,Object>> selectOrgList();
Map<String,Object> selectRZOrgInfo(Long id);
} }
package com.yeejoin.amos.boot.module.hygf.api.mapper;
import com.yeejoin.amos.boot.module.hygf.api.dto.FinancingRectificationOrderDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.FinancingRectificationOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
/**
* 投融整改单 Mapper 接口
*
* @author system_generator
* @date 2024-04-02
*/
public interface FinancingRectificationOrderMapper extends BaseMapper<FinancingRectificationOrder> {
public List<FinancingRectificationOrderDto> selectDataList(Long peasantHouseholdId);
}
...@@ -21,7 +21,11 @@ import java.util.Map; ...@@ -21,7 +21,11 @@ import java.util.Map;
* @date 2023-09-19 * @date 2023-09-19
*/ */
public interface JpStationMapper extends BaseMapper<JpStation> { public interface JpStationMapper extends BaseMapper<JpStation> {
@UserEmpower(field ={"hygf_jp_station.regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<JpStationDto> queryForDealerReviewPage(@Param("dto") JpStationDto reviewDto); List<JpStationDto> queryForDealerReviewPage(@Param("dto") JpStationDto reviewDto);
JpStationDto queryCount(@Param("dto") JpStationDto reviewDto); JpStationDto queryCount(@Param("dto") JpStationDto reviewDto);
List<Map<String,Object>> countState(@Param("dto") JpStationDto reviewDto); List<Map<String,Object>> countState(@Param("dto") JpStationDto reviewDto);
List<Map<String,Double>> getPowerqx(String dateType); List<Map<String,Double>> getPowerqx(String dateType);
...@@ -65,13 +69,15 @@ public interface JpStationMapper extends BaseMapper<JpStation> { ...@@ -65,13 +69,15 @@ public interface JpStationMapper extends BaseMapper<JpStation> {
List<DropDown> getDealerNew(@Param("regionalCompaniesSeq") String regionalCompaniesSeq); List<DropDown> getDealerNew(@Param("regionalCompaniesSeq") String regionalCompaniesSeq);
// @UserEmpower(field ={"ORG_CODE"} ,dealerField ={"ORG_CODE"}, fieldConditions ={"in","in"} ,relationship="and",specific=false) @UserEmpower(field ={"ORG_CODE"} ,dealerField ={"ORG_CODE"}, fieldConditions ={"in","in"} ,relationship="and",specific=false)
List<PowerStationStatistics> getRegionPage(String regionName); List<PowerStationStatistics> getRegionPage(String regionName);
PowerStationStatistics getRegionStatistics(String code); PowerStationStatistics getRegionStatistics(@Param("regionCode") String regionCode,@Param("code") String code);
List<PowerStationStatistics> getDealerPage(String regionalCompaniesCode, String dealerName);
List<PowerStationStatistics> getDealerPage(String regionCompanyOrgCode, String dealerName); @UserEmpower(field ={"hygf_jp_station.regional_companies_code"},dealerField ={"hygf_jp_station.amos_company_code","hygf_jp_station.regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<JpStationDto> queryAllPowerStation(String regionalCompaniesCode, String amosCompanyCode, String powerStationId);
} }
...@@ -20,5 +20,6 @@ public interface PowerStationMapper extends BaseMapper<PowerStation> { ...@@ -20,5 +20,6 @@ public interface PowerStationMapper extends BaseMapper<PowerStation> {
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,
@Param("regionalCompaniesName")String regionalCompaniesName); @Param("regionalCompaniesName")String regionalCompaniesName,
@Param("processStatus")String processStatus);
} }
...@@ -23,7 +23,8 @@ public interface UnitInfoMapper extends BaseMapper<UnitInfo> { ...@@ -23,7 +23,8 @@ public interface UnitInfoMapper extends BaseMapper<UnitInfo> {
//获取单位分页列表 @Param("offset") long offset, @Param("pageSize") long pageSize, //获取单位分页列表 @Param("offset") long offset, @Param("pageSize") long pageSize,
IPage<CompanyDto> getCompanyDto(@Param("dto") CompanyDto dto); IPage<CompanyDto> getCompanyDto(@Param("dto") CompanyDto dto);
Map<String,Integer> getCompanyDtoCount(@Param("dto")CompanyDto dto); Map<String,Integer> getCompanyDtoCount(@Param("dto")CompanyDto dto);
List< Map<String,Object>> getuserList(@Param("userName") String userName,@Param("role") Long role,@Param("regionalCompaniesSeq") Long regionalCompaniesSeq,@Param("amosUnitId") Long amosUnitId); //List< Map<String,Object>> getuserList(@Param("userName") String userName,@Param("role") Long role,@Param("regionalCompaniesSeq") Long regionalCompaniesSeq,@Param("amosUnitId") Long amosUnitId);
List< Map<String,Object>> getuserListByOrgCode(@Param("userName") String userName,@Param("role") Long role,@Param("regionalCompaniesSeq") Long regionalCompaniesSeq,@Param("amosOrgCode") String amosOrgCode);
List< Map<String,Object>> getuserListtelephone(@Param("userName") String userName,@Param("role") Long role,@Param("regionalCompaniesSeq") Long regionalCompaniesSeq,@Param("amosUnitId") Long amosUnitId); List< Map<String,Object>> getuserListtelephone(@Param("userName") String userName,@Param("role") Long role,@Param("regionalCompaniesSeq") Long regionalCompaniesSeq,@Param("amosUnitId") Long amosUnitId);
@UserEmpower(field ={"hygf_regional_companies.regional_companies_code"} ,dealerField ={} ,fieldConditions ={"in"} ,relationship="and") @UserEmpower(field ={"hygf_regional_companies.regional_companies_code"} ,dealerField ={} ,fieldConditions ={"in"} ,relationship="and")
......
...@@ -12,6 +12,7 @@ import java.util.List; ...@@ -12,6 +12,7 @@ import java.util.List;
*/ */
public interface IDayGenerateService { public interface IDayGenerateService {
List<DayGenerate> getDayGenerateph( List<JpStation> dto, String sort,String dateTime); List<DayGenerate> getDayGenerateph( List<JpStation> dto, String regionalCompaniesCode,
String amosCompanyCode, String sort,String dateTime);
} }
package com.yeejoin.amos.boot.module.hygf.api.service; package com.yeejoin.amos.boot.module.hygf.api.service;
import com.yeejoin.amos.boot.module.hygf.api.dto.FinancingInfoDto;
import java.util.Map;
/** /**
* 接口类 * 接口类
* *
...@@ -9,4 +13,11 @@ package com.yeejoin.amos.boot.module.hygf.api.service; ...@@ -9,4 +13,11 @@ package com.yeejoin.amos.boot.module.hygf.api.service;
*/ */
public interface IFinancingInfoService { public interface IFinancingInfoService {
void rollback(String processId, String peasantHouseholdId);
FinancingInfoDto selectDataInfo(Long sequenceNbr);
void execueFlow(Map<String, Object> params);
} }
package com.yeejoin.amos.boot.module.hygf.api.service;
/**
* 投融整改单接口类
*
* @author system_generator
* @date 2024-04-02
*/
public interface IFinancingRectificationOrderService {
}
package com.yeejoin.amos.boot.module.hygf.api.service; package com.yeejoin.amos.boot.module.hygf.api.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.github.pagehelper.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto; import com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationStatistics; import com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationStatistics;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpStation; import com.yeejoin.amos.boot.module.hygf.api.entity.JpStation;
...@@ -36,7 +36,10 @@ public interface IJpStationService { ...@@ -36,7 +36,10 @@ public interface IJpStationService {
Map<String, List<Object>> getPowerqxnew(String date, JpStationDto reviewDto); Map<String, List<Object>> getPowerqxnew(String date, JpStationDto reviewDto);
Page<PowerStationStatistics> getRegionStatistics(Integer current, Integer size, String regionName); com.baomidou.mybatisplus.extension.plugins.pagination.Page<PowerStationStatistics> getRegionStatistics(Integer current, Integer size, String regionName);
com.baomidou.mybatisplus.extension.plugins.pagination.Page<PowerStationStatistics> getDealerStatistics(Integer current, Integer size, String regionalCompaniesCode, String dealerName);
Page<PowerStationStatistics> getDealerStatistics(Integer current, Integer size, String regionCompanyOrgCode, String dealerName);
} }
package com.yeejoin.amos.boot.module.hygf.api.service; package com.yeejoin.amos.boot.module.hygf.api.service;
import com.yeejoin.amos.boot.module.hygf.api.dto.PeasantHouseholdDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold;
import java.util.List;
/** /**
* 农户信息接口类 * 农户信息接口类
* *
...@@ -10,6 +15,5 @@ package com.yeejoin.amos.boot.module.hygf.api.service; ...@@ -10,6 +15,5 @@ package com.yeejoin.amos.boot.module.hygf.api.service;
public interface IPeasantHouseholdService { public interface IPeasantHouseholdService {
List<PeasantHousehold> getInfoByIds(String ids);
} }
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper; package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.dto.PowerCurveDto; import com.yeejoin.amos.boot.module.hygf.api.dto.PowerCurveDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.DayGenerate; 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.JpStation;
...@@ -18,17 +22,32 @@ public interface DayGenerateMapper extends BaseMapper<DayGenerate> { ...@@ -18,17 +22,32 @@ public interface DayGenerateMapper extends BaseMapper<DayGenerate> {
//日发电量排行 //日发电量排行
// desc 前十名 // desc 前十名
// asc 后十名 // asc 后十名
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<DayGenerate> getDayGenerateph(@Param("dto") List<JpStation> dto, @Param("sort")String sort,@Param("dateTime")String dateTime); List<DayGenerate> getDayGenerateph(@Param("dto") List<JpStation> dto,
@Param("regionalCompaniesCode") String regionalCompaniesCode,
@Param("amosCompanyCode") String amosCompanyCode,
@Param("sort")String sort,
List<PowerCurveDto> getDayGeneratqx(@Param("date") String month, @Param("dto")List<String> statioId); @Param("dateTime")String dateTime);
List<PowerCurveDto> getMonthGenerateqx(@Param("date") String month, @Param("dto")List<String> statioId);
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<PowerCurveDto> getYearGenerateqx(@Param("date") String month, @Param("dto")List<String> statioId); List<PowerCurveDto> getDayGeneratqx(@Param("date") String month, @Param("thirdStationId") String thirdStationId,@Param("dto")List<String> statioId);
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<PowerCurveDto> getMonthGenerateqx(@Param("date") String month, @Param("thirdStationId") String thirdStationId, @Param("dto")List<String> statioId);
List<DayGenerate> selectPagenewDayGenerate(@Param("current") int current,@Param("size") int size,@Param("dto") List<String> statioId, @Param("dateTime")String dateTime ); @UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<PowerCurveDto> getYearGenerateqx(@Param("date") String month, @Param("thirdStationId") String thirdStationId, @Param("dto")List<String> statioId);
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<DayGenerate> selectPagenewDayGenerate(@Param("current") int current,
@Param("size") int size,@Param("dto")
List<String> statioId,
@Param("dateTime")String dateTime,
@Param("stationState")String stationState);
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
Integer selectCount(@Param(Constants.WRAPPER) Wrapper<DayGenerate> queryWrapper);
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<DayGenerate> selectList(@Param(Constants.WRAPPER) Wrapper<DayGenerate> queryWrapper);
} }
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper; package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.entity.DayGenerate;
import com.yeejoin.amos.boot.module.hygf.api.entity.MonthGenerate; import com.yeejoin.amos.boot.module.hygf.api.entity.MonthGenerate;
import com.yeejoin.amos.boot.module.hygf.api.entity.YearGenerate;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
public interface MonthGenerateMapper extends BaseMapper<MonthGenerate> { public interface MonthGenerateMapper extends BaseMapper<MonthGenerate> {
List<MonthGenerate> selectPagenewMonthGenerate(@Param("current") int current,@Param("size") int size,@Param("dto") List<String> statioId, @Param("dateTime")String dateTime ); @UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<MonthGenerate> selectPagenewMonthGenerate(@Param("current") int current,@Param("size") int size,@Param("dto") List<String> statioId,
@Param("dateTime")String dateTime,
@Param("stationState")String stationState );
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<MonthGenerate> selectList(@Param(Constants.WRAPPER) Wrapper<MonthGenerate> queryWrapper);
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
Integer selectCount(@Param(Constants.WRAPPER) Wrapper<MonthGenerate> queryWrapper);
} }
...@@ -31,6 +31,6 @@ public interface MonthPowerMapper extends BaseMapper<MonthPower> { ...@@ -31,6 +31,6 @@ public interface MonthPowerMapper extends BaseMapper<MonthPower> {
List<PowerCurveDto> getAllPower(@Param("date") String month,@Param("dto")List<String> statioId); List<PowerCurveDto> getAllPower(@Param("date") String month,@Param("dto")List<String> statioId);
List<PowerCurveDto> getDayPowercount(@Param("date") String month,@Param("dto")List<String> statioId); List<PowerCurveDto> getDayPowercount(@Param("date") String month,@Param("dto")List<String> statioId,@Param("thirdStationId") String thirdStationId);
} }
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper; package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHYGFInverterDayGenerate; import com.yeejoin.amos.boot.module.hygf.api.entity.TdHYGFInverterDayGenerate;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -9,6 +13,6 @@ import java.util.Map; ...@@ -9,6 +13,6 @@ import java.util.Map;
public interface TdHYGFInverterDayGenerateMapper extends BaseMapper<TdHYGFInverterDayGenerate> { public interface TdHYGFInverterDayGenerateMapper extends BaseMapper<TdHYGFInverterDayGenerate> {
List<Map<String,Object>> selectDayTrend(List<String> treeParams, String time, String snCode, String thirdStationId); List<Map<String,Object>> selectDayTrend(List<String> treeParams, String time, String snCode, String thirdStationId);
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<TdHYGFInverterDayGenerate> selectList(@Param(Constants.WRAPPER) Wrapper<TdHYGFInverterDayGenerate> queryWrapper);
} }
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper; package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHYGFInverterDayGenerate;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHYGFInverterMonthGenerate; import com.yeejoin.amos.boot.module.hygf.api.entity.TdHYGFInverterMonthGenerate;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -10,4 +15,8 @@ public interface TdHYGFInverterMonthGenerateMapper extends BaseMapper<TdHYGFInve ...@@ -10,4 +15,8 @@ public interface TdHYGFInverterMonthGenerateMapper extends BaseMapper<TdHYGFInve
List<Map<String,Object>> selectMonthTrend(String time, String snCode, String thirdStationId); List<Map<String,Object>> selectMonthTrend(String time, String snCode, String thirdStationId);
Map<String,Object> selectMonthTotal(String time, String snCode, String thirdStationId); Map<String,Object> selectMonthTotal(String time, String snCode, String thirdStationId);
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<TdHYGFInverterMonthGenerate> selectList(@Param(Constants.WRAPPER) Wrapper<TdHYGFInverterMonthGenerate> queryWrapper);
} }
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper; package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHYGFInverterMonthGenerate;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHYGFInverterTotalGenerate; import com.yeejoin.amos.boot.module.hygf.api.entity.TdHYGFInverterTotalGenerate;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHYGFInverterYearGenerate; import com.yeejoin.amos.boot.module.hygf.api.entity.TdHYGFInverterYearGenerate;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -14,4 +19,7 @@ public interface TdHYGFInverterYearGenerateMapper extends BaseMapper<TdHYGFInver ...@@ -14,4 +19,7 @@ public interface TdHYGFInverterYearGenerateMapper extends BaseMapper<TdHYGFInver
Map<String, Object> selectYearTotal(String time, String snCode, String thirdStationId); Map<String, Object> selectYearTotal(String time, String snCode, String thirdStationId);
List<TdHYGFInverterTotalGenerate> selectTotalSum(String time, String snCode, String thirdStationId); List<TdHYGFInverterTotalGenerate> selectTotalSum(String time, String snCode, String thirdStationId);
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<TdHYGFInverterYearGenerate> selectList(@Param(Constants.WRAPPER) Wrapper<TdHYGFInverterYearGenerate> queryWrapper);
} }
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper; package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto; import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpStation; import com.yeejoin.amos.boot.module.hygf.api.entity.JpStation;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInverterWarn; import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInverterWarn;
...@@ -29,10 +30,17 @@ public interface TdHygfJpInverterWarnMapper extends BaseMapper<TdHygfJpInverterW ...@@ -29,10 +30,17 @@ public interface TdHygfJpInverterWarnMapper extends BaseMapper<TdHygfJpInverterW
TdHygfJpInverterWarnDto getByTime(@Param("createdTime") long createdTime); TdHygfJpInverterWarnDto getByTime(@Param("createdTime") long createdTime);
List<TdHygfJpInverterWarnDto> selectWarnList(String state, String level, String minvalue, String maxValue, String snCode, List<String> stationId, String startTime, String endTime, String content, Integer current, Integer size,String handlerStatus);
int selectWarnListTotal(String state, String level, String minvalue, String maxValue, String snCode, List<String> stationId, String startTime, String endTime, String content,String handlerStatus); @UserEmpower(field = {"regional_companies_code"}, dealerField = {"amos_company_code", "regional_companies_code"}, fieldConditions = {"eq", "in"}, relationship = "and")
List<TdHygfJpInverterWarnDto> selectWarnList(String state, String level, String minvalue, String maxValue, String snCode, List<String> stationId, String startTime, String endTime, String content, Integer current, Integer size, String handlerStatus, String stationName);
@UserEmpower(field = {"regional_companies_code"}, dealerField = {"amos_company_code", "regional_companies_code"}, fieldConditions = {"eq", "in"}, relationship = "and")
int selectWarnListTotal(String state, String level, String minvalue, String maxValue, String snCode, List<String> stationId, String startTime, String endTime, String content, String handlerStatus, String stationName);
@Select("SELECT * from td_hygf_jp_inverter_warn WHERE (third_station_id = #{thirdStationId} AND sn_code = #{sncode} AND created_time = #{createdTime})") @Select("SELECT * from td_hygf_jp_inverter_warn WHERE (third_station_id = #{thirdStationId} AND sn_code = #{sncode} AND created_time = #{createdTime})")
TdHygfJpInverterWarn getInverTerWarnByparams(@Param("createdTime") long createdTime, @Param("sncode") String snCode, @Param("thirdStationId") String thirdStationId); TdHygfJpInverterWarn getInverTerWarnByparams(@Param("createdTime") long createdTime, @Param("sncode") String snCode, @Param("thirdStationId") String thirdStationId);
// @UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<TdHygfJpInverterWarnDto> queryAlarmNumber(@Param("thirdStationIds") List<String> thirdStationIds);
} }
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper; package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.entity.DayGenerate;
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.YearGenerate;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -12,6 +17,15 @@ import java.util.List; ...@@ -12,6 +17,15 @@ import java.util.List;
* @createDate: 2023/11/8 * @createDate: 2023/11/8
*/ */
public interface YearGenerateMapper extends BaseMapper<YearGenerate> { public interface YearGenerateMapper extends BaseMapper<YearGenerate> {
List<YearGenerate> selectPagenewYearGenerate(@Param("current") int current,@Param("size") int size,@Param("dto") List<String> statioId, @Param("dateTime")String dateTime ); @UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<YearGenerate> selectPagenewYearGenerate(@Param("current") int current,@Param("size") int size,@Param("dto") List<String> statioId,
@Param("dateTime")String dateTime,
@Param("stationState")String stationState );
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<YearGenerate> selectList(@Param(Constants.WRAPPER) Wrapper<YearGenerate> queryWrapper);
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
Integer selectCount(@Param(Constants.WRAPPER) Wrapper<YearGenerate> queryWrapper);
} }
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!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.api.mapper.FinancingAuditingMapper"> <mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.FinancingAuditingMapper">
</mapper> </mapper>
...@@ -4,16 +4,69 @@ ...@@ -4,16 +4,69 @@
<select id="getStationFinancingInfoList" resultType="java.util.Map"> <select id="getStationFinancingInfoList" resultType="java.util.Map">
SELECT sta.* FROM (SELECT
hph.sequence_nbr AS sequenceNbr,
hph.peasant_household_no peasantHouseholdNo,
hph.owners_name AS ownersName,
concat(hph.project_address_name,project_address_detail) AS projectAddress,
hph.regional_companies_name AS regionalCompaniesName,
IFNULL( info.`status`, '待推送' ) AS status,
(select count( hfro.sequence_nbr ) from hygf_financing_rectification_order hfro where hfro.peasant_household_id = hph.sequence_nbr )orderNum,
(select CONCAT_WS(',',instance_id,node_routing) instanceId FROM hygf_financing_auditing WHERE hygf_financing_auditing.peasant_household_id = hph.sequence_nbr ORDER BY rec_date desc limit 1) instanceId,
hygf_unit_info.head_name responsibleUserName,
hygf_unit_info.head_phone responsibleUserPhone,
hph.regional_companies_code,
hph.developer_code
FROM
`hygf_peasant_household` hph
LEFT JOIN hygf_financing_info info ON info.peasant_household_id = hph.sequence_nbr
LEFT JOIN hygf_unit_info on hph.developer_code = hygf_unit_info.amos_company_code
<where>
hph.construction_state = '验收完成'
<if test="params.ownersName != null and params.ownersName !=''">
and hph.owners_name like concat('%',#{params.ownersName},'%')
</if>
<if test="params.regionalCompaniesCode != null and params.regionalCompaniesCode !=''">
and hph.regional_companies_code = #{params.regionalCompaniesCode}
</if>
<if test="params.type == 2 ">
and info.status in ('待融资审核','审核通过','放款完成' ) and info.financing_companies_seq = #{params.financingCompaniesSeq}
</if>
<if test="params.type == 3 ">
and info.status in ('待整改','整改未完成')
</if>
<if test="params.status != null and params.status != ''">
and info.status = #{params.status}
</if>
</where>
ORDER BY
info.rec_date DESC ,hph.sequence_nbr ASC ) as sta
</select>
<select id="selectDataInfo" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.FinancingInfoDto">
SELECT SELECT
hph.sequence_nbr AS sequenceNbr, hfi.*,
hph.peasant_household_no peasantHouseholdNo, (select instance_id FROM hygf_financing_auditing WHERE peasant_household_id = hfi.peasant_household_id ORDER BY rec_date desc LIMIT 1) as instanceId
hph.owners_name as ownersName,
hph.project_address as projectAddress,
hph.regional_companies_name as regionalCompaniesName,
IFNULL(info.`status`,'待推送') as status
FROM FROM
`hygf_peasant_household` hph Left JOIN hygf_financing_info info on info.peasant_household_id = hph.sequence_nbr `hygf_financing_info` hfi
WHERE WHERE
hph.construction_state= '验收完成' hfi.peasant_household_id = #{peasantHouseholdId}
</select>
<select id="selectOrgList" resultType="java.util.Map">
select
*
from
privilege_company
where
PARENT_ID = (select SEQUENCE_NBR from privilege_company where COMPANY_NAME = '融资机构')
</select>
<select id="selectRZOrgInfo" resultType="java.util.Map">
select
*
from
privilege_company
where
SEQUENCE_NBR=#{id}
</select> </select>
</mapper> </mapper>
<?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.yeejoin.amos.boot.module.hygf.api.mapper.FinancingRectificationOrderMapper">
<select id="selectDataList"
resultType="com.yeejoin.amos.boot.module.hygf.api.dto.FinancingRectificationOrderDto">
select
hfro.sequence_nbr,
hfro.peasant_household_id,
hfro.rectification_status,
hfro.peasant_household_name,
hph.peasant_household_no,
project_address_name as projectAddress
from
hygf_financing_rectification_order hfro
INNER JOIN
hygf_peasant_household hph on hph.sequence_nbr = hfro.peasant_household_id
<where>
<if test="peasantHouseholdId != null and peasantHouseholdId != ''">
hfro.peasant_household_id = #{peasantHouseholdId}
</if>
</where>
</select>
</mapper>
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
<where> <where>
hygf_maintenance_tickets.creator_user_id =#{amosUserId} hygf_maintenance_tickets.creator_user_id =#{amosUserId}
and hygf_maintenance_tickets.warning_id =0
<if test="dto.handlerStatus != null and dto.handlerStatus !=''"> <if test="dto.handlerStatus != null and dto.handlerStatus !=''">
And hygf_maintenance_tickets.handler_status = #{dto.handlerStatus} And hygf_maintenance_tickets.handler_status = #{dto.handlerStatus}
</if> </if>
......
...@@ -620,8 +620,7 @@ ...@@ -620,8 +620,7 @@
</select> </select>
<!-- ========电站监控区域=======-->
<!-- ========电站监控区域=======-->
<select id="getRegionPage" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationStatistics"> <select id="getRegionPage" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationStatistics">
SELECT privilege_company.ORG_CODE code , SELECT privilege_company.ORG_CODE code ,
...@@ -635,7 +634,7 @@ ...@@ -635,7 +634,7 @@
</where> </where>
</select> </select>
<!-- code参数为区域公司orgCode或经销商orgCode--> <!-- code参数为区域公司orgCode或经销商orgCode-->
<select id="getRegionStatistics" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationStatistics"> <select id="getRegionStatistics" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationStatistics">
SELECT COUNT(*) AS powerStationNumber, SELECT COUNT(*) AS powerStationNumber,
ROUND(SUM(capacity), 2) AS totalCapacity, ROUND(SUM(capacity), 2) AS totalCapacity,
...@@ -643,24 +642,54 @@ ...@@ -643,24 +642,54 @@
ROUND(SUM(rated_power), 2) AS totalRatedPower, ROUND(SUM(rated_power), 2) AS totalRatedPower,
ROUND(SUM(day_income), 2) AS totalDayIncome ROUND(SUM(day_income), 2) AS totalDayIncome
FROM hygf_jp_station hjs FROM hygf_jp_station hjs
WHERE hjs.regional_companies_code = #{code} or hjs.amos_company_code = #{code} <where>
<if test="regionCode != null and regionCode !=''">
and hjs.regional_companies_code LIKE CONCAT ('%',#{regionCode})
</if>
<if test="code != null and code !=''">
and hjs.amos_company_code LIKE CONCAT ('%',#{code})
</if>
</where>
</select> </select>
<!-- 根据区域orgCode查询经销商--> <!-- 根据区域orgCode查询经销商-->
<select id="getDealerPage" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationStatistics"> <select id="getDealerPage" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationStatistics">
select hui.name as name, hui.amos_company_code as code SELECT hygf_unit_info.`name` name, hygf_unit_info.amos_company_code code, hygf_regional_companies.regional_companies_code FROM hygf_regional_companies LEFT JOIN hygf_unit_info
from hygf_regional_companies hrc ON hygf_unit_info.sequence_nbr=hygf_regional_companies.unit_info_id WHERE hygf_unit_info.audit_status='2'
RIGHT JOIN hygf_unit_info hui AND hygf_unit_info.blacklist='0' AND hygf_unit_info.is_delete='0'
ON hrc.unit_info_id = hui.sequence_nbr <if test="regionalCompaniesCode!=null and regionalCompaniesCode!=''">
and hygf_regional_companies.regional_companies_code = #{regionalCompaniesCode}
</if>
<if test="dealerName != null and dealerName!=''">
and hygf_unit_info.`name` like concat("%",#{dealerName},"%")
</if>
and hygf_unit_info.amos_company_code is not null
</select>
<!-- 查询所有场站-->
<select id="queryAllPowerStation" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto">
select
name,
third_station_id
from hygf_jp_station
<where> <where>
hui.blacklist=0 and hui.is_delete=0 <if test="powerStationId!=null">
<if test="regionCompanyOrgCode != null and regionCompanyOrgCode!=''"> and hygf_jp_station.sequence_nbr =#{powerStationId}
and hrc.regional_companies_code = #{regionCompanyOrgCode}
</if> </if>
<if test="dealerName != null and dealerName!=''">
and hui.name like concat("%",#{dealerName},"%") <if test="regionalCompaniesCode!=null">
and hygf_jp_station.regional_companies_code =#{regionalCompaniesCode}
</if>
<if test="amosCompanyCode!=null">
and hygf_jp_station.amos_company_code =#{amosCompanyCode}
</if> </if>
</where> </where>
</select> </select>
</mapper> </mapper>
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
hygf_peasant_household.regional_companies_code, hygf_peasant_household.regional_companies_code,
hygf_peasant_household.regional_companies_name, hygf_peasant_household.regional_companies_name,
hygf_peasant_household.developer_code, hygf_peasant_household.developer_code,
hygf_peasant_household.developer_user_id hygf_peasant_household.developer_user_id,
hygf_peasant_household.project_address_detail
from hygf_power_station LEFT JOIN ( select peasant_household_id,initiate_status, contract_lock_id from hygf_household_contract where hygf_household_contract.status !='已作废' from hygf_power_station LEFT JOIN ( select peasant_household_id,initiate_status, contract_lock_id from hygf_household_contract where hygf_household_contract.status !='已作废'
) b on b.peasant_household_id=hygf_power_station.peasant_household_id ) b on b.peasant_household_id=hygf_power_station.peasant_household_id
LEFT JOIN hygf_peasant_household on hygf_peasant_household.sequence_nbr=hygf_power_station.peasant_household_id LEFT JOIN hygf_peasant_household on hygf_peasant_household.sequence_nbr=hygf_power_station.peasant_household_id
...@@ -27,6 +28,9 @@ ...@@ -27,6 +28,9 @@
<if test="regionalCompaniesName!=null and regionalCompaniesName!=''"> <if test="regionalCompaniesName!=null and regionalCompaniesName!=''">
and hygf_peasant_household.regional_companies_name like concat(concat("%",#{regionalCompaniesName}),"%") and hygf_peasant_household.regional_companies_name like concat(concat("%",#{regionalCompaniesName}),"%")
</if> </if>
<if test="processStatus != null and processStatus != ''">
and hygf_power_station.process_status = #{processStatus}
</if>
ORDER BY hygf_power_station.rec_date desc ORDER BY hygf_power_station.rec_date desc
) a ) a
</select> </select>
......
...@@ -63,6 +63,32 @@ from privilege_company where IS_DELETED=0 and AGENCY_CODE='JXIOP' ...@@ -63,6 +63,32 @@ from privilege_company where IS_DELETED=0 and AGENCY_CODE='JXIOP'
</select> </select>
<select id="getuserListByOrgCode" resultType="Map">
select
DISTINCT std_user_biz.real_name realName
from
std_user_biz LEFT JOIN hygf_personnel_business on std_user_biz.sequence_nbr =hygf_personnel_business.foundation_id
<where>
<if test="role!=null">
and std_user_biz.role like concat(concat("%",#{role}),"%")
</if>
<if test="regionalCompaniesSeq!=null">
and hygf_personnel_business.regional_companies_seq=#{regionalCompaniesSeq}
</if>
<if test="amosOrgCode!=null">
and hygf_personnel_business.amos_unit_org_code like concat ('%',#{amosOrgCode},'%')
</if>
<if test="userName!=null">
and std_user_biz.amos_user_id=#{userName}
</if>
</where>
</select>
<select id="getuserListtelephone" resultType="Map"> <select id="getuserListtelephone" resultType="Map">
select select
......
...@@ -16,6 +16,14 @@ ...@@ -16,6 +16,14 @@
<if test="dateTime!=null"> <if test="dateTime!=null">
and day_time = #{dateTime} and day_time = #{dateTime}
</if> </if>
<if test="regionalCompaniesCode!=null and regionalCompaniesCode != ''">
and regional_companies_code = #{regionalCompaniesCode}
</if>
<if test="amosCompanyCode!=null and amosCompanyCode != ''">
and amos_company_code = #{amosCompanyCode}
</if>
</where> </where>
<if test="sort=='desc'"> <if test="sort=='desc'">
ORDER by fullhour desc ORDER by fullhour desc
...@@ -31,32 +39,67 @@ ...@@ -31,32 +39,67 @@
SELECT SELECT
sum(generate)num, sum(generate)num,
`day_time` date `day_time` date
FROM house_pv_data.td_hygf_station_day_generate where third_station_id in FROM house_pv_data.td_hygf_station_day_generate
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")"> <where>
#{item} <if test="dto!=null">
</foreach> third_station_id in
and year_month = #{date} <foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="thirdStationId!=null and thirdStationId != ''">
and third_station_id = #{thirdStationId}
</if>
and year_month = #{date}
</where>
GROUP BY `day_time` GROUP BY `day_time`
</select> </select>
<select id="getMonthGenerateqx" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerCurveDto"> <select id="getMonthGenerateqx" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerCurveDto">
SELECT SELECT
sum(generate)num, sum(generate)num,
`month_time` date `month_time` date
FROM house_pv_data.td_hygf_station_month_generate where third_station_id in FROM house_pv_data.td_hygf_station_month_generate
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item} <where>
</foreach> <if test="dto!=null">
and year = #{date} third_station_id in
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="thirdStationId!=null and thirdStationId != ''">
and third_station_id = #{thirdStationId}
</if>
and year = #{date}
</where>
GROUP BY `month_time` GROUP BY `month_time`
</select> </select>
<select id="getYearGenerateqx" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerCurveDto"> <select id="getYearGenerateqx" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerCurveDto">
SELECT SELECT
sum(generate)num, sum(generate)num,
`year_time` date `year_time` date
FROM house_pv_data.td_hygf_station_year_generate where third_station_id in FROM house_pv_data.td_hygf_station_year_generate
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")"> <where>
#{item} <if test="dto!=null">
</foreach> third_station_id in
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="thirdStationId!=null and thirdStationId != ''">
and third_station_id = #{thirdStationId}
</if>
</where>
GROUP BY `year_time` GROUP BY `year_time`
</select> </select>
...@@ -76,6 +119,9 @@ ...@@ -76,6 +119,9 @@
<if test="dateTime!=null and dateTime != ''"> <if test="dateTime!=null and dateTime != ''">
and day_time = #{dateTime} and day_time = #{dateTime}
</if> </if>
<if test="stationState!=null and stationState != ''">
and station_state = #{stationState}
</if>
</where> </where>
LIMIT #{current} ,#{size} LIMIT #{current} ,#{size}
</select> </select>
......
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
<if test="dateTime!=null and dateTime != ''"> <if test="dateTime!=null and dateTime != ''">
and month_time = #{dateTime} and month_time = #{dateTime}
</if> </if>
<if test="stationState!=null and stationState != ''">
and station_state = #{stationState}
</if>
</where> </where>
LIMIT #{current} ,#{size} LIMIT #{current} ,#{size}
</select> </select>
......
...@@ -77,10 +77,24 @@ ...@@ -77,10 +77,24 @@
SELECT SELECT
sum(power)num, sum(power)num,
`hour` date `hour` date
FROM house_pv_data.td_hygf_day_power where tation_id in FROM house_pv_data.td_hygf_day_power
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item} <where>
</foreach> <if test="dto!=null">
tation_id in
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="thirdStationId!=null and thirdStationId != ''">
and tation_id = #{thirdStationId}
</if>
</where>
and year_month_day = #{date} and year_month_day = #{date}
GROUP BY `hour` GROUP BY `hour`
</select> </select>
......
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
<if test="snCode != null and snCode != ''"> <if test="snCode != null and snCode != ''">
AND sn_code like #{snCode} AND sn_code like #{snCode}
</if> </if>
<if test="stationId.size >0 "> <if test="stationId != null and stationId.size >0 ">
AND third_station_id in AND third_station_id in
<foreach collection="stationId" item="item" open='(' close=')' separator=","> <foreach collection="stationId" item="item" open='(' close=')' separator=",">
#{item} #{item}
...@@ -104,6 +104,9 @@ ...@@ -104,6 +104,9 @@
<if test="content != null and content != ''"> <if test="content != null and content != ''">
AND content like #{content} AND content like #{content}
</if> </if>
<if test="stationName != null and stationName != ''">
AND station_name like #{stationName}
</if>
</where> </where>
ORDER BY start_time desc ORDER BY start_time desc
limit #{current},#{size} limit #{current},#{size}
...@@ -133,7 +136,7 @@ ...@@ -133,7 +136,7 @@
<if test="snCode != null and snCode != ''"> <if test="snCode != null and snCode != ''">
AND sn_code like #{snCode} AND sn_code like #{snCode}
</if> </if>
<if test="stationId.size >0 "> <if test="stationId != null and stationId.size >0 ">
AND third_station_id in AND third_station_id in
<foreach collection="stationId" item="item" open='(' close=')' separator=","> <foreach collection="stationId" item="item" open='(' close=')' separator=",">
#{item} #{item}
...@@ -148,6 +151,27 @@ ...@@ -148,6 +151,27 @@
<if test="content != null and content != ''"> <if test="content != null and content != ''">
AND content like #{content} AND content like #{content}
</if> </if>
<if test="stationName != null and stationName != ''">
AND station_name like #{stationName}
</if>
</where> </where>
</select> </select>
<select id="queryAlarmNumber" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto">
SELECT
`state`
FROM house_pv_data.td_hygf_jp_inverter_warn
<where>
<if test="thirdStationIds != null and thirdStationIds.size > 0 ">
third_station_id in
<foreach collection="thirdStationIds" item="item" open='(' close=')' separator=",">
#{item}
</foreach>
</if>
</where>
</select>
</mapper> </mapper>
...@@ -15,7 +15,9 @@ ...@@ -15,7 +15,9 @@
<if test="dateTime!=null and dateTime != ''"> <if test="dateTime!=null and dateTime != ''">
and year = #{dateTime} and year = #{dateTime}
</if> </if>
<if test="stationState!=null and stationState != ''">
and station_state = #{stationState}
</if>
</where> </where>
LIMIT #{current} ,#{size} LIMIT #{current} ,#{size}
</select> </select>
......
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.hygf.biz.config; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.hygf.biz.config;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean; import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
import com.github.pagehelper.PageInterceptor; import com.github.pagehelper.PageInterceptor;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpowerInterceptor;
import org.apache.ibatis.plugin.Interceptor; import org.apache.ibatis.plugin.Interceptor;
import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionTemplate; import org.mybatis.spring.SqlSessionTemplate;
...@@ -56,7 +57,13 @@ public class TDengineServerConfig { ...@@ -56,7 +57,13 @@ public class TDengineServerConfig {
"" + "" +
";"); ";");
interceptor.setProperties(properties); interceptor.setProperties(properties);
bean.setPlugins(new Interceptor[] {interceptor,paginationInterceptor()});
bean.setPlugins(new Interceptor[] {interceptor,
userEmpowerInterceptor(),
paginationInterceptor()
});
return bean.getObject(); return bean.getObject();
} }
...@@ -66,6 +73,12 @@ public class TDengineServerConfig { ...@@ -66,6 +73,12 @@ public class TDengineServerConfig {
return new DataSourceTransactionManager(dataSource); return new DataSourceTransactionManager(dataSource);
} }
@Bean
public UserEmpowerInterceptor userEmpowerInterceptor() {
UserEmpowerInterceptor userEmpowerInterceptor = new UserEmpowerInterceptor();
return userEmpowerInterceptor;
}
@Bean(name = "tdengineSqlSessionTemplate") @Bean(name = "tdengineSqlSessionTemplate")
public SqlSessionTemplate tdengineSqlSessionTemplate(@Qualifier("tdengineSqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception { public SqlSessionTemplate tdengineSqlSessionTemplate(@Qualifier("tdengineSqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception {
......
package com.yeejoin.amos.boot.module.hygf.biz.controller; package com.yeejoin.amos.boot.module.hygf.biz.controller;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.map.MapBuilder;
import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.boot.module.hygf.api.util.CommonResponseNewUtil;
import com.yeejoin.amos.boot.module.hygf.api.util.CommonResponseUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -57,7 +63,19 @@ public class FinancingInfoController extends BaseController { ...@@ -57,7 +63,19 @@ public class FinancingInfoController extends BaseController {
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新") @ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新")
public ResponseModel<FinancingInfoDto> updateBySequenceNbrFinancingInfo(@RequestBody FinancingInfoDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) { public ResponseModel<FinancingInfoDto> updateBySequenceNbrFinancingInfo(@RequestBody FinancingInfoDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr); model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(financingInfoServiceImpl.updateWithModel(model)); model.setFile(JSON.toJSONString(model.getFiles()));
financingInfoServiceImpl.updateWithModel(model);
if (null != model.getDisbursementMoney() && model.getStatus() != "放款完成" ){
Map<String, Object> map = BeanUtil.beanToMap(model);
map.put("approvalStatus","0");
financingInfoServiceImpl.execueFlow(map);
}
// if model.getStatus().equals("")){
// Map<String, Object> map = BeanUtil.beanToMap(model);
// map.put("approvalStatus","0");
// financingInfoServiceImpl.execueFlow(map);
// }
return ResponseHelper.buildResponse(model);
} }
/** /**
...@@ -83,7 +101,7 @@ public class FinancingInfoController extends BaseController { ...@@ -83,7 +101,7 @@ public class FinancingInfoController extends BaseController {
@GetMapping(value = "/{sequenceNbr}") @GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个", notes = "根据sequenceNbr查询单个") @ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个", notes = "根据sequenceNbr查询单个")
public ResponseModel<FinancingInfoDto> selectOne(@PathVariable Long sequenceNbr) { public ResponseModel<FinancingInfoDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(financingInfoServiceImpl.queryBySeq(sequenceNbr)); return ResponseHelper.buildResponse(financingInfoServiceImpl.selectDataInfo(sequenceNbr));
} }
/** /**
...@@ -96,12 +114,14 @@ public class FinancingInfoController extends BaseController { ...@@ -96,12 +114,14 @@ public class FinancingInfoController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/page") @GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询") @ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询")
public ResponseModel<Page<Map<String, String>>> queryForPage(@RequestParam(value = "current") int current,@RequestParam public ResponseModel<Page<Map<String, Object>>> queryForPage(@RequestParam(value = "current") int current,@RequestParam(value = "size") int size,@RequestParam(value = "type") String type,
(value = "size") int size) { @RequestParam(value = "status",required = false) String status,
Page<Map<String, String>> page = new Page<Map<String, String>>(); @RequestParam(value = "regionalCompaniesCode" ,required = false) String regionalCompaniesCode ,
@RequestParam(value = "ownersName",required = false) String ownersName){
Page<Map<String, Object>> page = new Page<Map<String, Object>>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(financingInfoServiceImpl.queryForFinancingInfoPage(page)); return ResponseHelper.buildResponse(financingInfoServiceImpl.queryForFinancingInfoPage(page,type,status,regionalCompaniesCode,ownersName));
} }
/** /**
...@@ -115,4 +135,30 @@ public class FinancingInfoController extends BaseController { ...@@ -115,4 +135,30 @@ public class FinancingInfoController extends BaseController {
public ResponseModel<List<FinancingInfoDto>> selectForList() { public ResponseModel<List<FinancingInfoDto>> selectForList() {
return ResponseHelper.buildResponse(financingInfoServiceImpl.queryForFinancingInfoList()); return ResponseHelper.buildResponse(financingInfoServiceImpl.queryForFinancingInfoList());
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "撤回", notes = "撤回")
@GetMapping(value = "/rollback")
public ResponseModel rollback(String instanceId,String peasantHouseholdId) {
financingInfoServiceImpl.rollback(instanceId,peasantHouseholdId);
return CommonResponseNewUtil.success();
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST",value = "审核", notes = "审核")
@PostMapping(value = "/execueFlow")
public ResponseModel execueFlow(@RequestBody Map<String, Object> params) {
financingInfoServiceImpl.execueFlow(params);
return CommonResponseNewUtil.success();
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "融资机构列表", notes = "融资机构列表")
@GetMapping(value = "/orgList")
public ResponseModel<List<Map<String,Object>>> orgList() {
return CommonResponseNewUtil.success(financingInfoServiceImpl.selectOrgList());
}
} }
package com.yeejoin.amos.boot.module.hygf.biz.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.yeejoin.amos.boot.module.hygf.api.dto.FinancingInfoDto;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.FinancingInfoServiceImpl;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.FinancingRectificationOrderServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.FinancingRectificationOrderDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 投融整改单
*
* @author system_generator
* @date 2024-04-02
*/
@RestController
@Api(tags = "投融整改单Api")
@RequestMapping(value = "/financing-rectification-order")
public class FinancingRectificationOrderController extends BaseController {
@Autowired
FinancingRectificationOrderServiceImpl financingRectificationOrderServiceImpl;
/**
* 新增投融整改单
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增投融整改单", notes = "新增投融整改单")
public ResponseModel<FinancingRectificationOrderDto> save(@RequestBody FinancingRectificationOrderDto model) {
model = financingRectificationOrderServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新投融整改单", notes = "根据sequenceNbr更新投融整改单")
public ResponseModel<FinancingRectificationOrderDto> updateBySequenceNbrFinancingRectificationOrder(@RequestBody FinancingRectificationOrderDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(financingRectificationOrderServiceImpl.updateOrderStatus(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除投融整改单", notes = "根据sequenceNbr删除投融整改单")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(financingRectificationOrderServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个投融整改单", notes = "根据sequenceNbr查询单个投融整改单")
public ResponseModel<FinancingRectificationOrderDto> selectOne(@PathVariable Long sequenceNbr) {
FinancingRectificationOrderDto dto = financingRectificationOrderServiceImpl.queryBySeq(sequenceNbr);
//前端回显有问题 兼容前端此处返回做特殊处理
if ("待整改".equals(dto.getRectificationStatus())){
dto.setRectificationStatus("整改未完成");
}
if (!StringUtils.isEmpty(dto.getRectificationPhoto())){
dto.setRectificationPhotos(JSONArray.parseArray(dto.getRectificationPhoto()));
}
return ResponseHelper.buildResponse(dto);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/problemDescription/{peasantHouseholdId}")
@ApiOperation(httpMethod = "GET",value = "获取整改问题", notes = "获取整改问题")
public ResponseModel<String> getProblemDescription(@PathVariable Long peasantHouseholdId) {
return ResponseHelper.buildResponse(financingRectificationOrderServiceImpl.getProblemDescription(peasantHouseholdId));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "投融整改单分页查询", notes = "投融整改单分页查询")
public ResponseModel<Page<FinancingRectificationOrderDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size,@RequestParam
(value = "peasantHouseholdId") Long peasantHouseholdId) {
return ResponseHelper.buildResponse(financingRectificationOrderServiceImpl.queryForFinancingRectificationOrderPage( current, size,peasantHouseholdId ));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "投融整改单列表全部数据查询", notes = "投融整改单列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<FinancingRectificationOrderDto>> selectForList() {
return ResponseHelper.buildResponse(financingRectificationOrderServiceImpl.queryForFinancingRectificationOrderList());
}
}
...@@ -260,32 +260,32 @@ public class JpInverterController extends BaseController { ...@@ -260,32 +260,32 @@ public class JpInverterController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping (value = "/jpInverterDayReport") @PostMapping (value = "/jpInverterDayReport")
@ApiOperation(httpMethod = "GET", value = "逆变器日报表", notes = "逆变器日报表") @ApiOperation(httpMethod = "POST", value = "逆变器日报表", notes = "逆变器日报表")
public ResponseModel<Page<TdHYGFInverterDayGenerate>> jpInverterDayReport(@RequestParam(value = "current") int current, public ResponseModel<Page<TdHYGFInverterDayGenerate>> jpInverterDayReport(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, @RequestParam(value = "size") int size,
@RequestBody(required = false) DataDto dataDto) { @RequestBody(required = false) DataDto dataDto) {
List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto()); // List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto());
List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList()); // List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList());
if(StringUtils.isEmpty(dataDto.getTime())){ if(StringUtils.isEmpty(dataDto.getTime())){
dataDto.setTime(DateUtil.format(new Date(),"yyyy-MM-dd")); dataDto.setTime(DateUtil.format(new Date(),"yyyy-MM-dd"));
} }
// List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null; // List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null;
return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterDayReport(current,size,dataDto.getTime(),dataDto.getSnCodes(),stationIds)); return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterDayReport(current,size,dataDto.getTime(),dataDto.getSnCodes(),null));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/jpInverterDayReportExport", method = RequestMethod.POST) @RequestMapping(value = "/jpInverterDayReportExport", method = RequestMethod.POST)
@ApiOperation(httpMethod = "GET", value = "逆变器日报表导出", notes = "逆变器日报表导出") @ApiOperation(httpMethod = "GET", value = "逆变器日报表导出", notes = "逆变器日报表导出")
public void jpInverterDayReportExport( @RequestBody(required = false) DataDto dataDto, HttpServletResponse response) { public void jpInverterDayReportExport( @RequestBody(required = false) DataDto dataDto, HttpServletResponse response) {
List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto()); // List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto());
List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList()); // List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList());
if(StringUtils.isEmpty(dataDto.getTime())){ if(StringUtils.isEmpty(dataDto.getTime())){
dataDto.setTime(DateUtil.format(new Date(),"yyyy-MM-dd")); dataDto.setTime(DateUtil.format(new Date(),"yyyy-MM-dd"));
} }
//List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null; //List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null;
List<TdHYGFInverterDayGenerate> tdHYGFInverterDayGenerates =jpInverterServiceImpl.jpInverterDayReportExport(dataDto.getTime(),dataDto.getSnCodes(),stationIds); List<TdHYGFInverterDayGenerate> tdHYGFInverterDayGenerates =jpInverterServiceImpl.jpInverterDayReportExport(dataDto.getTime(),dataDto.getSnCodes(),null);
try { try {
setResponseHeadForDowload(response,"逆变器日报表.xls"); setResponseHeadForDowload(response,"逆变器日报表.xls");
EasyExcel.write(response.getOutputStream()).head(TdHYGFInverterDayGenerate.class).excelType(ExcelTypeEnum.XLS).sheet("逆变器日报表").doWrite(tdHYGFInverterDayGenerates); EasyExcel.write(response.getOutputStream()).head(TdHYGFInverterDayGenerate.class).excelType(ExcelTypeEnum.XLS).sheet("逆变器日报表").doWrite(tdHYGFInverterDayGenerates);
...@@ -299,27 +299,27 @@ public class JpInverterController extends BaseController { ...@@ -299,27 +299,27 @@ public class JpInverterController extends BaseController {
public ResponseModel<Page<TdHYGFInverterMonthGenerate>> jpInverterMonthReport(@RequestParam(value = "current") int current, public ResponseModel<Page<TdHYGFInverterMonthGenerate>> jpInverterMonthReport(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, @RequestParam(value = "size") int size,
@RequestBody(required = false) DataDto dataDto) { @RequestBody(required = false) DataDto dataDto) {
List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto()); // List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto());
List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList()); // List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList());
if(StringUtils.isEmpty(dataDto.getTime())){ if(StringUtils.isEmpty(dataDto.getTime())){
dataDto.setTime(DateUtil.format(new Date(),"yyyy-MM")); dataDto.setTime(DateUtil.format(new Date(),"yyyy-MM"));
} }
// List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null; // List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null;
return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterMonthReport(current,size,dataDto.getTime(),dataDto.getSnCodes(),stationIds)); return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterMonthReport(current,size,dataDto.getTime(),dataDto.getSnCodes(),null));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/jpInverterMonthReportExport", method = RequestMethod.POST) @RequestMapping(value = "/jpInverterMonthReportExport", method = RequestMethod.POST)
@ApiOperation(httpMethod = "GET", value = "逆变器月报表导出", notes = "逆变器月报表导出") @ApiOperation(httpMethod = "GET", value = "逆变器月报表导出", notes = "逆变器月报表导出")
public void jpInverterMonthReportExport( @RequestBody(required = false) DataDto dataDto, HttpServletResponse response) { public void jpInverterMonthReportExport( @RequestBody(required = false) DataDto dataDto, HttpServletResponse response) {
List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto()); // List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto());
List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList()); // List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList());
if(StringUtils.isEmpty(dataDto.getTime())){ if(StringUtils.isEmpty(dataDto.getTime())){
dataDto.setTime(DateUtil.format(new Date(),"yyyy-MM")); dataDto.setTime(DateUtil.format(new Date(),"yyyy-MM"));
} }
// List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null; // List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null;
List<TdHYGFInverterMonthGenerate> tdHYGFInverterMonthGenerates =jpInverterServiceImpl.jpInverterMonthReportExport(dataDto.getTime(),dataDto.getSnCodes(),stationIds); List<TdHYGFInverterMonthGenerate> tdHYGFInverterMonthGenerates =jpInverterServiceImpl.jpInverterMonthReportExport(dataDto.getTime(),dataDto.getSnCodes(),null);
try { try {
setResponseHeadForDowload(response,"逆变器月报表.xls"); setResponseHeadForDowload(response,"逆变器月报表.xls");
EasyExcel.write(response.getOutputStream()).head(TdHYGFInverterMonthGenerate.class).excelType(ExcelTypeEnum.XLS).sheet("逆变器月报表").doWrite(tdHYGFInverterMonthGenerates); EasyExcel.write(response.getOutputStream()).head(TdHYGFInverterMonthGenerate.class).excelType(ExcelTypeEnum.XLS).sheet("逆变器月报表").doWrite(tdHYGFInverterMonthGenerates);
...@@ -334,27 +334,27 @@ public class JpInverterController extends BaseController { ...@@ -334,27 +334,27 @@ public class JpInverterController extends BaseController {
public ResponseModel<Page<TdHYGFInverterYearGenerate>> jpInverterYearReport(@RequestParam(value = "current") int current, public ResponseModel<Page<TdHYGFInverterYearGenerate>> jpInverterYearReport(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, @RequestParam(value = "size") int size,
@RequestBody(required = false) DataDto dataDto) { @RequestBody(required = false) DataDto dataDto) {
List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto()); // List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto());
List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList()); // List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList());
if(StringUtils.isEmpty(dataDto.getTime())){ if(StringUtils.isEmpty(dataDto.getTime())){
dataDto.setTime(DateUtil.format(new Date(),"yyyy")); dataDto.setTime(DateUtil.format(new Date(),"yyyy"));
} }
// List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null; // List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null;
return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterYearReport(current,size,dataDto.getTime(),dataDto.getSnCodes(),stationIds)); return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterYearReport(current,size,dataDto.getTime(),dataDto.getSnCodes(),null));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/jpInverterYearReportExport", method = RequestMethod.POST) @RequestMapping(value = "/jpInverterYearReportExport", method = RequestMethod.POST)
@ApiOperation(httpMethod = "GET", value = "逆变器年报表导出", notes = "逆变器年报表导出") @ApiOperation(httpMethod = "GET", value = "逆变器年报表导出", notes = "逆变器年报表导出")
public void jpInverterYearReportExport(@RequestBody(required = false) DataDto dataDto, HttpServletResponse response) { public void jpInverterYearReportExport(@RequestBody(required = false) DataDto dataDto, HttpServletResponse response) {
List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto()); // List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto());
List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList()); // List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList());
if(StringUtils.isEmpty(dataDto.getTime())){ if(StringUtils.isEmpty(dataDto.getTime())){
dataDto.setTime(DateUtil.format(new Date(),"yyyy")); dataDto.setTime(DateUtil.format(new Date(),"yyyy"));
} }
// List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null; // List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null;
List<TdHYGFInverterYearGenerate> tdHYGFInverterYearGenerates =jpInverterServiceImpl.jpInverterYearReportExport(dataDto.getTime(),dataDto.getSnCodes(),stationIds); List<TdHYGFInverterYearGenerate> tdHYGFInverterYearGenerates =jpInverterServiceImpl.jpInverterYearReportExport(dataDto.getTime(),dataDto.getSnCodes(),null);
try { try {
setResponseHeadForDowload(response,"逆变器年报表.xls"); setResponseHeadForDowload(response,"逆变器年报表.xls");
EasyExcel.write(response.getOutputStream()).head(TdHYGFInverterYearGenerate.class).excelType(ExcelTypeEnum.XLS).sheet("逆变器年报表").doWrite(tdHYGFInverterYearGenerates); EasyExcel.write(response.getOutputStream()).head(TdHYGFInverterYearGenerate.class).excelType(ExcelTypeEnum.XLS).sheet("逆变器年报表").doWrite(tdHYGFInverterYearGenerates);
......
...@@ -9,7 +9,6 @@ import com.yeejoin.amos.boot.module.hygf.api.config.DealerRestrict; ...@@ -9,7 +9,6 @@ import com.yeejoin.amos.boot.module.hygf.api.config.DealerRestrict;
import com.yeejoin.amos.boot.module.hygf.api.config.UserLimits; import com.yeejoin.amos.boot.module.hygf.api.config.UserLimits;
import com.yeejoin.amos.boot.module.hygf.api.dto.DropDown; import com.yeejoin.amos.boot.module.hygf.api.dto.DropDown;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto; import com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.MaintenanceDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationStatistics; import com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationStatistics;
import com.yeejoin.amos.boot.module.hygf.api.entity.*; import com.yeejoin.amos.boot.module.hygf.api.entity.*;
import com.yeejoin.amos.boot.module.hygf.api.mapper.*; import com.yeejoin.amos.boot.module.hygf.api.mapper.*;
...@@ -476,10 +475,13 @@ public class JpStationController extends BaseController { ...@@ -476,10 +475,13 @@ public class JpStationController extends BaseController {
JpStationDto jpStation = jpStationMapper.getCountJpStationdata(reviewDto); JpStationDto jpStation = jpStationMapper.getCountJpStationdata(reviewDto);
List<Map<String, Object>> powerRatio = new ArrayList<>(); List<Map<String, Object>> powerRatio = new ArrayList<>();
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
if (jpStation != null && jpStation.getRealTimePower() != null && jpStation.getCapacity() != null && jpStation.getCapacity() > 0) {
if(jpStation==null){
jpStation = new JpStationDto();
}
if (jpStation != null && jpStation.getRealTimePower() != null && jpStation.getRatedPower() != null && jpStation.getRatedPower() > 0) {
map.put("value", String.format("%.4f", jpStation.getRealTimePower() / (jpStation.getCapacity() * FDXSS))); map.put("value", String.format("%.4f", jpStation.getRealTimePower() / (jpStation.getCapacity() * FDXSS)));
} else { } else {
jpStation = new JpStationDto();
map.put("value", 0); map.put("value", 0);
} }
powerRatio.add(map); powerRatio.add(map);
...@@ -674,11 +676,16 @@ public class JpStationController extends BaseController { ...@@ -674,11 +676,16 @@ public class JpStationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "日满发小时排行", notes = "日满发小时排行") @ApiOperation(httpMethod = "GET", value = "日满发小时排行", notes = "日满发小时排行")
@GetMapping(value = "/getDayGenerateph") @GetMapping(value = "/getDayGenerateph")
@UserLimits
public ResponseModel<Page<Map<String, Object>>> getDayGenerateph(JpStationDto reviewDto, String type, String dateTime) { public ResponseModel<Page<Map<String, Object>>> getDayGenerateph(JpStationDto reviewDto, String type, String dateTime) {
//获取权限电站
List<JpStation> list = jpStationServiceImpl.getJpStation(reviewDto); List<JpStation> list = jpStationServiceImpl.getJpStation(reviewDto);
List<Map<String, Object>> li = new ArrayList<>(); List<Map<String, Object>> li = new ArrayList<>();
List<DayGenerate> date = dayGenerateServiceImpl.getDayGenerateph(list, type, dateTime); List<DayGenerate> date = dayGenerateServiceImpl.getDayGenerateph(null,reviewDto.getRegionalCompaniesCode(),reviewDto.getAmosCompanyCode(), type, dateTime);
DecimalFormat format2 = new DecimalFormat("0.00"); DecimalFormat format2 = new DecimalFormat("0.00");
if (date != null && !list.isEmpty()) { if (date != null && !list.isEmpty()) {
for (DayGenerate dayGenerate : date) { for (DayGenerate dayGenerate : date) {
...@@ -701,6 +708,34 @@ public class JpStationController extends BaseController { ...@@ -701,6 +708,34 @@ public class JpStationController extends BaseController {
result.setTotal(10); result.setTotal(10);
result.setRecords(li); result.setRecords(li);
return ResponseHelper.buildResponse(result); return ResponseHelper.buildResponse(result);
// List<JpStation> list = jpStationServiceImpl.getJpStation(reviewDto);
// List<Map<String, Object>> li = new ArrayList<>();
// List<DayGenerate> date = dayGenerateServiceImpl.getDayGenerateph(list, type, dateTime);
// DecimalFormat format2 = new DecimalFormat("0.00");
// if (date != null && !list.isEmpty()) {
// for (DayGenerate dayGenerate : date) {
// Map<String, Object> map = new HashMap<>();
// for (JpStation jpStation : list) {
// if (dayGenerate.getThirdStationId().equals(jpStation.getThirdStationId())) {
// map.put("id", jpStation.getSequenceNbr());
// map.put("name", jpStation.getName());
// map.put("address", jpStation.getAddress());
// map.put("fullhour", dayGenerate.getFullhour()!=null?format2.format(dayGenerate.getFullhour()):0);
// li.add(map);
// break;
// }
// }
//
// }
// }
// Page<Map<String, Object>> result = new Page<>();
// result.setCurrent(1);
// result.setTotal(10);
// result.setRecords(li);
// return ResponseHelper.buildResponse(result);
} }
...@@ -783,6 +818,30 @@ public class JpStationController extends BaseController { ...@@ -783,6 +818,30 @@ public class JpStationController extends BaseController {
// } // }
} }
//查询当前登录人权限区域公司统计数据
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询当前登录人权限区域公司统计数据", notes = "查询当前登录人权限区域公司统计数据")
@GetMapping(value = "/getRegionStatistics")
@UserLimits
public ResponseModel<Page<PowerStationStatistics>> getRegionStatistics(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, @RequestParam(required = false) String regionName) {
Page<PowerStationStatistics> poserStatisticsData = jpStationServiceImpl.getRegionStatistics(current, size, regionName);
return ResponseHelper.buildResponse(poserStatisticsData);
}
//查询经销商统计数据(根据区域公司orgCode)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询经销商统计数据", notes = "查询经销商统计数据")
@GetMapping(value = "/getDealerStatistics")
@UserLimits
public ResponseModel<Page<PowerStationStatistics>> getDealerStatistics(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, String regionalCompaniesCode, @RequestParam(required = false) String dealerName) {
Page<PowerStationStatistics> poserStatisticsData = jpStationServiceImpl.getDealerStatistics(current, size, regionalCompaniesCode, dealerName);
return ResponseHelper.buildResponse(poserStatisticsData);
}
//查询当前登录人权限区域公司统计数据 //查询当前登录人权限区域公司统计数据
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
...@@ -270,7 +270,13 @@ public class PeasantHouseholdController extends BaseController { ...@@ -270,7 +270,13 @@ public class PeasantHouseholdController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "农户信息列表根据ids查询", notes = "农户信息列表根据ids查询")
@GetMapping(value = "/getInfoByIds")
public ResponseModel<List<PeasantHousehold>> getInfoByIds(String ids) {
return ResponseHelper.buildResponse(peasantHouseholdServiceImpl.getInfoByIds(ids));
}
......
...@@ -102,12 +102,13 @@ public class PowerStationController extends BaseController { ...@@ -102,12 +102,13 @@ public class PowerStationController extends BaseController {
@RequestParam(value = "powerStationCode",required = false)String powerStationCode, @RequestParam(value = "powerStationCode",required = false)String powerStationCode,
@RequestParam(value = "ownersName",required = false)String ownersName, @RequestParam(value = "ownersName",required = false)String ownersName,
@RequestParam(value = "serviceAgent",required = false)String serviceAgent, @RequestParam(value = "serviceAgent",required = false)String serviceAgent,
@RequestParam(value = "processStatus",required = false) String processStatus,
@RequestParam(value = "regionalCompaniesName",required = false)String regionalCompaniesName) { @RequestParam(value = "regionalCompaniesName",required = false)String regionalCompaniesName) {
Page<PowerStationDto> page = new Page<PowerStationDto>(); Page<PowerStationDto> page = new Page<PowerStationDto>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
AgencyUserModel userInfo = getUserInfo(); AgencyUserModel userInfo = getUserInfo();
return ResponseHelper.buildResponse(powerStationServiceImpl.queryForPowerStationUserRoles(page,powerStationCode,ownersName,userInfo,serviceAgent,regionalCompaniesName)); return ResponseHelper.buildResponse(powerStationServiceImpl.queryForPowerStationUserRoles(page,powerStationCode,ownersName,userInfo,serviceAgent,regionalCompaniesName,processStatus));
} }
/** /**
......
...@@ -245,24 +245,24 @@ public class TdHygfJpInverterWarnController extends BaseController { ...@@ -245,24 +245,24 @@ public class TdHygfJpInverterWarnController extends BaseController {
Page<TdHygfJpInverterWarnDto> result = new Page<>(); Page<TdHygfJpInverterWarnDto> result = new Page<>();
result.setCurrent(current); result.setCurrent(current);
result.setSize(size); result.setSize(size);
JpStationDto reviewDto = new JpStationDto(); // JpStationDto reviewDto = new JpStationDto();
Map<String, String> nameMaps = new HashMap<>(); // Map<String, String> nameMaps = new HashMap<>();
if (null != stationName && stationName != "") { // if (null != stationName && stationName != "") {
reviewDto.setName(stationName); // reviewDto.setName(stationName);
} // }
List<JpStation> jpStation = jpStationMapper.getJpStation(reviewDto); // List<JpStation> jpStation = jpStationMapper.getJpStation(reviewDto);
if (CollectionUtil.isEmpty(jpStation)) { // if (CollectionUtil.isEmpty(jpStation)) {
result.setTotal(0); // result.setTotal(0);
List<TdHygfJpInverterWarnDto> list = new ArrayList<>(); // List<TdHygfJpInverterWarnDto> list = new ArrayList<>();
result.setRecords(list); // result.setRecords(list);
return ResponseHelper.buildResponse(result); // return ResponseHelper.buildResponse(result);
//
} // }
nameMaps = jpStation.stream().collect(Collectors.toMap(JpStation::getThirdStationId, JpStation::getName, (existing, replacement) -> existing)); // nameMaps = jpStation.stream().collect(Collectors.toMap(JpStation::getThirdStationId, JpStation::getName, (existing, replacement) -> existing));
//
if (null == stationId) { // if (null == stationId) {
stationId = jpStation.stream().map(JpStation::getThirdStationId).collect(Collectors.toList()); // stationId = jpStation.stream().map(JpStation::getThirdStationId).collect(Collectors.toList());
} // }
String startTime = ""; String startTime = "";
String endTime = ""; String endTime = "";
if (null != time) { if (null != time) {
...@@ -281,16 +281,21 @@ public class TdHygfJpInverterWarnController extends BaseController { ...@@ -281,16 +281,21 @@ public class TdHygfJpInverterWarnController extends BaseController {
if (StringUtils.isNotEmpty(content)) { if (StringUtils.isNotEmpty(content)) {
content = '%' + content + '%'; content = '%' + content + '%';
} }
List<TdHygfJpInverterWarnDto> maps = tdHygfJpInverterWarnServiceImpl.selectWarnList(state, level, minvalue, maxValue, snCode, stationId, startTime, endTime, content, current, size, handlerStatus); if (StringUtils.isNotEmpty(stationName)) {
stationName = '%' + stationName + '%';
}
List<TdHygfJpInverterWarnDto> maps = tdHygfJpInverterWarnServiceImpl.selectWarnList(state, level, minvalue, maxValue, snCode, stationId, startTime, endTime, content, current, size, handlerStatus, stationName);
for (TdHygfJpInverterWarnDto map : maps) { for (TdHygfJpInverterWarnDto map : maps) {
if (nameMaps.containsKey(map.getThirdStationId())) { // if (nameMaps.containsKey(map.getThirdStationId())) {
map.setStationName(nameMaps.get(map.getThirdStationId())); // map.setStationName(nameMaps.get(map.getThirdStationId()));
} // }
String te = map.getTimeLong() != null ? TimeUtil.longFormat(map.getTimeLong()) : ""; String te = map.getTimeLong() != null ? TimeUtil.longFormat(map.getTimeLong()) : "";
map.setTimeLongFormat(te); map.setTimeLongFormat(te);
} }
result.setTotal(tdHygfJpInverterWarnServiceImpl.selectWarnListTotal(state, level, minvalue, maxValue, snCode, stationId, startTime, endTime, content, handlerStatus)); result.setTotal(tdHygfJpInverterWarnServiceImpl.selectWarnListTotal(state, level, minvalue, maxValue, snCode, stationId, startTime, endTime, content, handlerStatus, stationName));
List<Long> waringIds = maps.stream().map(tdHygfJpInverterWarnDto -> tdHygfJpInverterWarnDto.getCreatedTime()).collect(Collectors.toList()); List<Long> waringIds = maps.stream().map(tdHygfJpInverterWarnDto -> tdHygfJpInverterWarnDto.getCreatedTime()).collect(Collectors.toList());
if (waringIds.size() == 0) { if (waringIds.size() == 0) {
waringIds = Arrays.asList(0L); waringIds = Arrays.asList(0L);
...@@ -311,4 +316,18 @@ public class TdHygfJpInverterWarnController extends BaseController { ...@@ -311,4 +316,18 @@ public class TdHygfJpInverterWarnController extends BaseController {
return ResponseHelper.buildResponse(result); return ResponseHelper.buildResponse(result);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏逆变器报警表统计数据查询", notes = "户用光伏逆变器报警表统计数据查询")
@GetMapping(value = "/queryAlarmNumber")
@UserLimits
public ResponseModel<Map<String, Object>> queryAlarmNumber(@RequestParam(required = false) String regionalCompaniesCode,
@RequestParam(required = false) String amosCompanyCode,
@RequestParam(required = false) String powerStationId
) {
Map<String, Object> result = tdHygfJpInverterWarnServiceImpl.queryAlarmNumber(regionalCompaniesCode, amosCompanyCode, powerStationId);
return ResponseHelper.buildResponse(result);
}
} }
...@@ -810,7 +810,8 @@ public ResponseModel< List<Map<String,Object>> > getRegionalCompanieByuser( ...@@ -810,7 +810,8 @@ public ResponseModel< List<Map<String,Object>> > getRegionalCompanieByuser(
) { ) {
UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto( getUserInfo().getUserId()); UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto( getUserInfo().getUserId());
List<Map<String,Object>> date= unitInfoMapper.getuserList(null,role,regionalCompaniesSeq,userUnitInformationDto.getAmosDealerId()); // List<Map<String,Object>> date= unitInfoMapper.getuserList(null,role,regionalCompaniesSeq,userUnitInformationDto.getAmosDealerId());
List<Map<String,Object>> date= unitInfoMapper.getuserListByOrgCode(null,role,regionalCompaniesSeq,userUnitInformationDto.getAmosDealerOrgCode());
return ResponseHelper.buildResponse(date); return ResponseHelper.buildResponse(date);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
...@@ -116,11 +116,16 @@ public class MaintenanceResultHandlerMessage extends EmqxListener { ...@@ -116,11 +116,16 @@ public class MaintenanceResultHandlerMessage extends EmqxListener {
hygfMaintenanceTickets.setStationContact(jpStation.getStationContact()); hygfMaintenanceTickets.setStationContact(jpStation.getStationContact());
//业主姓名 //业主姓名
hygfMaintenanceTickets.setOwnerName(jpStation.getUserName()); hygfMaintenanceTickets.setOwnerName(jpStation.getUserName());
if (ObjectUtil.isEmpty(hygfMaintenanceTickets.getStationContact())) { if (ObjectUtil.isEmpty(hygfMaintenanceTickets.getStationContact())) {
hygfMaintenanceTickets.setStationContact(jpStation.getUserName()); hygfMaintenanceTickets.setStationContact(jpStation.getUserName());
} }
} }
hygfMaintenanceTickets.setInverterSn(sncode); hygfMaintenanceTickets.setInverterSn(sncode);
if(specialMap.containsKey("creatorUserId")){
hygfMaintenanceTickets.setCreatorUserId(specialMap.get("creatorUserId").toString());
}
if(specialMap.containsKey("warningLevel")){ if(specialMap.containsKey("warningLevel")){
hygfMaintenanceTickets.setWarningLevel(specialMap.get("warningLevel").toString()); hygfMaintenanceTickets.setWarningLevel(specialMap.get("warningLevel").toString());
} }
...@@ -137,6 +142,9 @@ public class MaintenanceResultHandlerMessage extends EmqxListener { ...@@ -137,6 +142,9 @@ public class MaintenanceResultHandlerMessage extends EmqxListener {
if (ObjectUtil.isNotEmpty(tdHygfJpInverterWarn)) { if (ObjectUtil.isNotEmpty(tdHygfJpInverterWarn)) {
hygfMaintenanceTickets.setWarningLevel(tdHygfJpInverterWarn.getLevel()); hygfMaintenanceTickets.setWarningLevel(tdHygfJpInverterWarn.getLevel());
if(ObjectUtil.isEmpty(hygfMaintenanceTickets.getWarningLevel())){
hygfMaintenanceTickets.setWarningLevel("一般");
}
hygfMaintenanceTickets.setWarningContent(tdHygfJpInverterWarn.getContent()); hygfMaintenanceTickets.setWarningContent(tdHygfJpInverterWarn.getContent());
hygfMaintenanceTickets.setWarningStatus(tdHygfJpInverterWarn.getState()); hygfMaintenanceTickets.setWarningStatus(tdHygfJpInverterWarn.getState());
//告警等级 //告警等级
......
...@@ -241,7 +241,10 @@ public class BasicGridAcceptanceServiceImpl extends BaseService<BasicGridAccepta ...@@ -241,7 +241,10 @@ public class BasicGridAcceptanceServiceImpl extends BaseService<BasicGridAccepta
} }
//验收完成 //验收完成
if(workBasicGridAcceptance.getNextTaskId()==null){ System.out.println("验收完成==============================="+workBasicGridAcceptance.getNextTaskId());
System.out.println("验收完成888888==============================="+workBasicGridAcceptance.getAcceptanceStatus());
if(workBasicGridAcceptance.getAcceptanceStatus().equals("10")){
//更新状态 //更新状态
LambdaUpdateWrapper<PeasantHousehold> up =new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<PeasantHousehold> up =new LambdaUpdateWrapper<>();
......
...@@ -22,7 +22,11 @@ public class DayGenerateServiceImpl extends BaseService<DayGenerateDto, DayGener ...@@ -22,7 +22,11 @@ public class DayGenerateServiceImpl extends BaseService<DayGenerateDto, DayGener
@Autowired @Autowired
DayGenerateMapper dayGenerateMapper; DayGenerateMapper dayGenerateMapper;
@Override @Override
public List<DayGenerate> getDayGenerateph(List<JpStation> dto, String sort,String dateTime) { public List<DayGenerate> getDayGenerateph(List<JpStation> dto,
return dayGenerateMapper.getDayGenerateph(dto,sort,dateTime); String regionalCompaniesCode,
String amosCompanyCode,
String sort,
String dateTime) {
return dayGenerateMapper.getDayGenerateph(dto,regionalCompaniesCode,amosCompanyCode, sort,dateTime);
} }
} }
...@@ -25,6 +25,8 @@ public class FinancingAuditingServiceImpl extends BaseService<FinancingAuditingD ...@@ -25,6 +25,8 @@ public class FinancingAuditingServiceImpl extends BaseService<FinancingAuditingD
return this.queryForPage(page, null, false); return this.queryForPage(page, null, false);
} }
/** /**
* 列表查询 示例 * 列表查询 示例
*/ */
......
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.map.MapBuilder;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.hygf.api.dto.FinancingInfoDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.FinancingAuditing;
import com.yeejoin.amos.boot.module.hygf.api.entity.FinancingRectificationOrder;
import com.yeejoin.amos.boot.module.hygf.api.mapper.FinancingRectificationOrderMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IFinancingRectificationOrderService;
import com.yeejoin.amos.boot.module.hygf.api.dto.FinancingRectificationOrderDto;
import org.apache.activemq.util.MapHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 投融整改单服务实现类
*
* @author system_generator
* @date 2024-04-02
*/
@Service
public class FinancingRectificationOrderServiceImpl extends BaseService<FinancingRectificationOrderDto,FinancingRectificationOrder,FinancingRectificationOrderMapper> implements IFinancingRectificationOrderService {
@Autowired
private FinancingRectificationOrderMapper financingRectificationOrderMapper;
@Autowired
FinancingInfoServiceImpl financingInfoServiceImpl;
@Autowired
FinancingAuditingServiceImpl financingAuditingService;
/**
* 分页查询
*/
public Page<FinancingRectificationOrderDto> queryForFinancingRectificationOrderPage(int current,int size,Long peasantHouseholdId ) {
PageHelper.startPage(current,size);
List<FinancingRectificationOrderDto> list = financingRectificationOrderMapper.selectDataList(peasantHouseholdId);
PageInfo<FinancingRectificationOrderDto> pageInfo = new PageInfo<>(list);
Page<FinancingRectificationOrderDto> page = new Page<>();
page.setSize(pageInfo.getSize());
page.setCurrent(pageInfo.getPageNum());
page.setTotal(pageInfo.getTotal());
page.setRecords(list);
return page;
}
/**
* 列表查询 示例
*/
public List<FinancingRectificationOrderDto> queryForFinancingRectificationOrderList() {
return this.queryForList("" , false);
}
public FinancingRectificationOrderDto updateOrderStatus(FinancingRectificationOrderDto model){
if (CollectionUtil.isNotEmpty(model.getRectificationPhotos())){
model.setRectificationPhoto(JSON.toJSONString(model.getRectificationPhotos()));
}
this.updateWithModel(model);
FinancingInfoDto financingInfoDto = financingInfoServiceImpl.selectDataInfo(model.getPeasantHouseholdId());
if (model.getRectificationStatus().equals("整改已完成")){
financingInfoServiceImpl.execueFlow(MapBuilder.<String,Object>create().put("instanceId",financingInfoDto.getInstanceId()).put("approvalStatus","0").put("isZG","1").build());
}else {
financingInfoDto.setStatus(model.getRectificationStatus());
financingInfoServiceImpl.updateWithModel(financingInfoDto);
}
return model;
}
public String getProblemDescription(Long peasantHouseholdId) {
LambdaQueryWrapper<FinancingRectificationOrder> wrapper = new LambdaQueryWrapper<>();
wrapper.select(FinancingRectificationOrder::getProblemDescription);
wrapper.eq(FinancingRectificationOrder::getPeasantHouseholdId,peasantHouseholdId);
wrapper.orderByDesc(BaseEntity::getRecDate);
wrapper.last("limit 1");
FinancingRectificationOrder financingRectificationOrder = this.getBaseMapper().selectOne(wrapper);
if (null !=financingRectificationOrder){
return financingRectificationOrder.getProblemDescription();
}
LambdaQueryWrapper<FinancingAuditing> query = new LambdaQueryWrapper<>();
query.eq(FinancingAuditing::getPeasantHouseholdId,peasantHouseholdId);
query.orderByDesc(BaseEntity::getRecDate);
query.last("limit 1");
FinancingAuditing financingAuditing = financingAuditingService.getBaseMapper().selectOne(query);
return financingAuditing.getStatus();
}
}
\ No newline at end of file
...@@ -6,16 +6,21 @@ import cn.hutool.core.date.DateUtil; ...@@ -6,16 +6,21 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.unit.DataUnit; import cn.hutool.core.io.unit.DataUnit;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.module.hygf.api.dto.*; import com.yeejoin.amos.boot.module.hygf.api.dto.*;
import com.yeejoin.amos.boot.module.hygf.api.entity.HYGFMaintenanceTickets; import com.yeejoin.amos.boot.module.hygf.api.entity.HYGFMaintenanceTickets;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpStation;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInverterWarn; import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInverterWarn;
import com.yeejoin.amos.boot.module.hygf.api.mapper.HYGFMaintenanceTicketsMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.HYGFMaintenanceTicketsMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.JpStationMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.MaintenanceMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IHYGFMaintenanceTicketsService; import com.yeejoin.amos.boot.module.hygf.api.service.IHYGFMaintenanceTicketsService;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterWarnMapper; import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterWarnMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
...@@ -38,6 +43,10 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan ...@@ -38,6 +43,10 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
@Autowired @Autowired
HYGFMaintenanceTicketsMapper hygfMaintenanceTicketsMapper; HYGFMaintenanceTicketsMapper hygfMaintenanceTicketsMapper;
@Autowired
JpStationMapper jpStationMapper;
@Autowired
MaintenanceMapper maintenanceMapper;
/** /**
* 分页查询 * 分页查询
...@@ -71,6 +80,50 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan ...@@ -71,6 +80,50 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
} }
public void sendMeassageToMcb(HYGFMaintenanceTicketsDto hygfMaintenanceTicketsDto) { public void sendMeassageToMcb(HYGFMaintenanceTicketsDto hygfMaintenanceTicketsDto) {
if(hygfMaintenanceTicketsDto.getWarningId()==null){
JpStation jpStation = jpStationMapper.selectOne(new QueryWrapper<JpStation>().eq("third_station_id", hygfMaintenanceTicketsDto.getStationId()));
if (ObjectUtil.isEmpty(jpStation)) {
jpStation = jpStationMapper.selectById(hygfMaintenanceTicketsDto.getStationId());
}
if (ObjectUtil.isNotEmpty(jpStation)) {
//场站名称
hygfMaintenanceTicketsDto.setStationName(jpStation.getName());
//区域公司编码
hygfMaintenanceTicketsDto.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
//经销商orgCode
hygfMaintenanceTicketsDto.setAmosCompanyCode(jpStation.getAmosCompanyCode());
//地址
hygfMaintenanceTicketsDto.setStationAddress(jpStation.getAddress());
//经度
hygfMaintenanceTicketsDto.setStationLongitude(jpStation.getLongitude());
//纬度
hygfMaintenanceTicketsDto.setStationLatitude(jpStation.getLatitude());
//电站联系人电话
hygfMaintenanceTicketsDto.setStationContactPhone(jpStation.getUserPhone());
// 电站联系人
hygfMaintenanceTicketsDto.setStationContact(jpStation.getStationContact());
//业主姓名
hygfMaintenanceTicketsDto.setOwnerName(jpStation.getUserName());
if (ObjectUtil.isEmpty(hygfMaintenanceTicketsDto.getStationContact())) {
hygfMaintenanceTicketsDto.setStationContact(jpStation.getUserName());
}
}
MaintenanceDto maintenance = maintenanceMapper.selectOneById(Long.valueOf(hygfMaintenanceTicketsDto.getMaintenancePersonId()));
if (ObjectUtil.isNotEmpty(maintenance)) {
hygfMaintenanceTicketsDto.setMaintenancePersonName(maintenance.getName());
hygfMaintenanceTicketsDto.setMaintenancePersonPhone(maintenance.getTelephone());
}
HYGFMaintenanceTickets fMaintenanceTickets=new HYGFMaintenanceTickets();
BeanUtils.copyProperties(hygfMaintenanceTicketsDto,fMaintenanceTickets);
fMaintenanceTickets.setWarningId(0l);
this.save(fMaintenanceTickets);
}else{
HashMap<String, Object> messageMain = new HashMap<>(); HashMap<String, Object> messageMain = new HashMap<>();
HashMap<String, Object> rawData = new HashMap<>(); HashMap<String, Object> rawData = new HashMap<>();
HashMap<String, Object> bizInfo = new HashMap<>(); HashMap<String, Object> bizInfo = new HashMap<>();
...@@ -87,6 +140,10 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan ...@@ -87,6 +140,10 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
specialMap.put("warningId", hygfMaintenanceTicketsDto.getWarningId()); specialMap.put("warningId", hygfMaintenanceTicketsDto.getWarningId());
specialMap.put("taskStartTime", hygfMaintenanceTicketsDto.getTaskStartTime()); specialMap.put("taskStartTime", hygfMaintenanceTicketsDto.getTaskStartTime());
specialMap.put("taskEndTime", hygfMaintenanceTicketsDto.getTaskEndTime()); specialMap.put("taskEndTime", hygfMaintenanceTicketsDto.getTaskEndTime());
specialMap.put("creatorUserId", hygfMaintenanceTicketsDto.getCreatorUserId());
if (ObjectUtil.isNotEmpty(hygfMaintenanceTicketsDto.getWarningId())) { if (ObjectUtil.isNotEmpty(hygfMaintenanceTicketsDto.getWarningId())) {
//告警内容 //告警内容
specialMap.put("warningContent", hygfMaintenanceTicketsDto.getWarningContent()); specialMap.put("warningContent", hygfMaintenanceTicketsDto.getWarningContent());
...@@ -119,6 +176,8 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan ...@@ -119,6 +176,8 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
bizInfo.put("warningTime", DateUtil.format(new Date(), DatePattern.NORM_DATETIME_PATTERN)); bizInfo.put("warningTime", DateUtil.format(new Date(), DatePattern.NORM_DATETIME_PATTERN));
bizInfo.put("warningObjectName", hygfMaintenanceTicketsDto.getStationName()); bizInfo.put("warningObjectName", hygfMaintenanceTicketsDto.getStationName());
rawData.put("traceId", hygfMaintenanceTicketsDto.getInverterSn()); rawData.put("traceId", hygfMaintenanceTicketsDto.getInverterSn());
rawData.put("bizInfo", bizInfo); rawData.put("bizInfo", bizInfo);
rawData.put("indexKey", hygfMaintenanceTicketsDto.getInverterSn()); rawData.put("indexKey", hygfMaintenanceTicketsDto.getInverterSn());
...@@ -172,11 +231,12 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan ...@@ -172,11 +231,12 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
} catch (Exception exception) { } catch (Exception exception) {
exception.printStackTrace(); exception.printStackTrace();
} }
}
} }
public HYGFMaintenanceTicketsDto updateHYGFMaintenanceTicketsDto(HYGFMaintenanceTicketsDto hygfMaintenanceTicketsDto) { public HYGFMaintenanceTicketsDto updateHYGFMaintenanceTicketsDto(HYGFMaintenanceTicketsDto hygfMaintenanceTicketsDto) {
hygfMaintenanceTicketsDto.setHandlerStatus("已处理"); hygfMaintenanceTicketsDto.setHandlerStatus("已处理");
if(hygfMaintenanceTicketsDto.getWarningId()>0){ if(ObjectUtil.isNotEmpty(hygfMaintenanceTicketsDto.getWarningId())&&hygfMaintenanceTicketsDto.getWarningId()>0){
hygfMaintenanceTicketsDto.setTaskEndTime(new Date()); hygfMaintenanceTicketsDto.setTaskEndTime(new Date());
Long day = DateUtil.between(hygfMaintenanceTicketsDto.getWarningStartTime(),hygfMaintenanceTicketsDto.getTaskEndTime(), DateUnit.DAY); Long day = DateUtil.between(hygfMaintenanceTicketsDto.getWarningStartTime(),hygfMaintenanceTicketsDto.getTaskEndTime(), DateUnit.DAY);
Long hour = DateUtil.between(hygfMaintenanceTicketsDto.getWarningStartTime(),hygfMaintenanceTicketsDto.getTaskEndTime(), DateUnit.HOUR)-day*24; Long hour = DateUtil.between(hygfMaintenanceTicketsDto.getWarningStartTime(),hygfMaintenanceTicketsDto.getTaskEndTime(), DateUnit.HOUR)-day*24;
......
package com.yeejoin.amos.boot.module.hygf.biz.service.impl; package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
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.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.dto.BaseDto;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.hygf.api.Enum.ArrivalStateeEnum; import com.yeejoin.amos.boot.module.hygf.api.Enum.ArrivalStateeEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.CodeEnum; import com.yeejoin.amos.boot.module.hygf.api.Enum.CodeEnum;
...@@ -312,6 +315,9 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto ...@@ -312,6 +315,9 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
LoginInfoModel loginInfoModel = loginInfo.getResult(); LoginInfoModel loginInfoModel = loginInfo.getResult();
if (loginInfoModel == null || !StringUtils.isNotBlank(loginInfoModel.getLoginId())) { if (loginInfoModel == null || !StringUtils.isNotBlank(loginInfoModel.getLoginId())) {
// 没有认证过, 去注册用户 // 没有认证过, 去注册用户
if (StringUtils.isEmpty(wxDTO.getAmosUserId())){
throw new RuntimeException("请扫描经销商开发人员区域二维码进行注册");
}
FeignClientResult<AgencyUserModel> registerUserModelRestult = doRegister(wxDTO); FeignClientResult<AgencyUserModel> registerUserModelRestult = doRegister(wxDTO);
if (registerUserModelRestult == null || registerUserModelRestult.getStatus() != 200) { if (registerUserModelRestult == null || registerUserModelRestult.getStatus() != 200) {
log.error("用户手机号码 => " + phoneNo + " 调用平台创建用户信息失败: " + registerUserModelRestult.getDevMessage()); log.error("用户手机号码 => " + phoneNo + " 调用平台创建用户信息失败: " + registerUserModelRestult.getDevMessage());
...@@ -667,4 +673,14 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto ...@@ -667,4 +673,14 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
return (calendar.getTimeInMillis() - System.currentTimeMillis()) / 1000; return (calendar.getTimeInMillis() - System.currentTimeMillis()) / 1000;
} }
@Override
public List<PeasantHousehold> getInfoByIds(String ids) {
QueryWrapper<PeasantHousehold> queryWrapper = new QueryWrapper<>();
queryWrapper.select("sequence_nbr ","owners_name" ,"concat(project_address_name,project_address_detail) as project_address_name");
queryWrapper.in("sequence_nbr",Arrays.asList(ids.split(",")));
queryWrapper.eq("is_delete",0);
List<PeasantHousehold> peasantHouseholds = this.getBaseMapper().selectList(queryWrapper);
return peasantHouseholds;
}
} }
\ No newline at end of file
...@@ -63,6 +63,9 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD ...@@ -63,6 +63,9 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
protected EmqKeeper emqKeeper; protected EmqKeeper emqKeeper;
@Value("${hygf.user.group.id}") @Value("${hygf.user.group.id}")
private long userGroupId; private long userGroupId;
@Value("${hygf.user.group.empty}")
private long userGroupempty;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -355,51 +358,59 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD ...@@ -355,51 +358,59 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
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);
if(roidx==null){
publicAgencyUsex.setRole(null);
}else{
roidx.remove(userGroupId);
publicAgencyUsex.setRole(JSON.toJSONString(roidx));
}
//修改当前用户角色权限
List<Long> roid= JSONArray.parseArray(publicAgencyUse.getRole(),Long.class);
if(roid==null){
roid=new ArrayList<>();
}
roid.add(userGroupId);
publicAgencyUse.setRole(JSON.toJSONString(roid));
publicAgencyUserMapper.updateById(publicAgencyUsex);
publicAgencyUserMapper.updateById(publicAgencyUse);
//修改平台用户 //修改平台用户
List<String> userId = new ArrayList<>(); List<String> userId = new ArrayList<>();
userId.add(publicAgencyUse.getAmosUserId()); userId.add(publicAgencyUse.getAmosUserId());
System.out.println("删除旧管理员===================================:"+publicAgencyUsex.getAmosUserId());
if(roidx!=null&&!roidx.isEmpty()&&roidx.size()==1&&roidx.get(0).longValue()==userGroupId){
//新增空角色防止单位丢失
List<String> userId1 = new ArrayList<>();
userId1.add(publicAgencyUsex.getAmosUserId());
Privilege.groupUserClient.create(userGroupempty, userId1);
}
//删除旧管理员
Privilege.groupUserClient.deleteGroupUser(userGroupId,publicAgencyUsex.getAmosUserId());
//删除旧管理员
Privilege.groupUserClient.deleteGroupUser(userGroupId,publicAgencyUsex.getAmosUserId());
System.out.println("删除旧管理员===================================:"+publicAgencyUsex.getAmosUserId());
// 1 修改平台用户 // 1 修改平台用户
Privilege.groupUserClient.create(userGroupId, userId); Privilege.groupUserClient.create(userGroupId, userId);
System.out.println("新增角色用户===================================:"+userId);
// userEmpowerMapper.upuserrole( System.out.println("新增角色用户===================================:"+userId);
// publicAgencyUse.getSequenceNbr(),
// publicAgencyUse.getAmosUserId(),
// userGroupId,
// personnelBusines.getAmosUnitId()
// );
//修改权限 //修改权限
if(roidx==null){
publicAgencyUsex.setRole(null);
}else{
roidx.remove(userGroupId);
publicAgencyUsex.setRole(JSON.toJSONString(roidx));
}
//修改当前用户角色权限
List<Long> roid= JSONArray.parseArray(publicAgencyUse.getRole(),Long.class);
if(roid==null){
roid=new ArrayList<>();
}
roid.add(userGroupId);
publicAgencyUse.setRole(JSON.toJSONString(roid));
publicAgencyUserMapper.updateById(publicAgencyUsex);
publicAgencyUserMapper.updateById(publicAgencyUse);
//旧管理员去除 //旧管理员去除
List<String> li=null; List<String> li=null;
LambdaQueryWrapper<StdUserEmpower> uo=new LambdaQueryWrapper(); LambdaQueryWrapper<StdUserEmpower> uo=new LambdaQueryWrapper();
......
...@@ -46,48 +46,47 @@ import java.util.stream.Collectors; ...@@ -46,48 +46,47 @@ import java.util.stream.Collectors;
*/ */
@Service @Service
@Slf4j @Slf4j
public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerStation, PowerStationMapper> public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerStation, PowerStationMapper> implements IPowerStationService {
implements IPowerStationService {
@Autowired
@Autowired IdxFeginService idxFeginService;
IdxFeginService idxFeginService;
@Autowired
@Autowired IPowerStationService powerStationService;
IPowerStationService powerStationService; @Autowired
@Autowired DesignInformationMapper designInformationMapper;
DesignInformationMapper designInformationMapper; @Autowired
@Autowired DesignInformationServiceImpl designInformationService;
DesignInformationServiceImpl designInformationService; @Autowired
@Autowired PeasantHouseholdServiceImpl peasantHouseholdService;
PeasantHouseholdServiceImpl peasantHouseholdService;
private static final String IDX_REQUEST_STATE="200";
private static final String IDX_REQUEST_STATE = "200"; private static final String VERIFY_RESULT_YES="0";
private static final String VERIFY_RESULT_YES = "0"; private static final String VERIFY_RESULT_NO="1";
private static final String VERIFY_RESULT_NO = "1";
@Autowired
@Autowired WorkflowFeignClient workflowFeignClient;
WorkflowFeignClient workflowFeignClient; @Autowired
@Autowired HouseholdContractServiceImpl householdContractServiceImpl;
HouseholdContractServiceImpl householdContractServiceImpl; @Autowired
@Autowired PersonnelBusinessMapper personnelBusinessMapper;
PersonnelBusinessMapper personnelBusinessMapper; @Autowired
@Autowired ToDoTasksMapper toDoTasksMapper;
ToDoTasksMapper toDoTasksMapper; @Autowired
@Autowired protected EmqKeeper emqKeeper;
protected EmqKeeper emqKeeper; @Autowired
@Autowired ToDoTasksServiceImpl toDoTasksServiceImpl;
ToDoTasksServiceImpl toDoTasksServiceImpl; @Autowired
@Autowired UserMessageMapper userMessageMapper;
UserMessageMapper userMessageMapper; @Autowired
@Autowired PowerStationMapper powerStationMapper;
PowerStationMapper powerStationMapper; @Autowired
@Autowired AmosRequestContext requestContext;
AmosRequestContext requestContext; @Autowired
@Autowired WorkflowImpl workflow;
WorkflowImpl workflow;
public Page<PowerStationDto> queryForPowerStationUserRoles(Page<PowerStationDto> page, String powerStationCode, public Page<PowerStationDto> queryForPowerStationUserRoles(Page<PowerStationDto> page, String powerStationCode,
String ownersName, AgencyUserModel userInfo, String serviceAgent, String regionalCompaniesName) { String ownersName, AgencyUserModel userInfo, String serviceAgent, String regionalCompaniesName, String processStatus) {
// Map<Long, List<RoleModel>> orgRoles = userInfo.getOrgRoles(); // Map<Long, List<RoleModel>> orgRoles = userInfo.getOrgRoles();
// Collection<List<RoleModel>> roleModels = orgRoles.values(); // Collection<List<RoleModel>> roleModels = orgRoles.values();
// if(roleModels !=null){ // if(roleModels !=null){
...@@ -112,47 +111,48 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS ...@@ -112,47 +111,48 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
// return // return
// this.queryForPowerStationPage(page,powerStationCode,ownersName,serviceAgent); // this.queryForPowerStationPage(page,powerStationCode,ownersName,serviceAgent);
return this.queryPage((int) page.getCurrent(), (int) page.getSize(), powerStationCode, ownersName, return this.queryPage((int) page.getCurrent(), (int) page.getSize(), powerStationCode, ownersName,
serviceAgent,regionalCompaniesName); serviceAgent,regionalCompaniesName,processStatus);
} }
// 查询电站审核记录 // 查询电站审核记录
public Page<PowerStationDto> queryPage(int current, int size, String powerStationCode, String ownersName, public Page<PowerStationDto> queryPage(int current, int size, String powerStationCode, String ownersName,
String serviceAgent,String regionalCompaniesName) { String serviceAgent,String regionalCompaniesName,String processStatus) {
PageHelper.startPage(current, size); PageHelper.startPage(current, size);
List<PowerStationDto> list = powerStationMapper.queryPage(powerStationCode, ownersName, serviceAgent,regionalCompaniesName); List<PowerStationDto> list = powerStationMapper.queryPage(powerStationCode, ownersName, serviceAgent,regionalCompaniesName,processStatus);
PageInfo<PowerStationDto> pages = new PageInfo(list); PageInfo<PowerStationDto> pages = new PageInfo(list);
com.baomidou.mybatisplus.extension.plugins.pagination.Page<PowerStationDto> pagenew = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<PowerStationDto>(); com.baomidou.mybatisplus.extension.plugins.pagination.Page<PowerStationDto> pagenew = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<PowerStationDto>();
pagenew.setCurrent(current); pagenew.setCurrent(current);
pagenew.setTotal(pages.getTotal()); pagenew.setTotal(pages.getTotal());
pagenew.setSize(size); pagenew.setSize(size);
pagenew.setRecords(pages.getList()); pagenew.setRecords(pages.getList());
return pagenew; return pagenew;
} }
/**
* 分页查询
*/
public Page<PowerStationDto> queryForPowerStationPage(Page<PowerStationDto> page,
@Condition(Operator.like) String powerStationCode, @Condition(Operator.like) String ownersName,
String serviceAgent) {
return this.queryForPage(page, "rec_date", false, powerStationCode, ownersName, serviceAgent);
}
/**
* 列表查询 示例
*/
public List<PowerStationDto> queryForPowerStationList() {
return this.queryForList("", false);
}
@Override /**
@Transactional * 分页查询
public boolean savePowerStation(PowerStation powerStation, boolean flag, String name, String meg) { */
try { public Page<PowerStationDto> queryForPowerStationPage(Page<PowerStationDto> page,@Condition(Operator.like) String powerStationCode,@Condition(Operator.like) String ownersName,String serviceAgent) {
// 流程节点code return this.queryForPage(page, "rec_date", false,powerStationCode,ownersName,serviceAgent);
}
/**
* 列表查询 示例
*/
public List<PowerStationDto> queryForPowerStationList() {
return this.queryForList("" , false);
}
@Override
@Transactional
public boolean savePowerStation(PowerStation powerStation, boolean flag,String name,String meg) {
try{
//流程节点code
// if (flag) { // if (flag) {
// String flowTaskIdnext = this.getTaskNoAuth(powerStation.getProcessInstanceId()); // String flowTaskIdnext = this.getTaskNoAuth(powerStation.getProcessInstanceId());
// WorkDto workDto=this.getNodeInfoCode(flowTaskIdnext); // WorkDto workDto=this.getNodeInfoCode(flowTaskIdnext);
......
...@@ -308,6 +308,15 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -308,6 +308,15 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
if(model.getDeliveryFile()!=null&&!model.getDeliveryFile().isEmpty()){ if(model.getDeliveryFile()!=null&&!model.getDeliveryFile().isEmpty()){
model.setDeliveryState(DeliveryStateeEnum.已发货.getCode()); model.setDeliveryState(DeliveryStateeEnum.已发货.getCode());
model.setArrivalState(ArrivalStateeEnum.待收货.getCode());
model.setDeliveryTime(new Date());
}else{
model.setDeliveryState(DeliveryStateeEnum.待发货.getCode());
model.setArrivalState(DeliveryStateeEnum.待发货.getCode());
}
//更新电站施工状态 //更新电站施工状态
LambdaUpdateWrapper<PeasantHousehold> up =new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<PeasantHousehold> up =new LambdaUpdateWrapper<>();
up.set(PeasantHousehold::getConstructionState,ArrivalStateeEnum.备货中.getCode()); up.set(PeasantHousehold::getConstructionState,ArrivalStateeEnum.备货中.getCode());
...@@ -321,13 +330,6 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -321,13 +330,6 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
up.in(PeasantHousehold::getSequenceNbr,idsH); up.in(PeasantHousehold::getSequenceNbr,idsH);
peasantHouseholdMapper.update(null,up); peasantHouseholdMapper.update(null,up);
model.setArrivalState(ArrivalStateeEnum.待收货.getCode());
model.setDeliveryTime(new Date());
}else{
model.setDeliveryState(DeliveryStateeEnum.待发货.getCode());
model.setArrivalState(DeliveryStateeEnum.待发货.getCode());
}
preparationMoneyMapper.insert(model); preparationMoneyMapper.insert(model);
//电站信息存储 //电站信息存储
List<DocumentStation> ids= model.getPeasantHouseholdId(); List<DocumentStation> ids= model.getPeasantHouseholdId();
...@@ -424,6 +426,32 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -424,6 +426,32 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
}else{ }else{
model.setDeliveryState(DeliveryStateeEnum.待发货.getCode()); model.setDeliveryState(DeliveryStateeEnum.待发货.getCode());
model.setArrivalState(DeliveryStateeEnum.待发货.getCode()); model.setArrivalState(DeliveryStateeEnum.待发货.getCode());
//历史电站
LambdaQueryWrapper<DocumentStation> up=new LambdaQueryWrapper();
up.eq(DocumentStation::getPreparationMoneyId,model.getSequenceNbr());
List<DocumentStation> idsk= documentStationMapper.selectList(up);
//更新电站施工状态
LambdaUpdateWrapper<PeasantHousehold> up1 =new LambdaUpdateWrapper<>();
up1.set(PeasantHousehold::getConstructionState,ArrivalStateeEnum.勘察完成.getCode());
List<Long> idsH=new ArrayList<>();
for (DocumentStation documentStation : idsk) {
idsH.add(documentStation.getStationId());
}
up1.in(PeasantHousehold::getSequenceNbr,idsH);
peasantHouseholdMapper.update(null,up1);
//更新 //新选电站状态
LambdaUpdateWrapper<PeasantHousehold> up2 =new LambdaUpdateWrapper<>();
up2.set(PeasantHousehold::getConstructionState,ArrivalStateeEnum.备货中.getCode());
List<DocumentStation> idsk2= model.getPeasantHouseholdId();
List<Long> idsH2=new ArrayList<>();
for (DocumentStation documentStation : idsk2) {
idsH2.add(documentStation.getStationId());
}
up2.in(PeasantHousehold::getSequenceNbr,idsH2);
peasantHouseholdMapper.update(null,up2);
} }
} }
preparationMoneyMapper.updateById(model); preparationMoneyMapper.updateById(model);
......
...@@ -102,10 +102,12 @@ public class QiyuesuoServiceImpl { ...@@ -102,10 +102,12 @@ public class QiyuesuoServiceImpl {
String companyContact=contractDataDto.getCompanyContact(); String companyContact=contractDataDto.getCompanyContact();
Long emplateId= contractDataDto.getEmplateId(); Long emplateId= contractDataDto.getEmplateId();
String companykeyword= contractDataDto.getCompanykeyword(); String companykeyword= contractDataDto.getCompanykeyword();
Integer companykeywordIndex=contractDataDto.getCompanyKeywordIndex();
Integer companyPage= contractDataDto.getCompanyPage(); Integer companyPage= contractDataDto.getCompanyPage();
Double companyOffsetX= contractDataDto.getCompanyOffsetX(); Double companyOffsetX= contractDataDto.getCompanyOffsetX();
Double companyOffsetY= contractDataDto.getCompanyOffsetY(); Double companyOffsetY= contractDataDto.getCompanyOffsetY();
String personalkeyword= contractDataDto.getPersonalkeyword(); String personalkeyword= contractDataDto.getPersonalkeyword();
Integer personalkeywordIndex=contractDataDto.getPersonalKeywordIndex();
Integer personalPage= contractDataDto.getPersonalPage(); Integer personalPage= contractDataDto.getPersonalPage();
Double personalOffsetX= contractDataDto.getPersonalOffsetX(); Double personalOffsetX= contractDataDto.getPersonalOffsetX();
Double personalOffsetY= contractDataDto.getPersonalOffsetY(); Double personalOffsetY= contractDataDto.getPersonalOffsetY();
...@@ -174,17 +176,19 @@ public class QiyuesuoServiceImpl { ...@@ -174,17 +176,19 @@ public class QiyuesuoServiceImpl {
stamper.setDocumentId(documentAddResult.getDocumentId()); stamper.setDocumentId(documentAddResult.getDocumentId());
stamper.setKeyword(companykeyword); stamper.setKeyword(companykeyword);
stamper.setType("COMPANY"); stamper.setType("COMPANY");
stamper.setPage(companyPage); // stamper.setPage(companyPage);
stamper.setOffsetX(companyOffsetX); stamper.setOffsetX(companyOffsetX);
stamper.setOffsetY(companyOffsetY); stamper.setOffsetY(companyOffsetY);
stamper.setKeywordIndex(companykeywordIndex);
Stamper stamper2 = new Stamper(); Stamper stamper2 = new Stamper();
stamper2.setSignatoryId(SignatoryId); stamper2.setSignatoryId(SignatoryId);
stamper2.setDocumentId(documentAddResult.getDocumentId()); stamper2.setDocumentId(documentAddResult.getDocumentId());
stamper2.setKeyword(personalkeyword); stamper2.setKeyword(personalkeyword);
stamper2.setType("PERSONAL"); stamper2.setType("PERSONAL");
stamper2.setPage(personalPage); // stamper2.setPage(personalPage);
stamper2.setOffsetX(personalOffsetX); stamper2.setOffsetX(personalOffsetX);
stamper2.setOffsetY(personalOffsetY); stamper2.setOffsetY(personalOffsetY);
stamper2.setKeywordIndex(personalkeywordIndex);
List<Stamper> stampers = new ArrayList<>(); List<Stamper> stampers = new ArrayList<>();
stampers.add(stamper); stampers.add(stamper);
stampers.add(stamper2); stampers.add(stamper2);
...@@ -208,10 +212,10 @@ public class QiyuesuoServiceImpl { ...@@ -208,10 +212,10 @@ public class QiyuesuoServiceImpl {
logger.info("添加合同文档参数"+JSON.toJSONString(params)); logger.info("添加合同文档参数"+JSON.toJSONString(params));
DocumentAddByTemplateRequest request = new DocumentAddByTemplateRequest(contractId, DocumentAddByTemplateRequest request = new DocumentAddByTemplateRequest(contractId,
emplateId , params, subject); emplateId , params, subject);
logger.info("添加合同文档前", JSON.toJSONString(request)); logger.info("添加合同文档前"+ JSON.toJSONString(request));
String response = sdkClient.service(request); String response = sdkClient.service(request);
responseObj = JSONUtils.toQysResponse(response, DocumentAddResult.class); responseObj = JSONUtils.toQysResponse(response, DocumentAddResult.class);
logger.info("添加合同文档后", JSON.toJSONString(responseObj)); logger.info("添加合同文档后"+ JSON.toJSONString(responseObj));
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
...@@ -234,14 +238,14 @@ public class QiyuesuoServiceImpl { ...@@ -234,14 +238,14 @@ public class QiyuesuoServiceImpl {
SdkClient sdkClient = new SdkClient(serverUrl, accessKey, accessSecret); SdkClient sdkClient = new SdkClient(serverUrl, accessKey, accessSecret);
ContractSendRequest request = new ContractSendRequest(contractId, stampers); ContractSendRequest request = new ContractSendRequest(contractId, stampers);
logger.info("请求契约锁发起合同前", JSON.toJSONString(request)); logger.info("请求契约锁发起合同前"+JSON.toJSONString(request));
String response = sdkClient.service(request); String response = sdkClient.service(request);
responseObj = JSONUtils.toQysResponse(response); responseObj = JSONUtils.toQysResponse(response);
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
throw new BadRequest("请求契约锁发起合同接口失败"); throw new BadRequest("请求契约锁发起合同接口失败");
} }
logger.info("请求契约锁发起合同后", JSON.toJSONString(responseObj)); logger.info("请求契约锁发起合同后"+JSON.toJSONString(responseObj));
if(responseObj!=null&&responseObj.getCode() == 0) { if(responseObj!=null&&responseObj.getCode() == 0) {
logger.info("请求契约锁发起合同成功"); logger.info("请求契约锁发起合同成功");
} else { } else {
......
package com.yeejoin.amos.boot.module.hygf.biz.service.impl; package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -37,6 +38,8 @@ import org.typroject.tyboot.core.rdbms.service.BaseService; ...@@ -37,6 +38,8 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/** /**
* 勘察信息服务实现类 * 勘察信息服务实现类
...@@ -222,7 +225,7 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -222,7 +225,7 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
peasantHousehold.setPermanentAddressName(permanentAddressName.substring(0, permanentAddressName.length() - 1)); peasantHousehold.setPermanentAddressName(permanentAddressName.substring(0, permanentAddressName.length() - 1));
if(OPERATION_TYPE_SUBMIT.equals(operationType)){ if(OPERATION_TYPE_SUBMIT.equals(operationType)){
peasantHousehold.setSurveyOrNot(1); // peasantHousehold.setSurveyOrNot(1);
}else if(OPERATION_TYPE_APPLY.equals(operationType)){ }else if(OPERATION_TYPE_APPLY.equals(operationType)){
// 提交审核 // 提交审核
submitExamine(peasantHousehold); submitExamine(peasantHousehold);
...@@ -330,9 +333,10 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -330,9 +333,10 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
powerStationService.savePowerStation(powerStation, true,powerStation.getOwnersName(),""); powerStationService.savePowerStation(powerStation, true,powerStation.getOwnersName(),"");
// //
peasantHousehold.setConstructionState(ArrivalStateeEnum.勘察中.getCode());
LambdaUpdateWrapper<PeasantHousehold> up =new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<PeasantHousehold> up =new LambdaUpdateWrapper<>();
up.set(PeasantHousehold::getConstructionState, ArrivalStateeEnum.勘察中.getCode()); up.set(PeasantHousehold::getConstructionState, ArrivalStateeEnum.勘察中.getCode());
long idsk= basicGridAcceptance.getPeasantHouseholdId(); long idsk= peasantHousehold.getSequenceNbr();
up.eq(PeasantHousehold::getSequenceNbr,idsk); up.eq(PeasantHousehold::getSequenceNbr,idsk);
peasantHouseholdMapper.update(null,up); peasantHouseholdMapper.update(null,up);
...@@ -423,9 +427,9 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -423,9 +427,9 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
surveyInfoAllDto.getSurveyInformation().setDeveloperCode(userUnitInformationDto.getAmosDealerOrgCode()); surveyInfoAllDto.getSurveyInformation().setDeveloperCode(userUnitInformationDto.getAmosDealerOrgCode());
surveyInfoAllDto.getSurveyInformation().setDeveloperId(userUnitInformationDto.getAmosDealerId()); surveyInfoAllDto.getSurveyInformation().setDeveloperId(userUnitInformationDto.getAmosDealerId());
if(surveyInfoAllDto.getSurveyInformation().getSalesmanId()==null){ if(surveyInfoAllDto.getSurveyInformation().getSalesmanId()==null){
surveyInfoAllDto.getSurveyInformation().setSalesmanId(userInfo.getUserId()); surveyInfoAllDto.getSurveyInformation().setSalesmanId(peasantHousehold.getDeveloperUserId());
surveyInfoAllDto.getSurveyInformation().setSalesman(userInfo.getRealName()); surveyInfoAllDto.getSurveyInformation().setSalesman(peasantHousehold.getDeveloper());
surveyInfoAllDto.getSurveyInformation().setCreator(userInfo.getRealName()); surveyInfoAllDto.getSurveyInformation().setCreator(peasantHousehold.getDeveloper());
} }
if (!StringUtils.isEmpty(peasantHousehold.getProjectAddressName())) { if (!StringUtils.isEmpty(peasantHousehold.getProjectAddressName())) {
...@@ -457,17 +461,20 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -457,17 +461,20 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
informationQueryWrapper.eq("survey_information_id", surveyInformationId); informationQueryWrapper.eq("survey_information_id", surveyInformationId);
Information information = informationService.getBaseMapper().selectOne(informationQueryWrapper); Information information = informationService.getBaseMapper().selectOne(informationQueryWrapper);
if(information == null){
surveyInfoAllDto.setInformation(new InformationDto());
}else {
surveyInfoAllDto.setInformation(BeanDtoUtils.convert(information, InformationDto.class));
}
QueryWrapper<Commercial> commercialQueryWrapper = new QueryWrapper<>(); QueryWrapper<Commercial> commercialQueryWrapper = new QueryWrapper<>();
commercialQueryWrapper.eq("survey_information_id", surveyInformationId); commercialQueryWrapper.eq("survey_information_id", surveyInformationId);
Commercial commercial = commercialService.getBaseMapper().selectOne(commercialQueryWrapper); Commercial commercial = commercialService.getBaseMapper().selectOne(commercialQueryWrapper);
if(commercial==null){ if(commercial==null){
commercial=new Commercial(); commercial=new Commercial();
} }
if(information == null){
surveyInfoAllDto.setInformation(new InformationDto());
}else {
information.setCardFile( null == commercial ?new ArrayList<>() :(CollectionUtil.isNotEmpty(commercial.getIdCardCredit())? commercial.getIdCardCredit():new ArrayList<>()));
surveyInfoAllDto.setInformation(BeanDtoUtils.convert(information, InformationDto.class));
}
commercial.setApplicant(peasantHousehold.getOwnersName()); commercial.setApplicant(peasantHousehold.getOwnersName());
commercial.setIdCard(peasantHousehold.getIdCard()); commercial.setIdCard(peasantHousehold.getIdCard());
commercial.setTelephone(peasantHousehold.getTelephone()); commercial.setTelephone(peasantHousehold.getTelephone());
...@@ -476,6 +483,25 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -476,6 +483,25 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
commercial.setProjectAddressDetail(peasantHousehold.getProjectAddressDetail()); commercial.setProjectAddressDetail(peasantHousehold.getProjectAddressDetail());
commercial.setLegalContactTelephone(peasantHousehold.getTelephone()); commercial.setLegalContactTelephone(peasantHousehold.getTelephone());
List<Object> list = new ArrayList<>();
if (null != surveyDetails){
if (CollectionUtil.isNotEmpty(surveyDetails.getSurroundingHouseSurvey())){
list.addAll(surveyDetails.getSurroundingHouseSurvey());
}
if (CollectionUtil.isNotEmpty(surveyDetails.getOverallHousingSurvey())){
list.addAll(surveyDetails.getOverallHousingSurvey());
}
if (CollectionUtil.isNotEmpty(surveyDetails.getPanoramaSurvey())){
list.addAll(surveyDetails.getPanoramaSurvey());
}
if (CollectionUtil.isNotEmpty(surveyDetails.getPlanSketchSurvey())){
list.addAll(surveyDetails.getPlanSketchSurvey());
}
if (CollectionUtil.isNotEmpty(surveyDetails.getAzimuthSurvey())){
list.addAll(surveyDetails.getAzimuthSurvey());
}
}
commercial.setSurveyPhotosWeb(list);
if(information == null){ if(information == null){
......
...@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -8,6 +8,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.module.hygf.api.dto.HYGFMaintenanceTicketsDto; import com.yeejoin.amos.boot.module.hygf.api.dto.HYGFMaintenanceTicketsDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto; import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.HYGFMaintenanceTickets; import com.yeejoin.amos.boot.module.hygf.api.entity.HYGFMaintenanceTickets;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpStation; import com.yeejoin.amos.boot.module.hygf.api.entity.JpStation;
...@@ -19,6 +20,7 @@ import com.yeejoin.amos.boot.module.hygf.api.util.TimeUtil; ...@@ -19,6 +20,7 @@ import com.yeejoin.amos.boot.module.hygf.api.util.TimeUtil;
import jdk.nashorn.internal.ir.annotations.Ignore; import jdk.nashorn.internal.ir.annotations.Ignore;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.*; import java.util.*;
...@@ -40,6 +42,8 @@ public class TdHygfJpInverterWarnServiceImpl ...@@ -40,6 +42,8 @@ public class TdHygfJpInverterWarnServiceImpl
@Autowired @Autowired
HYGFMaintenanceTicketsMapper hygfMaintenanceTicketsMapper; HYGFMaintenanceTicketsMapper hygfMaintenanceTicketsMapper;
@Autowired
TdHygfJpInverterWarnMapper tdHygfJpInverterWarnMapper;
/** /**
* 分页查询 * 分页查询
...@@ -95,18 +99,18 @@ public class TdHygfJpInverterWarnServiceImpl ...@@ -95,18 +99,18 @@ public class TdHygfJpInverterWarnServiceImpl
} }
List<HYGFMaintenanceTickets> hygfMaintenanceTicketsList = hygfMaintenanceTicketsMapper.selectList(new QueryWrapper<HYGFMaintenanceTickets>().in("warning_id", waringIds)); List<HYGFMaintenanceTickets> hygfMaintenanceTicketsList = hygfMaintenanceTicketsMapper.selectList(new QueryWrapper<HYGFMaintenanceTickets>().in("warning_id", waringIds));
if (hygfMaintenanceTicketsList.size() > 0) { if (hygfMaintenanceTicketsList.size() > 0) {
list.forEach(i -> { list.forEach(i -> {
List<HYGFMaintenanceTickets> ticketsList = hygfMaintenanceTicketsList.stream().filter(hygfmaintenanceTickets -> i.getCreatedTime().equals(hygfmaintenanceTickets.getWarningId())).collect(Collectors.toList()); List<HYGFMaintenanceTickets> ticketsList = hygfMaintenanceTicketsList.stream().filter(hygfmaintenanceTickets -> i.getCreatedTime().equals(hygfmaintenanceTickets.getWarningId())).collect(Collectors.toList());
if (ObjectUtil.isNotEmpty(ticketsList)) { if (ObjectUtil.isNotEmpty(ticketsList)) {
Set<String> status = ticketsList.stream().map(HYGFMaintenanceTickets::getHandlerStatus).collect(Collectors.toSet()); Set<String> status = ticketsList.stream().map(HYGFMaintenanceTickets::getHandlerStatus).collect(Collectors.toSet());
if (status.contains("未处理")) { if (status.contains("未处理")) {
i.setTicketStatus("处理中"); i.setTicketStatus("处理中");
} }
if (status.contains("已处理") && status.size() == 1) { if (status.contains("已处理") && status.size() == 1) {
i.setTicketStatus("已处理"); i.setTicketStatus("已处理");
} }
} }
}); });
} }
PageInfo<TdHygfJpInverterWarnDto> page = new PageInfo(list); PageInfo<TdHygfJpInverterWarnDto> page = new PageInfo(list);
com.baomidou.mybatisplus.extension.plugins.pagination.Page<TdHygfJpInverterWarnDto> pagenew = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<TdHygfJpInverterWarnDto>(); com.baomidou.mybatisplus.extension.plugins.pagination.Page<TdHygfJpInverterWarnDto> pagenew = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<TdHygfJpInverterWarnDto>();
...@@ -165,20 +169,60 @@ public class TdHygfJpInverterWarnServiceImpl ...@@ -165,20 +169,60 @@ public class TdHygfJpInverterWarnServiceImpl
return tdHygfJpInverterWarnDto; return tdHygfJpInverterWarnDto;
} }
public List<TdHygfJpInverterWarnDto> selectWarnList(String state, String level, String minvalue, String maxValue, String snCode, List<String> stationId, String startTime, String endTime, String content, Integer current, Integer size, String handlerStatus) { public List<TdHygfJpInverterWarnDto> selectWarnList(String state, String level, String minvalue, String maxValue, String snCode, List<String> stationId, String startTime, String endTime, String content, Integer current, Integer size, String handlerStatus, String stationName) {
List<TdHygfJpInverterWarnDto> list = this.getBaseMapper().selectWarnList(state, level, minvalue, maxValue, snCode, stationId, startTime, endTime, content, (current - 1) * size, size, handlerStatus); List<TdHygfJpInverterWarnDto> list = tdHygfJpInverterWarnMapper.selectWarnList(state, level, minvalue, maxValue, snCode, stationId, startTime, endTime, content, (current - 1) * size, size, handlerStatus, stationName);
list.forEach(i -> { list.forEach(i -> {
JpStation jpStation = jpStationServiceImpl.getOne(new LambdaQueryWrapper<JpStation>() JpStation jpStation = jpStationServiceImpl.getOne(new LambdaQueryWrapper<JpStation>()
.eq(JpStation::getThirdStationId, i.getThirdStationId())); .eq(JpStation::getThirdStationId, i.getThirdStationId()));
if (ObjectUtil.isNotNull(jpStation)) { if (ObjectUtil.isNotNull(jpStation)) {
i.setAddress(jpStation.getAddress()); i.setAddress(jpStation.getAddress());
i.setArea(jpStation.getArea()); i.setArea(jpStation.getArea());
i.setStationName(jpStation.getName());
} }
}); });
return list; return list;
} }
public int selectWarnListTotal(String state, String level, String minvalue, String maxValue, String snCode, List<String> stationId, String startTime, String endTime, String content, String handlerStatus) { public int selectWarnListTotal(String state, String level, String minvalue, String maxValue, String snCode, List<String> stationId, String startTime, String endTime, String content, String handlerStatus, String stationName) {
return this.getBaseMapper().selectWarnListTotal(state, level, minvalue, maxValue, snCode, stationId, startTime, endTime, content, handlerStatus); return tdHygfJpInverterWarnMapper.selectWarnListTotal(state, level, minvalue, maxValue, snCode, stationId, startTime, endTime, content, handlerStatus, stationName);
}
public Map<String, Object> queryAlarmNumber(String regionalCompaniesCode, String amosCompanyCode, String powerStationId) {
// 查询所有场站
List<JpStationDto> jpStationDtos = jpStationServiceImpl.queryAllPowerStation(regionalCompaniesCode, amosCompanyCode, powerStationId);
Map<String, Object> result = new HashMap<>();
if (!CollectionUtils.isEmpty(jpStationDtos)) {
// 获取thirdStationId集合
List<String> thirdStationIds = jpStationDtos.stream().map(JpStation -> JpStation.getThirdStationId()).collect(Collectors.toList());
List<TdHygfJpInverterWarnDto> tdHygfJpInverterWarnDtos = tdHygfJpInverterWarnMapper.queryAlarmNumber(thirdStationIds);
ArrayList<String> yclArray = new ArrayList<>();
ArrayList<String> wclArray = new ArrayList<>();
tdHygfJpInverterWarnDtos.stream().forEach(tdHygfJpInverterWarnDto -> {
if (tdHygfJpInverterWarnDto.getState().equals("已恢复") || tdHygfJpInverterWarnDto.getState().equals("已处理")) {
yclArray.add(tdHygfJpInverterWarnDto.getState());
} else {
wclArray.add(tdHygfJpInverterWarnDto.getState());
}
});
result.put("ycl", yclArray.size());
result.put("wcl", wclArray.size());
}else {
result.put("ycl", 0);
result.put("wcl", 0);
}
return result;
} }
} }
\ No newline at end of file
...@@ -377,6 +377,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -377,6 +377,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
Privilege.agencyUserClient.multDeleteUser(userResult.getResult().getUserId()); Privilege.agencyUserClient.multDeleteUser(userResult.getResult().getUserId());
} }
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
e.printStackTrace();
throw new BadRequest(e.getMessage()); throw new BadRequest(e.getMessage());
} }
} }
...@@ -578,8 +579,8 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -578,8 +579,8 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
params.put("mobile",unitInfo.getAdminPhone()); params.put("mobile",unitInfo.getAdminPhone());
params.put("smsCode", SMSTEMPCODENO); params.put("smsCode", SMSTEMPCODENO);
approvalStatue="任务明细:"+DealerReviewEnum.经销商管理员审核.getName()+"审核不通过"; approvalStatue="任务明细:"+DealerReviewEnum.经销商管理员审核.getName()+"审核不通过";
FeignClientResult<SmsRecordModel> date= Systemctl.smsClient.sendCommonSms(params); // FeignClientResult<SmsRecordModel> date= Systemctl.smsClient.sendCommonSms(params);
System.out.println("短信通知============================"+JSON.toJSONString(date)); // System.out.println("短信通知============================"+JSON.toJSONString(date));
}else{ }else{
// 1. 更新经销商状态 // 1. 更新经销商状态
unitInfo.setAuditStatus(2); unitInfo.setAuditStatus(2);
...@@ -625,12 +626,12 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -625,12 +626,12 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
// Privilege.agencyUserClient.unlockUsers(unitInfo.getAdminUserId()); // Privilege.agencyUserClient.unlockUsers(unitInfo.getAdminUserId());
approvalStatue="任务明细:"+DealerReviewEnum.经销商管理员审核.getName()+"审核通过"; approvalStatue="任务明细:"+DealerReviewEnum.经销商管理员审核.getName()+"审核通过";
HashMap<String, String> params = new HashMap<>(3); // HashMap<String, String> params = new HashMap<>(3);
params.put("code","通过"); // params.put("code","通过");
params.put("mobile",unitInfo.getAdminPhone()); // params.put("mobile",unitInfo.getAdminPhone());
params.put("smsCode", SMSTEMPCODEYES); // params.put("smsCode", SMSTEMPCODEYES);
FeignClientResult<SmsRecordModel> date= Systemctl.smsClient.sendCommonSms(params); // FeignClientResult<SmsRecordModel> date= Systemctl.smsClient.sendCommonSms(params);
System.out.println("短信通知============================"+JSON.toJSONString(date)); // System.out.println("短信通知============================"+JSON.toJSONString(date));
} }
} }
...@@ -679,7 +680,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -679,7 +680,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
} }
e.printStackTrace(); e.printStackTrace();
throw new BaseException("获取工作流节点失败!","400","获取工作流节点失败!"); throw new BaseException("获取工作流节点失败!","400","获取工作流节点失败!");
......
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.hygf.api.dto.WorkflowResultDto;
import com.yeejoin.amos.component.feign.utils.FeignUtil;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.workflow.Workflow;
import com.yeejoin.amos.feign.workflow.model.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Service
@Slf4j
public class WorkFlowService {
/***
* 开启并执行一步 支持批量
*
* */
public List<ProcessTaskDTO> startBatch(ActWorkflowBatchDTO params) {
List<ProcessTaskDTO> processTasks;
try {
log.info("开始前请求工作流启动接口:/start/batch,请求参数:{}", JSONObject.toJSONString(params));
processTasks = FeignUtil.remoteCall(() -> Workflow.taskV2Client.startForBatch(params));
} catch (Exception e) {
log.error("调用工作流批量启动失败", e);
throw new RuntimeException("调用工作流批量启动失败");
}
return processTasks;
}
public ProcessInstanceDTO stopProcess(String processInstanceId) {
ProcessInstanceDTO processInstanceDTO ;
try {
log.info("开始前请求工作流停止接口:stopProcess,请求参数:{}", processInstanceId);
processInstanceDTO = FeignUtil.remoteCall(() -> Workflow.taskV2Client.stopProcess(processInstanceId));
} catch (Exception e) {
log.error("调用工作流批量停止失败", e);
throw new RuntimeException("调用工作流批量停止失败");
}
return processInstanceDTO;
}
/***
* 执行
*
* */
public ProcessTaskDTO complete(String taskId, TaskResultDTO data) {
ProcessTaskDTO processTaskDTO;
try {
log.info("开始前请求工作流完成任务接口:/complete/standard/{taskId},请求参数:{},{}", taskId, JSONObject.toJSONString(data));
processTaskDTO = FeignUtil.remoteCall(() -> Workflow.taskV2Client.completeByTaskFroStandard(taskId, data));
} catch (Exception e) {
log.error("调用工作流完成任务接口失败", e);
throw new RuntimeException("调用工作流完成任务接口失败");
}
return processTaskDTO;
}
public List<WorkflowResultDto> buildWorkFlowInfo(List<ProcessTaskDTO> processTaskDTOS) {
List<WorkflowResultDto> workflowResultDtoList = new ArrayList<>();
processTaskDTOS.forEach(item -> {
WorkflowResultDto workflowResultDto = new WorkflowResultDto();
if (null != item.getProcessInstance()){
workflowResultDto.setInstanceId(item.getProcessInstance().getId());
}
// workflowResultDto.setNextExecutorIds(String.join(",", item.getCandidateGroups()));
if (!CollectionUtils.isEmpty(item.getNextTask())) {
ActTaskDTO actTaskDTO = item.getNextTask().get(0);
workflowResultDto.setTaskName(actTaskDTO.getName());
workflowResultDto.setNextTaskId(actTaskDTO.getId());
workflowResultDto.setNextNodeKey(actTaskDTO.getKey()); // 工作流字段还未添加
workflowResultDto.setNextNodeName(actTaskDTO.getName());
List<String> nextGroups = item.getNextCandidateGroups().get(actTaskDTO.getId());
String join = String.join(",", nextGroups);
workflowResultDto.setNextExecutorIds(join);
List<String> nextUserIds = item.getNextTaskExecutor().get(actTaskDTO.getId()).stream().map(AgencyUserModel::getUserId).collect(Collectors.toList());
String nextUserIdsString = String.join(",", nextUserIds);
workflowResultDto.setNextExecuteUserIds(nextUserIdsString);
}
workflowResultDtoList.add(workflowResultDto);
});
return workflowResultDtoList;
}
}
...@@ -168,6 +168,9 @@ hygf.user.group.id=1702512164058718210 ...@@ -168,6 +168,9 @@ hygf.user.group.id=1702512164058718210
regionalCompanies.company.seq=1701778292098498561 regionalCompanies.company.seq=1701778292098498561
hygf.user.group.empty=1775056568031645697
#qiyuesuo.serverUrl = https://openapi.qiyuesuo.cn #qiyuesuo.serverUrl = https://openapi.qiyuesuo.cn
#qiyuesuo.accessKey = a1lcd3WRRV #qiyuesuo.accessKey = a1lcd3WRRV
......
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
<factorypathentry kind="VARJAR" id="M2_REPO/com/github/pagehelper/pagehelper/5.1.10/pagehelper-5.1.10.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/com/github/pagehelper/pagehelper/5.1.10/pagehelper-5.1.10.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/github/jsqlparser/jsqlparser/2.0/jsqlparser-2.0.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/com/github/jsqlparser/jsqlparser/2.0/jsqlparser-2.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/commons/commons-text/1.9/commons-text-1.9.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/org/apache/commons/commons-text/1.9/commons-text-1.9.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/yeejoin/amos-feign-privilege/1.8.5/amos-feign-privilege-1.8.5.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/com/yeejoin/amos-feign-privilege/1.9.0-SNAPSHOT/amos-feign-privilege-1.9.0-SNAPSHOT.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/typroject/tyboot-core-foundation/1.1.24-SNAPSHOT/tyboot-core-foundation-1.1.24-SNAPSHOT.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/org/typroject/tyboot-core-foundation/1.1.24-SNAPSHOT/tyboot-core-foundation-1.1.24-SNAPSHOT.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/belerweb/pinyin4j/2.5.0/pinyin4j-2.5.0.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/com/belerweb/pinyin4j/2.5.0/pinyin4j-2.5.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/commons-beanutils/commons-beanutils/1.9.2/commons-beanutils-1.9.2.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/commons-beanutils/commons-beanutils/1.9.2/commons-beanutils-1.9.2.jar" enabled="true" runInBatchMode="false"/>
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
<factorypathentry kind="VARJAR" id="M2_REPO/com/esotericsoftware/reflectasm/reflectasm/1.09/reflectasm-1.09.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/com/esotericsoftware/reflectasm/reflectasm/1.09/reflectasm-1.09.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/github/axet/kaptcha/0.0.9/kaptcha-0.0.9.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/com/github/axet/kaptcha/0.0.9/kaptcha-0.0.9.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/jhlabs/filters/2.0.235/filters-2.0.235.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/com/jhlabs/filters/2.0.235/filters-2.0.235.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/yeejoin/amos-component-feign/1.8.5/amos-component-feign-1.8.5.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/com/yeejoin/amos-component-feign/1.9.0-SNAPSHOT/amos-component-feign-1.9.0-SNAPSHOT.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/cloud/spring-cloud-starter-openfeign/2.2.5.RELEASE/spring-cloud-starter-openfeign-2.2.5.RELEASE.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/cloud/spring-cloud-starter-openfeign/2.2.5.RELEASE/spring-cloud-starter-openfeign-2.2.5.RELEASE.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/cloud/spring-cloud-openfeign-core/2.2.5.RELEASE/spring-cloud-openfeign-core-2.2.5.RELEASE.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/cloud/spring-cloud-openfeign-core/2.2.5.RELEASE/spring-cloud-openfeign-core-2.2.5.RELEASE.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/github/openfeign/form/feign-form-spring/3.8.0/feign-form-spring-3.8.0.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/io/github/openfeign/form/feign-form-spring/3.8.0/feign-form-spring-3.8.0.jar" enabled="true" runInBatchMode="false"/>
......
...@@ -58,7 +58,6 @@ ...@@ -58,7 +58,6 @@
<factorypathentry kind="VARJAR" id="M2_REPO/org/attoparser/attoparser/2.0.5.RELEASE/attoparser-2.0.5.RELEASE.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/org/attoparser/attoparser/2.0.5.RELEASE/attoparser-2.0.5.RELEASE.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/unbescape/unbescape/1.1.6.RELEASE/unbescape-1.1.6.RELEASE.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/org/unbescape/unbescape/1.1.6.RELEASE/unbescape-1.1.6.RELEASE.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/thymeleaf/extras/thymeleaf-extras-java8time/3.0.4.RELEASE/thymeleaf-extras-java8time-3.0.4.RELEASE.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/org/thymeleaf/extras/thymeleaf-extras-java8time/3.0.4.RELEASE/thymeleaf-extras-java8time-3.0.4.RELEASE.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/yeejoin/amos-feign-workflow/1.8.5-SNAPSHOT/amos-feign-workflow-1.8.5-SNAPSHOT.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/typroject/tyboot-component-event/1.1.23-SNAPSHOT/tyboot-component-event-1.1.23-SNAPSHOT.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/org/typroject/tyboot-component-event/1.1.23-SNAPSHOT/tyboot-component-event-1.1.23-SNAPSHOT.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-aop/2.3.11.RELEASE/spring-boot-starter-aop-2.3.11.RELEASE.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-aop/2.3.11.RELEASE/spring-boot-starter-aop-2.3.11.RELEASE.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-logging/2.3.11.RELEASE/spring-boot-starter-logging-2.3.11.RELEASE.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-logging/2.3.11.RELEASE/spring-boot-starter-logging-2.3.11.RELEASE.jar" enabled="true" runInBatchMode="false"/>
...@@ -131,14 +130,15 @@ ...@@ -131,14 +130,15 @@
<factorypathentry kind="VARJAR" id="M2_REPO/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/cn/hutool/hutool-all/5.7.22/hutool-all-5.7.22.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/commons/commons-text/1.9/commons-text-1.9.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/org/apache/commons/commons-text/1.9/commons-text-1.9.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/yeejoin/amos-feign-privilege/1.8.5/amos-feign-privilege-1.8.5.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/com/yeejoin/amos-feign-privilege/1.9.0-SNAPSHOT/amos-feign-privilege-1.9.0-SNAPSHOT.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/typroject/tyboot-core-foundation/1.1.24-SNAPSHOT/tyboot-core-foundation-1.1.24-SNAPSHOT.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/org/typroject/tyboot-core-foundation/1.1.24-SNAPSHOT/tyboot-core-foundation-1.1.24-SNAPSHOT.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/belerweb/pinyin4j/2.5.0/pinyin4j-2.5.0.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/com/belerweb/pinyin4j/2.5.0/pinyin4j-2.5.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/esotericsoftware/reflectasm/reflectasm/1.09/reflectasm-1.09.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/com/esotericsoftware/reflectasm/reflectasm/1.09/reflectasm-1.09.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/github/axet/kaptcha/0.0.9/kaptcha-0.0.9.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/com/github/axet/kaptcha/0.0.9/kaptcha-0.0.9.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/jhlabs/filters/2.0.235/filters-2.0.235.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/com/jhlabs/filters/2.0.235/filters-2.0.235.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/yeejoin/amos-component-feign/1.8.5/amos-component-feign-1.8.5.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/com/yeejoin/amos-component-feign/1.9.0-SNAPSHOT/amos-component-feign-1.9.0-SNAPSHOT.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/cloud/spring-cloud-starter-openfeign/2.2.5.RELEASE/spring-cloud-starter-openfeign-2.2.5.RELEASE.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/cloud/spring-cloud-starter-openfeign/2.2.5.RELEASE/spring-cloud-starter-openfeign-2.2.5.RELEASE.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/cloud/spring-cloud-openfeign-core/2.2.5.RELEASE/spring-cloud-openfeign-core-2.2.5.RELEASE.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/cloud/spring-cloud-openfeign-core/2.2.5.RELEASE/spring-cloud-openfeign-core-2.2.5.RELEASE.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/github/openfeign/form/feign-form-spring/3.8.0/feign-form-spring-3.8.0.jar" enabled="true" runInBatchMode="false"/> <factorypathentry kind="VARJAR" id="M2_REPO/io/github/openfeign/form/feign-form-spring/3.8.0/feign-form-spring-3.8.0.jar" enabled="true" runInBatchMode="false"/>
......
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