Commit ad673887 authored by chenzhao's avatar chenzhao

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents c3dced3f 123d45ca
...@@ -11,8 +11,8 @@ import lombok.Getter; ...@@ -11,8 +11,8 @@ import lombok.Getter;
@AllArgsConstructor @AllArgsConstructor
public enum PowerStationProcessStateEnum { public enum PowerStationProcessStateEnum {
进行中("进行中", "0", "progress"), 进行中("进行中", "0", "progress"),
通过("通过", "1", "yes"), 通过("通过", "1", "0"),
不通过("不通过", "2", "no"), 不通过("不通过", "2", "1"),
完成("完成", "3", "complete"), 完成("完成", "3", "complete"),
作废("作废", "4", "reject"); 作废("作废", "4", "reject");
......
...@@ -76,4 +76,6 @@ public class PowerStationDto extends BaseDto { ...@@ -76,4 +76,6 @@ public class PowerStationDto extends BaseDto {
@ApiModelProperty(value = "计划实例id") @ApiModelProperty(value = "计划实例id")
private String planInstanceId; private String planInstanceId;
@ApiModelProperty(value = "设计图纸审核")
private String drawingReview;
} }
package com.yeejoin.amos.boot.module.hygf.api.entity; package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
...@@ -27,157 +28,157 @@ public class DesignInformation extends BaseEntity { ...@@ -27,157 +28,157 @@ public class DesignInformation extends BaseEntity {
/** /**
* 典型设计图信息 * 典型设计图信息
*/ */
@TableField(value = "typical_diagram",typeHandler = FastjsonTypeHandler.class) @TableField(value = "typical_diagram",typeHandler = FastjsonTypeHandler.class,updateStrategy = FieldStrategy.IGNORED)
private List<Object> typicalDiagram; private List<Object> typicalDiagram;
/** /**
* 组件排布图 * 组件排布图
*/ */
@TableField(value = "component_layout",typeHandler = FastjsonTypeHandler.class) @TableField(value = "component_layout",typeHandler = FastjsonTypeHandler.class,updateStrategy = FieldStrategy.IGNORED)
private List<Object> componentLayout; private List<Object> componentLayout;
/** /**
* 组件支架图 * 组件支架图
*/ */
@TableField(value = "component_bracket",typeHandler = FastjsonTypeHandler.class) @TableField(value = "component_bracket",typeHandler = FastjsonTypeHandler.class,updateStrategy = FieldStrategy.IGNORED)
private List<Object> componentBracket; private List<Object> componentBracket;
/** /**
* 组串接线图 * 组串接线图
*/ */
@TableField(value = "connection_line",typeHandler = FastjsonTypeHandler.class) @TableField(value = "connection_line",typeHandler = FastjsonTypeHandler.class,updateStrategy = FieldStrategy.IGNORED)
private List<Object> connectionLine; private List<Object> connectionLine;
/** /**
* 一次接线图 * 一次接线图
*/ */
@TableField(value = "once_line",typeHandler = FastjsonTypeHandler.class) @TableField(value = "once_line",typeHandler = FastjsonTypeHandler.class,updateStrategy = FieldStrategy.IGNORED)
private List<Object> onceLine; private List<Object> onceLine;
/** /**
* 组件 * 组件
*/ */
@TableField(value = "assembly",typeHandler = FastjsonTypeHandler.class) @TableField(value = "assembly",typeHandler = FastjsonTypeHandler.class,updateStrategy = FieldStrategy.IGNORED)
private List<Object> assembly; private List<Object> assembly;
/** /**
* 逆变器 * 逆变器
*/ */
@TableField(value = "inverter",typeHandler = FastjsonTypeHandler.class) @TableField(value = "inverter",typeHandler = FastjsonTypeHandler.class,updateStrategy = FieldStrategy.IGNORED)
private List<Object> inverter; private List<Object> inverter;
/** /**
* 电表箱 * 电表箱
*/ */
@TableField(value = "electricity_meter",typeHandler = FastjsonTypeHandler.class) @TableField(value = "electricity_meter",typeHandler = FastjsonTypeHandler.class,updateStrategy = FieldStrategy.IGNORED)
private List<Object> electricityMeter; private List<Object> electricityMeter;
/** /**
* 支架 * 支架
*/ */
@TableField(value = "support",typeHandler = FastjsonTypeHandler.class) @TableField(value = "support",typeHandler = FastjsonTypeHandler.class,updateStrategy = FieldStrategy.IGNORED)
private List<Object> support; private List<Object> support;
/** /**
* 防滑雪措施 * 防滑雪措施
*/ */
@TableField("anti_skiing") @TableField(value = "anti_skiing",updateStrategy = FieldStrategy.IGNORED)
private String antiSkiing; private String antiSkiing;
/** /**
* 防滑雪措施备注 * 防滑雪措施备注
*/ */
@TableField("anti_skiing_notes") @TableField(value = "anti_skiing_notes",updateStrategy = FieldStrategy.IGNORED)
private String antiSkiingNotes; private String antiSkiingNotes;
/** /**
* 抽检 * 抽检
*/ */
@TableField("spot_check") @TableField(value = "spot_check",updateStrategy = FieldStrategy.IGNORED)
private String spotCheck; private String spotCheck;
/** /**
* 抽检意见 * 抽检意见
*/ */
@TableField("spot_check_opinion") @TableField(value = "spot_check_opinion",updateStrategy = FieldStrategy.IGNORED)
private String spotCheckOpinion; private String spotCheckOpinion;
/** /**
* 是否定制 * 是否定制
*/ */
@TableField("isok_customized") @TableField(value = "isok_customized",updateStrategy = FieldStrategy.IGNORED)
private String isokCustomized; private String isokCustomized;
/** /**
* 是否加固 * 是否加固
*/ */
@TableField("wind_resistant") @TableField(value = "wind_resistant",updateStrategy = FieldStrategy.IGNORED)
private String windResistant; private String windResistant;
/** /**
* 试点方案 * 试点方案
*/ */
@TableField("pilot_program") @TableField(value = "pilot_program",updateStrategy = FieldStrategy.IGNORED)
private String pilotProgram; private String pilotProgram;
/** /**
* s试点物料 * s试点物料
*/ */
@TableField("pilot_materials") @TableField(value = "pilot_materials",updateStrategy = FieldStrategy.IGNORED)
private String pilotMaterials; private String pilotMaterials;
/** /**
* 方位角 * 方位角
*/ */
@TableField("azimuth") @TableField(value = "azimuth",updateStrategy = FieldStrategy.IGNORED)
private String azimuth; private String azimuth;
/** /**
* 倾角 * 倾角
*/ */
@TableField("dip_angle") @TableField(value = "dip_angle",updateStrategy = FieldStrategy.IGNORED)
private String dipAngle; private String dipAngle;
/** /**
* 应用场景 * 应用场景
*/ */
@TableField("application_scenario") @TableField(value = "application_scenario",updateStrategy = FieldStrategy.IGNORED)
private String applicationScenario; private String applicationScenario;
/** /**
* 应用场景数量 * 应用场景数量
*/ */
@TableField("application_scenario_num") @TableField(value = "application_scenario_num",updateStrategy = FieldStrategy.IGNORED)
private Integer applicationScenarioNum; private Integer applicationScenarioNum;
/** /**
* 支架方案 * 支架方案
*/ */
@TableField("support_scheme") @TableField(value = "support_scheme",updateStrategy = FieldStrategy.IGNORED)
private String supportScheme; private String supportScheme;
/** /**
* 支架方案数量 * 支架方案数量
*/ */
@TableField("support_scheme_num") @TableField(value = "support_scheme_num",updateStrategy = FieldStrategy.IGNORED)
private Integer supportSchemeNum; private Integer supportSchemeNum;
/** /**
* 特殊方案 * 特殊方案
*/ */
@TableField("special_plan") @TableField(value = "special_plan",updateStrategy = FieldStrategy.IGNORED)
private String specialPlan; private String specialPlan;
/** /**
* 特殊方案数量 * 特殊方案数量
*/ */
@TableField("special_plan_num") @TableField(value = "special_plan_num",updateStrategy = FieldStrategy.IGNORED)
private Integer specialPlanNum; private Integer specialPlanNum;
/** /**
* 农户id * 农户id
*/ */
@TableField("peasant_household_id") @TableField(value = "peasant_household_id",updateStrategy = FieldStrategy.IGNORED)
private String peasantHouseholdId; private String peasantHouseholdId;
} }
...@@ -127,4 +127,8 @@ public class PowerStation extends BaseEntity { ...@@ -127,4 +127,8 @@ public class PowerStation extends BaseEntity {
*/ */
@TableField("plan_instance_id") @TableField("plan_instance_id")
private String planInstanceId; private String planInstanceId;
@TableField("drawing_review")
private String drawingReview;
} }
...@@ -16,9 +16,10 @@ public interface IPowerStationService { ...@@ -16,9 +16,10 @@ public interface IPowerStationService {
/** /**
* 保存审核实例 * 保存审核实例
* @param powerStation 审核对象 * @param powerStation 审核对象
* @param flag 是否是最后一个节点
* @return 状态 * @return 状态
*/ */
boolean savePowerStation(PowerStation powerStation); boolean savePowerStation(PowerStation powerStation, boolean flag);
/** /**
......
...@@ -3,13 +3,19 @@ package com.yeejoin.amos.boot.module.hygf.biz.controller; ...@@ -3,13 +3,19 @@ package com.yeejoin.amos.boot.module.hygf.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationDto; import com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationDto;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.PowerStationServiceImpl; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.PowerStationServiceImpl;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
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;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -96,12 +102,15 @@ public class PowerStationController extends BaseController { ...@@ -96,12 +102,15 @@ public class PowerStationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page") @GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询") @ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询")
public ResponseModel<Page<PowerStationDto>> queryForPage(@RequestParam(value = "current") int current, @RequestParam public ResponseModel<Page<PowerStationDto>> queryForPage(@RequestParam(value = "current") int current,
(value = "size") int size) { @RequestParam(value = "size") int size,
@RequestParam(value = "powerStationCode",required = false)String powerStationCode,
@RequestParam(value = "ownersName",required = false)String ownersName) {
Page<PowerStationDto> page = new Page<PowerStationDto>(); Page<PowerStationDto> page = new Page<PowerStationDto>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(powerStationServiceImpl.queryForPowerStationPage(page)); AgencyUserModel userInfo = getUserInfo();
return ResponseHelper.buildResponse(powerStationServiceImpl.queryForPowerStationUserRoles(page,powerStationCode,ownersName,userInfo));
} }
/** /**
......
...@@ -233,7 +233,7 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -233,7 +233,7 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
powerStation.setFlowTaskId(flowTaskId); powerStation.setFlowTaskId(flowTaskId);
powerStation.setNextProcessNode(PowerStationNodeEnum.设计审核.getCode()); powerStation.setNextProcessNode(PowerStationNodeEnum.设计审核.getCode());
} }
powerStationService.savePowerStation(powerStation); powerStationService.savePowerStation(powerStation, true);
} }
} catch (Exception e){ } catch (Exception e){
throw new BaseException("获取工作流节点失败!","400","获取工作流节点失败!"); throw new BaseException("获取工作流节点失败!","400","获取工作流节点失败!");
......
...@@ -6,6 +6,7 @@ import lombok.Data; ...@@ -6,6 +6,7 @@ import lombok.Data;
import java.util.List; import java.util.List;
@Data @Data
public class StationRecordInfo { public class StationRecordInfo {
...@@ -40,4 +41,6 @@ public class StationRecordInfo { ...@@ -40,4 +41,6 @@ public class StationRecordInfo {
@ApiModelProperty(value = "风险等级") @ApiModelProperty(value = "风险等级")
private String riskLevel; private String riskLevel;
@ApiModelProperty(value = "场站坐标偏移量")
private String titlePos;
} }
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jxiop.api.entity; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jxiop.api.entity;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.jxiop.api.dto.StationCoordinateDto; import com.yeejoin.amos.boot.module.jxiop.api.dto.StationCoordinateDto;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -20,7 +21,7 @@ import java.util.List; ...@@ -20,7 +21,7 @@ import java.util.List;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Accessors(chain = true) @Accessors(chain = true)
@TableName("station_basic") @TableName(value = "station_basic",autoResultMap = true)
public class StationBasic extends BaseEntity { public class StationBasic extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -139,8 +140,6 @@ public class StationBasic extends BaseEntity { ...@@ -139,8 +140,6 @@ public class StationBasic extends BaseEntity {
@TableField(exist =false) @TableField(exist =false)
private List<StationCoordinate> stationCoordinate; private List<StationCoordinate> stationCoordinate;
//新增 场站第三方编号 //新增 场站第三方编号
@TableField("station_number") @TableField("station_number")
private String stationNumber; private String stationNumber;
...@@ -150,6 +149,7 @@ public class StationBasic extends BaseEntity { ...@@ -150,6 +149,7 @@ public class StationBasic extends BaseEntity {
//升压站网管 //升压站网管
@TableField("booster_gateway_id") @TableField("booster_gateway_id")
private String boosterGatewayId; private String boosterGatewayId;
//地图偏移量
@TableField(value = "title_pos",typeHandler = FastjsonTypeHandler.class)
private List<Double> titlePos;
} }
...@@ -44,4 +44,6 @@ public interface MonitorFanIndicatorMapper extends BaseMapper<MonitorFanIndicato ...@@ -44,4 +44,6 @@ public interface MonitorFanIndicatorMapper extends BaseMapper<MonitorFanIndicato
Map<String, String> getMajorBoosterStationInfoBySort(@Param("gatewayId") String gatewayId, Map<String, String> getMajorBoosterStationInfoBySort(@Param("gatewayId") String gatewayId,
@Param("sort") String sort); @Param("sort") String sort);
List<Map<String, String>> getBoosterStationInfo2(@Param("gatewayId") String boosterGatewayId);
} }
...@@ -112,6 +112,47 @@ ...@@ -112,6 +112,47 @@
ORDER BY sort ASC ORDER BY sort ASC
</select> </select>
<select id="getBoosterStationInfo2" resultType="java.util.Map">
select * from
((select
`sequence_nbr` as id,
`gateway_id` as gatewayId,
`booster_name` as text,
booster_name as boosterName,
`booster_code` as boosterCode,
`sort` as value
from booster_station_info
<where>
sort != 2
<if test="gatewayId != null and gatewayId != ''">
AND gateway_id = #{gatewayId}
</if>
<!-- <if test="sort != null and sort != ''">-->
<!-- AND sort = #{sort}-->
<!-- </if>-->
<!-- <if test="boosterName != null and boosterName != '' and (sort = null or sort = '')">-->
<!-- AND booster_name = #{boosterName}-->
<!-- </if>-->
</where>)
union all
(select
'99999' as id,
`gateway_id` as gatewayId,
'1主变' as text,
'1主变' as boosterName,
'2' as boosterCode,
2 as value
from booster_station_info
<where>
<if test="gatewayId != null and gatewayId != ''">
AND gateway_id = #{gatewayId}
</if>
</where>
limit 1)) a
ORDER BY a.value ASC
</select>
<select id="getMajorBoosterStationInfo" resultType="java.util.Map"> <select id="getMajorBoosterStationInfo" resultType="java.util.Map">
select select
`sequence_nbr` as id, `sequence_nbr` as id,
......
...@@ -114,6 +114,7 @@ ...@@ -114,6 +114,7 @@
station_basic.station_flag stationFlag, station_basic.station_flag stationFlag,
station_basic.area_code areaCode, station_basic.area_code areaCode,
station_basic.jump_path, station_basic.jump_path,
station_basic.title_pos titlePos,
station_basic.risk_level riskLevel, station_basic.risk_level riskLevel,
station_basic.belong_area belongArea, station_basic.belong_area belongArea,
station_coordinate.longitude, station_coordinate.longitude,
......
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl; package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yeejoin.amos.boot.module.jxiop.api.dto.StationCoordinateDto; import com.yeejoin.amos.boot.module.jxiop.api.dto.StationCoordinateDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.StationInfoDto; import com.yeejoin.amos.boot.module.jxiop.api.dto.StationInfoDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.StationRecordInfo; import com.yeejoin.amos.boot.module.jxiop.api.dto.StationRecordInfo;
...@@ -320,8 +322,13 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto, Statio ...@@ -320,8 +322,13 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto, Statio
if (stationRecordInfo.getBelongArea() != null) { if (stationRecordInfo.getBelongArea() != null) {
stationInfoDto.setRegion(this.getProviceName(stationRecordInfo.getBelongArea())); stationInfoDto.setRegion(this.getProviceName(stationRecordInfo.getBelongArea()));
} }
ArrayList<Double> arrayList = MapUtils.geoTo3d(Double.valueOf(stationRecordInfo.getLongitude()), Double.valueOf(stationRecordInfo.getLaitude())); // ArrayList<Double> arrayList = MapUtils.geoTo3d(Double.valueOf(stationRecordInfo.getLongitude()), Double.valueOf(stationRecordInfo.getLaitude()));
stationInfoDto.setTitlePos(arrayList); String []original = stationRecordInfo.getTitlePos().replace("[","").replace("]","").split(",");
ArrayList<Double> doubleList = new ArrayList<>();
for (String s : original) {
doubleList.add(Double.parseDouble(s));
}
stationInfoDto.setTitlePos(doubleList);
stationInfoDto.setIndicatorData(indicatorList); stationInfoDto.setIndicatorData(indicatorList);
stationInfoDto.setRiskLevel(stationRecordInfo.getRiskLevel()); stationInfoDto.setRiskLevel(stationRecordInfo.getRiskLevel());
stationInfoDtoList.add(stationInfoDto); stationInfoDtoList.add(stationInfoDto);
......
...@@ -398,11 +398,12 @@ public class MonitorFanIdxController extends BaseController { ...@@ -398,11 +398,12 @@ public class MonitorFanIdxController extends BaseController {
@GetMapping("/getByStationId") @GetMapping("/getByStationId")
public ResponseModel<IPage<StationBasic>> getByStationId(@RequestParam(value = "stationId", required = false) String stationId) { public ResponseModel<IPage<StationBasic>> getByStationId(@RequestParam(value = "stationId", required = false) String stationId) {
StationBasic oneByStationNumber = monitorFanIndicator.getOneByStationNumber(stationId); StationBasic oneByStationNumber = monitorFanIndicator.getOneByStationNumber(stationId);
oneByStationNumber.setTitlePos(null);
List<StationBasic> stationBasics = Collections.singletonList(oneByStationNumber); List<StationBasic> stationBasics = Collections.singletonList(oneByStationNumber);
IPage<StationBasic> result = new Page<>(); IPage<StationBasic> result = new Page<>();
result.setRecords(stationBasics); result.setRecords(stationBasics);
result.setCurrent(1); result.setCurrent(1);
result.setTotal(stationBasics.size()); result.setTotal(1);
return ResponseHelper.buildResponse(result); return ResponseHelper.buildResponse(result);
} }
...@@ -416,7 +417,7 @@ public class MonitorFanIdxController extends BaseController { ...@@ -416,7 +417,7 @@ public class MonitorFanIdxController extends BaseController {
return ResponseHelper.buildResponse(resultsData); return ResponseHelper.buildResponse(resultsData);
} }
// @Scheduled(cron = "0/10 * * * * ? ") // @Scheduled(cron = "0/15 * * * * ? ")
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "模拟量列表消息") @ApiOperation(value = "模拟量列表消息")
@GetMapping("/getAnalogQuantityInfo") @GetMapping("/getAnalogQuantityInfo")
...@@ -430,7 +431,7 @@ public class MonitorFanIdxController extends BaseController { ...@@ -430,7 +431,7 @@ public class MonitorFanIdxController extends BaseController {
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} }
// @Scheduled(cron = "0/10 * * * * ? ") // @Scheduled(cron = "0/15 * * * * ? ")
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "升压站主屏消息接口") @ApiOperation(value = "升压站主屏消息接口")
@GetMapping("/getMajorAnalogQuantityByPage") @GetMapping("/getMajorAnalogQuantityByPage")
......
package com.yeejoin.amos.boot.module.jxiop.biz.controller; package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jxiop.api.entity.Region; import com.yeejoin.amos.boot.module.jxiop.api.entity.Region;
...@@ -30,7 +31,10 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -30,7 +31,10 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.logging.Handler;
@RestController @RestController
@Api(tags = "监盘地图接口") @Api(tags = "监盘地图接口")
...@@ -40,14 +44,14 @@ public class MonitoringMapController extends BaseController { ...@@ -40,14 +44,14 @@ public class MonitoringMapController extends BaseController {
@Autowired @Autowired
MonitoringServiceImpl monitoringServiceImpl; MonitoringServiceImpl monitoringServiceImpl;
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "获取监盘全国地图数据") @ApiOperation(value = "获取监盘全国地图数据")
@GetMapping("/nationwide") @GetMapping("/nationwide")
public ResponseModel<List<RegionNationWideDto>> getNationWideInfo(@RequestParam (value = "provinceName", required = false)String provinceName) { public ResponseModel<List<RegionNationWideDto>> getNationWideInfo(@RequestParam (value = "provinceName", required = false)String provinceName) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getNationWideInfo(provinceName)); return ResponseHelper.buildResponse(monitoringServiceImpl.getNationWideInfo(provinceName));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "获取区域电量指标完成情况") @ApiOperation(value = "获取区域电量指标完成情况")
@GetMapping("/getCompletionOfPowerIndicatorsByProvinceName") @GetMapping("/getCompletionOfPowerIndicatorsByProvinceName")
public ResponseModel<ResultsData> getCompletionOfPowerIndicatorsByProvinceName(@RequestParam(required = true) int current, @RequestParam(required = true) int size, @RequestParam(required = true) String provinceName) { public ResponseModel<ResultsData> getCompletionOfPowerIndicatorsByProvinceName(@RequestParam(required = true) int current, @RequestParam(required = true) int size, @RequestParam(required = true) String provinceName) {
...@@ -61,15 +65,55 @@ public class MonitoringMapController extends BaseController { ...@@ -61,15 +65,55 @@ public class MonitoringMapController extends BaseController {
return ResponseHelper.buildResponse(monitoringServiceImpl.getTabsByStationBasicId(stationBasicId)); return ResponseHelper.buildResponse(monitoringServiceImpl.getTabsByStationBasicId(stationBasicId));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "首页地图-获取片区信息") @ApiOperation(value = "监盘首页地图-全国")
@GetMapping("/getAreaInfo") @GetMapping("/getAreaInfo")
public ResponseModel<List<MapAreaInfoDto>> getAreaInfo() { public ResponseModel<List<MapAreaInfoDto>> getAreaInfo() {
return ResponseHelper.buildResponse(monitoringServiceImpl.getAreaInfo()); return ResponseHelper.buildResponse(monitoringServiceImpl.getAreaInfo());
} }
// @TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
// @ApiOperation(value = "地图首页接口") @ApiOperation(value = "监盘首页地图-片区")
// @GetMapping("/getMapInfoByAreaName") @GetMapping("/getStaitonListInfoByAreaName")
// public ResponseModel<List<RegionNationWideDto>> getMapInfo(@RequestParam (value = "areaName", required = false)String areaName) { public ResponseModel<List<HomeMapStationInfoDto>> getStaitonListInfoByAreaName(@RequestParam(required = true)String areaName) {
// return ResponseHelper.buildResponse(monitoringServiceImpl.getNationWideInfo(provinceName)); return ResponseHelper.buildResponse(monitoringServiceImpl.getStaitonListInfoByAreaName(areaName));
// } }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "监盘首页-场站分类信息")
@GetMapping("/getStaionCategoryInfo")
public ResponseModel<List<Map<String,String>>> getStaionCategoryInfo(@RequestParam(required = false)String areaName) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getStaionCategoryInfo(areaName));
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "监盘首页-装机容量")
@GetMapping("/getInstallCapityByAreaName")
public ResponseModel<HashMap<String,String>> getInstallCapityByAreaName(@RequestParam(required = false)String areaName) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getInstallCapityByAreaName(areaName));
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "监盘首页-有功功率")
@GetMapping("/getActivePowerByAreaName")
public ResponseModel<HashMap<String,String>> getActivePowerByAreaName(@RequestParam(required = false)String areaName) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getActivePowerByAreaName(areaName));
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "监盘首页-社会贡献")
@GetMapping("/getSocialContributionDtoList")
public ResponseModel<Page<SocialContributionDto>> getSocialContributionDtoList(@RequestParam(required = false)String areaName, @RequestParam(required = false)String station) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getSocialContributionDtoList(areaName,station));
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "监盘首页-发电量趋势")
@GetMapping("/getPowerGenerationTrends")
public ResponseModel<HashMap<String, List<String>>> getPowerGenerationTrends(@RequestParam(required = false)String areaName) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getPowerGenerationTrends(areaName));
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "监盘首页-发电量详情")
@GetMapping("/getDetailsOnPowergeneration")
public ResponseModel<Page<HashMap<String,String>>> getDetailsOnPowergeneration(@RequestParam(required = false)String areaName) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getDetailsOnPowergeneration(areaName));
}
} }
package com.yeejoin.amos.boot.module.jxiop.biz.dto;
import lombok.Data;
import java.util.List;
import java.util.Map;
@Data
public class HomeMapStationInfoDto {
//场站id
String stationId;
//当前功率
String currentPower = "0";
//风速辐照度
String speendOrirradiate;
//场站类型
String stationType;
//场站装机容量
String stationInstalledCapacity;
//场站经纬度
List<String> stationPosition;
}
...@@ -3,19 +3,28 @@ package com.yeejoin.amos.boot.module.jxiop.biz.dto; ...@@ -3,19 +3,28 @@ package com.yeejoin.amos.boot.module.jxiop.biz.dto;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
import java.util.Map;
@Data @Data
public class MapAreaInfoDto { public class MapAreaInfoDto {
//片区省份
List<String> province; List<String> province;
//经纬度
List<String> position; List<String> position;
//片区名称
String areaName; String areaName;
//片区code
String areaCode; String areaCode;
//风电站数量
String windPowerStationCount = "0"; String windPowerStationCount = "0";
//集中式光伏电站数量
String centralizedPhotovoltaicStationCount = "0"; String centralizedPhotovoltaicStationCount = "0";
//分布式光伏电站数量
String distributedPhotovoltaicStationCount = "0"; String distributedPhotovoltaicStationCount = "0";
//储能电站数量
String energyStorageStationCount = "0"; String energyStorageStationCount = "0";
//装机容量
String installedCapacity = "0"; String installedCapacity = "0";
//当日发电量
String electricityGenerationOfDay = "0"; String electricityGenerationOfDay = "0";
} }
...@@ -7,7 +7,7 @@ public class SocialContributionDto { ...@@ -7,7 +7,7 @@ public class SocialContributionDto {
/** /**
* 社会贡献值 * 社会贡献值
*/ */
private Double title; private String title;
/** /**
* 贡献单位 * 贡献单位
*/ */
......
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl; package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IndicatorsDto; import com.yeejoin.amos.boot.module.jxiop.biz.dto.IndicatorsDto;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.SocialContributionDto;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SjglZsjZsbtzMapper; import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SjglZsjZsbtzMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils; import com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils;
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 java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
...@@ -30,7 +36,7 @@ public class CommonServiceImpl { ...@@ -30,7 +36,7 @@ public class CommonServiceImpl {
List<IndicatorsDto> indicatorsDtoList = influxDButils.getListData(sql,IndicatorsDto.class); List<IndicatorsDto> indicatorsDtoList = influxDButils.getListData(sql,IndicatorsDto.class);
List<Double> doubleList = indicatorsDtoList.stream().map(indicatorsDto -> Double.parseDouble(indicatorsDto.getValue())).collect(Collectors.toList()); List<Double> doubleList = indicatorsDtoList.stream().map(indicatorsDto -> Double.parseDouble(indicatorsDto.getValue())).collect(Collectors.toList());
totalvalue = doubleList.stream().mapToDouble(Double::doubleValue).sum(); totalvalue = doubleList.stream().mapToDouble(Double::doubleValue).sum();
return totalvalue; return Double.valueOf(String.format("%.2f",totalvalue));
} }
/** /**
* @deprecated 获取指标值平均值 * @deprecated 获取指标值平均值
...@@ -44,10 +50,47 @@ public class CommonServiceImpl { ...@@ -44,10 +50,47 @@ public class CommonServiceImpl {
List<IndicatorsDto> indicatorsDtoList = influxDButils.getListData(sql,IndicatorsDto.class); List<IndicatorsDto> indicatorsDtoList = influxDButils.getListData(sql,IndicatorsDto.class);
List<Double> doubleList = indicatorsDtoList.stream().map(indicatorsDto -> Double.parseDouble(indicatorsDto.getValue())).collect(Collectors.toList()); List<Double> doubleList = indicatorsDtoList.stream().map(indicatorsDto -> Double.parseDouble(indicatorsDto.getValue())).collect(Collectors.toList());
avageValue = doubleList.stream().mapToDouble(Double::doubleValue).average().getAsDouble(); avageValue = doubleList.stream().mapToDouble(Double::doubleValue).average().getAsDouble();
return avageValue; return Double.valueOf(String.format("%.2f",avageValue));
} }
public Double getStationCapactityByStationWerks(String WERKS){ public Double getStationCapactityByStationWerks(String WERKS){
return sjglZsjZsbtzMapper.getStationCapactityByStationWerks(WERKS); return sjglZsjZsbtzMapper.getStationCapactityByStationWerks(WERKS);
} }
public Page<SocialContributionDto> getSocialContributionDtoList(Double totalSocialContribution){
Page<SocialContributionDto> socialContributionDtoPage = new Page<SocialContributionDto>();
List<SocialContributionDto> socialContributionDtoList = new ArrayList<>();
//获取所有网关id不为空的数据
//二氧化碳贡献数
SocialContributionDto co2 = new SocialContributionDto();
//标准煤贡献度
SocialContributionDto coal = new SocialContributionDto();
//碳粉尘计算公式
SocialContributionDto toner = new SocialContributionDto();
//二氧化硫贡献度
SocialContributionDto so2 = new SocialContributionDto();
/** 社会贡献原始计算公式,后边的数据已经经过处理
//二氧化碳计算公式 *10000*832/10000/1000/1000
//标准煤计算公式 *10000*304.9/10000/1000/1000
//碳粉尘计算公式 *10000*0.032/1000/1000
//二氧化硫计算公式 =A2*10000*0.16/1000/1000
*/
co2.setUnit("二氧化碳减排量(万t)");
co2.setTitle(String.format("%.2f",totalSocialContribution * 0.000832));
socialContributionDtoList.add(co2);
coal.setUnit("节约标准煤(万t)");
coal.setTitle(String.format("%.2f",totalSocialContribution * 0.0003049));
socialContributionDtoList.add(coal);
toner.setUnit("碳粉尘减排量(万t)");
toner.setTitle(String.format("%.2f",totalSocialContribution * 0.00032));
socialContributionDtoList.add(toner);
so2.setUnit("二氧化硫减排量(万t)");
so2.setTitle(String.format("%.2f",totalSocialContribution * 0.0016));
socialContributionDtoList.add(so2);
socialContributionDtoPage.setRecords(socialContributionDtoList);
socialContributionDtoPage.setTotal(100);
socialContributionDtoPage.setCurrent(1);
return socialContributionDtoPage;
}
} }
...@@ -782,7 +782,12 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -782,7 +782,12 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public List<Map<String, String>> getBoosterStationInfo(String stationId) { public List<Map<String, String>> getBoosterStationInfo(String stationId) {
StationBasic stationBasic = getOneByStationNumber(stationId); StationBasic stationBasic = getOneByStationNumber(stationId);
List<Map<String, String>> boosterStationInfo = monitorFanIndicatorregionMapper.getBoosterStationInfo(stationBasic.getBoosterGatewayId()); List<Map<String, String>> boosterStationInfo = monitorFanIndicatorregionMapper.getBoosterStationInfo2(stationBasic.getBoosterGatewayId());
// List<Map<String, String>> value = boosterStationInfo.stream().filter(item -> !"2".equals(item.get("value"))).collect(Collectors.toList());
// HashMap<String, String> stringStringHashMap = new HashMap<>();
// stringStringHashMap.put();
return boosterStationInfo; return boosterStationInfo;
} }
...@@ -1009,6 +1014,11 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1009,6 +1014,11 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
resultMap.put("1svg", "1SVG"); resultMap.put("1svg", "1SVG");
resultMap.put("2svg", "2SVG"); resultMap.put("2svg", "2SVG");
resultMap.put("xzsvg", "夏造 SVG");
resultMap.put("xzaggavc", "夏造 AGGAVC");
resultMap.put("xzgyxh", "夏造 公用信号");
resultMap.put("xzjzlp", "夏造 交直流屏");
//下方重复列表数据 //下方重复列表数据
List<Map<String, String>> boosterStationInfo = monitorFanIndicatorregionMapper.getMajorBoosterStationInfo(gatewayId, "ASC", 10); List<Map<String, String>> boosterStationInfo = monitorFanIndicatorregionMapper.getMajorBoosterStationInfo(gatewayId, "ASC", 10);
ArrayList<Map<String, String>> resultList = new ArrayList<>(); ArrayList<Map<String, String>> resultList = new ArrayList<>();
...@@ -1039,7 +1049,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1039,7 +1049,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
// 开关信息 // 开关信息
Map<String, Object> switchUrl = getSwitchUrl(gatewayId, null); Map<String, Object> switchUrl = getSwitchUrl(gatewayId, null);
BeanUtils.copyProperties(switchUrl, resultMap); resultMap.putAll(switchUrl);
List<Map<String, Object>> finallyResultList = Collections.singletonList(resultMap); List<Map<String, Object>> finallyResultList = Collections.singletonList(resultMap);
// 主屏下方重复列表数据 // 主屏下方重复列表数据
......
...@@ -104,16 +104,16 @@ public class MonitoringServiceIMQTTmpl { ...@@ -104,16 +104,16 @@ public class MonitoringServiceIMQTTmpl {
//二氧化硫计算公式 =A2*10000*0.16/1000/1000 //二氧化硫计算公式 =A2*10000*0.16/1000/1000
*/ */
co2.setUnit("二氧化碳减排量(万t)"); co2.setUnit("二氧化碳减排量(万t)");
co2.setTitle(totalSocialContribution.get() * 0.000832); co2.setTitle(String.format("%.2f",totalSocialContribution.get() * 0.000832));
socialContributionDtoList.add(co2); socialContributionDtoList.add(co2);
coal.setUnit("节约标准煤(万t)"); coal.setUnit("节约标准煤(万t)");
coal.setTitle(totalSocialContribution.get() * 0.0003049); coal.setTitle(String.format("%.2f",totalSocialContribution.get() * 0.0003049));
socialContributionDtoList.add(coal); socialContributionDtoList.add(coal);
toner.setUnit("碳粉尘减排量(万t)"); toner.setUnit("碳粉尘减排量(万t)");
toner.setTitle(totalSocialContribution.get() * 0.00032); toner.setTitle(String.format("%.2f",totalSocialContribution.get() * 0.00032));
socialContributionDtoList.add(toner); socialContributionDtoList.add(toner);
so2.setUnit("二氧化硫减排量(万t)"); so2.setUnit("二氧化硫减排量(万t)");
so2.setTitle(totalSocialContribution.get() * 0.0016); so2.setTitle(String.format("%.2f",totalSocialContribution.get() * 0.0016));
socialContributionDtoList.add(so2); socialContributionDtoList.add(so2);
socialContributionDtoPage.setRecords(socialContributionDtoList); socialContributionDtoPage.setRecords(socialContributionDtoList);
socialContributionDtoPage.setTotal(100); socialContributionDtoPage.setTotal(100);
...@@ -143,7 +143,7 @@ public class MonitoringServiceIMQTTmpl { ...@@ -143,7 +143,7 @@ public class MonitoringServiceIMQTTmpl {
//年发电量 //年发电量
AtomicReference<Double> annualPower = new AtomicReference<>(0.0); AtomicReference<Double> annualPower = new AtomicReference<>(0.0);
//年发电量完成比例 //年发电量完成比例
Double completionRatio = 23.11; String completionRatio = "23.11";
//年利用小时数 //年利用小时数
AtomicReference<Double> useHours = new AtomicReference<>(0.01); AtomicReference<Double> useHours = new AtomicReference<>(0.01);
stationBasicList.forEach(stationBasic -> { stationBasicList.forEach(stationBasic -> {
...@@ -153,19 +153,19 @@ public class MonitoringServiceIMQTTmpl { ...@@ -153,19 +153,19 @@ public class MonitoringServiceIMQTTmpl {
useHours.updateAndGet(v -> v + commonServiceImpl.getTotalByIndicatior(stationBasic.getFanGatewayId(), "日工作时间")); useHours.updateAndGet(v -> v + commonServiceImpl.getTotalByIndicatior(stationBasic.getFanGatewayId(), "日工作时间"));
}); });
SocialContributionDto dailyPowerdto = new SocialContributionDto(); SocialContributionDto dailyPowerdto = new SocialContributionDto();
dailyPowerdto.setTitle(dailyPower.get()); dailyPowerdto.setTitle(String.format("%.2f",dailyPower.get()));
dailyPowerdto.setUnit("万kWh"); dailyPowerdto.setUnit("万kWh");
SocialContributionDto monthlyPowerdto = new SocialContributionDto(); SocialContributionDto monthlyPowerdto = new SocialContributionDto();
monthlyPowerdto.setTitle(monthlyPower.get()); monthlyPowerdto.setTitle(String.format("%.2f",monthlyPower.get()));
monthlyPowerdto.setUnit("万kWh"); monthlyPowerdto.setUnit("万kWh");
SocialContributionDto annualPowerdto = new SocialContributionDto(); SocialContributionDto annualPowerdto = new SocialContributionDto();
annualPowerdto.setTitle(annualPower.get()); annualPowerdto.setTitle(String.format("%.2f",annualPower.get()));
annualPowerdto.setUnit("万kWh"); annualPowerdto.setUnit("万kWh");
SocialContributionDto completionRatioDto = new SocialContributionDto(); SocialContributionDto completionRatioDto = new SocialContributionDto();
completionRatioDto.setTitle(completionRatio); completionRatioDto.setTitle(completionRatio);
completionRatioDto.setUnit("%"); completionRatioDto.setUnit("%");
SocialContributionDto useHoursDto = new SocialContributionDto(); SocialContributionDto useHoursDto = new SocialContributionDto();
useHoursDto.setTitle(useHours.get()); useHoursDto.setTitle(String.format("%.2f",useHours.get()));
useHoursDto.setUnit("h"); useHoursDto.setUnit("h");
socialContributionDtoList.add(dailyPowerdto); socialContributionDtoList.add(dailyPowerdto);
socialContributionDtoList.add(monthlyPowerdto); socialContributionDtoList.add(monthlyPowerdto);
......
...@@ -15,8 +15,25 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisKey; ...@@ -15,8 +15,25 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto; import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService; import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService;
import com.yeejoin.amos.boot.module.tzs.api.dto.*; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.*; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledRecordDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertHandlerDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertHandlerInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertPaperInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.FormValue;
import com.yeejoin.amos.boot.module.tzs.api.dto.TzsCitInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBusinessListDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBussinessDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchPaper;
import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchTask;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.TzsCitInfo;
import com.yeejoin.amos.boot.module.tzs.api.entity.VoiceRecordFile;
import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums; import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.tzs.api.enums.DispatchPaperEnums; import com.yeejoin.amos.boot.module.tzs.api.enums.DispatchPaperEnums;
import com.yeejoin.amos.boot.module.tzs.api.enums.EquipmentClassifityEnum; import com.yeejoin.amos.boot.module.tzs.api.enums.EquipmentClassifityEnum;
...@@ -25,8 +42,6 @@ import com.yeejoin.amos.boot.module.tzs.api.mapper.AlertCalledMapper; ...@@ -25,8 +42,6 @@ import com.yeejoin.amos.boot.module.tzs.api.mapper.AlertCalledMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IAlertCalledService; import com.yeejoin.amos.boot.module.tzs.api.service.IAlertCalledService;
import com.yeejoin.amos.boot.module.tzs.api.service.TzsAuthService; import com.yeejoin.amos.boot.module.tzs.api.service.TzsAuthService;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils; import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.commons.lang.text.StrBuilder; import org.apache.commons.lang.text.StrBuilder;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
...@@ -36,14 +51,21 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -36,14 +51,21 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; 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.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -153,12 +175,13 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -153,12 +175,13 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
wrapper.eq(DataDictionary::getCode, alertCalledDto.getUseSiteCategory()); wrapper.eq(DataDictionary::getCode, alertCalledDto.getUseSiteCategory());
DataDictionary dataDictionary = iDataDictionaryService.getOne(wrapper); DataDictionary dataDictionary = iDataDictionaryService.getOne(wrapper);
if (!ValidationUtil.isEmpty(dataDictionary)) { if (!ValidationUtil.isEmpty(dataDictionary)) {
alertCalledDto.setUseUnit(dataDictionary.getName()); // alertCalledDto.setUseUnit(dataDictionary.getName());
alertCalledDto.setUseSiteCategory(dataDictionary.getName());
} else { } else {
alertCalledDto.setUseUnit(""); alertCalledDto.setUseSiteCategory("");
} }
} else { } else {
alertCalledDto.setUseUnit(""); alertCalledDto.setUseSiteCategory("");
} }
String voiceRecord = ""; String voiceRecord = "";
VoiceRecordFile temp = voiceRecordFileServiceImpl.getOne(new LambdaQueryWrapper<VoiceRecordFile>().eq(VoiceRecordFile::getAlertId,id).eq(VoiceRecordFile::getAlertStageCode,"860").orderByAsc(VoiceRecordFile::getRecDate)); VoiceRecordFile temp = voiceRecordFileServiceImpl.getOne(new LambdaQueryWrapper<VoiceRecordFile>().eq(VoiceRecordFile::getAlertId,id).eq(VoiceRecordFile::getAlertStageCode,"860").orderByAsc(VoiceRecordFile::getRecDate));
......
...@@ -191,7 +191,7 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc ...@@ -191,7 +191,7 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
useSiteCategory = ValidationUtil.isEmpty(categoryDict) ? "" : categoryDict.getName(); useSiteCategory = ValidationUtil.isEmpty(categoryDict) ? "" : categoryDict.getName();
} }
String useUnit = elevator.getUseUnit(); String useUnit = elevator.getUseUnit();
content = content.replace("$call_time",createTime).replace("$address",address).replace("$rescue_code",rescueCode).replace("$use_site_category",useSiteCategory); content = content.replace("$call_time", createTime).replace("$address", address).replace("$rescue_code", rescueCode).replace("$use_site_category", useSiteCategory);
String typeCode = ""; String typeCode = "";
if(AlertStageEnums.KRJY.toString().equals(alertTypeCode)) { if(AlertStageEnums.KRJY.toString().equals(alertTypeCode)) {
typeCode = AlertStageEnums.KRJY.getId(); typeCode = AlertStageEnums.KRJY.getId();
...@@ -228,14 +228,14 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc ...@@ -228,14 +228,14 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
break; break;
case "GZWX" : // 故障维修 case "GZWX" : // 故障维修
dispatchTaskDto.setIsSaveTask(false); dispatchTaskDto.setIsSaveTask(false);
desc = dynamicParms.get("desc") == null ? "" : dynamicParms.get("desc"); desc = dynamicParms.get("fault_report") == null ? "" : dynamicParms.get("fault_report");
content = content.replace("$use_unit",useUnit).replace("$desc",desc); content = content.replace("$use_unit", useUnit).replace("$desc", desc);
break; break;
case "TSZX" : // 投诉咨询 case "TSZX" : // 投诉咨询
dispatchTaskDto.setIsSaveTask(false); dispatchTaskDto.setIsSaveTask(false);
desc = dynamicParms.get("desc") == null ? "" : dynamicParms.get("desc"); desc = dynamicParms.get("complaint_consulttation") == null ? "" : dynamicParms.get("complaint_consulttation");
content = content.replace("$emergency_call",emergencyCall).replace("$contact_phone",contactPhone); content = content.replace("$emergency_call",emergencyCall).replace("$contact_phone", contactPhone);
content = content.replace("$use_unit",useUnit).replace("$desc",desc); content = content.replace("$use_unit", useUnit).replace("$desc", desc);
break; break;
} }
dispatchTaskDto.setDispatchContext(content); dispatchTaskDto.setDispatchContext(content);
......
...@@ -41,6 +41,7 @@ import org.elasticsearch.index.query.BoolQueryBuilder; ...@@ -41,6 +41,7 @@ import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.search.sort.SortOrder;
import org.springframework.aop.framework.AopContext;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
...@@ -48,6 +49,7 @@ import org.springframework.http.HttpStatus; ...@@ -48,6 +49,7 @@ import org.springframework.http.HttpStatus;
import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -262,10 +264,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -262,10 +264,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
} }
//生成码 //生成码
Map<String, String> codeMap; EquipmentCategoryServiceImpl categoryService = (EquipmentCategoryServiceImpl) AopContext.currentProxy();
synchronized (EquipmentCategoryServiceImpl.class) { Map<String, String> codeMap = categoryService.creatCode(city, county, equipCategory, null, null);
codeMap = creatCode(city, county, equipCategory, null,null);
}
if (ObjectUtils.isEmpty(codeMap)) { if (ObjectUtils.isEmpty(codeMap)) {
return new HashMap<>(); return new HashMap<>();
} }
...@@ -283,7 +283,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -283,7 +283,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
elevatorCode = EquipmentCategoryEnum.BF.getCode().equals(equInfoDto.getEquState()) ? null : codeMap.get("code96333"); elevatorCode = EquipmentCategoryEnum.BF.getCode().equals(equInfoDto.getEquState()) ? null : codeMap.get("code96333");
List<CategoryOtherInfo> categoryOtherInfo = categoryOtherInfoMapper.selectList(new QueryWrapper<CategoryOtherInfo>().eq("SUPERVISORY_CODE", supervisorCode)); List<CategoryOtherInfo> categoryOtherInfo = categoryOtherInfoMapper.selectList(new QueryWrapper<CategoryOtherInfo>().eq("SUPERVISORY_CODE", supervisorCode));
if (categoryOtherInfo.size() > 0) { if (categoryOtherInfo.size() > 0) {
// categoryOtherInfoMapper.updateCode(supervisorCode, equState);
supervisoryCodeInfoMapper.update(supervisoryCodeInfo,new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code",supervisoryCodeInfo.getSupervisoryCode())); supervisoryCodeInfoMapper.update(supervisoryCodeInfo,new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code",supervisoryCodeInfo.getSupervisoryCode()));
} else { } else {
supervisoryCodeInfo.setStatus(equState); supervisoryCodeInfo.setStatus(equState);
...@@ -482,7 +481,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -482,7 +481,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
/** /**
* 具体生成监管码和电梯96333识别码逻辑 * 具体生成监管码和电梯96333识别码逻辑
*/ */
private synchronized Map<String, String> creatCode(String city, String county, String equipCategory, String code96333,String supervisionCode) { @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRES_NEW)
public synchronized Map<String, String> creatCode(String city, String county, String equipCategory, String code96333,String supervisionCode) {
Map<String, String> resultMap = new HashMap<>(); Map<String, String> resultMap = new HashMap<>();
StringBuilder supervisorCode = new StringBuilder(); StringBuilder supervisorCode = new StringBuilder();
StringBuilder elevatorCode = new StringBuilder(); StringBuilder elevatorCode = new StringBuilder();
...@@ -551,7 +551,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -551,7 +551,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
* @param county 行政区划区 * @param county 行政区划区
* @return 监管码 * @return 监管码
*/ */
private String createSupervisorCode(String city, String county, String equipCategory) { public String createSupervisorCode(String city, String county, String equipCategory) {
StringBuilder supervisorCode = new StringBuilder(); StringBuilder supervisorCode = new StringBuilder();
//生成监管码前缀 //生成监管码前缀
Map<String, Object> divisionMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), county); Map<String, Object> divisionMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), county);
...@@ -585,7 +585,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -585,7 +585,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
* @param county 行政区划区 * @param county 行政区划区
* @return 96333电梯识别码 * @return 96333电梯识别码
*/ */
private String createElevatorCode(String city, String county) { public String createElevatorCode(String city, String county) {
StringBuilder elevatorCode = new StringBuilder(); StringBuilder elevatorCode = new StringBuilder();
//生成生成96333电梯码前缀 //生成生成96333电梯码前缀
Map<String, Object> elevatorMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQHDT.getCode(), county); Map<String, Object> elevatorMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQHDT.getCode(), county);
...@@ -1034,8 +1034,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1034,8 +1034,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
String county = String.valueOf(superviseMap.get("county")); String county = String.valueOf(superviseMap.get("county"));
String equCategory = String.valueOf(superviseMap.get("equCategory")); String equCategory = String.valueOf(superviseMap.get("equCategory"));
String supervisionCode = String.valueOf(superviseMap.get("supervisionCode")); String supervisionCode = String.valueOf(superviseMap.get("supervisionCode"));
EquipmentCategoryServiceImpl categoryService = (EquipmentCategoryServiceImpl) AopContext.currentProxy();
// EquipmentCategoryServiceImpl categoryService = SpringUtils.getBean(EquipmentCategoryServiceImpl.class);
//生成码 //生成码
codeMap = creatCode(city, county, equCategory, code96333, supervisionCode); codeMap = categoryService.creatCode(city, county, equCategory, code96333, supervisionCode);
log.info("已生成对应监管码或96333电梯识别码"); log.info("已生成对应监管码或96333电梯识别码");
//删除map中的冗余数据,添加对应监管码和96333码调用idx多表单页提交接口吧保存数据 //删除map中的冗余数据,添加对应监管码和96333码调用idx多表单页提交接口吧保存数据
map.remove("data"); map.remove("data");
...@@ -1075,8 +1077,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1075,8 +1077,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
response.setStatus(HttpStatus.BAD_REQUEST.value()); response.setStatus(HttpStatus.BAD_REQUEST.value());
return response; return response;
} finally { } finally {
log.info("已生成对应监管码" + supervisionMap.get("SUPERVISORY_CODE"));
log.info("已生成对应96333电梯识别码" + supervisionMap.get("CODE96333"));
updateEquipmentCategoryData(unitCode,orgBranchCode); updateEquipmentCategoryData(unitCode,orgBranchCode);
supervisoryCodeInfoMapper.update(supervisoryCodeInfo,new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code",supervisoryCodeInfo.getSupervisoryCode())); supervisoryCodeInfoMapper.update(supervisoryCodeInfo,new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code",supervisionMap.get("SUPERVISORY_CODE")));
} }
return responseModel; return responseModel;
} }
......
...@@ -13,11 +13,6 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.VoiceRecordLog; ...@@ -13,11 +13,6 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.VoiceRecordLog;
import com.yeejoin.amos.boot.module.tzs.api.mapper.VoiceRecordLogMapper; import com.yeejoin.amos.boot.module.tzs.api.mapper.VoiceRecordLogMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.ICtiService; import com.yeejoin.amos.boot.module.tzs.api.service.ICtiService;
import com.yeejoin.amos.boot.module.tzs.api.service.IVoiceRecordLogService; import com.yeejoin.amos.boot.module.tzs.api.service.IVoiceRecordLogService;
import com.yeejoin.amos.component.feign.config.TokenOperation;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.IdPasswordAuthModel;
import com.yeejoin.amos.feign.privilege.util.DesUtil;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.eclipse.paho.client.mqttv3.MqttException; import org.eclipse.paho.client.mqttv3.MqttException;
...@@ -26,11 +21,9 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -26,11 +21,9 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -121,7 +114,7 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi ...@@ -121,7 +114,7 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi
model.setTelStartTime(telStartTime); model.setTelStartTime(telStartTime);
model.setTelEndTime(telEndTime); model.setTelEndTime(telEndTime);
if(1 == recordInfo.getInteger("callType")) { if(1 == recordInfo.getInteger("callType")) {
model.setFileType("客户呼入"); model.setFileType("呼入");
} else if(2 == recordInfo.getInteger("callType")) { } else if(2 == recordInfo.getInteger("callType")) {
model.setFileType("坐席呼出"); model.setFileType("坐席呼出");
} }
......
package com.yeejoin.amos.boot.module.tzs.biz.utils;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
@Configuration
@ComponentScan("com.yeejoin.amos.boot.module.tzs.biz.service.impl")
@EnableAspectJAutoProxy(exposeProxy = true)//开启spring注解aop配置的支持
public class SpringConfiguration {
}
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