Commit 1fe8adb3 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/controller/MonitorFanIdxController.java # 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 94eb0740 72b0c111
package com.yeejoin.amos.boot.biz.common.enums;
import lombok.AllArgsConstructor;
@AllArgsConstructor
public enum DictTypeEnum {
坐席技能组("ZXJNZ","坐席技能组");
private String type;//字典类型
private String desc;//描述
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
package com.yeejoin.amos.boot.module.hygf.api.dto; package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.List;
/** /**
* 商务信息 * 商务信息
...@@ -34,7 +36,14 @@ public class CommercialDto extends BaseDto { ...@@ -34,7 +36,14 @@ public class CommercialDto extends BaseDto {
private String telephone; private String telephone;
@ApiModelProperty(value = "省市区") @ApiModelProperty(value = "省市区")
private String projectAddress; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Integer> projectAddress;
@ApiModelProperty(value = "省市区名称")
private String projectAddressName;
@ApiModelProperty(value = "省市区文字集合")
private List<String> projectAddressText;
@ApiModelProperty(value = "设备信息") @ApiModelProperty(value = "设备信息")
private String device; private String device;
...@@ -55,52 +64,68 @@ public class CommercialDto extends BaseDto { ...@@ -55,52 +64,68 @@ public class CommercialDto extends BaseDto {
private String legalEmergentTelephone; private String legalEmergentTelephone;
@ApiModelProperty(value = "结婚证文件标识") @ApiModelProperty(value = "结婚证文件标识")
private String marriageCredit; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> marriageCredit;
@ApiModelProperty(value = "房产证文件标识") @ApiModelProperty(value = "房产证文件标识")
private String realEstateCredit; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> realEstateCredit;
@ApiModelProperty(value = "身份证正反面文件标识") @ApiModelProperty(value = "身份证正反面文件标识")
private String idCardCredit; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> idCardCredit;
@ApiModelProperty(value = "户口本文件标识") @ApiModelProperty(value = "户口本文件标识")
private String householdBookCredit; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> householdBookCredit;
@ApiModelProperty(value = "手持身份证文件标识") @ApiModelProperty(value = "手持身份证文件标识")
private String handIdCardCredit; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> handIdCardCredit;
@ApiModelProperty(value = "踏勘照片文件标识") @ApiModelProperty(value = "踏勘照片文件标识")
private String surveyPhotosWeb; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> surveyPhotosWeb;
@ApiModelProperty(value = "组件平面图与组串连线图文件标识") @ApiModelProperty(value = "组件平面图与组串连线图文件标识")
private String formationWeb; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> formationWeb;
@ApiModelProperty(value = "房屋所有权继承说明文件标识") @ApiModelProperty(value = "房屋所有权继承说明文件标识")
private String inheritWeb; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> inheritWeb;
@ApiModelProperty(value = "户用光伏电站项目合作协议文件标识") @ApiModelProperty(value = "户用光伏电站项目合作协议文件标识")
private String agreementWeb; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> agreementWeb;
@ApiModelProperty(value = "用户手持身份证照片文件标识") @ApiModelProperty(value = "用户手持身份证照片文件标识")
private String handIdCardLegal; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> handIdCardLegal;
@ApiModelProperty(value = "法人营业执照文件标识") @ApiModelProperty(value = "法人营业执照文件标识")
private String licenseLegal; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> licenseLegal;
@ApiModelProperty(value = "法定代理人身份证文件标识") @ApiModelProperty(value = "法定代理人身份证文件标识")
private String agentLegal; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> agentLegal;
@ApiModelProperty(value = "房产证明文件或乡镇街道土管部门房屋产权证明文件文件标识") @ApiModelProperty(value = "房产证明文件或乡镇街道土管部门房屋产权证明文件文件标识")
private String realEstateLegal; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> realEstateLegal;
@ApiModelProperty(value = "房屋屋顶租赁协议/户用光伏共建开发协议文件标识") @ApiModelProperty(value = "房屋屋顶租赁协议/户用光伏共建开发协议文件标识")
private String houseAgreementLegal; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> houseAgreementLegal;
@ApiModelProperty(value = "法人的企业征信报告、工商内档文件标识") @ApiModelProperty(value = "法人的企业征信报告、工商内档文件标识")
private String creditReportLegal; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> creditReportLegal;
@ApiModelProperty(value = "项目备案证文件标识") @ApiModelProperty(value = "项目备案证文件标识")
private String filingsLegal; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> filingsLegal;
@ApiModelProperty(value = " 省市区详细地址") @ApiModelProperty(value = " 省市区详细地址")
private String projectAddressDetail; private String projectAddressDetail;
......
package com.yeejoin.amos.boot.module.hygf.api.dto; package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.List;
/** /**
* 扩展信息 * 扩展信息
...@@ -25,7 +27,8 @@ public class ExtendedInformationDto extends BaseDto { ...@@ -25,7 +27,8 @@ public class ExtendedInformationDto extends BaseDto {
private String orderDescription; private String orderDescription;
@ApiModelProperty(value = "联系人") @ApiModelProperty(value = "联系人")
private String contacts; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> contacts;
@ApiModelProperty(value = "勘察表id") @ApiModelProperty(value = "勘察表id")
private Long surveyInformationId; private Long surveyInformationId;
......
package com.yeejoin.amos.boot.module.hygf.api.dto; package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 资料归档 * 资料归档
...@@ -28,10 +31,12 @@ public class InformationDto extends BaseDto { ...@@ -28,10 +31,12 @@ public class InformationDto extends BaseDto {
private String archivesNumber; private String archivesNumber;
@ApiModelProperty(value = "身份证文件标识") @ApiModelProperty(value = "身份证文件标识")
private String cardFile; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> cardFile;
@ApiModelProperty(value = " 房产证文件标识") @ApiModelProperty(value = " 房产证文件标识")
private String houseProve; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> houseProve;
@ApiModelProperty(value = "勘察表id") @ApiModelProperty(value = "勘察表id")
private Long surveyInformationId; private Long surveyInformationId;
......
package com.yeejoin.amos.boot.module.hygf.api.dto; package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
...@@ -9,6 +10,7 @@ import lombok.EqualsAndHashCode; ...@@ -9,6 +10,7 @@ import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 农户信息 * 农户信息
...@@ -50,20 +52,23 @@ public class PeasantHouseholdDto extends BaseDto { ...@@ -50,20 +52,23 @@ public class PeasantHouseholdDto extends BaseDto {
private Date creationTime; private Date creationTime;
@ApiModelProperty(value = "项目地址") @ApiModelProperty(value = "项目地址")
private String projectAddress; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Integer> projectAddress;
@ApiModelProperty(value = "项目地址Arr")
private String[] projectAddressArr;
@ApiModelProperty(value = "常住地址") @ApiModelProperty(value = "常住是否相同")
private String permanentAddress; private String isPermanent;
@ApiModelProperty(value = "常住地址Arr") @ApiModelProperty(value = "常住地址")
private String permanentAddressArr; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Integer> permanentAddress;
@ApiModelProperty(value = "是否勘察 0,1") @ApiModelProperty(value = "是否勘察 0,1,2")
private Integer surveyOrNot; private Integer surveyOrNot;
@ApiModelProperty(value = "勘察状态描述")
private String surveyOrNotText;
@ApiModelProperty(value = "身份证号") @ApiModelProperty(value = "身份证号")
private String idCard; private String idCard;
......
package com.yeejoin.amos.boot.module.hygf.api.dto; package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 勘察明细 * 勘察明细
...@@ -23,11 +27,13 @@ public class SurveyDetailsDto extends BaseDto { ...@@ -23,11 +27,13 @@ public class SurveyDetailsDto extends BaseDto {
@ApiModelProperty(value = "勘察表id") @ApiModelProperty(value = "勘察表id")
private Long surveyInformationId; private Long surveyInformationId;
@JsonFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "勘察时间") @ApiModelProperty(value = "勘察时间")
private Date surveyorTime; private Date surveyorTime;
@ApiModelProperty(value = "房屋类型") @ApiModelProperty(value = "房屋类型")
private String houseType; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<String> houseType;
@ApiModelProperty(value = "房屋整体情况") @ApiModelProperty(value = "房屋整体情况")
private String houseSituation; private String houseSituation;
...@@ -45,7 +51,7 @@ public class SurveyDetailsDto extends BaseDto { ...@@ -45,7 +51,7 @@ public class SurveyDetailsDto extends BaseDto {
private Integer houseHeight; private Integer houseHeight;
@ApiModelProperty(value = "房屋偏向") @ApiModelProperty(value = "房屋偏向")
private Integer houseBias; private String houseBias;
@ApiModelProperty(value = "房屋偏向备注") @ApiModelProperty(value = "房屋偏向备注")
private String houseBiasNotes; private String houseBiasNotes;
...@@ -63,25 +69,29 @@ public class SurveyDetailsDto extends BaseDto { ...@@ -63,25 +69,29 @@ public class SurveyDetailsDto extends BaseDto {
private String locationAlt; private String locationAlt;
@ApiModelProperty(value = "屋顶通道") @ApiModelProperty(value = "屋顶通道")
private String roofway; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<String> roofway;
@ApiModelProperty(value = "屋顶通道备注") @ApiModelProperty(value = "屋顶通道备注")
private String roofwayNotes; private String roofwayNotes;
@ApiModelProperty(value = "周边障碍物") @ApiModelProperty(value = "周边障碍物")
private String obstacle; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<String> obstacle;
@ApiModelProperty(value = "周边障碍物备注") @ApiModelProperty(value = "周边障碍物备注")
private String obstacleNotes; private String obstacleNotes;
@ApiModelProperty(value = "遮挡物") @ApiModelProperty(value = "遮挡物")
private String screen; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<String> screen;
@ApiModelProperty(value = "遮挡物备注") @ApiModelProperty(value = "遮挡物备注")
private String screenNotes; private String screenNotes;
@ApiModelProperty(value = "解决措施") @ApiModelProperty(value = "解决措施")
private String solutionMeasures; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<String> solutionMeasures;
@ApiModelProperty(value = "房屋产权") @ApiModelProperty(value = "房屋产权")
private String houseProperty; private String houseProperty;
...@@ -141,27 +151,35 @@ public class SurveyDetailsDto extends BaseDto { ...@@ -141,27 +151,35 @@ public class SurveyDetailsDto extends BaseDto {
private String daylightingObstruction; private String daylightingObstruction;
@ApiModelProperty(value = "房屋整体文件标识") @ApiModelProperty(value = "房屋整体文件标识")
private String overallHousingSurvey; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> overallHousingSurvey;
@ApiModelProperty(value = "房屋周边文件标识") @ApiModelProperty(value = "房屋周边文件标识")
private String surroundingHouseSurvey; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> surroundingHouseSurvey;
@ApiModelProperty(value = "房屋内部整体照片文件标识") @ApiModelProperty(value = "房屋内部整体照片文件标识")
private String insideHouseSurvey; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> insideHouseSurvey;
@ApiModelProperty(value = "电表参数文件标识") @ApiModelProperty(value = "电表参数文件标识")
private String electricitySurvey; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> electricitySurvey;
@ApiModelProperty(value = "屋顶全貌文件标识") @ApiModelProperty(value = "屋顶全貌文件标识")
private String panoramaSurvey; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> panoramaSurvey;
@ApiModelProperty(value = "屋顶平面草图文件标识") @ApiModelProperty(value = "屋顶平面草图文件标识")
private String planSketchSurvey; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> planSketchSurvey;
@ApiModelProperty(value = "房屋方位角文件标识") @ApiModelProperty(value = "房屋方位角文件标识")
private String azimuthSurvey; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> azimuthSurvey;
@ApiModelProperty(value = "其他附件文件标识") @ApiModelProperty(value = "其他附件文件标识")
private String otherAccessorySurvey; @TableField(typeHandler = FastjsonTypeHandler.class)
private List<Object> otherAccessorySurvey;
} }
package com.yeejoin.amos.boot.module.hygf.api.dto; package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 勘察信息 * 勘察信息
...@@ -42,6 +46,7 @@ public class SurveyInformationDto extends BaseDto { ...@@ -42,6 +46,7 @@ public class SurveyInformationDto extends BaseDto {
@ApiModelProperty(value = "制单人") @ApiModelProperty(value = "制单人")
private String creator; private String creator;
@JsonFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "制单时间") @ApiModelProperty(value = "制单时间")
private Date creatorTime; private Date creatorTime;
...@@ -51,6 +56,9 @@ public class SurveyInformationDto extends BaseDto { ...@@ -51,6 +56,9 @@ public class SurveyInformationDto extends BaseDto {
@ApiModelProperty(value = " 审核状态 0未审核,1审核中,2审核结束") @ApiModelProperty(value = " 审核状态 0未审核,1审核中,2审核结束")
private Integer review; private Integer review;
@ApiModelProperty(value = "来源农户编号")
private String peasantHouseholdNo;
@ApiModelProperty(value = "业主姓名") @ApiModelProperty(value = "业主姓名")
private String ownersName; private String ownersName;
...@@ -69,10 +77,30 @@ public class SurveyInformationDto extends BaseDto { ...@@ -69,10 +77,30 @@ public class SurveyInformationDto extends BaseDto {
@ApiModelProperty(value = "常住详细地址") @ApiModelProperty(value = "常住详细地址")
private String permanentAddressDetail; private String permanentAddressDetail;
@ApiModelProperty(value = "项目地址code")
@TableField(typeHandler = FastjsonTypeHandler.class)
private List<Integer> projectAddress;
@ApiModelProperty(value = "项目地址文字")
@TableField(typeHandler = FastjsonTypeHandler.class)
private List<String> projectAddressText;
@ApiModelProperty(value = "项目地址") @ApiModelProperty(value = "项目地址")
private String projectAddress; private String projectAddressName;
@ApiModelProperty(value = "常住地址code")
@TableField(typeHandler = FastjsonTypeHandler.class)
private List<Integer> permanentAddress;
@ApiModelProperty(value = "常住地址文字")
@TableField(typeHandler = FastjsonTypeHandler.class)
private List<String> permanentAddressText;
@ApiModelProperty(value = "常住是否相同")
private String isPermanent;
@ApiModelProperty(value = "常住地址") @ApiModelProperty(value = "定金")
private String permanentAddress; private Float deposit;
} }
...@@ -48,6 +48,9 @@ public class UnitInfoDto extends BaseDto { ...@@ -48,6 +48,9 @@ public class UnitInfoDto extends BaseDto {
@ApiModelProperty(value = "管理员账户名") @ApiModelProperty(value = "管理员账户名")
private String adminLoginName; private String adminLoginName;
@ApiModelProperty(value = "管理员账户名")
private String adminUserName;
@ApiModelProperty(value = "管理员电话") @ApiModelProperty(value = "管理员电话")
private String adminPhone; private String adminPhone;
...@@ -66,4 +69,28 @@ public class UnitInfoDto extends BaseDto { ...@@ -66,4 +69,28 @@ public class UnitInfoDto extends BaseDto {
@ApiModelProperty(value = "角色id") @ApiModelProperty(value = "角色id")
private String roleId; private String roleId;
@ApiModelProperty(value = "注册地址省-市-区")
private String registerPcd;
@ApiModelProperty(value = "工作地址省-市-区")
private String workPcd;
@ApiModelProperty(value = "注册地址省-市-区code")
private String registerPcdCode;
@ApiModelProperty(value = "工作地址省-市-区code")
private String workPcdCode;
@ApiModelProperty(value = "单位类型")
private String unitType;
@ApiModelProperty(value = "单位类型code")
private String unitTypeCode;
@ApiModelProperty(value = "管辖机构")
private String managementUnit;
@ApiModelProperty(value = "管辖单位id")
private String managementUnitId;
} }
package com.yeejoin.amos.boot.module.hygf.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author DELL
*/
@Data
@ApiModel(value="UnitRegisterDto", description="单位注册")
public class UnitRegisterDto {
@ApiModelProperty(value = "企业名称")
private UnitInfoDto unitInfoDto;
@ApiModelProperty(value = "企业名称")
private CommerceInfoDto commerceInfoDto;
}
...@@ -2,11 +2,13 @@ package com.yeejoin.amos.boot.module.hygf.api.entity; ...@@ -2,11 +2,13 @@ package com.yeejoin.amos.boot.module.hygf.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 lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 商务信息 * 商务信息
...@@ -17,7 +19,7 @@ import java.util.Date; ...@@ -17,7 +19,7 @@ import java.util.Date;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Accessors(chain = true) @Accessors(chain = true)
@TableName("hygf_commercial") @TableName(value = "hygf_commercial",autoResultMap = true)
public class Commercial extends BaseEntity { public class Commercial extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -53,10 +55,15 @@ public class Commercial extends BaseEntity { ...@@ -53,10 +55,15 @@ public class Commercial extends BaseEntity {
private String telephone; private String telephone;
/** /**
* 省市区 * 省市区code
*/ */
@TableField("project_address") @TableField(value = "project_address",typeHandler = FastjsonTypeHandler.class)
private String projectAddress; private List<Object> projectAddress;
/**
* 省市区名称
*/
@TableField("project_address_name")
private String projectAddressName;
/** /**
* 设备信息 * 设备信息
...@@ -97,98 +104,98 @@ public class Commercial extends BaseEntity { ...@@ -97,98 +104,98 @@ public class Commercial extends BaseEntity {
/** /**
* 结婚证文件标识 * 结婚证文件标识
*/ */
@TableField("marriage_credit") @TableField(value = "marriage_credit",typeHandler = FastjsonTypeHandler.class)
private String marriageCredit; private List<Object> marriageCredit;
/** /**
* 房产证文件标识 * 房产证文件标识
*/ */
@TableField("real_estate_credit") @TableField(value = "real_estate_credit",typeHandler = FastjsonTypeHandler.class)
private String realEstateCredit; private List<Object> realEstateCredit;
/** /**
* 身份证正反面文件标识 * 身份证正反面文件标识
*/ */
@TableField("id_card_credit") @TableField(value = "id_card_credit",typeHandler = FastjsonTypeHandler.class)
private String idCardCredit; private List<Object> idCardCredit;
/** /**
* 户口本文件标识 * 户口本文件标识
*/ */
@TableField("household_book_credit") @TableField(value = "household_book_credit",typeHandler = FastjsonTypeHandler.class)
private String householdBookCredit; private List<Object> householdBookCredit;
/** /**
* 手持身份证文件标识 * 手持身份证文件标识
*/ */
@TableField("hand_id_card_credit") @TableField(value = "hand_id_card_credit",typeHandler = FastjsonTypeHandler.class)
private String handIdCardCredit; private List<Object> handIdCardCredit;
/** /**
* 踏勘照片文件标识 * 踏勘照片文件标识
*/ */
@TableField("survey_photos_web") @TableField(value = "survey_photos_web",typeHandler = FastjsonTypeHandler.class)
private String surveyPhotosWeb; private List<Object> surveyPhotosWeb;
/** /**
* 组件平面图与组串连线图文件标识 * 组件平面图与组串连线图文件标识
*/ */
@TableField("formation_web") @TableField(value = "formation_web",typeHandler = FastjsonTypeHandler.class)
private String formationWeb; private List<Object> formationWeb;
/** /**
* 房屋所有权继承说明文件标识 * 房屋所有权继承说明文件标识
*/ */
@TableField("inherit_web") @TableField(value = "inherit_web",typeHandler = FastjsonTypeHandler.class)
private String inheritWeb; private List<Object> inheritWeb;
/** /**
* 户用光伏电站项目合作协议文件标识 * 户用光伏电站项目合作协议文件标识
*/ */
@TableField("agreement_web") @TableField(value = "agreement_web",typeHandler = FastjsonTypeHandler.class)
private String agreementWeb; private List<Object> agreementWeb;
/** /**
* 用户手持身份证照片文件标识 * 用户手持身份证照片文件标识
*/ */
@TableField("hand_id_card_legal") @TableField(value = "hand_id_card_legal",typeHandler = FastjsonTypeHandler.class)
private String handIdCardLegal; private List<Object> handIdCardLegal;
/** /**
* 法人营业执照文件标识 * 法人营业执照文件标识
*/ */
@TableField("license_legal") @TableField(value = "license_legal",typeHandler = FastjsonTypeHandler.class)
private String licenseLegal; private List<Object> licenseLegal;
/** /**
* 法定代理人身份证文件标识 * 法定代理人身份证文件标识
*/ */
@TableField("agent_legal") @TableField(value = "agent_legal",typeHandler = FastjsonTypeHandler.class)
private String agentLegal; private List<Object> agentLegal;
/** /**
* 房产证明文件或乡镇街道土管部门房屋产权证明文件文件标识 * 房产证明文件或乡镇街道土管部门房屋产权证明文件文件标识
*/ */
@TableField("real_estate_legal") @TableField(value = "real_estate_legal",typeHandler = FastjsonTypeHandler.class)
private String realEstateLegal; private List<Object> realEstateLegal;
/** /**
* 房屋屋顶租赁协议/户用光伏共建开发协议文件标识 * 房屋屋顶租赁协议/户用光伏共建开发协议文件标识
*/ */
@TableField("house_agreement_legal") @TableField(value = "house_agreement_legal",typeHandler = FastjsonTypeHandler.class)
private String houseAgreementLegal; private List<Object> houseAgreementLegal;
/** /**
* 法人的企业征信报告、工商内档文件标识 * 法人的企业征信报告、工商内档文件标识
*/ */
@TableField("credit_report_legal") @TableField(value = "credit_report_legal",typeHandler = FastjsonTypeHandler.class)
private String creditReportLegal; private List<Object> creditReportLegal;
/** /**
* 项目备案证文件标识 * 项目备案证文件标识
*/ */
@TableField("filings_legal") @TableField(value = "filings_legal",typeHandler = FastjsonTypeHandler.class)
private String filingsLegal; private List<Object> filingsLegal;
/** /**
* 省市区详细地址 * 省市区详细地址
......
...@@ -2,11 +2,13 @@ package com.yeejoin.amos.boot.module.hygf.api.entity; ...@@ -2,11 +2,13 @@ package com.yeejoin.amos.boot.module.hygf.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 lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 扩展信息 * 扩展信息
...@@ -17,7 +19,7 @@ import java.util.Date; ...@@ -17,7 +19,7 @@ import java.util.Date;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Accessors(chain = true) @Accessors(chain = true)
@TableName("hygf_extended_information") @TableName(value = "hygf_extended_information",autoResultMap = true)
public class ExtendedInformation extends BaseEntity { public class ExtendedInformation extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -31,8 +33,8 @@ public class ExtendedInformation extends BaseEntity { ...@@ -31,8 +33,8 @@ public class ExtendedInformation extends BaseEntity {
/** /**
* 联系人 * 联系人
*/ */
@TableField("contacts") @TableField(value = "contacts",typeHandler = FastjsonTypeHandler.class)
private String contacts; private List<Object> contacts;
/** /**
* 勘察表id * 勘察表id
......
...@@ -2,11 +2,13 @@ package com.yeejoin.amos.boot.module.hygf.api.entity; ...@@ -2,11 +2,13 @@ package com.yeejoin.amos.boot.module.hygf.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 lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 资料归档 * 资料归档
...@@ -17,7 +19,7 @@ import java.util.Date; ...@@ -17,7 +19,7 @@ import java.util.Date;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Accessors(chain = true) @Accessors(chain = true)
@TableName("hygf_information") @TableName(value = "hygf_information",autoResultMap = true)
public class Information extends BaseEntity { public class Information extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -37,14 +39,14 @@ public class Information extends BaseEntity { ...@@ -37,14 +39,14 @@ public class Information extends BaseEntity {
/** /**
* 身份证文件标识 * 身份证文件标识
*/ */
@TableField("card_file") @TableField(value = "card_file",typeHandler = FastjsonTypeHandler.class)
private String cardFile; private List<Object> cardFile;
/** /**
* 房产证文件标识 * 房产证文件标识
*/ */
@TableField("house_prove") @TableField(value = "house_prove",typeHandler = FastjsonTypeHandler.class)
private String houseProve; private List<Object> houseProve;
/** /**
* 勘察表id * 勘察表id
......
...@@ -2,11 +2,13 @@ package com.yeejoin.amos.boot.module.hygf.api.entity; ...@@ -2,11 +2,13 @@ package com.yeejoin.amos.boot.module.hygf.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 lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 农户信息 * 农户信息
...@@ -17,7 +19,7 @@ import java.util.Date; ...@@ -17,7 +19,7 @@ import java.util.Date;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Accessors(chain = true) @Accessors(chain = true)
@TableName("hygf_peasant_household") @TableName(value = "hygf_peasant_household",autoResultMap = true)
public class PeasantHousehold extends BaseEntity { public class PeasantHousehold extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -73,14 +75,14 @@ public class PeasantHousehold extends BaseEntity { ...@@ -73,14 +75,14 @@ public class PeasantHousehold extends BaseEntity {
/** /**
* 项目地址 * 项目地址
*/ */
@TableField("project_address") @TableField(value = "project_address",typeHandler = FastjsonTypeHandler.class)
private String projectAddress; private List<Integer> projectAddress;
/** /**
* 常住地址 * 常住地址
*/ */
@TableField("permanent_address") @TableField(value = "permanent_address",typeHandler = FastjsonTypeHandler.class)
private String permanentAddress; private List<Integer> permanentAddress;
/** /**
* 常住地址 * 常住地址
......
...@@ -2,11 +2,13 @@ package com.yeejoin.amos.boot.module.hygf.api.entity; ...@@ -2,11 +2,13 @@ package com.yeejoin.amos.boot.module.hygf.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 lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 勘察明细 * 勘察明细
...@@ -17,7 +19,7 @@ import java.util.Date; ...@@ -17,7 +19,7 @@ import java.util.Date;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Accessors(chain = true) @Accessors(chain = true)
@TableName("hygf_survey_details") @TableName(value = "hygf_survey_details",autoResultMap = true)
public class SurveyDetails extends BaseEntity { public class SurveyDetails extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -37,8 +39,8 @@ public class SurveyDetails extends BaseEntity { ...@@ -37,8 +39,8 @@ public class SurveyDetails extends BaseEntity {
/** /**
* 房屋类型 * 房屋类型
*/ */
@TableField("house_type") @TableField(value = "house_type",typeHandler = FastjsonTypeHandler.class)
private String houseType; private List<String> houseType;
/** /**
* 房屋整体情况 * 房屋整体情况
...@@ -74,7 +76,7 @@ public class SurveyDetails extends BaseEntity { ...@@ -74,7 +76,7 @@ public class SurveyDetails extends BaseEntity {
* 房屋偏向 * 房屋偏向
*/ */
@TableField("house_bias") @TableField("house_bias")
private Integer houseBias; private String houseBias;
/** /**
* 房屋偏向备注 * 房屋偏向备注
...@@ -109,8 +111,8 @@ public class SurveyDetails extends BaseEntity { ...@@ -109,8 +111,8 @@ public class SurveyDetails extends BaseEntity {
/** /**
* 屋顶通道 * 屋顶通道
*/ */
@TableField("roofway") @TableField(value = "roofway",typeHandler = FastjsonTypeHandler.class)
private String roofway; private List<String> roofway;
/** /**
* 屋顶通道备注 * 屋顶通道备注
...@@ -121,8 +123,8 @@ public class SurveyDetails extends BaseEntity { ...@@ -121,8 +123,8 @@ public class SurveyDetails extends BaseEntity {
/** /**
* 周边障碍物 * 周边障碍物
*/ */
@TableField("obstacle") @TableField(value = "obstacle",typeHandler = FastjsonTypeHandler.class)
private String obstacle; private List<String> obstacle;
/** /**
* 周边障碍物备注 * 周边障碍物备注
...@@ -133,8 +135,8 @@ public class SurveyDetails extends BaseEntity { ...@@ -133,8 +135,8 @@ public class SurveyDetails extends BaseEntity {
/** /**
* 遮挡物 * 遮挡物
*/ */
@TableField("screen") @TableField(value = "screen",typeHandler = FastjsonTypeHandler.class)
private String screen; private List<String> screen;
/** /**
* 遮挡物备注 * 遮挡物备注
...@@ -145,8 +147,8 @@ public class SurveyDetails extends BaseEntity { ...@@ -145,8 +147,8 @@ public class SurveyDetails extends BaseEntity {
/** /**
* 解决措施 * 解决措施
*/ */
@TableField("solution_measures") @TableField(value = "solution_measures",typeHandler = FastjsonTypeHandler.class)
private String solutionMeasures; private List<String> solutionMeasures;
/** /**
* 房屋产权 * 房屋产权
...@@ -265,49 +267,49 @@ public class SurveyDetails extends BaseEntity { ...@@ -265,49 +267,49 @@ public class SurveyDetails extends BaseEntity {
/** /**
* 房屋整体文件标识 * 房屋整体文件标识
*/ */
@TableField("overall_housing_survey") @TableField(value = "overall_housing_survey",typeHandler = FastjsonTypeHandler.class)
private String overallHousingSurvey; private List<Object> overallHousingSurvey;
/** /**
* 房屋周边文件标识 * 房屋周边文件标识
*/ */
@TableField("surrounding_house_survey") @TableField(value = "surrounding_house_survey",typeHandler = FastjsonTypeHandler.class)
private String surroundingHouseSurvey; private List<Object> surroundingHouseSurvey;
/** /**
* 房屋内部整体照片文件标识 * 房屋内部整体照片文件标识
*/ */
@TableField("inside_house_survey") @TableField(value = "inside_house_survey",typeHandler = FastjsonTypeHandler.class)
private String insideHouseSurvey; private List<Object> insideHouseSurvey;
/** /**
* 电表参数文件标识 * 电表参数文件标识
*/ */
@TableField("electricity_survey") @TableField(value = "electricity_survey",typeHandler = FastjsonTypeHandler.class)
private String electricitySurvey; private List<Object> electricitySurvey;
/** /**
* 屋顶全貌文件标识 * 屋顶全貌文件标识
*/ */
@TableField("panorama_survey") @TableField(value = "panorama_survey",typeHandler = FastjsonTypeHandler.class)
private String panoramaSurvey; private List<Object> panoramaSurvey;
/** /**
* 屋顶平面草图文件标识 * 屋顶平面草图文件标识
*/ */
@TableField("plan_sketch_survey") @TableField(value = "plan_sketch_survey",typeHandler = FastjsonTypeHandler.class)
private String planSketchSurvey; private List<Object> planSketchSurvey;
/** /**
* 房屋方位角文件标识 * 房屋方位角文件标识
*/ */
@TableField("azimuth_survey") @TableField(value = "azimuth_survey",typeHandler = FastjsonTypeHandler.class)
private String azimuthSurvey; private List<Object> azimuthSurvey;
/** /**
* 其他附件文件标识 * 其他附件文件标识
*/ */
@TableField("other_accessory_survey") @TableField(value = "other_accessory_survey",typeHandler = FastjsonTypeHandler.class)
private String otherAccessorySurvey; private List<Object> otherAccessorySurvey;
} }
...@@ -17,7 +17,7 @@ import java.util.Date; ...@@ -17,7 +17,7 @@ import java.util.Date;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Accessors(chain = true) @Accessors(chain = true)
@TableName("hygf_survey_information") @TableName(value = "hygf_survey_information",autoResultMap = true)
public class SurveyInformation extends BaseEntity { public class SurveyInformation extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -49,7 +49,7 @@ public class SurveyInformation extends BaseEntity { ...@@ -49,7 +49,7 @@ public class SurveyInformation extends BaseEntity {
/** /**
* 业务员id * 业务员id
*/ */
@TableField("salesman _id") @TableField("salesman_id")
private String salesmanId; private String salesmanId;
/** /**
......
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.hygf.api.entity; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.hygf.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.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
...@@ -112,4 +113,58 @@ public class UnitInfo extends BaseEntity { ...@@ -112,4 +113,58 @@ public class UnitInfo extends BaseEntity {
@TableField("role_id") @TableField("role_id")
private String roleId; private String roleId;
/**
* 管理员账户名
*/
@TableField("admin_user_name")
private String adminUserName;
/**
* 注册地址省-市-区
*/
@TableField("register_pcd")
private String registerPcd;
/**
* 工作地址省-市-区
*/
@TableField("work_Pcd")
private String workPcd;
/**
* 注册地址省-市-区code
*/
@TableField("register_pcd_code")
private String registerPcdCode;
/**
* 工作地址省-市-区code
*/
@TableField("work_pcd_code")
private String workPcdCode;
/**
* 单位类型
*/
@TableField("unit_type")
private String unitType;
/**
* 单位类型code
*/
@TableField("unit_type_code")
private String unitTypeCode;
/**
* 管辖机构
*/
@TableField("management_unit")
private String managementUnit;
/**
* 管辖单位id
*/
@TableField("management_unit_id")
private String managementUnitId;
} }
package com.yeejoin.amos.boot.module.hygf.api.fegin;
import com.yeejoin.amos.boot.biz.common.feign.FeignConfiguration;
import com.yeejoin.amos.component.feign.config.InnerInvokException;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.VerifyCodeAuthModel;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
@FeignClient(value = "AMOS-API-PRIVILEGE", configuration = {FeignConfiguration.class})
public interface PrivilegeFeginService {
@RequestMapping(value = "/privilege/v1/agencyuser/me", method = RequestMethod.GET)
ResponseModel<AgencyUserModel> getMe();
//获取单位树
@RequestMapping(value = "/privilege/v1/company/tree", method = RequestMethod.GET)
FeignClientResult tree(@RequestHeader("token") String token, @RequestHeader("appKey") String appKey, @RequestHeader("product") String product);
//获取省级行政区划
@RequestMapping(value = "systemctl/v1/region/level", method = RequestMethod.GET)
FeignClientResult getProvince(@RequestParam String level);
//获取行政区划树
@RequestMapping(value = "systemctl/v1/region/tree", method = RequestMethod.GET)
FeignClientResult getTree();
/**
* 手机号验证码登录
*/
@RequestMapping(value = "/privilege/v1/auth/mobile/verifycode", method = RequestMethod.POST)
FeignClientResult mobileVerifyCode(@RequestBody VerifyCodeAuthModel model) throws InnerInvokException;
}
package com.yeejoin.amos.boot.module.hygf.api.hwsms;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.net.ssl.*;
import java.io.*;
import java.net.URL;
import java.net.URLEncoder;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.text.SimpleDateFormat;
import java.util.*;
/**
*
* @author DELL
*/
@Component
@Slf4j
public class HwSendSms {
/**
* 无需修改,用于格式化鉴权头域,给"X-WSSE"参数赋值
*/
private static final String WSSE_HEADER_FORMAT = "UsernameToken Username=\"%s\",PasswordDigest=\"%s\",Nonce=\"%s\",Created=\"%s\"";
/**
* 无需修改,用于格式化鉴权头域,给"Authorization"参数赋值
*/
private static final String AUTH_HEADER_VALUE = "WSSE realm=\"SDP\",profile=\"UsernameToken\",type=\"Appkey\"";
private static final String UTF_8 = "UTF-8";
private static final int SUCCESS_STATUS = 200;
private static final int FAIL_STATUS = 500;
@Value("${sms.huawei.url}")
private String url;
@Value("${sms.huawei.appKey}")
private String appKey;
@Value("${sms.huawei.appSecret}")
private String appSecret;
@Value("${sms.huawei.sender}")
private String sender;
@Value("${sms.huawei.signature}")
private String signature;
public int sendSms(String receiver, String templateParas, String templateId) throws Exception {
//选填,短信状态报告接收地址,推荐使用域名,为空或者不填表示不接收状态报告
String statusCallBack = "";
/**
* 选填,使用无变量模板时请赋空值 String templateParas = "";
* 单变量模板示例:模板内容为"您的验证码是${1}"时,templateParas可填写为"[\"369751\"]"
* 双变量模板示例:模板内容为"您有${1}件快递请到${2}领取"时,templateParas可填写为"[\"3\",\"人民公园正门\"]"
* 模板中的每个变量都必须赋值,且取值不能为空
* 查看更多模板和变量规范:产品介绍>模板和变量规范
*/
//模板变量,此处以单变量验证码短信为例,请客户自行生成6位验证码,并定义为字符串类型,以杜绝首位0丢失的问题(例如:002569变成了2569)。
// String templateParas = "[\"12345\"]";
//请求Body,不携带签名名称时,signature请填null
String body = buildRequestBody(sender, receiver, templateId, templateParas, statusCallBack, signature);
if (null == body || body.isEmpty()) {
log.info("body is null.");
return FAIL_STATUS;
}
//请求Headers中的X-WSSE参数值
String wsseHeader = buildWsseHeader(appKey, appSecret);
if (null == wsseHeader || wsseHeader.isEmpty()) {
log.info("wsse header is null.");
return FAIL_STATUS;
}
Writer out = null;
BufferedReader in = null;
StringBuffer result = new StringBuffer();
HttpsURLConnection connection = null;
InputStream is = null;
//为防止因HTTPS证书认证失败造成API调用失败,需要先忽略证书信任问题
HostnameVerifier hv = new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
return true;
}
};
trustAllHttpsCertificates();
try {
URL realUrl = new URL(url);
connection = (HttpsURLConnection) realUrl.openConnection();
connection.setHostnameVerifier(hv);
connection.setDoOutput(true);
connection.setDoInput(true);
connection.setUseCaches(true);
//请求方法
connection.setRequestMethod("POST");
//请求Headers参数
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
connection.setRequestProperty("Authorization", AUTH_HEADER_VALUE);
connection.setRequestProperty("X-WSSE", wsseHeader);
connection.connect();
out = new OutputStreamWriter(connection.getOutputStream());
//发送请求Body参数
out.write(body);
out.flush();
out.close();
int status = connection.getResponseCode();
if (SUCCESS_STATUS == status) {
is = connection.getInputStream();
} else { //400/401
is = connection.getErrorStream();
}
in = new BufferedReader(new InputStreamReader(is, UTF_8));
String line = "";
while ((line = in.readLine()) != null) {
result.append(line);
}
log.info("短信发送返回详情:{}", result.toString());
return status;
} catch (Exception e) {
e.printStackTrace();
return FAIL_STATUS;
} finally {
try {
if (null != out) {
out.close();
}
if (null != is) {
is.close();
}
if (null != in) {
in.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
/**
* 构造请求Body体
* @param sender
* @param receiver
* @param templateId
* @param templateParas
* @param statusCallBack
* @param signature | 签名名称,使用中国大陆短信通用模板时填写
* @return
*/
static String buildRequestBody(String sender, String receiver, String templateId, String templateParas,
String statusCallBack, String signature) {
if (null == sender || null == receiver || null == templateId || sender.isEmpty() || receiver.isEmpty()
|| templateId.isEmpty()) {
System.out.println("buildRequestBody(): sender, receiver or templateId is null.");
return null;
}
Map<String, String> map = new HashMap<String, String>();
map.put("from", sender);
map.put("to", receiver);
map.put("templateId", templateId);
if (null != templateParas && !templateParas.isEmpty()) {
map.put("templateParas", templateParas);
}
if (null != statusCallBack && !statusCallBack.isEmpty()) {
map.put("statusCallback", statusCallBack);
}
if (null != signature && !signature.isEmpty()) {
map.put("signature", signature);
}
StringBuilder sb = new StringBuilder();
String temp = "";
for (String s : map.keySet()) {
try {
temp = URLEncoder.encode(map.get(s), "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
sb.append(s).append("=").append(temp).append("&");
}
return sb.deleteCharAt(sb.length()-1).toString();
}
/**
* 构造X-WSSE参数值
* @param appKey
* @param appSecret
* @return
*/
static String buildWsseHeader(String appKey, String appSecret) {
if (null == appKey || null == appSecret || appKey.isEmpty() || appSecret.isEmpty()) {
System.out.println("buildWsseHeader(): appKey or appSecret is null.");
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
String time = sdf.format(new Date()); //Created
String nonce = UUID.randomUUID().toString().replace("-", ""); //Nonce
MessageDigest md;
byte[] passwordDigest = null;
try {
md = MessageDigest.getInstance("SHA-256");
md.update((nonce + time + appSecret).getBytes());
passwordDigest = md.digest();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
//如果JDK版本是1.8,请加载原生Base64类,并使用如下代码
String passwordDigestBase64Str = Base64.getEncoder().encodeToString(passwordDigest); //PasswordDigest
//如果JDK版本低于1.8,请加载三方库提供Base64类,并使用如下代码
//String passwordDigestBase64Str = Base64.encodeBase64String(passwordDigest); //PasswordDigest
//若passwordDigestBase64Str中包含换行符,请执行如下代码进行修正
//passwordDigestBase64Str = passwordDigestBase64Str.replaceAll("[\\s*\t\n\r]", "");
return String.format(WSSE_HEADER_FORMAT, appKey, passwordDigestBase64Str, nonce, time);
}
/**
* 忽略证书信任问题
* @throws Exception
*/
static void trustAllHttpsCertificates() throws Exception {
TrustManager[] trustAllCerts = new TrustManager[] {
new X509TrustManager() {
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
return;
}
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
return;
}
public X509Certificate[] getAcceptedIssuers() {
return null;
}
}
};
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, null);
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
}
}
package com.yeejoin.amos.boot.module.hygf.api.hwsms;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
/**
* 发送短信验证码
* @author xxz
*/
@Component
public class SendSmsCode {
@Autowired
HwSendSms hwSendSms;
@Value("${sms.huawei.templateId}")
private String templateId;
private static final int SUCCESS_STATUS = 200;
public boolean sendSmsCode (String mobile, String templateParas) throws Exception {
int i = hwSendSms.sendSms(mobile, templateParas, templateId);
return i == SUCCESS_STATUS;
}
}
package com.yeejoin.amos.boot.module.hygf.api.service; package com.yeejoin.amos.boot.module.hygf.api.service;
import com.yeejoin.amos.boot.module.hygf.api.dto.UnitRegisterDto;
import java.util.Collection;
/** /**
* 经销商人员信息接口类 * 经销商人员信息接口类
* *
...@@ -9,4 +13,7 @@ package com.yeejoin.amos.boot.module.hygf.api.service; ...@@ -9,4 +13,7 @@ package com.yeejoin.amos.boot.module.hygf.api.service;
*/ */
public interface IUnitInfoService { public interface IUnitInfoService {
Collection getManagementUnitTree(String orgCode);
UnitRegisterDto registerUnit(UnitRegisterDto model);
} }
package com.yeejoin.amos.boot.module.hygf.biz.controller; package com.yeejoin.amos.boot.module.hygf.biz.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.hygf.api.dto.PeasantHouseholdDtoP;
import com.yeejoin.amos.boot.module.hygf.api.dto.SurveyInformationDto; import com.yeejoin.amos.boot.module.hygf.api.dto.SurveyInformationDto;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.SurveyInformationServiceImpl; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.SurveyInformationServiceImpl;
import com.yeejoin.amos.component.feign.model.FeignClientResult; 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.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel; import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -16,8 +17,8 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -16,8 +17,8 @@ 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.ArrayList;
import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.Date;
import java.util.List; import java.util.List;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.PeasantHouseholdServiceImpl; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.PeasantHouseholdServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
...@@ -60,28 +61,43 @@ public class PeasantHouseholdController extends BaseController { ...@@ -60,28 +61,43 @@ public class PeasantHouseholdController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增农户信息", notes = "新增农户信息") @ApiOperation(httpMethod = "POST", value = "新增农户信息", notes = "新增农户信息")
public ResponseModel<PeasantHouseholdDto> save(@RequestBody PeasantHouseholdDtoP model) { public ResponseModel<PeasantHouseholdDto> save(@RequestBody PeasantHouseholdDto model) {
AgencyUserModel userInfo = getUserInfo();
SurveyInformationDto surveyInformationDto = new SurveyInformationDto(); SurveyInformationDto surveyInformationDto = new SurveyInformationDto();
surveyInformationServiceImpl.createWithModel(surveyInformationDto); surveyInformationServiceImpl.createWithModel(surveyInformationDto);
JSONArray regionName = getRegionName(); JSONArray regionName = getRegionName();
List<RegionModel> list = JSONArray.parseArray(regionName.toJSONString(), RegionModel.class); List<RegionModel> list = JSONArray.parseArray(regionName.toJSONString(), RegionModel.class);
if(StringUtils.isEmpty(model.getProjectAddressName())){
// 处理地址 // 处理地址
String area = ""; String area = "";
for (Integer reg : model.getProjectAddress())
for (String reg : model.getFarmerInformation().getProjectAddressArr()) for (RegionModel re : list) {
for (RegionModel re : list) { if (re.getRegionCode().equals(Integer.valueOf(reg))) {
if (re.getRegionCode().equals(Integer.valueOf(reg))) { area = area + re.getRegionName() + "/";
area = area + re.getRegionName() + "/"; }
} }
model.setProjectAddressName(area.substring(0, area.length() - 2)+"/"+model.getProjectAddressDetail());
}
if ("1".equals(model.getIsPermanent())) {
model.setPermanentAddress(model.getProjectAddress());
model.setPermanentAddressDetail(model.getProjectAddressDetail());
} }
model.getFarmerInformation().setProjectAddressName(area.substring(0, area.length() - 2)); model.setSurveyInformationId(surveyInformationDto.getSequenceNbr());
model.setSurveyOrNot(0);
model.setReview(0);
model.getFarmerInformation().setProjectAddress(StringUtils.joinWith(",", model.getFarmerInformation().getProjectAddressArr())); if(StringUtils.isEmpty(model.getDeveloperCode())){
model.getFarmerInformation().setPermanentAddress(StringUtils.joinWith(",", model.getFarmerInformation().getPermanentAddressArr())); model.setDeveloperCode(userInfo.getAgencyCode());
model.getFarmerInformation().setSurveyInformationId(surveyInformationDto.getSequenceNbr()); }
PeasantHouseholdDto householdDto = peasantHouseholdServiceImpl.createWithModel(model.getFarmerInformation()); model.setDeveloperName(userInfo.getOrgNamesWithoutRole());
if(StringUtils.isEmpty(model.getDeveloper())){
model.setDeveloper(userInfo.getRealName());
}
if(model.getCreationTime() == null){
model.setCreationTime(new Date());
}
PeasantHouseholdDto householdDto = peasantHouseholdServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(householdDto); return ResponseHelper.buildResponse(householdDto);
} }
...@@ -96,6 +112,34 @@ public class PeasantHouseholdController extends BaseController { ...@@ -96,6 +112,34 @@ public class PeasantHouseholdController extends BaseController {
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新农户信息", notes = "根据sequenceNbr更新农户信息") @ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新农户信息", notes = "根据sequenceNbr更新农户信息")
public ResponseModel<PeasantHouseholdDto> updateBySequenceNbrPeasantHousehold(@RequestBody PeasantHouseholdDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) { public ResponseModel<PeasantHouseholdDto> updateBySequenceNbrPeasantHousehold(@RequestBody PeasantHouseholdDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr); model.setSequenceNbr(sequenceNbr);
JSONArray regionName = getRegionName();
List<RegionModel> list = JSONArray.parseArray(regionName.toJSONString(), RegionModel.class);
if(model.getProjectAddress().size()>0){
// 处理项目地址
String projectAddressName = "";
for (Integer reg : model.getProjectAddress())
for (RegionModel re : list) {
if (re.getRegionCode().equals(Integer.valueOf(reg))) {
projectAddressName = projectAddressName + re.getRegionName() + "/";
}
}
model.setProjectAddressName(projectAddressName.substring(0, projectAddressName.length() - 2));
}
if ("1".equals(model.getIsPermanent())) {
model.setPermanentAddress(model.getProjectAddress());
model.setPermanentAddressDetail(model.getProjectAddressDetail());
}
if(model.getPermanentAddress().size()>0){
// 处理常驻地址
String permanentAddressName = "";
for (Integer reg : model.getPermanentAddress())
for (RegionModel re : list) {
if (re.getRegionCode().equals(Integer.valueOf(reg))) {
permanentAddressName = permanentAddressName + re.getRegionName() + "/";
}
}
model.setPermanentAddressName(permanentAddressName.substring(0, permanentAddressName.length() - 2));
}
return ResponseHelper.buildResponse(peasantHouseholdServiceImpl.updateWithModel(model)); return ResponseHelper.buildResponse(peasantHouseholdServiceImpl.updateWithModel(model));
} }
...@@ -109,7 +153,7 @@ public class PeasantHouseholdController extends BaseController { ...@@ -109,7 +153,7 @@ public class PeasantHouseholdController extends BaseController {
@DeleteMapping(value = "/{sequenceNbr}") @DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除农户信息", notes = "根据sequenceNbr删除农户信息") @ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除农户信息", notes = "根据sequenceNbr删除农户信息")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){ public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(peasantHouseholdServiceImpl.removeById(sequenceNbr)); return ResponseHelper.buildResponse(peasantHouseholdServiceImpl.deletePeasantHouseholdBySequenceNbr(sequenceNbr));
} }
/** /**
...@@ -122,7 +166,13 @@ public class PeasantHouseholdController extends BaseController { ...@@ -122,7 +166,13 @@ public class PeasantHouseholdController extends BaseController {
@GetMapping(value = "/{sequenceNbr}") @GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个农户信息", notes = "根据sequenceNbr查询单个农户信息") @ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个农户信息", notes = "根据sequenceNbr查询单个农户信息")
public ResponseModel<PeasantHouseholdDto> selectOne(@PathVariable Long sequenceNbr) { public ResponseModel<PeasantHouseholdDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(peasantHouseholdServiceImpl.queryBySeq(sequenceNbr)); PeasantHouseholdDto peasantHouseholdDto = peasantHouseholdServiceImpl.queryBySeq(sequenceNbr);
if(JSON.toJSONString(peasantHouseholdDto.getProjectAddress()).equals(JSON.toJSONString(peasantHouseholdDto.getPermanentAddress()))){
peasantHouseholdDto.setIsPermanent("1");
}else {
peasantHouseholdDto.setIsPermanent("0");
}
return ResponseHelper.buildResponse(peasantHouseholdDto);
} }
/** /**
...@@ -135,12 +185,14 @@ public class PeasantHouseholdController extends BaseController { ...@@ -135,12 +185,14 @@ public class PeasantHouseholdController 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<PeasantHouseholdDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam public ResponseModel<Page<PeasantHouseholdDto>> queryForPage(@RequestParam(value = "current") int current,
(value = "size") int size) { @RequestParam(value = "size") int size,
@RequestParam(value = "ownersName",required = false)String ownersName) {
Page<PeasantHouseholdDto> page = new Page<PeasantHouseholdDto>(); Page<PeasantHouseholdDto> page = new Page<PeasantHouseholdDto>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(peasantHouseholdServiceImpl.queryForPeasantHouseholdPage(page)); AgencyUserModel userInfo = getUserInfo();
return ResponseHelper.buildResponse(peasantHouseholdServiceImpl.queryForPeasantHouseholdPage(page,userInfo.getAgencyCode(),ownersName));
} }
/** /**
......
...@@ -123,8 +123,9 @@ public class SurveyInformationController extends BaseController { ...@@ -123,8 +123,9 @@ public class SurveyInformationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST",value = "勘察信息数据提交", notes = "勘察信息数据提交") @ApiOperation(httpMethod = "POST",value = "勘察信息数据提交", notes = "勘察信息数据提交")
@PostMapping(value = "/surveySubmit") @PostMapping(value = "/surveySubmit")
public ResponseModel<SurveyInfoAllDto> surveySubmit(@RequestBody SurveyInfoAllDto surveyInfoAllDto ) { public ResponseModel<SurveyInfoAllDto> surveySubmit(@RequestBody SurveyInfoAllDto surveyInfoAllDto,
SurveyInfoAllDto returnDto = surveyInformationServiceImpl.saveSurveyInfo(surveyInfoAllDto); @RequestParam(value = "operationType") String operationType) {
SurveyInfoAllDto returnDto = surveyInformationServiceImpl.saveSurveyInfo(surveyInfoAllDto,operationType);
return ResponseHelper.buildResponse(returnDto); return ResponseHelper.buildResponse(returnDto);
} }
......
package com.yeejoin.amos.boot.module.hygf.biz.controller; package com.yeejoin.amos.boot.module.hygf.biz.controller;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.hygf.api.dto.UnitRegisterDto;
import com.yeejoin.amos.boot.module.hygf.api.hwsms.SendSmsCode;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.component.robot.AmosRequestContext;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import io.swagger.annotations.ApiParam;
import org.apache.poi.util.ArrayUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
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.List;
import java.util.*;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.UnitInfoServiceImpl; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.UnitInfoServiceImpl;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
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 org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -24,25 +45,31 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType; ...@@ -24,25 +45,31 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
* @date 2023-07-07 * @date 2023-07-07
*/ */
@RestController @RestController
@Api(tags = "经销商人员信息Api") @Api(tags = "经销商单位信息Api")
@RequestMapping(value = "/unit-info") @RequestMapping(value = "/unit-info")
public class UnitInfoController extends BaseController { public class UnitInfoController extends BaseController {
@Autowired @Autowired
UnitInfoServiceImpl unitInfoServiceImpl; UnitInfoServiceImpl unitInfoServiceImpl;
/** @Autowired
* 新增经销商人员信息 AmosRequestContext requestContext;
*
* @return @Autowired
*/ RedisUtils redisUtil;
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save") @Value("${hygf.sms.tempCode}")
@ApiOperation(httpMethod = "POST", value = "新增经销商人员信息", notes = "新增经销商人员信息") private String smsTempCode;
public ResponseModel<UnitInfoDto> save(@RequestBody UnitInfoDto model) {
model = unitInfoServiceImpl.createWithModel(model); @Autowired
return ResponseHelper.buildResponse(model); SendSmsCode sendSmsCode;
}
public static final String HYGF_USER_TEL = "hygf_tel_";
/**
* 验证码过期时间
*/
private long time = 180L;
/** /**
* 根据sequenceNbr更新 * 根据sequenceNbr更新
...@@ -113,4 +140,160 @@ public class UnitInfoController extends BaseController { ...@@ -113,4 +140,160 @@ public class UnitInfoController extends BaseController {
public ResponseModel<List<UnitInfoDto>> selectForList() { public ResponseModel<List<UnitInfoDto>> selectForList() {
return ResponseHelper.buildResponse(unitInfoServiceImpl.queryForUnitInfoList()); return ResponseHelper.buildResponse(unitInfoServiceImpl.queryForUnitInfoList());
} }
/**
* 管理员身份证图片上传 无token
*
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@PostMapping(value = "/uploadFile")
@ApiOperation(httpMethod = "POST", value = "管理员身份证图片上传 无token", notes = "管理员身份证图片上传 无token")
public ResponseModel<String> uploadFile(@ApiParam(value = "文件", required = true)@RequestParam MultipartFile file) {
if (ValidationUtil.isEmpty(file)){
throw new BadRequest("参数校验失败.");
}
RequestContext.setAppKey("AMOS_STUDIO");
RequestContext.setProduct("AMOS_STUDIO_WEB");
RequestContext.setToken(requestContext.getToken());
FeignClientResult<Map<String, String>> date = Systemctl.fileStorageClient.updateCommonFile(file);
String urlString="";
if (date != null) {
Map<String, String> map = date.getResult();
Iterator<String> it = map.keySet().iterator();
while (it.hasNext()) {
urlString=it.next();
}
}
return ResponseHelper.buildResponse(urlString);
}
/**
* 获取组织机构树
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/region/tree")
@ApiOperation(httpMethod = "GET", value = "获取组织机构树", notes = "获取组织机构树")
public ResponseModel<Collection<RegionModel>> getRegionTree() {
RequestContext.setAppKey("AMOS_STUDIO");
RequestContext.setProduct("AMOS_STUDIO_WEB");
RequestContext.setToken(requestContext.getToken());
return ResponseHelper.buildResponse(Systemctl.regionClient.queryForTree(null).getResult());
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/management-unit/tree")
@ApiOperation(httpMethod = "GET", value = "管辖机构树", notes = "管辖机构树")
public ResponseModel<Collection> managementUnitTree(@RequestParam(required = false)String orgCode) {
RequestContext.setAppKey("AMOS_STUDIO");
RequestContext.setProduct("AMOS_STUDIO_WEB");
RequestContext.setToken(requestContext.getToken());
Collection result = unitInfoServiceImpl.getManagementUnitTree(orgCode);
return ResponseHelper.buildResponse(result);
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/unitRegister")
@ApiOperation(httpMethod = "POST", value = "单位注册", notes = "单位注册")
public ResponseModel<UnitRegisterDto> save(@RequestBody UnitRegisterDto model) {
try {
RequestContext.setAppKey("AMOS_STUDIO");
RequestContext.setProduct("AMOS_STUDIO_WEB");
RequestContext.setToken(requestContext.getToken());
model = unitInfoServiceImpl.registerUnit(model);
return ResponseHelper.buildResponse(model);
} catch (Exception e) {
ResponseModel<UnitRegisterDto> response = new ResponseModel<>();
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
response.setResult(null);
response.setDevMessage(e.getMessage());
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
response.setTraceId(RequestContext.getTraceId());
response.setPath(request.getServletPath());
return response;
}
}
/**
* 判断用户号码是否存在
*
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/hasExistPhone/{phone}")
@ApiOperation(httpMethod = "GET", value = "判断用户号码是否存在", notes = "判断用户号码是否存在")
public ResponseModel hasExistPhone( @PathVariable(value = "phone") String phone) {
try {
return CommonResponseUtil.success(Privilege.agencyUserClient.checkLoginId(phone).getResult());
} catch (Exception e) {
return CommonResponseUtil.failure("该手机号已经注册");
}
}
/**
* 发送手机号验证码
*
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/sendTelCode/{tel}")
@ApiOperation(httpMethod = "GET", value = "发送手机号验证码", notes = "发送手机号验证码")
public ResponseModel<Boolean> sendTelCode(@PathVariable(value = "tel") String tel,
@RequestParam(value = "type", required = false) String type) {
if (ValidationUtil.isEmpty(tel)) {
throw new BadRequest("参数校验失败.");
}
Boolean flag = true;
HashMap<String, String> params = new HashMap<>(3);
String code = this.getRandomCode();
params.put("code",code);
params.put("mobile",tel);
params.put("smsCode", smsTempCode);
try {
// sendSmsCode.sendSmsCode(tel, s);
Systemctl.smsClient.sendCommonSms(params).getResult();
// code 保存到缓存中
redisUtil.set(HYGF_USER_TEL + tel, code, time);
} catch (Exception e) {
throw new BadRequest("发送短信失败:" + e.getMessage());
}
return ResponseHelper.buildResponse(flag);
}
/**
* 验证手机号验证码是否成功
*
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/verifyTelCode/{tel}/{code}")
@ApiOperation(httpMethod = "GET", value = "验证手机号验证码是否成功", notes = "验证手机号验证码是否成功")
public ResponseModel<Boolean> verifyTelCode(@PathVariable(value = "tel") String adminTel, @PathVariable(value = "code") String code) {
Boolean flag = false;
if (ValidationUtil.isEmpty(adminTel) || ValidationUtil.isEmpty(code)) {
throw new BadRequest("参数校验失败.");
}
if(redisUtil.hasKey(HYGF_USER_TEL + adminTel)) {
String redisCode = redisUtil.get(HYGF_USER_TEL + adminTel).toString();
if(code.equals(redisCode)) {
flag = true;
}
}
return ResponseHelper.buildResponse(flag);
}
private String getRandomCode(){
String code = "";
Random random = new Random();
for (int i = 0; i < 6; i++) {
int r = random.nextInt(10);
code = code + r;
}
return code;
}
} }
package com.yeejoin.amos.boot.module.hygf.biz.service.impl; package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.Commercial;
import com.yeejoin.amos.boot.module.hygf.api.entity.ExtendedInformation;
import com.yeejoin.amos.boot.module.hygf.api.entity.Information;
import com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold; import com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold;
import com.yeejoin.amos.boot.module.hygf.api.entity.SurveyDetails;
import com.yeejoin.amos.boot.module.hygf.api.mapper.PeasantHouseholdMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.PeasantHouseholdMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IPeasantHouseholdService; import com.yeejoin.amos.boot.module.hygf.api.service.IPeasantHouseholdService;
import com.yeejoin.amos.boot.module.hygf.api.dto.PeasantHouseholdDto; import com.yeejoin.amos.boot.module.hygf.api.dto.PeasantHouseholdDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* 农户信息服务实现类 * 农户信息服务实现类
...@@ -17,11 +26,66 @@ import java.util.List; ...@@ -17,11 +26,66 @@ import java.util.List;
*/ */
@Service @Service
public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto,PeasantHousehold,PeasantHouseholdMapper> implements IPeasantHouseholdService { public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto,PeasantHousehold,PeasantHouseholdMapper> implements IPeasantHouseholdService {
@Autowired
SurveyInformationServiceImpl surveyInformationService;
@Autowired
SurveyDetailsServiceImpl surveyDetailsService;
@Autowired
InformationServiceImpl informationService;
@Autowired
ExtendedInformationServiceImpl extendedInformationService;
@Autowired
CommercialServiceImpl commercialService;
public boolean deletePeasantHouseholdBySequenceNbr(Long sequenceNbr){
PeasantHouseholdDto peasantHouseholdDto = this.queryBySeq(sequenceNbr);
Long surveyInformationId = peasantHouseholdDto.getSurveyInformationId();
//删除勘察基本信息
surveyInformationService.deleteBySeq(surveyInformationId);
//删除扩展信息
QueryWrapper<ExtendedInformation> extendedInformationDeleteWrapper = new QueryWrapper<>();
extendedInformationDeleteWrapper.lambda().eq(ExtendedInformation::getSurveyInformationId,surveyInformationId);
extendedInformationService.getBaseMapper().delete(extendedInformationDeleteWrapper);
//删除勘察明细
QueryWrapper<SurveyDetails> surveyDetailsDeleteWrapper = new QueryWrapper<>();
surveyDetailsDeleteWrapper.lambda().eq(SurveyDetails::getSurveyInformationId,surveyInformationId);
surveyDetailsService.getBaseMapper().delete(surveyDetailsDeleteWrapper);
//删除商务信息
QueryWrapper<Commercial> commercialDeleteWrapper = new QueryWrapper<>();
commercialDeleteWrapper.lambda().eq(Commercial::getSurveyInformationId,surveyInformationId);
commercialService.getBaseMapper().delete(commercialDeleteWrapper);
//删除资料归档信息
QueryWrapper<Information> informationDeleteWrapper = new QueryWrapper<>();
informationDeleteWrapper.lambda().eq(Information::getSurveyInformationId,surveyInformationId);
informationService.getBaseMapper().delete(informationDeleteWrapper);
//删除农户信息
return this.deleteBySeq(sequenceNbr);
}
/** /**
* 分页查询 * 分页查询
*/ */
public Page<PeasantHouseholdDto> queryForPeasantHouseholdPage(Page<PeasantHouseholdDto> page) { public Page<PeasantHouseholdDto> queryForPeasantHouseholdPage(Page<PeasantHouseholdDto> page,String developerCode,@Condition(Operator.like) String ownersName) {
return this.queryForPage(page, null, false); Page<PeasantHouseholdDto> peasantHouseholdDtoPage = this.queryForPage(page, null, false,developerCode,ownersName);
List<PeasantHouseholdDto> records = peasantHouseholdDtoPage.getRecords();
List<PeasantHouseholdDto> newRecords = records.stream().map(item -> {
if (item.getSurveyOrNot() == 0) {
item.setSurveyOrNotText("待勘察");
} else if (item.getSurveyOrNot() == 1) {
item.setSurveyOrNotText("已勘察");
} else if (item.getSurveyOrNot() == 2) {
item.setSurveyOrNotText("提交审核");
}
item.setProjectAddressName(item.getProjectAddressName()+"/"+item.getProjectAddressDetail());
return item;
}).collect(Collectors.toList());
peasantHouseholdDtoPage.setRecords(newRecords);
return peasantHouseholdDtoPage;
} }
/** /**
......
## DB properties: ## DB properties:
spring.datasource.url=jdbc:mysql://172.16.10.220:3306/production?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8 spring.datasource.url=jdbc:mysql://172.16.10.220:3306/hygf_database?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=Yeejoin@2020 spring.datasource.password=Yeejoin@2020
## eureka properties: ## eureka properties:
...@@ -85,3 +85,20 @@ spring.activemq.user=admin ...@@ -85,3 +85,20 @@ spring.activemq.user=admin
spring.activemq.password=admin spring.activemq.password=admin
spring.jms.pub-sub-domain=false spring.jms.pub-sub-domain=false
myqueue=amos.privilege.v1.JXIOP.AQSC_FDGL.userBusiness myqueue=amos.privilege.v1.JXIOP.AQSC_FDGL.userBusiness
regulator.unit.code=86*258
# 经销商应用code
dealer.appcode=studio_normalapp_5133538
hygf.sms.tempCode=SMS_HYGF_0001
# 华为短信相关配置
sms.huawei.url=https://smsapi.cn-north-4.myhuaweicloud.com:443/sms/batchSendSms/v1
sms.huawei.appKey=n3FYPWO7Heo1ze212QRBvF4VA2E2
sms.huawei.appSecret=IFhiMpWROi7w4Ei21ZbfIjKyt97b
# 模板id
sms.huawei.templateId=6aaeb4bf916d4db0a1942c598912519e
# 签名通道号
sms.huawei.sender=1069368924410006092
# 签名名称
sms.huawei.signature=华为云短信测试
\ No newline at end of file
...@@ -60,3 +60,8 @@ spring.http.encoding.force=true ...@@ -60,3 +60,8 @@ spring.http.encoding.force=true
privilege.fegin.name=AMOS-API-PRIVILEGE privilege.fegin.name=AMOS-API-PRIVILEGE
feign.client.config.default.connect-timeout=20000 feign.client.config.default.connect-timeout=20000
feign.client.config.default.read-timeout=20000 feign.client.config.default.read-timeout=20000
amos.system.user.user-name=hygf_admin
amos.system.user.password=a1234567
amos.system.user.product=AMOS_STUDIO_WEB
amos.system.user.app-key=AMOS_STUDIO
...@@ -35,4 +35,6 @@ public interface MonitorFanIndicatorMapper extends BaseMapper<MonitorFanIndicato ...@@ -35,4 +35,6 @@ public interface MonitorFanIndicatorMapper extends BaseMapper<MonitorFanIndicato
Object getIndicatoralueTotal(String gateway,String indicator); Object getIndicatoralueTotal(String gateway,String indicator);
List<Map<String, String>> getFanConfigPower(@Param("gatewayId") String gatewayId); List<Map<String, String>> getFanConfigPower(@Param("gatewayId") String gatewayId);
List<Map<String, String>> getBoosterStationInfo(@Param("gatewayId") String gatewayId);
} }
...@@ -88,4 +88,27 @@ ...@@ -88,4 +88,27 @@
from fan_config_power from fan_config_power
where gateway_id = #{gatewayId} where gateway_id = #{gatewayId}
</select> </select>
<select id="getBoosterStationInfo" resultType="java.util.Map">
select
`sequence_nbr` as id,
`gateway_id` as gatewayId,
`booster_name` as text,
booster_name as value,
<!-- `booster_code` as value,-->
`sort` as sort
from booster_station_info
<where>
<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>
ORDER BY sort ASC
</select>
</mapper> </mapper>
...@@ -10,6 +10,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator; ...@@ -10,6 +10,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator;
import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic; import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.MonitorFanIndicatorMapper; import com.yeejoin.amos.boot.module.jxiop.api.mapper.MonitorFanIndicatorMapper;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper; import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IndicatorsDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.Test; import com.yeejoin.amos.boot.module.jxiop.biz.entity.Test;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.SjglZsjZsbtzServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.SjglZsjZsbtzServiceImpl;
...@@ -23,10 +24,13 @@ import io.swagger.annotations.ApiOperation; ...@@ -23,10 +24,13 @@ import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
...@@ -70,58 +74,63 @@ public class DemoController extends BaseController { ...@@ -70,58 +74,63 @@ public class DemoController extends BaseController {
public StationBasic demoTest() { public StationBasic demoTest() {
return stationBasicServiceimpl.getById(1660231556607774721L); return stationBasicServiceimpl.getById(1660231556607774721L);
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "demo测试中间库") @ApiOperation(value = "demo测试中间库")
@GetMapping("/test1") @GetMapping("/test1")
public List<Test> demoTest1() { public List<Test> demoTest1() {
return testServiceimpl.getList(); return testServiceimpl.getList();
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "demo测试influxdb") @ApiOperation(value = "demo测试influxdb")
@GetMapping("/test3") @GetMapping("/test3")
public void demoTest2() { public void demoTest2() {
String sql = "SELECT createdTime ,gatewayId,address,valueLabel FROM \"iot_data\" WHERE equipmentSpecificName=~/.*27风机.*/ and gatewayId='1668801435891929089' GROUP BY equipmentIndex ORDER BY time desc LIMIT 600"; String sql = "SELECT * FROM indicators_1668801435891929089";
List<IndexDto> list=influxDButils.getListData(sql,IndexDto.class); String sql1 = "SELECT * FROM indicators_1668801570352926721";
List<IndicatorsDto> list = influxDButils.getListData(sql, IndicatorsDto.class);
List<IndicatorsDto> list2 = influxDButils.getListData(sql1, IndicatorsDto.class);
System.out.println(list.size()); System.out.println(list.size());
System.out.println(list2.size());
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "测试获取风速平均值") @ApiOperation(value = "初始化风机")
@GetMapping("/test4") @GetMapping("/test4")
public void demoTest3() { public void demoTest3() {
// Object o=this.monitorFanIndicatorImpl.getIndicatoralueAvage("1668801435891929089","60秒平均风速"); // Object o=this.monitorFanIndicatorImpl.getIndicatoralueAvage("1668801435891929089","60秒平均风速");
// System.out.println(o.toString()); // System.out.println(o.toString());
QueryWrapper<MonitorFanIndicator> QueryWrapper= new QueryWrapper<>(); QueryWrapper<MonitorFanIndicator> QueryWrapper = new QueryWrapper<>();
QueryWrapper.eq("gateway","1668801435891929089"); QueryWrapper.eq("gateway", "1668801435891929089");
long DATE =new Date().getTime(); long DATE = new Date().getTime();
System.out.println(DATE); System.out.println(DATE);
List<MonitorFanIndicator> list=monitorFanIndicatorregionMapper.selectList(QueryWrapper); List<MonitorFanIndicator> list = monitorFanIndicatorregionMapper.selectList(QueryWrapper);
for (MonitorFanIndicator monitorFanIndicator : list) { for (MonitorFanIndicator monitorFanIndicator : list) {
Map<String, String> tag = new HashMap<>(); Map<String, String> tag = new HashMap<>();
Map<String, Object> maps2 = new HashMap<>(); Map<String, Object> maps2 = new HashMap<>();
tag.put("address",monitorFanIndicator.getIndexAddress() ); tag.put("address", monitorFanIndicator.getIndexAddress());
tag.put("dataType", monitorFanIndicator.getDataType()); tag.put("dataType", monitorFanIndicator.getDataType());
tag.put("equipmentSpecificName",monitorFanIndicator.getFanCode() ); tag.put("equipmentSpecificName", monitorFanIndicator.getFanCode());
tag.put("equipmentsIdx",monitorFanIndicator.getAddressGateway() ); tag.put("equipmentsIdx", monitorFanIndicator.getAddressGateway());
tag.put("gatewayId", monitorFanIndicator.getGateway()); tag.put("gatewayId", monitorFanIndicator.getGateway());
tag.put("isAlarm", monitorFanIndicator.getIsAlarm()); tag.put("isAlarm", monitorFanIndicator.getIsAlarm());
maps2.put("createdTime", "2023-07-05 18:30:26"); // maps2.put("createdTime", "2023-07-05 18:30:26");
maps2.put("unit", monitorFanIndicator.getUnit()); // maps2.put("unit", monitorFanIndicator.getUnit());
maps2.put("value", ""); // maps2.put("value", "");
maps2.put("valueLabel","" ); // maps2.put("valueLabel","" );
maps2.put("traceId", ""); // maps2.put("traceId", "");
maps2.put("equipmentIndexName", monitorFanIndicator.getIndicator()); // maps2.put("equipmentIndexName", monitorFanIndicator.getIndicator());
maps2.put("equipmentNumber", monitorFanIndicator.getEquipmentNumber()); // maps2.put("equipmentNumber", monitorFanIndicator.getEquipmentNumber());
maps2.put("frontModule", monitorFanIndicator.getFrontModule()); maps2.put("frontModule", monitorFanIndicator.getFrontModule());
maps2.put("systemType", monitorFanIndicator.getSystemType()); maps2.put("systemType", monitorFanIndicator.getSystemType());
influxDbConnection.insert("indicators_"+monitorFanIndicator.getGateway(), tag, maps2,1688558007051L, TimeUnit.MILLISECONDS); influxDbConnection.insert("indicators_" + monitorFanIndicator.getGateway(), tag, maps2, 1688558007051L, TimeUnit.MILLISECONDS);
} }
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
...@@ -129,8 +138,8 @@ public class DemoController extends BaseController { ...@@ -129,8 +138,8 @@ public class DemoController extends BaseController {
@GetMapping("/test5") @GetMapping("/test5")
public void demoTest4() { public void demoTest4() {
HashMap<String, String> hashMap = new HashMap<>(); HashMap<String, String> hashMap = new HashMap<>();
hashMap.put("test", String.valueOf(Math.random() *1000)); hashMap.put("test", String.valueOf(Math.random() * 1000));
hashMap.put("test1", String.valueOf(Math.random() *100)); hashMap.put("test1", String.valueOf(Math.random() * 100));
try { try {
emqKeeper.getMqttClient().publish("test_topic", JSON.toJSON(hashMap).toString().getBytes("UTF-8"), 1, true); emqKeeper.getMqttClient().publish("test_topic", JSON.toJSON(hashMap).toString().getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish("test_topic1", JSON.toJSON(hashMap).toString().getBytes("UTF-8"), 1, true); emqKeeper.getMqttClient().publish("test_topic1", JSON.toJSON(hashMap).toString().getBytes("UTF-8"), 1, true);
...@@ -140,5 +149,58 @@ public class DemoController extends BaseController { ...@@ -140,5 +149,58 @@ public class DemoController extends BaseController {
} }
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "初始化升压站")
@GetMapping("/test6")
public void demoTest5() {
//!!!!!!!!!!!!!!注意 初始化升压站的时候需要先更新monitor_fan_indicator_copy2表数据 且修改entity的表映射为monitor_fan_indicator_copy2
QueryWrapper<MonitorFanIndicator> QueryWrapper = new QueryWrapper<>();
QueryWrapper.eq("gateway", "1668801570352926721");
long DATE = new Date().getTime();
System.out.println(DATE);
List<MonitorFanIndicator> list = monitorFanIndicatorregionMapper.selectList(QueryWrapper);
for (MonitorFanIndicator monitorFanIndicator : list) {
Map<String, String> tag = new HashMap<>();
Map<String, Object> maps2 = new HashMap<>();
//-------------------tag----------
tag.put("address", monitorFanIndicator.getIndexAddress());
tag.put("dataType", monitorFanIndicator.getDataType());
tag.put("equipmentSpecificName", monitorFanIndicator.getFanCode());
tag.put("equipmentsIdx", monitorFanIndicator.getAddressGateway());
tag.put("gatewayId", monitorFanIndicator.getGateway());
tag.put("isAlarm", monitorFanIndicator.getIsAlarm());
//--------------------field------------------------
maps2.put("createdTime", "2023-07-05 18:30:26");
maps2.put("unit", "");
maps2.put("value", "");
maps2.put("valueLabel", "");
maps2.put("traceId", "");
maps2.put("equipmentIndexName", monitorFanIndicator.getIndicator());
maps2.put("equipmentNumber", "");
maps2.put("frontModule", "");
maps2.put("systemType", "");
//升压站的字段显示名称
maps2.put("displayName", monitorFanIndicator.getEquipmentNumber());
if (!ObjectUtils.isEmpty(monitorFanIndicator.getFrontModule())) {
maps2.put("frontModule", monitorFanIndicator.getFrontModule());
}
if (!ObjectUtils.isEmpty(monitorFanIndicator.getSystemType())) {
maps2.put("systemType", monitorFanIndicator.getSystemType());
}
if (!ObjectUtils.isEmpty(monitorFanIndicator.getUnit())) {
maps2.put("unit", monitorFanIndicator.getUnit());
}
influxDbConnection.insert("indicators_" + monitorFanIndicator.getGateway(), tag, maps2, 1688558007051L, TimeUnit.MILLISECONDS);
}
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "测试动态图片")
@GetMapping("/test7")
public ResponseModel<HashMap<String, String>> demoTest6() {
HashMap<String, String> hashMap = new HashMap<>();
hashMap.put("url", "upload/jxiop/amos_studio/758F6F4BC695B777899485DB0C7E5D3.gif");
return ResponseHelper.buildResponse(hashMap);
}
} }
...@@ -11,10 +11,12 @@ import com.yeejoin.amos.boot.module.jxiop.api.dto.TreeDto; ...@@ -11,10 +11,12 @@ import com.yeejoin.amos.boot.module.jxiop.api.dto.TreeDto;
import com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator; import com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator;
import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic; import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper; import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.ResultsData;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.elasticsearch.index.Index;
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.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -26,6 +28,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -26,6 +28,7 @@ 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.io.File;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -53,6 +56,9 @@ public class MonitorFanIdxController extends BaseController { ...@@ -53,6 +56,9 @@ public class MonitorFanIdxController extends BaseController {
@Value("${gl.avg.column}") @Value("${gl.avg.column}")
String avgColumn; String avgColumn;
@Value("${fan.statuts.stattuspath}")
private String fanStatusImagePathPrefix;
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据设备编号、场站id、前段展示模块、系统类型查询表数据") @ApiOperation(value = "根据设备编号、场站id、前段展示模块、系统类型查询表数据")
@GetMapping("/getFanIdxInfoByPage") @GetMapping("/getFanIdxInfoByPage")
...@@ -91,6 +97,31 @@ public class MonitorFanIdxController extends BaseController { ...@@ -91,6 +97,31 @@ public class MonitorFanIdxController extends BaseController {
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "风机布置图 - 风机状态图片")
@GetMapping("/getFanStatusListImage")
public ResponseModel<IPage<HashMap<String,String>>> getFanStatusListImages() {
List<IndexDto> fanStatusList = monitorFanIndicator.getFanStatusList("1660231556607774721");
List<IndexDto> collect = fanStatusList.stream()
.limit(999)
.collect(Collectors.toList());
IPage<HashMap<String,String>> page = new Page<>();
HashMap<String,String> hashMap = new HashMap<>();
List<IndexDto> indexDtoList = collect.stream().sorted(Comparator.comparing(IndexDto::getEquipmentNumber)).collect(Collectors.toList());
for (int i = 1; i <= indexDtoList.size(); i++) {
IndexDto indexDto = indexDtoList.get(i-1);
hashMap.put("url"+i,fanStatusImagePathPrefix+"/"+"风机-"+indexDto.getState()+".gif");
hashMap.put("name"+i,indexDto.getEquipmentNumber());
}
page.setTotal(10);
page.setSize(10);
page.setCurrent(1);
List<HashMap<String,String>> hashMapList = new ArrayList<>();
hashMapList.add(hashMap);
page.setRecords(hashMapList);
return ResponseHelper.buildResponse(page);
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "风机布置图 - 风机数量") @ApiOperation(value = "风机布置图 - 风机数量")
@GetMapping("/getFanNum") @GetMapping("/getFanNum")
public ResponseModel<Integer> getFanNum(@RequestParam(value = "stationId", required = false) String stationId) { public ResponseModel<Integer> getFanNum(@RequestParam(value = "stationId", required = false) String stationId) {
...@@ -251,6 +282,7 @@ public class MonitorFanIdxController extends BaseController { ...@@ -251,6 +282,7 @@ public class MonitorFanIdxController extends BaseController {
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "升压站光字牌/开关-通用") @ApiOperation(value = "升压站光字牌/开关-通用")
@GetMapping("/getStatusGzp") @GetMapping("/getStatusGzp")
public ResponseModel<IPage<Map<String, Object>>> getStatusGzp(@RequestParam(value = "stationId", required = true)String stationId,String frontModule,String systemType) { public ResponseModel<IPage<Map<String, Object>>> getStatusGzp(@RequestParam(value = "stationId", required = true)String stationId,String frontModule,String systemType) {
...@@ -300,4 +332,34 @@ public class MonitorFanIdxController extends BaseController { ...@@ -300,4 +332,34 @@ public class MonitorFanIdxController extends BaseController {
@ApiOperation(value = "获取升压站信息 通过排序等")
@GetMapping("/getBoosterStationInfo")
public ResponseModel<List<Map<String, String>>> getBoosterStationInfo(@RequestParam(value = "stationId", required = false) String stationId) {
return ResponseHelper.buildResponse(monitorFanIndicator.getBoosterStationInfo(stationId));
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据id获取场站信息")
@GetMapping("/getByStationId")
public ResponseModel<IPage<StationBasic>> getByStationId(@RequestParam(value = "stationId", required = false) String stationId) {
StationBasic oneByStationNumber = monitorFanIndicator.getOneByStationNumber(stationId);
List<StationBasic> stationBasics = Collections.singletonList(oneByStationNumber);
IPage<StationBasic> result = new Page<>();
result.setRecords(stationBasics);
result.setCurrent(1);
result.setTotal(stationBasics.size());
return ResponseHelper.buildResponse(result);
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "夏造运行列表API")
@GetMapping("/runningPageByStationId")
public ResponseModel<ResultsData> runningPageByStationId(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "stationId") String stationId) {
ResultsData resultsData = monitorFanIndicatorImpl.runningPageByStationId(current, size, stationId);
return ResponseHelper.buildResponse(resultsData);
}
} }
...@@ -11,7 +11,7 @@ public class CompletionOfPowerIndicatorsDto { ...@@ -11,7 +11,7 @@ public class CompletionOfPowerIndicatorsDto {
private String installCapactity; private String installCapactity;
//风速或者辐照度 //风速或者辐照度
private String windSpeedOrIrradiance; private String windSpeedOrIrradiance;
// 有功功率 //有功功率
private String activePower; private String activePower;
//日发电量 //日发电量
private String dailyPower; private String dailyPower;
......
...@@ -245,7 +245,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -245,7 +245,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
private StationBasic getOneByStationNumber(String stationId) { public StationBasic getOneByStationNumber(String stationId) {
return stationBasicMapper.selectById(stationId); return stationBasicMapper.selectById(stationId);
} }
...@@ -665,7 +665,51 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -665,7 +665,51 @@ 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());
return boosterStationInfo;
}
public ResultsData runningPageByStationId(int current, int size, String stationId) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String baseSql = "SELECT equipmentNumber, value FROM \"indicators_%s\" where equipmentIndexName = '%s'";
String windSql = String.format(baseSql, stationBasic.getFanGatewayId(), "风向角");
List<IndicatorsDto> windSqlList = influxDButils.getListDataAll(windSql,IndicatorsDto.class);
String powerSql = String.format(baseSql, stationBasic.getFanGatewayId(), "有功功率");
List<IndicatorsDto> powerSqlList = influxDButils.getListDataAll(powerSql,IndicatorsDto.class);
Map<String, String> powerSqlMap = powerSqlList.stream().collect(Collectors.toMap(IndicatorsDto::getEquipmentNumber, IndicatorsDto::getValue));
String windSpeedSql = String.format(baseSql, stationBasic.getFanGatewayId(), "瞬时风速");
List<IndicatorsDto> windSpeedSqlList = influxDButils.getListDataAll(windSpeedSql,IndicatorsDto.class);
Map<String, String> windSpeedSqlMap = windSpeedSqlList.stream().collect(Collectors.toMap(IndicatorsDto::getEquipmentNumber, IndicatorsDto::getValue));
String electricitySql = String.format(baseSql, stationBasic.getFanGatewayId(), "日发电量");
List<IndicatorsDto> electricitySqlList = influxDButils.getListDataAll(electricitySql,IndicatorsDto.class);
Map<String, String> electricitySqlMap = electricitySqlList.stream().collect(Collectors.toMap(IndicatorsDto::getEquipmentNumber, IndicatorsDto::getValue));
ArrayList<Map<String, String>> resultList = new ArrayList<>();
windSqlList.forEach(item -> {
HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("equipmentNumber", item.getEquipmentNumber());
stringStringHashMap.put("wind", item.getValue());
stringStringHashMap.put("power", powerSqlMap.get(item.getEquipmentNumber()));
stringStringHashMap.put("windSpeed", windSpeedSqlMap.get(item.getEquipmentNumber()));
stringStringHashMap.put("electricity", electricitySqlMap.get(item.getEquipmentNumber()));
resultList.add(stringStringHashMap);
});
//构建平台数据
DataGridMock DataGridMock = new DataGridMock(current, resultList.size(), false, current, resultList);
ColModel colModelEquipmentNumber = new ColModel("equipmentNumber", "equipmentNumber", "风机编码", "风机编码", "dataGrid", "equipmentNumber");
ColModel colModelPower = new ColModel("power", "power", "有功功率", "有功功率", "dataGrid", "power");
ColModel colModelWindSpeed = new ColModel("windSpeed", "windSpeed", "风速", "风速", "dataGrid", "windSpeed");
ColModel colModelWind = new ColModel("wind", "wind", "风向", "风向", "dataGrid", "wind");
ColModel colModelElectricity = new ColModel("electricity", "electricity", "日发电量", "日发电量", "dataGrid", "electricity");
List<ColModel> listColModel = Arrays.asList(colModelEquipmentNumber, colModelPower, colModelWindSpeed, colModelWind, colModelElectricity);
ResultsData resultsData = new ResultsData(DataGridMock, listColModel);
return resultsData;
} }
} }
...@@ -99,3 +99,6 @@ spring.activemq.user=admin ...@@ -99,3 +99,6 @@ spring.activemq.user=admin
spring.activemq.password=admin spring.activemq.password=admin
spring.jms.pub-sub-domain=false spring.jms.pub-sub-domain=false
myqueue=amos.privilege.v1.JXIOP.AQSC_FDGL.userBusiness myqueue=amos.privilege.v1.JXIOP.AQSC_FDGL.userBusiness
# ?????????
fan.statuts.stattuspath=upload/jxiop/device_status
...@@ -44,4 +44,9 @@ public interface ICtiService { ...@@ -44,4 +44,9 @@ public interface ICtiService {
* @return * @return
*/ */
Map<Object, Object> getUserStatus(); Map<Object, Object> getUserStatus();
/**
* 根据坐席配置获取主叫号码
*/
String getCallPhone();
} }
...@@ -3,12 +3,9 @@ package com.yeejoin.amos.boot.module.tzs.biz.controller; ...@@ -3,12 +3,9 @@ package com.yeejoin.amos.boot.module.tzs.biz.controller;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
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.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil; 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.CtiDto;
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.biz.utils.HttpUtils;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -25,11 +22,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest; ...@@ -25,11 +22,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
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.security.MessageDigest;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
...@@ -109,5 +102,16 @@ public class CtiController extends BaseController { ...@@ -109,5 +102,16 @@ public class CtiController extends BaseController {
return ResponseHelper.buildResponse(recordInfo); return ResponseHelper.buildResponse(recordInfo);
} }
/**
* 获取坐席技能组对应主叫号码信息
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/callPhone")
@ApiOperation(httpMethod = "GET", value = "获取坐席技能组对应主叫号码信息", notes = "获取坐席技能组对应主叫号码信息")
public ResponseModel<String> getCallPhone() {
String callPhone = ctiService.getCallPhone();
return ResponseHelper.buildResponse(callPhone);
}
} }
...@@ -4,6 +4,9 @@ import com.alibaba.fastjson.JSON; ...@@ -4,6 +4,9 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
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.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.tzs.api.entity.TzsCitInfo; import com.yeejoin.amos.boot.module.tzs.api.entity.TzsCitInfo;
...@@ -40,6 +43,9 @@ public class CtiServiceImpl implements ICtiService { ...@@ -40,6 +43,9 @@ public class CtiServiceImpl implements ICtiService {
@Autowired @Autowired
TzsCitInfoServiceImpl ctiInfoService; TzsCitInfoServiceImpl ctiInfoService;
@Autowired
DataDictionaryServiceImpl dictionaryService;
/** /**
* token 过期时间, cti 系统为7200 ,tzs 系统小于7200 防止获取到无效token * token 过期时间, cti 系统为7200 ,tzs 系统小于7200 防止获取到无效token
*/ */
...@@ -229,8 +235,17 @@ public class CtiServiceImpl implements ICtiService { ...@@ -229,8 +235,17 @@ public class CtiServiceImpl implements ICtiService {
return encryptStr; return encryptStr;
} }
@Override
public String getCallPhone() {
AgencyUserModel me = Privilege.agencyUserClient.getme().getResult();
LambdaQueryWrapper<TzsCitInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(TzsCitInfo::getCtiUserId,me.getUserId());
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();
}
return "";
}
} }
\ No newline at end of file
...@@ -188,7 +188,7 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc ...@@ -188,7 +188,7 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
if (!ValidationUtil.isEmpty(elevator.getUseSiteCategory())) { if (!ValidationUtil.isEmpty(elevator.getUseSiteCategory())) {
String categoryCode = elevator.getUseSiteCategory(); String categoryCode = elevator.getUseSiteCategory();
DataDictionary categoryDict = iDataDictionaryService.getByCode(categoryCode, "USE_SITE_CATEGORY"); DataDictionary categoryDict = iDataDictionaryService.getByCode(categoryCode, "USE_SITE_CATEGORY");
useSiteCategory = 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);
...@@ -924,6 +924,7 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc ...@@ -924,6 +924,7 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
if(infoCode.indexOf("1") != -1 && StringUtils.isNotBlank(dispatchTaskDto.getResponseUserTel())) { // 下发了短信 if(infoCode.indexOf("1") != -1 && StringUtils.isNotBlank(dispatchTaskDto.getResponseUserTel())) { // 下发了短信
HashMap<String, String> params = new HashMap<>(); HashMap<String, String> params = new HashMap<>();
params.put("smsCode","SMS_TZS_0006"); params.put("smsCode","SMS_TZS_0006");
params.put("mobile",dispatchTaskDto.getResponseUserTel());
params.put("content",dispatchTaskDto.getDispatchContext()); params.put("content",dispatchTaskDto.getDispatchContext());
FeignClientResult<SmsRecordModel> result = Systemctl.smsClient.sendCommonSms(params); FeignClientResult<SmsRecordModel> result = Systemctl.smsClient.sendCommonSms(params);
} }
......
...@@ -33,7 +33,6 @@ import com.yeejoin.amos.feign.systemctl.Systemctl; ...@@ -33,7 +33,6 @@ import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel; import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import liquibase.pro.packaged.O;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
......
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