Commit a52291ba authored by chenzhao's avatar chenzhao

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

# Conflicts: # amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
parents 677f4b84 813fbbd3
package com.yeejoin.amos.boot.module.jxiop.api.dto;
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;
/**
* 设计信息
*
* @author system_generator
* @date 2023-07-14
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="DesignInformationDto", description="设计信息")
public class DesignInformationDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "典型设计图信息")
private String typicalDiagram;
@ApiModelProperty(value = "组件排布图")
private String componentLayout;
@ApiModelProperty(value = "组件支架图")
private String componentBracket;
@ApiModelProperty(value = "组串接线图")
private String connectionLine;
@ApiModelProperty(value = "一次接线图")
private String onceLine;
@ApiModelProperty(value = "组件")
private String assembly;
@ApiModelProperty(value = "逆变器")
private String inverter;
@ApiModelProperty(value = "电表箱")
private String electricityMeter;
@ApiModelProperty(value = "支架")
private String support;
@ApiModelProperty(value = " 防滑雪措施")
private String antiSkiing;
@ApiModelProperty(value = " 防滑雪措施备注")
private String antiSkiingNotes;
@ApiModelProperty(value = " 抽检")
private String spotCheck;
@ApiModelProperty(value = " 抽检意见")
private String spotCheckOpinion;
@ApiModelProperty(value = "是否定制")
private String isokCustomized;
@ApiModelProperty(value = "是否加固")
private String windResistant;
@ApiModelProperty(value = "试点方案")
private String pilotProgram;
@ApiModelProperty(value = " s试点物料")
private String pilotMaterials;
@ApiModelProperty(value = "方位角")
private String azimuth;
@ApiModelProperty(value = "倾角")
private String dipAngle;
@ApiModelProperty(value = " 应用场景")
private String applicationScenario;
@ApiModelProperty(value = "应用场景数量")
private Integer applicationScenarioNum;
@ApiModelProperty(value = "支架方案")
private String supportScheme;
@ApiModelProperty(value = "支架方案数量")
private Integer supportSchemeNum;
@ApiModelProperty(value = "特殊方案")
private String specialPlan;
@ApiModelProperty(value = "特殊方案数量")
private Integer specialPlanNum;
@ApiModelProperty(value = "勘察表id")
private Long surveyInformationId;
}
package com.yeejoin.amos.boot.module.jxiop.api.dto;
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;
/**
*
*
* @author system_generator
* @date 2023-07-15
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="PowerStationDto", description="")
public class PowerStationDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "电站编号")
private String powerStationCode;
@ApiModelProperty(value = "业主姓名")
private String ownersName;
@ApiModelProperty(value = "项目地址")
private String projectAddress;
@ApiModelProperty(value = "服务代理商")
private String serviceAgent;
@ApiModelProperty(value = "电站类型")
private String powerStationType;
@ApiModelProperty(value = "流程状态")
private String processStatus;
@ApiModelProperty(value = "设计审核状态")
private String designStatus;
@ApiModelProperty(value = "商务审核状态")
private String businessStatus;
@ApiModelProperty(value = "技术审核状态")
private String technologyStatus;
@ApiModelProperty(value = "流程id")
private String workflowId;
@ApiModelProperty(value = "农户id")
private String peasantHouseholdId;
}
package com.yeejoin.amos.boot.module.jxiop.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 2023-07-14
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("hygf_design_information")
public class DesignInformation extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 典型设计图信息
*/
@TableField("typical_diagram")
private String typicalDiagram;
/**
* 组件排布图
*/
@TableField("component_layout")
private String componentLayout;
/**
* 组件支架图
*/
@TableField("component_bracket")
private String componentBracket;
/**
* 组串接线图
*/
@TableField("connection_line")
private String connectionLine;
/**
* 一次接线图
*/
@TableField("once_line")
private String onceLine;
/**
* 组件
*/
@TableField("assembly")
private String assembly;
/**
* 逆变器
*/
@TableField("inverter")
private String inverter;
/**
* 电表箱
*/
@TableField("electricity_meter")
private String electricityMeter;
/**
* 支架
*/
@TableField("support")
private String support;
/**
* 防滑雪措施
*/
@TableField("anti_skiing")
private String antiSkiing;
/**
* 防滑雪措施备注
*/
@TableField("anti_skiing_notes")
private String antiSkiingNotes;
/**
* 抽检
*/
@TableField("spot_check")
private String spotCheck;
/**
* 抽检意见
*/
@TableField("spot_check_opinion")
private String spotCheckOpinion;
/**
* 是否定制
*/
@TableField("isok_customized")
private String isokCustomized;
/**
* 是否加固
*/
@TableField("wind_resistant")
private String windResistant;
/**
* 试点方案
*/
@TableField("pilot_program")
private String pilotProgram;
/**
* s试点物料
*/
@TableField("pilot_materials")
private String pilotMaterials;
/**
* 方位角
*/
@TableField("azimuth")
private String azimuth;
/**
* 倾角
*/
@TableField("dip_angle")
private String dipAngle;
/**
* 应用场景
*/
@TableField("application_scenario")
private String applicationScenario;
/**
* 应用场景数量
*/
@TableField("application_scenario_num")
private Integer applicationScenarioNum;
/**
* 支架方案
*/
@TableField("support_scheme")
private String supportScheme;
/**
* 支架方案数量
*/
@TableField("support_scheme_num")
private Integer supportSchemeNum;
/**
* 特殊方案
*/
@TableField("special_plan")
private String specialPlan;
/**
* 特殊方案数量
*/
@TableField("special_plan_num")
private Integer specialPlanNum;
/**
* 勘察表id
*/
@TableField("survey_information_id")
private Long surveyInformationId;
}
package com.yeejoin.amos.boot.module.jxiop.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 2023-07-15
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("hygf_power_station")
public class PowerStation extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 电站编号
*/
@TableField("power_station_code")
private String powerStationCode;
/**
* 业主姓名
*/
@TableField("owners_name")
private String ownersName;
/**
* 项目地址
*/
@TableField("project_address")
private String projectAddress;
/**
* 服务代理商
*/
@TableField("service_agent")
private String serviceAgent;
/**
* 电站类型
*/
@TableField("power_station_type")
private String powerStationType;
/**
* 流程状态
*/
@TableField("process_status")
private String processStatus;
/**
* 设计审核状态
*/
@TableField("design_status")
private String designStatus;
/**
* 商务审核状态
*/
@TableField("business_status")
private String businessStatus;
/**
* 技术审核状态
*/
@TableField("technology_status")
private String technologyStatus;
/**
* 流程id
*/
@TableField("workflow_id")
private String workflowId;
/**
* 农户id
*/
@TableField("peasant_household_id")
private String peasantHouseholdId;
}
package com.yeejoin.amos.boot.module.jxiop.api.mapper;
import com.yeejoin.amos.boot.module.jxiop.api.entity.DesignInformation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 设计信息 Mapper 接口
*
* @author system_generator
* @date 2023-07-14
*/
public interface DesignInformationMapper extends BaseMapper<DesignInformation> {
}
package com.yeejoin.amos.boot.module.jxiop.api.mapper;
import com.yeejoin.amos.boot.module.jxiop.api.entity.PowerStation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* Mapper 接口
*
* @author system_generator
* @date 2023-07-15
*/
public interface PowerStationMapper extends BaseMapper<PowerStation> {
}
package com.yeejoin.amos.boot.module.jxiop.api.service;
/**
* 设计信息接口类
*
* @author system_generator
* @date 2023-07-14
*/
public interface IDesignInformationService {
}
package com.yeejoin.amos.boot.module.jxiop.api.service;
/**
* 接口类
*
* @author system_generator
* @date 2023-07-15
*/
public interface IPowerStationService {
}
<?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.jxiop.api.mapper.DesignInformationMapper">
</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.jxiop.api.mapper.PowerStationMapper">
</mapper>
package com.yeejoin.amos.boot.module.jxiop.biz.controller;
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.jxiop.biz.service.impl.DesignInformationServiceImpl;
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.jxiop.api.dto.DesignInformationDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 设计信息
*
* @author system_generator
* @date 2023-07-14
*/
@RestController
@Api(tags = "设计信息Api")
@RequestMapping(value = "/design-information")
public class DesignInformationController extends BaseController {
@Autowired
DesignInformationServiceImpl designInformationServiceImpl;
/**
* 新增设计信息
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增设计信息", notes = "新增设计信息")
public ResponseModel<DesignInformationDto> save(@RequestBody DesignInformationDto model) {
model = designInformationServiceImpl.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<DesignInformationDto> updateBySequenceNbrDesignInformation(@RequestBody DesignInformationDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(designInformationServiceImpl.updateWithModel(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(designInformationServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个设计信息", notes = "根据sequenceNbr查询单个设计信息")
public ResponseModel<DesignInformationDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(designInformationServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "设计信息分页查询", notes = "设计信息分页查询")
public ResponseModel<Page<DesignInformationDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<DesignInformationDto> page = new Page<DesignInformationDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(designInformationServiceImpl.queryForDesignInformationPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "设计信息列表全部数据查询", notes = "设计信息列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<DesignInformationDto>> selectForList() {
return ResponseHelper.buildResponse(designInformationServiceImpl.queryForDesignInformationList());
}
}
......@@ -67,8 +67,7 @@ public class PeasantHouseholdController extends BaseController {
surveyInformationServiceImpl.createWithModel(surveyInformationDto);
JSONArray regionName = getRegionName();
List<RegionModel> list = JSONArray.parseArray(regionName.toJSONString(), RegionModel.class);
if(StringUtils.isEmpty(model.getProjectAddressName())){
// 处理地址
// 处理项目地址
String area = "";
for (Integer reg : model.getProjectAddress())
for (RegionModel re : list) {
......@@ -76,20 +75,28 @@ public class PeasantHouseholdController extends BaseController {
area = area + re.getRegionName() + "/";
}
}
model.setProjectAddressName(area.substring(0, area.length() - 2)+"/"+model.getProjectAddressDetail());
}
model.setProjectAddressName(area.substring(0, area.length() - 2));
if ("1".equals(model.getIsPermanent())) {
model.setPermanentAddress(model.getProjectAddress());
model.setPermanentAddressDetail(model.getProjectAddressDetail());
model.setPermanentAddressName(area.substring(0, area.length() - 2));
}else {
// 处理常住地址
String permanent = "";
for (Integer reg : model.getPermanentAddress())
for (RegionModel re : list) {
if (re.getRegionCode().equals(Integer.valueOf(reg))) {
permanent = permanent + re.getRegionName() + "/";
}
}
model.setPermanentAddressName(permanent.substring(0, permanent.length() - 2));
}
model.setSurveyInformationId(surveyInformationDto.getSequenceNbr());
model.setSurveyOrNot(0);
model.setReview(0);
if(StringUtils.isEmpty(model.getDeveloperCode())){
model.setDeveloperCode(userInfo.getAgencyCode());
}
model.setDeveloperCode(userInfo.getCompanys().get(0).getOrgCode());
model.setDeveloperName(userInfo.getOrgNamesWithoutRole());
if(StringUtils.isEmpty(model.getDeveloper())){
model.setDeveloper(userInfo.getRealName());
......@@ -192,7 +199,8 @@ public class PeasantHouseholdController extends BaseController {
page.setCurrent(current);
page.setSize(size);
AgencyUserModel userInfo = getUserInfo();
return ResponseHelper.buildResponse(peasantHouseholdServiceImpl.queryForPeasantHouseholdPage(page,userInfo.getAgencyCode(),ownersName));
String orgCode = userInfo.getCompanys().get(0).getOrgCode();
return ResponseHelper.buildResponse(peasantHouseholdServiceImpl.queryForPeasantHouseholdPage(page,orgCode,ownersName));
}
/**
......
package com.yeejoin.amos.boot.module.jxiop.biz.controller;
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.jxiop.biz.service.impl.PowerStationServiceImpl;
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.jxiop.api.dto.PowerStationDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
*
*
* @author system_generator
* @date 2023-07-15
*/
@RestController
@Api(tags = "Api")
@RequestMapping(value = "/power-station")
public class PowerStationController extends BaseController {
@Autowired
PowerStationServiceImpl powerStationServiceImpl;
/**
* 新增
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public ResponseModel<PowerStationDto> save(@RequestBody PowerStationDto model) {
model = powerStationServiceImpl.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<PowerStationDto> updateBySequenceNbrPowerStation(@RequestBody PowerStationDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(powerStationServiceImpl.updateWithModel(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(powerStationServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个", notes = "根据sequenceNbr查询单个")
public ResponseModel<PowerStationDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(powerStationServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询")
public ResponseModel<Page<PowerStationDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<PowerStationDto> page = new Page<PowerStationDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(powerStationServiceImpl.queryForPowerStationPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<PowerStationDto>> selectForList() {
return ResponseHelper.buildResponse(powerStationServiceImpl.queryForPowerStationList());
}
}
package com.yeejoin.amos.boot.module.hygf.biz.controller;
import com.yeejoin.amos.boot.module.hygf.api.dto.SurveyInfoAllDto;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
......@@ -138,8 +139,8 @@ public class SurveyInformationController extends BaseController {
@ApiOperation(httpMethod = "GET",value = "勘察信息编辑", notes = "勘察信息编辑")
@GetMapping(value = "/surveyQuery")
public ResponseModel<SurveyInfoAllDto> surveyQuery(@RequestParam String surveyInformationId) {
SurveyInfoAllDto returnDto = surveyInformationServiceImpl.querySurveyInfo(surveyInformationId);
AgencyUserModel userInfo = getUserInfo();
SurveyInfoAllDto returnDto = surveyInformationServiceImpl.querySurveyInfo(surveyInformationId,userInfo);
return ResponseHelper.buildResponse(returnDto);
}
}
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import com.yeejoin.amos.boot.module.jxiop.api.entity.DesignInformation;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.DesignInformationMapper;
import com.yeejoin.amos.boot.module.jxiop.api.service.IDesignInformationService;
import com.yeejoin.amos.boot.module.jxiop.api.dto.DesignInformationDto;
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 2023-07-14
*/
@Service
public class DesignInformationServiceImpl extends BaseService<DesignInformationDto,DesignInformation,DesignInformationMapper> implements IDesignInformationService {
/**
* 分页查询
*/
public Page<DesignInformationDto> queryForDesignInformationPage(Page<DesignInformationDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<DesignInformationDto> queryForDesignInformationList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
......@@ -71,7 +71,7 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
* 分页查询
*/
public Page<PeasantHouseholdDto> queryForPeasantHouseholdPage(Page<PeasantHouseholdDto> page,String developerCode,@Condition(Operator.like) String ownersName) {
Page<PeasantHouseholdDto> peasantHouseholdDtoPage = this.queryForPage(page, null, false,developerCode,ownersName);
Page<PeasantHouseholdDto> peasantHouseholdDtoPage = this.queryForPage(page, "rec_date", false,developerCode,ownersName);
List<PeasantHouseholdDto> records = peasantHouseholdDtoPage.getRecords();
List<PeasantHouseholdDto> newRecords = records.stream().map(item -> {
if (item.getSurveyOrNot() == 0) {
......
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import com.yeejoin.amos.boot.module.jxiop.api.entity.PowerStation;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.PowerStationMapper;
import com.yeejoin.amos.boot.module.jxiop.api.service.IPowerStationService;
import com.yeejoin.amos.boot.module.jxiop.api.dto.PowerStationDto;
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 2023-07-15
*/
@Service
public class PowerStationServiceImpl extends BaseService<PowerStationDto,PowerStation,PowerStationMapper> implements IPowerStationService {
/**
* 分页查询
*/
public Page<PowerStationDto> queryForPowerStationPage(Page<PowerStationDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<PowerStationDto> queryForPowerStationList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
......@@ -11,6 +11,7 @@ import com.yeejoin.amos.boot.module.hygf.api.mapper.SurveyInformationMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.ISurveyInformationService;
import com.yeejoin.amos.boot.module.hygf.api.util.BeanDtoUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import org.apache.commons.beanutils.ConvertUtils;
......@@ -24,6 +25,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.List;
/**
......@@ -157,7 +159,7 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
return surveyInfoAllDto;
}
public SurveyInfoAllDto querySurveyInfo(String surveyInformationId) {
public SurveyInfoAllDto querySurveyInfo(String surveyInformationId,AgencyUserModel userInfo) {
SurveyInfoAllDto surveyInfoAllDto = new SurveyInfoAllDto();
......@@ -170,6 +172,11 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
peasantHouseholdQueryWrapper.eq("survey_information_id", surveyInformationId);
PeasantHousehold peasantHousehold = peasantHouseholdServiceImpl.getBaseMapper().selectOne(peasantHouseholdQueryWrapper);
BeanUtils.copyProperties(peasantHousehold, surveyInfoAllDto.getSurveyInformation());
surveyInfoAllDto.getSurveyInformation().setDeveloperName(userInfo.getCompanys().get(0).getCompanyName());
surveyInfoAllDto.getSurveyInformation().setDeveloperCode(userInfo.getCompanys().get(0).getOrgCode());
surveyInfoAllDto.getSurveyInformation().setSalesmanId(userInfo.getUserId());
surveyInfoAllDto.getSurveyInformation().setSalesman(userInfo.getRealName());
surveyInfoAllDto.getSurveyInformation().setCreator(userInfo.getRealName());
if (!StringUtils.isEmpty(peasantHousehold.getProjectAddressName())) {
surveyInfoAllDto.getSurveyInformation().setProjectAddressText(Arrays.asList(peasantHousehold.getProjectAddressName().split("/")));
}
......@@ -181,8 +188,9 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
surveyInfoAllDto.getSurveyInformation().setPermanentAddress(peasantHousehold.getProjectAddress());
surveyInfoAllDto.getSurveyInformation().setIsPermanent("1");
}
surveyInfoAllDto.getSurveyInformation().setSequenceNbr(surveyInformation.getSequenceNbr());
surveyInfoAllDto.getSurveyInformation().setSequenceNbr(surveyInformation.getSequenceNbr());
surveyInfoAllDto.getSurveyInformation().setCreatorTime(new Date());
QueryWrapper<SurveyDetails> surveyDetailsQueryWrapper = new QueryWrapper<>();
surveyDetailsQueryWrapper.eq("survey_information_id", surveyInformationId);
SurveyDetails surveyDetails = surveyDetailsService.getBaseMapper().selectOne(surveyDetailsQueryWrapper);
......@@ -206,7 +214,10 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
commercialQueryWrapper.eq("survey_information_id", surveyInformationId);
Commercial commercial = commercialService.getBaseMapper().selectOne(commercialQueryWrapper);
if(information == null){
surveyInfoAllDto.setCommercial(new CommercialDto());
CommercialDto commercialDto = new CommercialDto();
commercialDto.setType("zrr");
commercialDto.setLegalType("zjdnhw");
surveyInfoAllDto.setCommercial(commercialDto);
}else {
surveyInfoAllDto.setCommercial(BeanDtoUtils.convert(commercial, CommercialDto.class));
if(commercial !=null && !StringUtils.isEmpty(commercial.getProjectAddressName())){
......
......@@ -39,4 +39,7 @@ public class MapRegionDto extends BaseDto {
@ApiModelProperty(value = "片区中心点")
private CameraInfo cameraInfo;
@ApiModelProperty(value = "片区code")
private String areaCode;
}
......@@ -27,6 +27,9 @@ public class StationInfoDto {
@ApiModelProperty(value ="场站id")
private Long stationId;
@ApiModelProperty(value ="平台id")
private String platformStationId;
@ApiModelProperty(value = "场站名称")
private String stationName;
......
......@@ -13,6 +13,9 @@ public class StationRecordInfo {
@ApiModelProperty(value = "场站id")
private Long stationId;
@ApiModelProperty(value = "平台id")
private String platformStationId;
@ApiModelProperty(value = "场站名称")
private String stationName;
......
......@@ -17,7 +17,7 @@ import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("indicator")
@TableName("map_indicator")
public class Indicator extends BaseEntity {
private static final long serialVersionUID = 1L;
......
......@@ -54,4 +54,10 @@ public class MapRegion extends BaseEntity {
*/
@TableField(value = "cameraInfo", typeHandler = FastjsonTypeHandler.class)
private CameraInfo cameraInfo;
/**
* 片区文字显示的省份
*/
@TableField("area_code")
private String areaCode;
}
......@@ -17,7 +17,7 @@ import java.util.Date;
*/
@Data
@Accessors(chain = true)
@TableName(value = "monitor_fan_indicator" ,autoResultMap = true)
@TableName(value = "monitor_fan_indicator_copy3" ,autoResultMap = true)
public class MonitorFanIndicator extends BaseEntity {
......
......@@ -37,4 +37,8 @@ public interface MonitorFanIndicatorMapper extends BaseMapper<MonitorFanIndicato
List<Map<String, String>> getFanConfigPower(@Param("gatewayId") String gatewayId);
List<Map<String, String>> getBoosterStationInfo(@Param("gatewayId") String gatewayId);
List<Map<String, String>> getMajorBoosterStationInfo(@Param("gatewayId") String gatewayId,
@Param("sortType") String sortType,
@Param("size") Integer size);
}
......@@ -94,9 +94,9 @@
`sequence_nbr` as id,
`gateway_id` as gatewayId,
`booster_name` as text,
booster_name as value,
<!-- `booster_code` as value,-->
`sort` as sort
booster_name as boosterName,
`booster_code` as boosterCode,
`sort` as value
from booster_station_info
<where>
<if test="gatewayId != null and gatewayId != ''">
......@@ -111,4 +111,22 @@
</where>
ORDER BY sort ASC
</select>
<select id="getMajorBoosterStationInfo" resultType="java.util.Map">
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>
<if test="gatewayId != null and gatewayId != ''">
AND gateway_id = #{gatewayId}
</if>
</where>
ORDER BY major_sort ${sortType}
limit #{size}
</select>
</mapper>
......@@ -108,6 +108,7 @@
<select id="getStationList" resultType="com.yeejoin.amos.boot.module.jxiop.api.dto.StationRecordInfo">
select
station_basic.sequence_nbr stationId,
station_basic.platform_station_id platformStationId,
station_basic.station_name stationName ,
station_basic.station_type stationType,
station_basic.station_flag stationFlag,
......
......@@ -172,7 +172,7 @@ public class StationBasicController extends BaseController {
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET", value = "场站地图数据", notes = "场站地图数据")
@GetMapping(value = "/listforMap")
public ResponseModel<List<StationInfoDto>> getStationList(@RequestParam(value = "areaCode", required = false) String areaCode,@RequestParam(value = "type", required = false,defaultValue = "qj") String type) {
......
......@@ -311,6 +311,7 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto, Statio
list.forEach(stationRecordInfo -> {
StationInfoDto stationInfoDto = new StationInfoDto();
stationInfoDto.setStationId(stationRecordInfo.getStationId());
stationInfoDto.setPlatformStationId(stationRecordInfo.getPlatformStationId());
stationInfoDto.setStationName(stationRecordInfo.getStationName());
stationInfoDto.setType(stationRecordInfo.getStationType());
//url 暂时写死
......
......@@ -20,6 +20,7 @@ import io.swagger.annotations.ApiOperation;
import org.elasticsearch.index.Index;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
......@@ -332,7 +333,7 @@ public class MonitorFanIdxController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取升压站信息 通过排序等")
@GetMapping("/getBoosterStationInfo")
public ResponseModel<List<Map<String, String>>> getBoosterStationInfo(@RequestParam(value = "stationId", required = false) String stationId) {
......@@ -362,6 +363,33 @@ public class MonitorFanIdxController extends BaseController {
return ResponseHelper.buildResponse(resultsData);
}
// @Scheduled(cron = "0/10 * * * * ? ")
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "模拟量列表消息")
@GetMapping("/getAnalogQuantityInfo")
public ResponseModel getAnalogQuantityInfo() {
LambdaQueryWrapper<StationBasic> wrapper = new LambdaQueryWrapper<>();
List<StationBasic> stationBasics = stationBasicMapper.selectList(wrapper);
for (StationBasic stationBasic : stationBasics) {
String gatewayId = stationBasic.getBoosterGatewayId();
monitorFanIndicator.getAnalogQuantityInfo(gatewayId, stationBasic.getSequenceNbr().toString());
}
return CommonResponseUtil.success();
}
// @Scheduled(cron = "0/10 * * * * ? ")
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "升压站主屏消息接口")
@GetMapping("/getMajorAnalogQuantityByPage")
public ResponseModel getMajorAnalogQuantityByPage() {
LambdaQueryWrapper<StationBasic> wrapper = new LambdaQueryWrapper<>();
List<StationBasic> stationBasics = stationBasicMapper.selectList(wrapper);
for (StationBasic stationBasic : stationBasics) {
String gatewayId = stationBasic.getBoosterGatewayId();
monitorFanIndicator.getMajorAnalogQuantityByPage(gatewayId, stationBasic.getSequenceNbr().toString());
}
return CommonResponseUtil.success();
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "故障记录API")
......
......@@ -26,6 +26,7 @@ public class IndicatorsDto {
private String distinct;
private String time;
private String displayName;
private String title;
public String getTime() {
......
......@@ -752,7 +752,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public List<Map<String, String>> getBoosterStationInfo(String stationId) {
StationBasic stationBasic = getOneByStationNumber(stationId);
List<Map<String, String>> boosterStationInfo = monitorFanIndicatorregionMapper.getBoosterStationInfo(stationBasic.getFanGatewayId());
List<Map<String, String>> boosterStationInfo = monitorFanIndicatorregionMapper.getBoosterStationInfo(stationBasic.getBoosterGatewayId());
return boosterStationInfo;
}
......@@ -795,6 +795,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public ResultsData getAlarmEventList(int current, int size,String stationId) {
List<AlarmEventDto> alarmEventList = alarmEventMapper.getAlarmEventList(null, stationId,current,size);
......@@ -825,15 +826,15 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public ResultsData getElectricQuantityList(int current, int size,String gatewayId) {
String sql = " SELECT * FROM indicators_"+gatewayId+" WHERE frontModule ='电量表计' and displayName != '' and displayName != '检修状态' ";
List<IndicatorsDto> windSqlList = influxDButils.getListDataAll(sql,IndicatorsDto.class);
String sql = " SELECT * FROM indicators_" + gatewayId + " WHERE frontModule ='电量表计' and displayName != '' and displayName != '检修状态' ";
List<IndicatorsDto> windSqlList = influxDButils.getListDataAll(sql, IndicatorsDto.class);
Map<String, List<IndicatorsDto>> maps = windSqlList.stream().collect(Collectors.groupingBy(IndicatorsDto::getSystemType));
ArrayList<Map<String, String>> resultList = new ArrayList<>();
for (Map.Entry<String, List<IndicatorsDto>> stringListEntry : maps.entrySet()) {
HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("name",stringListEntry.getKey());
stringStringHashMap.put("name", stringListEntry.getKey());
for (IndicatorsDto indicatorsDto : stringListEntry.getValue()) {
stringStringHashMap.put(ElectricQuantity.getCode(indicatorsDto.getDisplayName()),indicatorsDto.getValue());
stringStringHashMap.put(ElectricQuantity.getCode(indicatorsDto.getDisplayName()), indicatorsDto.getValue());
}
resultList.add(stringStringHashMap);
}
......@@ -843,11 +844,134 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
ColModel colModelEventMovement = new ColModel("name", "name", "测量点", "测量点", "dataGrid", "name");
ColModel colModelStationName = new ColModel("zxzyg", "zxzyg", "正向总有功", "正向总有功", "dataGrid", "zxzyg");
ColModel colModelEventDesc = new ColModel("fxzyg", "fxzyg", "反向总有功", "反向总有功", "dataGrid", "fxzyg");
ColModel colModelAlarmGroupName= new ColModel("zxzwg", "zxzwg", "正向总无功", "正向总无功", "zxzwg", "alarmGroupName");
ColModel colModelAlarmGroupName = new ColModel("zxzwg", "zxzwg", "正向总无功", "正向总无功", "zxzwg", "alarmGroupName");
ColModel colModelEventTime = new ColModel("fxzwg", "fxzwg", "反向总无功", "反向总无功", "dataGrid", "fxzwg");
List<ColModel> listColModel = Arrays.asList(colModelEventMovement,colModelStationName, colModelEventDesc, colModelAlarmGroupName, colModelEventTime );
List<ColModel> listColModel = Arrays.asList(colModelEventMovement, colModelStationName, colModelEventDesc, colModelAlarmGroupName, colModelEventTime);
ResultsData resultsData = new ResultsData(DataGridMock, listColModel);
return resultsData;
}
public void getAnalogQuantityInfo(String gatewayId, String stationId) {
if (StringUtils.isNotEmpty(gatewayId)) {
List<Map<String, String>> boosterStationInfo = monitorFanIndicatorregionMapper.getBoosterStationInfo(gatewayId);
for (Map<String, String> map : boosterStationInfo) {
String sql = String.format("SELECT equipmentIndexName, value, frontModule, unit, displayName FROM \"indicators_%s\" WHERE systemType = '%s' and frontModule =~/%s/ ", gatewayId, "模拟量", map.get("boosterName"));
List<IndicatorsDto> listData = influxDButils.getListData(sql, IndicatorsDto.class);
ArrayList<Map<String, String>> resultList = new ArrayList<>();
listData.forEach(item -> {
HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("title", item.getDisplayName());
stringStringHashMap.put("value", item.getValue());
if (StringUtils.isNotEmpty(item.getUnit())) {
stringStringHashMap.put("title", String.format("%s(%s)", item.getDisplayName(), item.getUnit()));
}
resultList.add(stringStringHashMap);
});
IPage<Map<String, String>> result = new Page<>();
result.setRecords(resultList);
result.setCurrent(1);
result.setTotal(resultList.size());
try {
log.info("消息内容:{}", JSON.toJSONString(result));
emqKeeper.getMqttClient().publish(String.format("%s/%s/%s", stationId, map.get("boosterCode"), "mnl"), JSON.toJSONString(result).getBytes(),0,false);
} catch (MqttException e) {
log.info("消息发送失败");
e.printStackTrace();
}
}
}
}
public void getMajorAnalogQuantityByPage(String gatewayId, String stationId) {
if (StringUtils.isNotEmpty(gatewayId)) {
// List<Map<String, String>> boosterStationInfo = monitorFanIndicatorregionMapper.getMajorBoosterStationInfo(gatewayId, "DESC", 3);
String xianSql = String.format("SELECT equipmentIndexName, value, frontModule, unit, displayName FROM \"indicators_%s\" WHERE systemType = '模拟量' and (frontModule = '220kVⅠ母PT' or frontModule = '35kVⅠ母PT')", gatewayId);
List<IndicatorsDto> xianData = influxDButils.getListData(xianSql, IndicatorsDto.class);
HashMap<String, Object> resultMap = new HashMap<>();
xianData.forEach(item -> {
if ("220kVⅠ母PT".equals(item.getFrontModule())) {
resultMap.put("220" + item.getDisplayName(), item.getValue());
} else if ("35kVⅠ母PT".equals(item.getFrontModule())) {
resultMap.put("35" + item.getDisplayName(), item.getValue());
}
});
String xyxSql = String.format("SELECT value, displayName FROM \"indicators_%s\" WHERE systemType = '模拟量' and frontModule = '夏雩线' and (displayName = 'Ia' or displayName = 'P' or displayName = 'Q' or displayName = 'Ux' ", gatewayId);
List<IndicatorsDto> xyxSqlData = influxDButils.getListData(xyxSql, IndicatorsDto.class);
xyxSqlData.forEach(item -> resultMap.put("xyx" + item.getDisplayName(), item.getValue()));
String dlbjSql = String.format("SELECT value, displayName FROM \"indicators_%s\" WHERE systemType = '模拟量' and frontModule = '电量表计'", gatewayId);
List<IndicatorsDto> dlbjSqlData = influxDButils.getListData(dlbjSql, IndicatorsDto.class);
dlbjSqlData.forEach(item -> {
if ("正向总有功".equals(item.getDisplayName())) {
resultMap.put("2000S1", item.getValue());
} else if ("正向总无功".equals(item.getDisplayName())) {
resultMap.put("2000S2", item.getValue());
}
});
String zb1Sql = String.format("SELECT * FROM \"indicators_%s\" WHERE frontModule = '1主变' and systemType = '模拟量' and (displayName = '档位' or displayName = '油面温1' or displayName = '油面温2' or displayName = '绕组温度' ) ", gatewayId);
List<IndicatorsDto> zb1SqlData = influxDButils.getListData(zb1Sql, IndicatorsDto.class);
// TODO: 2023/7/14 数据未整理 ---> 油面温1 油面温2 绕组温度
resultMap.put("value1", "0.0");
resultMap.put("value2", "0.0");
resultMap.put("value3", "0.0");
resultMap.put("value4", "0.0");
zb1SqlData.forEach(item -> {
if ("档位".equals(item.getDisplayName())) {
resultMap.put("value4", item.getValue());
} else if ("油面温1".equals(item.getDisplayName())) {
resultMap.put("value1", item.getValue());
} else if ("油面温2".equals(item.getDisplayName())) {
resultMap.put("value2", item.getValue());
} else if ("绕组温度".equals(item.getDisplayName())) {
resultMap.put("value3", item.getValue());
}
});
//下方重复列表数据
List<Map<String, String>> boosterStationInfo = monitorFanIndicatorregionMapper.getMajorBoosterStationInfo(gatewayId, "ASC", 10);
ArrayList<Map<String, String>> resultList = new ArrayList<>();
for (Map<String, String> map : boosterStationInfo) {
String sql = String.format("SELECT equipmentIndexName, value, frontModule, unit, displayName FROM \"indicators_%s\" WHERE systemType = '%s' and frontModule =~/%s/ and (displayName = 'Ia' or displayName = 'P' or displayName = 'Q') ", gatewayId, "模拟量", map.get("boosterName"));
List<IndicatorsDto> listData = influxDButils.getListData(sql, IndicatorsDto.class);
HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("value1", "0.0");
stringStringHashMap.put("value2", "0.0");
stringStringHashMap.put("value3", "0.0");
listData.forEach(item -> {
if (item.getDisplayName().equals("Ia")) {
stringStringHashMap.put("value1", item.getValue());
}
if (item.getDisplayName().equals("P")) {
stringStringHashMap.put("value2", item.getValue());
}
if (item.getDisplayName().equals("Q")) {
stringStringHashMap.put("value3", item.getValue());
}
});
resultList.add(stringStringHashMap);
}
resultMap.put("records", resultList);
resultMap.put("current", 1);
resultMap.put("size", resultList.size());
List<Map<String, Object>> finallyResultList = Collections.singletonList(resultMap);
// 主屏下方重复列表数据
IPage<Map<String, Object>> resultPage = new Page<>();
resultPage.setRecords(finallyResultList);
resultPage.setCurrent(1);
resultPage.setTotal(finallyResultList.size());
try {
log.info("消息内容:{}", JSON.toJSONString(resultPage));
emqKeeper.getMqttClient().publish(String.format("%s/%s/%s", stationId, "major", "data"), JSON.toJSONString(resultPage).getBytes(),0,false);
} catch (MqttException e) {
log.info("消息发送失败");
e.printStackTrace();
}
}
}
}
package com.yeejoin.amos.boot.module.tzs.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 96333坐席信息
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "CtiUserDto", description = "坐席信息")
public class CtiUserDto {
@ApiModelProperty(value = "坐席对应主叫号码")
private String callerNo;
}
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.tzs.api.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.tzs.api.dto.CtiUserDto;
import java.util.Map;
......@@ -48,5 +49,5 @@ public interface ICtiService {
/**
* 根据坐席配置获取主叫号码
*/
String getCallPhone();
CtiUserDto getCallPhone(String userId);
}
......@@ -2,10 +2,13 @@ package com.yeejoin.amos.boot.module.tzs.biz.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.tzs.api.dto.CtiDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.CtiUserDto;
import com.yeejoin.amos.boot.module.tzs.api.service.ICtiService;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -110,8 +113,9 @@ public class CtiController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/callPhone")
@ApiOperation(httpMethod = "GET", value = "获取坐席技能组对应主叫号码信息", notes = "获取坐席技能组对应主叫号码信息")
public ResponseModel<String> getCallPhone() {
String callPhone = ctiService.getCallPhone();
return ResponseHelper.buildResponse(callPhone);
public ResponseModel<CtiUserDto> getCallPhone() {
ReginParams reginParams = getSelectedOrgInfo();
AgencyUserModel loginUserModel = reginParams.getUserModel();
return ResponseHelper.buildResponse(ctiService.getCallPhone(loginUserModel.getUserId()));
}
}
......@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.biz.common.enums.DictTypeEnum;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.tzs.api.dto.CtiUserDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.TzsCitInfo;
import com.yeejoin.amos.boot.module.tzs.api.service.ICtiService;
import com.yeejoin.amos.boot.module.tzs.biz.utils.HttpUtils;
......@@ -236,16 +237,19 @@ public class CtiServiceImpl implements ICtiService {
}
@Override
public String getCallPhone() {
AgencyUserModel me = Privilege.agencyUserClient.getme().getResult();
public CtiUserDto getCallPhone(String userId) {
CtiUserDto ctiUserDto = new CtiUserDto();
if (ValidationUtil.isEmpty(userId)) {
return ctiUserDto;
}
LambdaQueryWrapper<TzsCitInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(TzsCitInfo::getCtiUserId,me.getUserId());
wrapper.eq(TzsCitInfo::getCtiUserId, userId);
TzsCitInfo ctiInfo = ctiInfoService.getOne(wrapper);
if (!ValidationUtil.isEmpty(ctiInfo)) {
String groupCode = ctiInfo.getGid().split(",")[0];
DataDictionary dataDictionary = dictionaryService.getByCode(groupCode, DictTypeEnum.坐席技能组.getType());
return dataDictionary.getName();
ctiUserDto.setCallerNo(dataDictionary.getName());
}
return "";
return ctiUserDto;
}
}
\ No newline at end of file
......@@ -218,9 +218,13 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
String trappedFloorNum = dynamicParms.get("trapped_floor_num") == null ? "" : dynamicParms.get("trapped_floor_num");
String isLight = dynamicParms.get("is_light") == null ? "" : dynamicParms.get("is_light");
String trappedTime = dynamicParms.get("trapped_time") == null ? "" : dynamicParms.get("trapped_time");
content = content.replace("$trapped_num",trappedNum).replace("$trapped_floor_num",trappedFloorNum);
content = content.replace("$emergency_call",emergencyCall).replace("$contact_phone",contactPhone);
content = content.replace("$is_light",isLight).replace("$trapped_time",trappedTime);
String injuredNum = dynamicParms.get("injured_num") == null ? "" : dynamicParms.get("injured_num");
String dieNum = dynamicParms.get("die_num") == null ? "" : dynamicParms.get("die_num");
String hasInjury = Integer.parseInt(injuredNum) + Integer.parseInt(dieNum) > 0 ? "有" : "无";
content = content.replace("$trapped_num",trappedNum).replace("$trapped_floor_num", trappedFloorNum);
content = content.replace("$emergency_call",emergencyCall).replace("$contact_phone", contactPhone);
content = content.replace("$is_light", isLight).replace("$trapped_time", trappedTime);
content = content.replace("$hasInjury", hasInjury);
break;
case "GZWX" : // 故障维修
dispatchTaskDto.setIsSaveTask(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