Commit 3b189119 authored by litengwei's avatar litengwei

Merge branch 'develop_dl_plan6' into develop_dl_plan6_temp

# Conflicts: # amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/vo/EquipmentManageVo.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/OrgPersonController.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FirefightersServiceImpl.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EquipmentManageController.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/FireFightingSystemController.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/EquipmentManageService.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IFireFightingSystemService.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentManageServiceImpl.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java # amos-boot-system-equip/src/main/resources/mapper/EquipmentManageMapper.xml
parents 087b24ba db52b87f
......@@ -6,6 +6,20 @@
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
<option name="ignoredFiles">
<set>
<option value="$PROJECT_DIR$/amos-boot-data/amos-boot-data-accessapi/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-module/amos-boot-module-api/amos-boot-module-kgd-api/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-module/amos-boot-module-biz/amos-boot-module-kgd-biz/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-system-cas/amos-boot-module-cas-api/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-system-cas/amos-boot-module-cas-biz/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-system-cas/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-system-kgd/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-system-tdc/amos-boot-module-tdc-api/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-system-tdc/amos-boot-module-tdc-biz/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-system-tdc/pom.xml" />
</set>
</option>
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/classes" />
......
......@@ -45,5 +45,16 @@
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".apt_generated">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path=".apt_generated_tests">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
package com.yeejoin.amos.boot.biz.common.aop;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.bo.RoleBo;
import com.yeejoin.amos.boot.biz.common.interceptors.PermissionInterceptor;
import com.yeejoin.amos.boot.biz.common.interceptors.PermissionInterceptorContext;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.ObjectUtils;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
......@@ -34,10 +25,22 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.bo.RoleBo;
import com.yeejoin.amos.boot.biz.common.interceptors.PermissionInterceptorContext;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
/**
* controller层切面 用于用户数据缓存 供 sql自动填充使用
......@@ -155,6 +158,11 @@ public class ControllerAop {
} else {
roleM = roles.get(sequenceNbr).get(0);
}
if(companyM!=null&&companyM.getRegionSeq()!=null)
{
FeignClientResult<RegionModel> result = Systemctl.regionClient.getRegion(Long.valueOf(companyM.getRegionSeq()));
company.setRegionCode(String.valueOf(result.getResult().getRegionCode()));
}
Bean.copyExistPropertis(roleM, role);
ReginParams reginParams = new ReginParams();
reginParams.setCompany(company);
......
......@@ -19,6 +19,7 @@ public class CompanyBo {
private String orgCode;
private Long parentId;
private Long sequenceNbr;
private String regionCode;
private List<CompanyBo> children;
public String getAddress() {
......@@ -116,4 +117,13 @@ public class CompanyBo {
public void setChildren(List<CompanyBo> children) {
this.children = children;
}
public String getRegionCode() {
return regionCode;
}
public void setRegionCode(String regionCode) {
this.regionCode = regionCode;
}
}
......@@ -44,4 +44,5 @@ public class BaseDto implements Serializable{
private Boolean isDelete=false;
}
......@@ -97,7 +97,7 @@ public class BusinessController {
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = true)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/getData", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取map", notes = "获取map")
@RestEventTrigger(value = "openapiLogEventHandler")
......
......@@ -12,6 +12,7 @@ import com.csoft.sdk.domain.response.CsoftDataApiXixianGetzhutiinfoResponse;
import com.yeejoin.amos.api.openapi.face.orm.dao.DataDictionaryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.alibaba.fastjson.JSONArray;
......@@ -57,7 +58,10 @@ public class TaBusinessServiceImpl extends BaseService<TaAccessConfigModel, TaAc
System.out.println(response.getResult());
JSONObject jsonObject = JSONObject.parseObject(response.getData());
JSONObject data = jsonObject.getJSONObject("data");
//如果不存在该企业 则直接返回null
if(ValidationUtil.isEmpty(data)){
return null;
}
//分割字符串 根据详细地址分割出 省/市/区、街道地址、小区地址
String address = data.getString("dom");
String area = address.substring(0,address.indexOf("区")+1);
......
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".apt_generated">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path=".apt_generated_tests">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
......@@ -142,8 +142,8 @@ public class OrgUsrFireExcelDto extends BaseDto {
@ExcelProperty(value = "出生日期", index = 17)
@ApiModelProperty(value = "出生日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
// @DateTimeFormat(pattern = "yyyy-MM-dd") 此注解用于此处不起任何作用 --ky20220918
// @JsonFormat(pattern = "yyyy-MM-dd")
private String birthdayTime;
@ExplicitConstraint(indexNum = 18, sourceClass = CommonExplicitConstraint.class, method = "getMaritalStatus") //固定下拉内容
......
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.common.api.dto;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsrAgencyUser;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -18,6 +19,9 @@ public class PeopleInfoDto {
@ApiModelProperty(value = "联系人信息")
private FirefightersContacts firefightersContacts;
@ApiModelProperty(value = "账户信息")
private OrgUsrAgencyUser orgUsrAgencyUser;
@ApiModelProperty(value = "岗位页签")
private FirefightersDataDto postEduDtoObj;
......
......@@ -24,8 +24,9 @@ public class OrgUsrAgencyUser extends BaseEntity {
/**
* 用户名
*/
@TableField("user_name")
private String userName;
@TableField("usr_name")
private String usrName;
/**
* 手机号
......@@ -57,4 +58,10 @@ public class OrgUsrAgencyUser extends BaseEntity {
@TableField("amos_user_id")
private String amosUserId;
@TableField(exist = false)
private String upPassWord;
@TableField(exist = false)
private String upAmosUser;
}
......@@ -50,4 +50,6 @@ public interface WaterResourceMapper extends BaseMapper<WaterResource> {
Long sequenceNbr, String equipId,String bizOrgCode, String equipCateGoryCode,List<String> ids,String companyId);
List<Map<String, Object>> getWaterTypeByBizOrgCode(String bizOrgCode);
}
Page<WaterResourceDto> pageByDefect(Page<WaterResourceDto> page, @Param("nameOrCode") String nameOrCode, @Param("bizOrgCode") String bizOrgCode);
}
......@@ -407,9 +407,9 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr
AND type = 'RYZT'
) AS stateCode,
fp.employee_hierarchy,
cast(b.birthdayTime as datetime) as birthdayTime,
b.*,
fw.*
fw.*,
DATE_FORMAT(b.birthdayTime,'%Y-%m-%d') AS birthdaryTime
from cb_org_usr a LEFT JOIN
(SELECT
instance_id,
......@@ -427,7 +427,7 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr
max(case field_code when 'telephone' then field_value end) telephone,
max(case field_code when 'peopleType' then field_value end) peopleType,
max(case field_code when 'nation' then field_value end) nation,
max(case field_code when 'birthdayTime' then field_value end) birthdayTime,
max( CASE field_code WHEN 'birthdayTime' THEN DATE_FORMAT(field_value, '%Y-%m-%d') END ) birthdayTime,
max(case field_code when 'maritalStatus' then field_value end) maritalStatus,
max(case field_code when 'nativePlace' then field_value end) nativePlace,
max(case field_code when 'nativePlaceVal' then field_value end) nativePlaceVal,
......
......@@ -151,6 +151,9 @@
<if test="map.company != null and map.company != '-1'">
AND u.parent_id = #{map.company}
</if>
<if test="map.positionType != null and map.positionType != ''">
AND AND FIND_IN_SET(#{positionType},g.positionType)
</if>
GROUP BY
u.sequence_nbr ,
u.biz_org_name ,
......
......@@ -186,4 +186,10 @@
</select>
<select id="pageByDefect" resultType="com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto">
select * from cb_water_resource where is_delete = 1
<if test="nameOrCode != null and nameOrCode != ''">and (name like concat('%', #{nameOrCode}, '%') or equip_code like concat('%', #{nameOrCode}, '%'))</if>
<if test="bizOrgCode != null and bizOrgCode != ''">and biz_org_code like concat( #{bizOrgCode}, '%')</if>
order by cb_water_resource.rec_date desc
</select>
</mapper>
package com.yeejoin.equipmanage.common.entity;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
......@@ -93,12 +94,12 @@ public class EquipmentDetail extends BaseEntity {
@ApiModelProperty(value = "合同编号")
private String contractCode;
@TableField("production_date")
@TableField(value = "production_date", updateStrategy = FieldStrategy.IGNORED)
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "生产日期")
private Date productionDate;
@TableField("delivery_date")
@TableField(value = "delivery_date", updateStrategy = FieldStrategy.IGNORED)
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "投运日期")
private Date deliveryDate;
......
......@@ -133,4 +133,12 @@ public class FireFightingSystemEntity {
@ApiModelProperty(value = "分析报告统计用参数(为空不统计) ")
private String analysisIndexKey;
@ApiModelProperty(value = "责任单位")
private String designOrg;
@ApiModelProperty(value = "设计单位联系方式")
private String designOrgTelephone;
@ApiModelProperty(value = "主要设计人员")
private String leadDesigner;
}
......@@ -60,4 +60,10 @@ public class EquipTypeAmountPageDTO extends BaseDTO<EquipmentSpecific> {
@ApiModelProperty(value = "是否物联")
private String isIot;
@ApiModelProperty(value = "装备编码或名称")
private String nameOrCode;
@ApiModelProperty(value = "缺陷管理新增页面用,其余地方可忽略 1-是缺陷管理 0-不是")
private Integer isDefect;
}
......@@ -53,4 +53,6 @@ public class EquipTypeImgAmountVO {
@ApiModelProperty(value = "单位部门org")
private String bizOrgCode;
@ApiModelProperty(value = "所在建筑")
private String belongBuildName;
}
......@@ -125,4 +125,6 @@ public class EquipmentManageVo implements Serializable {
private String controBoxBuildName;
private String controBoxBuildId;
private String address;
private String fullName;
}
......@@ -176,4 +176,16 @@ public class FireFightingSystemVo implements Serializable {
*/
private String bizOrgName;
/**
* 责任单位
*/
private String designOrg;
/**
* 主要设计人员
*/
private String leadDesigner;
private String designOrgTelephone;
}
......@@ -45,5 +45,16 @@
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".apt_generated">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path=".apt_generated_tests">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-api</artifactId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>amos-boot-module-kgd-api</artifactId>
<properties>
<tyboot.version>1.1.23-SNAPSHOT</tyboot.version>
</properties>
<dependencies>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-component-influxdb</artifactId>
<version>1.7.13-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-redis</artifactId>
<version>1.4.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.typroject</groupId>
<artifactId>tyboot-component-cache</artifactId>
<version>${tyboot.version}</version>
<exclusions>
<exclusion>
<groupId>org.typroject</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- j2cache 二级缓存 -->
<dependency>
<groupId>net.oschina.j2cache</groupId>
<artifactId>j2cache-spring-boot2-starter</artifactId>
<version>2.8.0-release</version>
</dependency>
<dependency>
<groupId>net.oschina.j2cache</groupId>
<artifactId>j2cache-core</artifactId>
<version>2.8.0-release</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.typroject</groupId>
<artifactId>tyboot-component-emq</artifactId>
<version>${tyboot.version}</version>
<exclusions>
<exclusion>
<groupId>org.typroject</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.yeejoin.amos.kgd.message;
public class Constant {
public static final String REGION = "REALTIME";
}
package com.yeejoin.amos.kgd.message;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.component.emq.EmqxListener;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.component.influxdb.InfluxDbConnection;
import com.yeejoin.amos.component.influxdb.InfluxdbUtil;
import com.yeejoin.amos.kgd.message.model.MessageModel;
import net.oschina.j2cache.CacheChannel;
import net.oschina.j2cache.CacheObject;
@Component
public class IOTPropertyMessageAction extends EmqxListener{
private InfluxDbConnection influxDbConnection;
private InfluxdbUtil influxdbUtil;
private CacheChannel cacheChannel;
public static final int threadNum = 5;
ExecutorService service = Executors.newFixedThreadPool(threadNum);
private static final BlockingQueue<MessageModel> blockingQueue = new LinkedBlockingQueue<MessageModel>();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
public IOTPropertyMessageAction(InfluxDbConnection influxDbConnection, InfluxdbUtil influxdbUtil, CacheChannel cacheChannel) {
this.influxDbConnection = influxDbConnection;
this.cacheChannel = cacheChannel;
this.influxdbUtil = influxdbUtil;
for (int i = 0; i < threadNum; i++) {
service.execute(task_runnable);
}
}
@Override
public void processMessage(String topic,MqttMessage mqttMessage) throws Exception {
MessageModel message = new MessageModel();
message.setPayload(mqttMessage.getPayload());
message.setTableName(topic.replace("/", "").replace("property", ""));
blockingQueue.add(message);
}
Runnable task_runnable = new Runnable() {
public void run() {
while (true) {
try {
MessageModel mqttMessage = blockingQueue.take();
String jsonStr = new String(mqttMessage.getPayload());
String tableName = mqttMessage.getTableName();
if ("iotlogs".contains(tableName)) {
continue;
}
Map<String, String> tagsMap = new HashMap<>();
tagsMap.put("iotCode", tableName);
Map<String, Object> fieldsMap = JSON.parseObject(jsonStr, Map.class);
String sql = "show field keys from " + tableName;
try {
List<Map<String, Object>> list = influxdbUtil.query(sql);
Map<String, Object> fieldsTempMap = new HashMap<>();
for (Map<String, Object> field : list) {
if (fieldsTempMap.containsKey(field.get("fieldKey").toString())) {
continue;
}
fieldsTempMap.put(field.get("fieldKey").toString(), field.get("fieldType").toString());
if (fieldsMap.containsKey(field.get("fieldKey"))) {
if ("integer".equals(field.get("fieldType").toString())) {
fieldsMap.put(field.get("fieldKey").toString(),
Integer.valueOf(fieldsMap.get(field.get("fieldKey")).toString()));
} else if ("float".equals(field.get("fieldType").toString())) {
fieldsMap.put(field.get("fieldKey").toString(),
Float.valueOf(fieldsMap.get(field.get("fieldKey")).toString()));
} else if ("double".equals(field.get("fieldType").toString())) {
fieldsMap.put(field.get("fieldKey").toString(),
Double.valueOf(fieldsMap.get(field.get("fieldKey")).toString()));
}
else {
if ("true".equals(fieldsMap.get(field.get("fieldKey")).toString().toLowerCase()) ||
"false".equals(fieldsMap.get(field.get("fieldKey")).toString().toLowerCase())) {
fieldsMap.put(field.get("fieldKey").toString(), Boolean.valueOf(fieldsMap.get(field.get("fieldKey")).toString()) ? 1 : 0);
} else {
fieldsMap.put(field.get("fieldKey").toString(),
fieldsMap.get(field.get("fieldKey")).toString());
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
fieldsMap.put("createdTime", simpleDateFormat.format(new Date()));
influxDbConnection.insert(tableName, tagsMap, fieldsMap);
CacheObject cacheObject = cacheChannel.get(Constant.REGION, tableName);
if (cacheObject.getValue() == null) {
cacheChannel.set(Constant.REGION, tableName, fieldsMap);
} else {
HashMap<String, Object> cacheData = (HashMap<String, Object>) cacheObject.getValue();
cacheData.putAll(fieldsMap);
cacheChannel.set(Constant.REGION, tableName, cacheData);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
};
}
package com.yeejoin.amos.kgd.message;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.component.emq.EmqxListener;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.component.influxdb.InfluxDbConnection;
import com.yeejoin.amos.component.influxdb.InfluxdbUtil;
import com.yeejoin.amos.kgd.message.model.MessageModel;
import net.oschina.j2cache.CacheChannel;
import net.oschina.j2cache.CacheObject;
@Component
public class MaasMessageAction extends EmqxListener{
private InfluxDbConnection influxDbConnection;
private InfluxdbUtil influxdbUtil;
private CacheChannel cacheChannel;
public static final int threadNum = 5;
ExecutorService service = Executors.newFixedThreadPool(threadNum);
private static final BlockingQueue<MessageModel> blockingQueue = new LinkedBlockingQueue<MessageModel>();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
public MaasMessageAction(InfluxDbConnection influxDbConnection, InfluxdbUtil influxdbUtil, CacheChannel cacheChannel) {
this.influxDbConnection = influxDbConnection;
this.cacheChannel = cacheChannel;
this.influxdbUtil = influxdbUtil;
for (int i = 0; i < threadNum; i++) {
service.execute(task_runnable);
}
}
@Override
public void processMessage(String topic,MqttMessage mqttMessage) throws Exception {
MessageModel message = new MessageModel();
message.setPayload(mqttMessage.getPayload());
message.setTableName(topic.replace("/", ""));
blockingQueue.add(message);
}
Runnable task_runnable = new Runnable() {
public void run() {
while (true) {
try {
MessageModel mqttMessage = blockingQueue.take();
String jsonStr = new String(mqttMessage.getPayload());
JSONObject data = JSONObject.parseObject(jsonStr);
String tableName = mqttMessage.getTableName();
Map<String, String> tagsMap = new HashMap<>();
Map<String, Object> fieldsMap = JSONObject.toJavaObject(data, HashMap.class);
String sql = "show field keys from " + tableName;
try {
List<Map<String, Object>> list = influxdbUtil.query(sql);
Map<String, Object> fieldsTempMap = new HashMap<>();
for (Map<String, Object> field : list) {
if (fieldsTempMap.containsKey(field.get("fieldKey").toString())) {
continue;
}
fieldsTempMap.put(field.get("fieldKey").toString(), field.get("fieldType").toString());
if (fieldsMap.containsKey(field.get("fieldKey"))) {
if ("integer".equals(field.get("fieldType").toString())) {
fieldsMap.put(field.get("fieldKey").toString(),
Integer.valueOf(fieldsMap.get(field.get("fieldKey")).toString()));
} else if ("float".equals(field.get("fieldType").toString())) {
fieldsMap.put(field.get("fieldKey").toString(),
Float.valueOf(fieldsMap.get(field.get("fieldKey")).toString()));
} else if ("double".equals(field.get("fieldType").toString())) {
fieldsMap.put(field.get("fieldKey").toString(),
Double.valueOf(fieldsMap.get(field.get("fieldKey")).toString()));
} else {
fieldsMap.put(field.get("fieldKey").toString(),
fieldsMap.get(field.get("fieldKey")).toString());
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
fieldsMap.put("createdTime", simpleDateFormat.format(new Date()));
influxDbConnection.insert(tableName, tagsMap, fieldsMap);
CacheObject cacheObject = cacheChannel.get(Constant.REGION, tableName);
if (cacheObject.getValue() == null) {
cacheChannel.set(Constant.REGION, tableName, fieldsMap);
} else {
HashMap<String, Object> cacheData = (HashMap<String, Object>) cacheObject.getValue();
cacheData.putAll(fieldsMap);
cacheChannel.set(Constant.REGION, tableName, cacheData);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
};
}
package com.yeejoin.amos.kgd.message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Configuration;
import org.typroject.tyboot.component.emq.EmqKeeper;
@Configuration
public class MessageConfig implements ApplicationListener<ApplicationReadyEvent>{
@Autowired
private EmqKeeper emqKeeper;
@Autowired
IOTPropertyMessageAction propertyMessageAction;
@Autowired
MaasMessageAction maasMessageAction;
@Value("spring.application.name")
private String serviceName;
public static final Integer DEFAULT_QOS = 2;
@Override
public void onApplicationEvent(ApplicationReadyEvent event) {
try {
emqKeeper.subscript(Topic.IOT_PROPERTY_MESSAGE.getShareTopicStr(serviceName), DEFAULT_QOS, propertyMessageAction);
emqKeeper.subscript(Topic.MAAS_CALCULATION_RESULTS.getShareTopicStr(serviceName), DEFAULT_QOS, maasMessageAction);
} catch (Exception e) {
e.printStackTrace();
}
}
}
package com.yeejoin.amos.kgd.message;
public enum Topic {
MAAS_CALCULATION_RESULTS("maas/calculation/result"),
IOT_PROPERTY_MESSAGE("+/+/property"),
IOT_SHADOW_MESSAGE("+/+/shadow");
private String topicStr;
Topic(String topicStr) {
this.topicStr = topicStr;
}
public String getTopicStr() {
return topicStr;
}
public String getShareTopicStr(String groupName) {
String shareTopicStr = "$share/" + groupName.trim() + "/" + getTopicStr();
return shareTopicStr;
}
}
package com.yeejoin.amos.kgd.message.model;
import lombok.Data;
@Data
public class MessageModel {
private String tableName;
private byte[] payload;
}
package com.yeejoin.amos.kgd.service;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import com.yeejoin.amos.component.feign.model.Page;
import com.yeejoin.amos.component.influxdb.InfluxDbConnection;
import com.yeejoin.amos.component.influxdb.InfluxdbUtil;
import com.yeejoin.amos.kgd.message.Constant;
import net.oschina.j2cache.CacheChannel;
import net.oschina.j2cache.CacheObject;
@Component
public class LiveDataService {
private final Logger logger = LogManager.getLogger(LiveDataService.class);
@Autowired
private InfluxdbUtil influxdbUtil;
@Autowired
InfluxDbConnection influxDbConnection;
@Autowired
private CacheChannel cacheChannel;
public static final String SPACE = " ";
public static final String ASTERISK = "*";
public static final String DATE = "time";
public static final String COMMA = ",";
public static final String FROM = "FROM";
public static final String WHERE = "WHERE";
public static final String EQUALSIGN = "=";
public static final String AND = "AND";
public List queryHistoryDataForList(String tableName, String timeStart, String timeEnd, String fieldKeys, Map<String, Object> requestParams) {
StringBuffer sqlSb = new StringBuffer();
sqlSb.append("SELECT").append(SPACE);
if (ObjectUtils.isEmpty(fieldKeys)) {
sqlSb.append(SPACE).append(ASTERISK).append(SPACE);
} else {
fieldKeys = fieldKeys + ", createdTime ";
sqlSb.append(SPACE).append(fieldKeys).append(SPACE);
}
sqlSb.append(SPACE).append(FROM).append(SPACE);
sqlSb.append(tableName);
if (!ObjectUtils.isEmpty(requestParams)) {
sqlSb.append(SPACE).append(WHERE).append(SPACE);
sqlSb.append(DATE).append(">=").append("'").append(timeStart).append("'");
sqlSb.append(AND).append(DATE).append("<=").append("'").append(timeEnd).append("'");
Set<String> keys = requestParams.keySet();
StringBuffer whereSb = new StringBuffer();
for (String key : keys) {
whereSb.append(AND).append(SPACE).append(key).append(SPACE).append(EQUALSIGN).append(requestParams.get(key)).append(SPACE);
}
sqlSb.append(whereSb.toString());
}
sqlSb.append(SPACE).append("tz('Asia/Shanghai')");
List<Map<String, Object>> list = influxdbUtil.query(sqlSb.toString());
return list;
}
public Page<Map<String, Object>> queryHistoryDataForPage(String tableName, String timeStart, String timeEnd, String fieldKeys, Map<String, Object> requestParams, long current, long size) {
StringBuffer sqlSb = new StringBuffer();
StringBuffer countSb = new StringBuffer();
StringBuffer whereSb = new StringBuffer();
sqlSb.append("SELECT").append(SPACE);
if (ObjectUtils.isEmpty(fieldKeys)) {
sqlSb.append(SPACE).append(ASTERISK).append(SPACE);
} else {
fieldKeys = fieldKeys + ", createdTime ";
sqlSb.append(SPACE).append(fieldKeys).append(SPACE);
}
sqlSb.append(SPACE).append(FROM).append(SPACE);
sqlSb.append(tableName);
if (!ObjectUtils.isEmpty(requestParams)) {
whereSb.append(SPACE).append(WHERE).append(SPACE);
whereSb.append(DATE).append(">=").append("'").append(timeStart).append("'").append(SPACE);
whereSb.append(AND).append(SPACE).append(DATE).append("<=").append("'").append(timeEnd).append("'");
Set<String> keys = requestParams.keySet();
StringBuffer subWhereSb = new StringBuffer();
for (String key : keys) {
subWhereSb.append(AND).append(SPACE).append(key).append(SPACE).append(EQUALSIGN).append(requestParams.get(key)).append(SPACE);
}
whereSb.append(subWhereSb.toString());
}
sqlSb.append(" LIMIT ").append(size).append(" OFFSET ").append((current - 1) * size);
sqlSb.append(whereSb.toString());
sqlSb.append(SPACE).append("tz('Asia/Shanghai')");
countSb.append("SELECT COUNT(createdTime) FROM ").append(tableName);
countSb.append(whereSb.toString());
List<Map<String, Object>> count = influxdbUtil.query(countSb.toString());
List<Map<String, Object>> list = influxdbUtil.query(sqlSb.toString());
Page<Map<String, Object>> page = new Page<Map<String, Object>>();
page.setCurrent(current);
page.setSize(size);
page.setRecords(list);
page.setTotal((Double.valueOf(count.get(0).get("count").toString()).longValue()));
return page;
}
public Map<String, Object> queryrealTimeData(String tableName) {
CacheObject cacheObject = cacheChannel.get(Constant.REGION, tableName);
return (Map<String, Object>) cacheObject.getValue();
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.avic.face.orm.dao.AvicCustomPathMapper">
</mapper>
......@@ -28,5 +28,6 @@
<module>amos-boot-module-ccs-api</module>
<module>amos-boot-module-avic-api</module>
<module>amos-boot-module-precontrol-api</module>
<module>amos-boot-module-kgd-api</module>
</modules>
</project>
\ No newline at end of file
package com.yeejoin.amos.boot.module.common.biz.controller;
import java.io.UnsupportedEncodingException;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
......@@ -23,43 +13,33 @@ 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.api.core.framework.PersonIdentify;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.CompanyInfo;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.mapper.FireTeamMapper;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.boot.module.common.biz.service.impl.ESOrgUsrService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireCompanyInfoServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
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 com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author fengwang
......
......@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrAgencyUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
......@@ -36,10 +37,15 @@ public class OrgUsrAgencyUserController extends BaseController {
* @return OrgUsrAgencyUser
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{orgUsrId}/detail", method = RequestMethod.GET)
@RequestMapping(value = "/{orgUsrId}/detail", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "查询关联的amos账号信息", notes = "查询关联的amos账号信息")
public ResponseModel<OrgUsrAgencyUser> getAccountDetail(@PathVariable String orgUsrId) {
OrgUsrAgencyUser orgUsrAgencyUser = new OrgUsrAgencyUser();
OrgUsrAgencyUser agencyUser = orgUsrAgencyUserService.getAccountDetail(orgUsrId);
if (ObjectUtils.isEmpty(agencyUser)) {
orgUsrAgencyUser.setUpAmosUser("0");
return ResponseHelper.buildResponse(orgUsrAgencyUser);
}
return ResponseHelper.buildResponse(agencyUser);
}
}
\ No newline at end of file
......@@ -19,6 +19,7 @@ import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.biz.service.impl.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -511,6 +512,34 @@ public class WaterResourceController extends BaseController {
}
/**
* 列表分页查询缺陷模块用
*
* @param pageNum 当前页
* @param pageSize 每页大小
* @return 返回结果
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/pageByDefect")
@ApiOperation(httpMethod = "GET", value = "列表分页查询缺陷模块用", notes = "列表分页查询缺陷模块用")
public ResponseModel<Page<WaterResourceDto>> pageByDefect(@RequestParam(value = "pageNum") int pageNum,
@RequestParam(value = "pageSize") int pageSize,
@RequestParam(value = "nameOrCode", required = false) String nameOrCode,
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
ReginParams reginParams = getSelectedOrgInfo();
if (StringUtils.isEmpty(bizOrgCode)) {
if (ObjectUtils.isEmpty(reginParams) || ObjectUtils.isEmpty(reginParams.getPersonIdentity()) || StringUtils.isEmpty(reginParams.getPersonIdentity().getBizOrgCode())) {
return ResponseHelper.buildResponse(null);
}
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
Page<WaterResourceDto> page = new Page<>();
page.setCurrent(pageNum);
page.setSize(pageSize);
Page<WaterResourceDto> waterResourceDtoPage = waterResourceServiceImpl.pageByDefect(page, nameOrCode, bizOrgCode);
return ResponseHelper.buildResponse(waterResourceDtoPage);
}
/**
* 列表全部数据查询
*
* @return 返回结果
......
......@@ -4,11 +4,13 @@ import com.yeejoin.amos.boot.module.common.biz.listener.AmosMqttListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.component.emq.EmqKeeper;
/**
* @author Administrator
*/
@Component
public class ApplicationRunnerImpl implements ApplicationRunner {
@Autowired
......
......@@ -6,9 +6,10 @@ import java.util.stream.Collectors;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.entity.*;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrAgencyUserMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.component.feign.model.Page;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.commons.lang3.ObjectUtils;
......@@ -28,8 +29,6 @@ import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.Menu;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts;
import com.yeejoin.amos.boot.module.common.api.mapper.FirefightersMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFirefightersService;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
......@@ -228,20 +227,65 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
@Override
@Transactional(rollbackFor = Exception.class)
public PeopleInfoDto updatePeopleById(PeopleInfoDto peopleInfoDto, Long id) {
Map<String, String> map = new HashMap<>();
// 1.动态表单
if(!ValidationUtil.isEmpty(peopleInfoDto.getFirefighters().getAmosUserId())) {
AgencyUserModel amosUser = Privilege.agencyUserClient.queryByUserId(peopleInfoDto.getFirefighters().getAmosUserId()).getResult();
peopleInfoDto.getFirefighters().setAmosName(amosUser.getRealName());
OrgUsr orgUsr = orgUsrService.peopleSaveOrgUsr(peopleInfoDto.getFirefighters());
if(!ValidationUtil.isEmpty(peopleInfoDto.getFirefighters().getAmosUserId()) || "1".equals(peopleInfoDto.getOrgUsrAgencyUser().getUpAmosUser())) {
AgencyUserModel amosUser = null;
if(!ValidationUtil.isEmpty(peopleInfoDto.getFirefighters().getAmosUserId())){
amosUser = Privilege.agencyUserClient.queryByUserId(peopleInfoDto.getFirefighters().getAmosUserId()).getResult();
}
//删除之前所在用户组
OrgUsrAgencyUser orgUsrAgencyUser = orgUsrAgencyUserMapper.selectOne(new QueryWrapper<OrgUsrAgencyUser>().eq("org_usr_id", id));
if (!ValidationUtil.isEmpty(orgUsrAgencyUser) && amosUser != null ) {
String groupIds = orgUsrAgencyUser.getGroupIds();
if (!"".equals(groupIds) && null != groupIds) {
String[] ids = groupIds.split(",");
for (String gId : ids) {
Long groupId = Long.valueOf(gId);
Privilege.groupUserClient.deleteGroupUser(groupId,amosUser.getUserId());
}
}
}
//同步更新或者创建平台用户
if(null == amosUser){
map = orgUsrService.savePlatformUser(orgUsr,peopleInfoDto,"create");
} else {
if("0".equals(peopleInfoDto.getOrgUsrAgencyUser().getUpAmosUser())){
//删除cb_org_usr_agency_user中对应数据
if (!ValidationUtil.isEmpty(orgUsrAgencyUser)) {
orgUsrAgencyUserMapper.delete(new QueryWrapper<OrgUsrAgencyUser>().eq("org_usr_id", id));
}
//删除cb_org_usr相关字段
OrgUsr orgUsr1 = orgUsrMapper.queryBySequenceNbr(id.toString());
orgUsr1.setAmosOrgId("");
orgUsr1.setAmosOrgCode("");
orgUsrMapper.update(orgUsr1,new QueryWrapper<OrgUsr>().eq("sequence_nbr",id));
//删除cb_firefighters相关字段
Firefighters firefighters = firefightersMapper.selectOne(new QueryWrapper<Firefighters>().eq("org_usr_id", id));
firefighters.setAmosUserId("");
firefighters.setAmosName("");
firefightersMapper.update(firefighters,new QueryWrapper<Firefighters>().eq("org_usr_id", id));
Privilege.agencyUserClient.multDeleteUser(orgUsrAgencyUser.getAmosUserId());
} else {
map = orgUsrService.savePlatformUser(orgUsr,peopleInfoDto,"update");
}
}
if(amosUser==null){
peopleInfoDto.getFirefighters().setAmosName(peopleInfoDto.getOrgUsrAgencyUser().getUsrName());
}else {
peopleInfoDto.getFirefighters().setAmosName(amosUser.getRealName());
}
} else {
peopleInfoDto.getFirefighters().setAmosUserId(null);
peopleInfoDto.getFirefighters().setAmosName(null);
}
OrgUsr orgUsr = orgUsrService.peopleSaveOrgUsr(peopleInfoDto.getFirefighters());
OrgPersonDto orgPersonDto = new OrgPersonDto();
BeanUtils.copyProperties(orgUsr, orgPersonDto);
List<DynamicFormInstance> dynamicFormInstances = orgUsrService.dynamicFormColumn(peopleInfoDto.getFirefighters(), true);
orgPersonDto.setAmosOrgId(map.get("orgId"));
orgPersonDto.setAmosOrgCode(map.get("orgCode"));
List<DynamicFormInstance> dynamicFormInstances = orgUsrService.dynamicFormColumn(peopleInfoDto.getFirefighters(), false);
orgPersonDto.setDynamicFormValue(dynamicFormInstances);
try {
orgUsrService.updateByIdOrgPerson(orgPersonDto, id);
......
......@@ -3,14 +3,22 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrAgencyUserDto;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsrAgencyUser;
import com.yeejoin.amos.boot.module.common.api.mapper.FirefightersMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrAgencyUserMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrAgencyUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
......@@ -22,6 +30,12 @@ import java.util.stream.Collectors;
@Service
public class OrgUsrAgencyUserServiceImpl extends BaseService<OrgUsrAgencyUserDto, OrgUsrAgencyUser, OrgUsrAgencyUserMapper> implements IOrgUsrAgencyUserService {
@Autowired
OrgUsrAgencyUserMapper orgUsrAgencyUserMapper;
@Autowired
FirefightersMapper firefightersMapper;
@Autowired
OrgUsrMapper orgUsrMapper;
@Override
public OrgUsrAgencyUser getAccountDetail(String orgUsrId) {
......@@ -35,17 +49,52 @@ public class OrgUsrAgencyUserServiceImpl extends BaseService<OrgUsrAgencyUserDto
String userId = jsonObject.getString("userId");
// 平台添加用户
if ("update".equals(methodName)) {
// 更新cb_org_usr_agency_user、cb_org_usr、cb_firefighters
// 更新cb_org_usr_agency_user
JSONObject object = result.getJSONObject("result");
// person.setId(object.getLong("sequenceNbr"));
// person.setAccountName(object.getString("userName"));
// person.setUserId(object.getLong("userId"));
// person.setName(object.getString("realName"));
// person.setPhone(object.getString("mobile"));
OrgUsrAgencyUser orgUsrAgencyUser = orgUsrAgencyUserMapper.selectOne(new QueryWrapper<OrgUsrAgencyUser>().eq("amos_user_id", object.getString("userId")));
orgUsrAgencyUser.setUsrName(object.getString("userName"));
orgUsrAgencyUser.setMobile(object.getString("mobile"));
orgUsrAgencyUser.setAmosUserId(object.getString("userId"));
orgUsrAgencyUserMapper.update(orgUsrAgencyUser,new QueryWrapper<OrgUsrAgencyUser>().eq("amos_user_id",object.getString("userId")));
// 更新cb_firefighters
Firefighters firefighter = firefightersMapper.selectOne(new QueryWrapper<Firefighters>().eq("org_usr_id", orgUsrAgencyUser.getOrgUsrId()));
if (!ObjectUtils.isEmpty(firefighter) && !firefighter.getIsDelete()) {
firefighter.setAmosUserId(object.get("userId").toString());
firefighter.setAmosName(object.getString("userName"));
firefightersMapper.update(firefighter, new QueryWrapper<Firefighters>().eq("org_usr_id", orgUsrAgencyUser.getOrgUsrId()));
}
// 更新cb_org_usr
OrgUsr orgUsr1 = orgUsrMapper.selectById(orgUsrAgencyUser.getOrgUsrId());
if (!ObjectUtils.isEmpty(orgUsr1) && !orgUsr1.getIsDelete()) {
orgUsr1.setAmosOrgId(object.get("userId").toString());
List<Map<String, Object>> companys = (List<Map<String, Object>>) object.get("companys");
orgUsr1.setAmosOrgCode(companys.get(0).get("orgCode").toString());
orgUsrMapper.update(orgUsr1,new QueryWrapper<OrgUsr>().eq("sequence_nbr",orgUsrAgencyUser.getOrgUsrId()));
}
} else if ("multDeleteUser".equals(methodName)) {
JSONArray array = result.getJSONArray("result");
List<Object> userIds = array.stream().collect(Collectors.toList());
// 删除cb_org_usr_agency_user、cb_org_usr与用户有关字段、cb_firefighters和用户有关字段
for (Object id : userIds) {
//删除cb_org_usr_agency_user中信息
OrgUsrAgencyUser orgUsrAgencyUser = orgUsrAgencyUserMapper.selectOne(new QueryWrapper<OrgUsrAgencyUser>().eq("amos_user_id", id));
if (!ObjectUtils.isEmpty(orgUsrAgencyUser)) {
orgUsrAgencyUserMapper.delete(new QueryWrapper<OrgUsrAgencyUser>().eq("amos_user_id", id));
}
// 删除cb_firefighters和用户有关字段
Firefighters firefighter = firefightersMapper.selectOne(new QueryWrapper<Firefighters>().eq("amos_user_id", id));
if (!ObjectUtils.isEmpty(firefighter)) {
firefighter.setAmosUserId("");
firefighter.setAmosName("");
firefightersMapper.update(firefighter, new QueryWrapper<Firefighters>().eq("amos_user_id", id).eq("is_delete", 0));
}
// 删除cb_org_usr与用户有关字段
OrgUsr orgUsr1 = orgUsrMapper.selectOne(new QueryWrapper<OrgUsr>().eq("amos_org_id", id));
if (!ObjectUtils.isEmpty(orgUsr1)) {
orgUsr1.setAmosOrgId("");
orgUsr1.setAmosOrgCode("");
orgUsrMapper.update(orgUsr1,new QueryWrapper<OrgUsr>().eq("amos_org_id",id).eq("is_delete",0));
}
}
}
}
}
\ No newline at end of file
......@@ -93,6 +93,15 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
}
/**
* 分页查询
*/
public Page<WaterResourceDto> pageByDefect(Page<WaterResourceDto> page,
String nameOrCode,
String bizOrgCode) {
return this.waterResourceMapper.pageByDefect(page, nameOrCode, bizOrgCode);
}
/**
* 列表查询 示例
*/
public List<WaterResourceDto> queryForWaterResourceList(@Condition(Operator.eq) Boolean isDelete) {
......
......@@ -51,6 +51,21 @@
<artifactId>geodesy</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-component-authtoken</artifactId>
<version>1.7.13-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.typroject</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>io.springfox</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
package com.yeejoin.equipmanage.controller;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
......@@ -37,6 +41,7 @@ import com.yeejoin.equipmanage.service.IFormInstanceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
/**
* @author ZeHua Li
......@@ -106,8 +111,23 @@ public class BuildingController extends AbstractBaseController {
@ApiOperation("消防建筑树")
@GetMapping(value = "/tree")
public List<BuildingTreeVo> getBuildingTree() {
return buildService.getBuildingTree();
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
return buildService.getBuildingTree(bizOrgCode);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防建筑树带筛选")
@GetMapping(value = "/treeByName")
public List<BuildingTreeVo> treeByName(@RequestParam(required = false) String name) {
ReginParams reginParams = getSelectedOrgInfo();
if (ObjectUtils.isEmpty(reginParams) || ObjectUtils.isEmpty(reginParams.getPersonIdentity()) || StringUtils.isEmpty(reginParams.getPersonIdentity().getBizOrgCode())) {
return new ArrayList<>();
}
String bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
return buildService.treeByName(bizOrgCode, name);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防建筑树列表信息")
@GetMapping(value = "/getBuildingList")
......
......@@ -121,7 +121,7 @@ public class CarController extends AbstractBaseController {
private RestTemplate restTemplate;
@Value("${security.productApp}")
private String productApp;
@Value("${security.appKeyApp}")
@Value("${amos.system.user.app-key}")
private String appKeyApp;
@Value("${iot.vehicle.track}")
private String iotServerName;
......
......@@ -486,6 +486,12 @@ public class FireFightingSystemController extends AbstractBaseController {
return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, equipTypeAmountPage.getEquipmentClassificationCode().substring(0, inhierarchy), equipTypeAmountPage);
} else {
if (null != equipTypeAmountPage.getIsDefect() && 1 == equipTypeAmountPage.getIsDefect()) {
ReginParams reginParams = getSelectedOrgInfo();
if (StringUtils.isEmpty(equipTypeAmountPage.getBizOrgCode())) {
equipTypeAmountPage.setBizOrgCode(reginParams.getPersonIdentity().getBizOrgCode());
}
}
return fireFightingSystemService.getColaCategoryAmountEquList(0, null, equipTypeAmountPage);
}
......@@ -532,10 +538,20 @@ public class FireFightingSystemController extends AbstractBaseController {
@RequestParam(value = "maintenance", required = false) String maintenance,
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode,
@RequestParam(value = "formGroupId", required = false) String formGroupId,
@RequestParam(value = "controBoxBuildId", required = false) String controBoxBuildId,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int pageSize, @RequestParam(value = "companyId",required = false) String companyId
@RequestParam(value = "size") int pageSize,
@RequestParam(value = "nameOrCode", required = false) String nameOrCode,
@ApiParam(value = "缺陷管理新增页面用,其余地方可忽略 1-是缺陷管理 0-不是") @RequestParam(required = false) Integer isDefect
) {
if (null != isDefect && 1 == isDefect) {
ReginParams reginParams = getSelectedOrgInfo();
if (org.apache.commons.lang3.ObjectUtils.isEmpty(reginParams) || org.apache.commons.lang3.ObjectUtils.isEmpty(reginParams.getPersonIdentity()) || StringUtils.isEmpty(reginParams.getPersonIdentity().getBizOrgCode())) {
return new HashMap<>();
}
if (StringUtils.isEmpty(bizOrgCode)) {
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
}
if (current > 0){
current = (current - 1) * pageSize;
}
......@@ -550,7 +566,7 @@ public class FireFightingSystemController extends AbstractBaseController {
}
}
return fireFightingSystemService.queryEquipmenInfoAndCount(equipmentName, equipmentCode, construction, maintenance, bizOrgCode, formGroupId, current, pageSize,controBoxBuildId, companyId);
return fireFightingSystemService.queryEquipmenInfoAndCount(equipmentName, equipmentCode, construction, maintenance, bizOrgCode, formGroupId, current, pageSize,controBoxBuildId, companyId, nameOrCode);
}
/**
......
package com.yeejoin.equipmanage.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.equipmanage.config.PersonIdentify;
import com.yeejoin.equipmanage.service.DutyDetailsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
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.*;
/**
* 获取用户信息
*
*/
@RestController
@RequestMapping(value = "/org/user")
@Api(tags = "用户信息api")
public class OrgUserController {
@Autowired
DutyDetailsService dutyDetailsService;
@Autowired
RedisUtils redisUtils;
/**
* 今日值班运维人员列表清单--分页
*
* @return ResponseModel
*/
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "duty-person/page-list")
@ApiOperation(httpMethod = "GET", value = "今日值班运维人员列表清单", notes = "今日值班运维人员列表清单")
public ResponseModel<IPage<Map<String, Object>>> dutyPersonPageList(
@ApiParam(value = "当前页", required = true) @RequestParam(value = "current") int current,
@ApiParam(value = "页面大小", required = true) @RequestParam(value = "size") int size) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
String bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
return ResponseHelper.buildResponse(dutyDetailsService.dutyPersonPageList(current, size, bizOrgCode));
}
}
\ No newline at end of file
......@@ -20,8 +20,8 @@ import com.yeejoin.equipmanage.common.entity.AnalysisReportLog;
*/
public interface AnalysisReportLogMapper extends BaseMapper<AnalysisReportLog> {
IPage<AnalysisReportLogDto> allPage(Page<AnalysisReportLogDto> page, @Param("analysisReportLog")AnalysisReportLogDto analysisReportLog,
@Param("rootParentId") Long rootParentId);
IPage<AnalysisReportLogDto> allPage(Page<AnalysisReportLogDto> page, @Param("analysisReportLog")AnalysisReportLogDto analysisReportLog
);
Map<String,Object> getStation(String stationCode);
......
package com.yeejoin.equipmanage.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import java.util.Map;
public interface DutyDetailsMapper {
IPage<Map<String, Object>> selectDutyPersonList(Page page, @Param(value = "dutyDate") String dutyDate, @Param(value = "bizOrgCode") String bizOrgCode);
}
......@@ -47,7 +47,14 @@ public interface FormInstanceMapper extends BaseMapper<FormInstance> {
* @param parentId
* @return
*/
List<Map<String,Object>> querySpecialChildrenList(String parentId);
List<Map<String,Object>> querySpecialChildrenList(String parentId, String bizOrgCode);
/**
* 查询指定节点的子
* @param parentId
* @return
*/
List<Map<String,Object>> querySpecialChildrenListByName(String parentId, String bizOrgCode, String name);
/**
* 查询指定节点的子
......
......@@ -9,6 +9,7 @@ import java.util.concurrent.TimeUnit;
import javax.servlet.http.HttpServletRequest;
import com.yeejoin.amos.component.authtoken.robot.AmosRequestContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
......@@ -46,18 +47,15 @@ import com.yeejoin.equipmanage.common.vo.Token;
@Service("remoteSecurityService")
public class RemoteSecurityService {
@Value("${security.password}")
@Autowired
AmosRequestContext amosRequestContext;
@Value("${amos.system.user.password}")
private String password;
@Value("${security.loginId}")
private String loginId;
@Value("${security.productWeb}")
private String productWeb;
@Value("${security.productApp}")
private String productApp;
@Value("${security.appKeyApp}")
@Value("${amos.system.user.app-key}")
private String appKeyApp;
@Autowired
......@@ -410,15 +408,15 @@ public class RemoteSecurityService {
public Token getServerToken() {
IdPasswordAuthModel dPasswordAuthModel = new IdPasswordAuthModel();
dPasswordAuthModel.setLoginId(loginId);
dPasswordAuthModel.setLoginId(amosRequestContext.getUserName());
dPasswordAuthModel.setPassword(DesUtil.encode(password, "qaz"));
Token toke = null;
try {
toke = JSON.parseObject(this.redisTemplate.opsForValue().get(buildKey(loginId)), Token.class);
toke = JSON.parseObject(this.redisTemplate.opsForValue().get(buildKey(amosRequestContext.getUserName())), Token.class);
if (ObjectUtils.isEmpty(toke)) {
toke = getLogin(dPasswordAuthModel);
} else {
RequestContext.setProduct(productWeb);
RequestContext.setProduct(amosRequestContext.getProduct());
if (!redisUtils.refresh(toke.getToke())) {
toke = getLogin(dPasswordAuthModel);
}
......@@ -436,15 +434,11 @@ public class RemoteSecurityService {
private Token getLogin(IdPasswordAuthModel dPasswordAuthModel) {
Token toke = new Token();
RequestContext.setProduct(productWeb);
FeignClientResult feignClientResult = Privilege.authClient.idpassword(dPasswordAuthModel);
Map map = (Map) feignClientResult.getResult();
if (map != null) {
toke.setToke(map.get("token").toString());
toke.setProduct(productWeb);
toke.setAppKey(appKeyApp);
redisTemplate.opsForValue().set(buildKey(dPasswordAuthModel.getLoginId()), JSONObject.toJSONString(toke), 28, TimeUnit.DAYS);
}
RequestContext.setProduct(amosRequestContext.getProduct());
toke.setToke(amosRequestContext.getToken());
toke.setProduct(amosRequestContext.getProduct());
toke.setAppKey(amosRequestContext.getAppKey());
redisTemplate.opsForValue().set(buildKey(dPasswordAuthModel.getLoginId()), JSONObject.toJSONString(toke), 28, TimeUnit.DAYS);
return toke;
}
}
package com.yeejoin.equipmanage.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.Map;
/**
* 服务类
*
*/
public interface DutyDetailsService {
IPage<Map<String, Object>> dutyPersonPageList(int current, int size, String bizOrgCode);
}
......@@ -27,7 +27,7 @@ public interface EquipmentManageService extends IService<EquipmentManageEntity>
* @param pageSize
* @return
*/
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId , int spage, int pageSize, String controBoxBuildId,String companyId);
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId , int spage, int pageSize, String controBoxBuildId,String companyId, String nameOrCode);
/**
* 获取下拉菜单数据
......
......@@ -74,7 +74,7 @@ public interface IBuilldService extends IService<Building> {
*
* @return List<BuildingTreeVo>
*/
List<BuildingTreeVo> getBuildingTree();
List<BuildingTreeVo> getBuildingTree(String bizOrgCode);
/**
* 消防建筑树查询接口(带条件bizOrgCode)
......@@ -346,4 +346,6 @@ public interface IBuilldService extends IService<Building> {
List<BuildingTreeVo> getBuildingTreeInMyOrgCodeList(String bizOrgCode);
List<OrgMenuDto> companyTreeByUserAndType();
List<BuildingTreeVo> treeByName(String bizOrgCode, String name);
}
......@@ -40,7 +40,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
* @param pageSize
* @return
*/
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize,String controBoxBuildId,String companyId);
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize, String nameOrCode);
FireFightingSystemEntity getOneById(Long id);
......
......@@ -70,7 +70,7 @@ public interface IFormInstanceService extends IService<FormInstance> {
* @param parentId 父节点
* @return List<Map < String, Object>>
*/
List<Map<String, Object>> getSpecialChildrenList(String parentId);
List<Map<String, Object>> getSpecialChildrenList(String parentId, String bizOrgCode);
/**
* 查询指定节点的下降
......@@ -164,4 +164,12 @@ public interface IFormInstanceService extends IService<FormInstance> {
List<UnitAreaTreeVo> getValueByColumn(Long instanceId, String bizOrgcode);
List<Map<String, Long>> getBuildVideoCount();
/**
* 查询指定节点的下降
*
* @param parentId 父节点
* @return List<Map < String, Object>>
*/
List<Map<String, Object>> getSpecialChildrenListByName(String parentId, String bizOrgCode, String name);
}
......@@ -452,8 +452,20 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
}
@Override
public List<BuildingTreeVo> getBuildingTree(String bizOrgCode) {
List<BuildingTreeVo> allListVo = getBuildingTreeVos(true, bizOrgCode);
return allListVo.stream().filter(s -> "-1".equals(s.getParentId())).map(s -> {
BuildingTreeVo t = new BuildingTreeVo();
Bean.copyExistPropertis(s, t);
t.setChildren(this.getChildren(t.getInstanceId(), allListVo));
t.setDetailPaneApi(address);
t.setApiUrl(apiUrl);
return t;
}).collect(Collectors.toList());
}
public List<BuildingTreeVo> getBuildingTree() {
List<BuildingTreeVo> allListVo = getBuildingTreeVos(true);
List<BuildingTreeVo> allListVo = getBuildingTreeVos(true, null);
return allListVo.stream().filter(s -> "-1".equals(s.getParentId())).map(s -> {
BuildingTreeVo t = new BuildingTreeVo();
Bean.copyExistPropertis(s, t);
......@@ -488,12 +500,12 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override
public List<Map<String, Object>> getBuildingDetaiList() {
return iFormInstanceService.getSpecialChildrenList(null);
return iFormInstanceService.getSpecialChildrenList(null, null);
}
private List<BuildingTreeVo> getBuildingTreeVos(Boolean isContainRootNode) {
private List<BuildingTreeVo> getBuildingTreeVos(Boolean isContainRootNode, String bizOrgCode) {
FormGroup formGroup = iFormGroupService.getByUniqueKey(GroupCodeEnum.ALL_BUILDING.getGroupCode());
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null);
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null, bizOrgCode);
List<BuildingTreeVo> allListVo = buildBuildingData(formGroup, allList, isContainRootNode);
Map<Long, String> absolutePositionMap = getBuildingAbsolutePosition(allListVo);
allListVo.forEach(s -> s.setAbsolutePosition(absolutePositionMap.get(s.getId())));
......@@ -505,7 +517,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override
public List<BuildingTreeVo> getBuildingTierTree(Integer tier) {
if (tier != null) {
List<BuildingTreeVo> list = getBuildingTreeVos(true);
List<BuildingTreeVo> list = getBuildingTreeVos(true, null);
if (!CollectionUtils.isEmpty(list)) {
if (tier == 1) {
List<BuildingTreeVo> collect = list.stream().filter(x -> "-1".equals(x.getParentId()) || "building".equalsIgnoreCase(x.getGroupType())).collect(Collectors.toList());
......@@ -1217,7 +1229,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override
public Map<Long, String> getBuildingAbsolutePosition() {
FormGroup formGroup = iFormGroupService.getByUniqueKey(GroupCodeEnum.ALL_BUILDING.getGroupCode());
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null);
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null, null);
List<BuildingTreeVo> allListVo = buildBuildingData(formGroup, allList, true);
return getBuildingAbsolutePosition(allListVo);
}
......@@ -1225,7 +1237,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override
public Map<String, Long> getBuildingCodeKey() {
Map<String, Long> resMap = new HashMap<>();
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null);
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null, null);
if (!allList.isEmpty()) {
allList.forEach(map -> resMap.put(String.valueOf(map.get("code")), Long.valueOf(String.valueOf(map.get("id")))));
}
......@@ -1387,7 +1399,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
if (StringUtils.isEmpty(authKey)) {
authKey = this.authKey;
}
List<BuildingTreeVo> buildingTreeVos = getBuildingTreeVos(false);
List<BuildingTreeVo> buildingTreeVos = getBuildingTreeVos(false, null);
// 1.获取公司list
List<OrgUsrDto> orgUsrLists = jcsRemoteService.getCompanyDeptListWithAuth(authKey, "COMPANY");
if(orgUsrLists.isEmpty()){
......@@ -1537,7 +1549,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
//如果传递的为部门bizOrgCode 取其上级单位下的建筑
// ResponseModel<OrgUsrDto> companyByBizOrgCodeList = jcsFeign.getCompanyByBizOrgCodeList(bizOrgCode);
// String resultCode = companyByBizOrgCodeList.getResult().getBizOrgCode();
List<BuildingTreeVo> buildingTreeVos = this.getBuildingTreeVos(true);
List<BuildingTreeVo> buildingTreeVos = this.getBuildingTreeVos(true, null);
List<BuildingTreeVo> orgBuildingTreeVos = buildingTreeVos.stream().filter(b-> b.getBizOrgCode() != null && b.getBizOrgCode().contains(bizOrgCode)).collect(Collectors.toList());
return buildingTreeVos.stream().filter(b -> "-1".equals(b.getParentId())).peek(b -> {
b.setId(0L);
......@@ -1580,4 +1592,26 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
a.setChildren(getCompanyBuildingChildrenTree(a.getId().toString(), all));
}).collect(Collectors.toList());
}
@Override
public List<BuildingTreeVo> treeByName(String bizOrgCode, String name) {
List<BuildingTreeVo> allListVo = getBuildingTreeVosByName(true, bizOrgCode, name);
return allListVo.stream().filter(s -> "-1".equals(s.getParentId())).map(s -> {
BuildingTreeVo t = new BuildingTreeVo();
Bean.copyExistPropertis(s, t);
t.setChildren(this.getChildren(t.getInstanceId(), allListVo));
t.setDetailPaneApi(address);
t.setApiUrl(apiUrl);
return t;
}).collect(Collectors.toList());
}
private List<BuildingTreeVo> getBuildingTreeVosByName(Boolean isContainRootNode, String bizOrgCode, String name) {
FormGroup formGroup = iFormGroupService.getByUniqueKey(GroupCodeEnum.ALL_BUILDING.getGroupCode());
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenListByName(null, bizOrgCode, name);
List<BuildingTreeVo> allListVo = buildBuildingData(formGroup, allList, isContainRootNode);
Map<Long, String> absolutePositionMap = getBuildingAbsolutePosition(allListVo);
allListVo.forEach(s -> s.setAbsolutePosition(absolutePositionMap.get(s.getId())));
return allListVo;
}
}
......@@ -191,7 +191,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
set(EquipmentSpecific::getRealtimeIotIndexUpdateDate,new Date()).
eq(EquipmentSpecific::getId,alarm.getEquipmentSpecificId());
equipmentSpecificSerivce.update(wrapper);
MqttReceiveServiceImpl.upAlarmLogStatus(alarmLog.getIotCode(), alarmLog.getEquipmentSpecificIndexKey(), null, equipmentSpecificAlarmLogService);
MqttReceiveServiceImpl.upAlarmLogStatus(alarmLog.getIotCode(), alarmLog.getEquipmentSpecificIndexKey(), null, equipmentSpecificAlarmLogService, true);
}
// 如果是批量确警,先查询,再确警,用于批量消息推送
isBatch = ent.getIsBatch();
......
......@@ -72,7 +72,7 @@ public class DownloadFileService implements IDownloadFileService {
//建筑信息
FormGroup formGroup = iFormGroupService.getByUniqueKey(GroupCodeEnum.ALL_BUILDING.getGroupCode());
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null);
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null, null);
List<BuildingTreeVo> allListVo = buildBuildingData(formGroup, allList);
appDownload.setBuildTree(allListVo);
......
package com.yeejoin.equipmanage.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.equipmanage.mapper.DutyDetailsMapper;
import com.yeejoin.equipmanage.service.DutyDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
@Service
public class DutyDetailsImpl implements DutyDetailsService {
@Autowired
private DutyDetailsMapper dutyDetailsMapper;
@Autowired
RedisUtils redisUtils;
@Override
public IPage<Map<String, Object>> dutyPersonPageList(int current, int size,String bizOrgCode) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String dutyDate = sdf.format(new Date());
Page page = new Page();
if (current > 0){
page.setCurrent((long) (current - 1) *size);
page.setSize(size);
}
return dutyDetailsMapper.selectDutyPersonList(page, dutyDate, bizOrgCode);
}
}
......@@ -56,7 +56,7 @@ public class EquipmentManageServiceImpl extends ServiceImpl<EquipmentManageMappe
@Override
public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance,
String bizOrgCode, String formGroupId, int current, int pageSize,String controBoxBuildId,String companyCode) {
String bizOrgCode, String formGroupId, int current, int pageSize) {
HttpServletRequest request = null;
Map map = new HashMap<String, Object>();
map.put("equimentName", equimentName);
......@@ -69,11 +69,14 @@ public class EquipmentManageServiceImpl extends ServiceImpl<EquipmentManageMappe
map.put("companyCode", companyCode);
map.put("formGroupId", formGroupId);
map.put("controBoxBuildId",controBoxBuildId);
map.put("nameOrCode", nameOrCode);
List<EquipmentManageVo> dataList = equipmentManageMapper.queryEquipmenInfo(map);
Long count = equipmentManageMapper.queryEquipmenCount(map);
map.clear();
map.put("dataList", dataList);
map.put("count", count);
map.put("current", current);
map.put("pageSize", pageSize);
return map;
}
......
......@@ -371,8 +371,8 @@ public class FilePatrolReportServiceImpl implements IFirePatrolReportService {
analysisReportLog.setEndDate(endDate);
analysisReportLog.setReportType(reportType);
analysisReportLog.setStationCode(stationCode);
Long rootParentId = Long.valueOf(String.valueOf(analysisReportLogMapper.getRootOrgUsr().get("sequence_nbr")));
return analysisReportLogMapper.allPage(page, analysisReportLog, rootParentId);
//Long rootParentId = Long.valueOf(String.valueOf(analysisReportLogMapper.getRootOrgUsr().get("sequence_nbr")));
return analysisReportLogMapper.allPage(page, analysisReportLog);
}
@Override
......
......@@ -250,8 +250,8 @@ public class FireAutoSysManageReportServiceImpl implements IFireAutoSysManageRep
analysisReportLog.setEndDate(endDate);
analysisReportLog.setReportType(reportType);
analysisReportLog.setStationCode(stationCode);
Long rootParentId = Long.valueOf(String.valueOf(analysisReportLogMapper.getRootOrgUsr().get("sequence_nbr")));
return analysisReportLogMapper.allPage(page, analysisReportLog, rootParentId);
//Long rootParentId = Long.valueOf(String.valueOf(analysisReportLogMapper.getRootOrgUsr().get("sequence_nbr")));
return analysisReportLogMapper.allPage(page, analysisReportLog);
}
@Override
......
......@@ -163,9 +163,9 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override
public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction,
String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize,String controBoxBuildId,String companyId) {
String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize, String controBoxBuildId,String companyId, String nameOrCode) {
Map<String, Object> map = equipmentManageService.queryEquipmenInfoAndCount(equimentName, equimentCode,
construction, maintenance, bizOrgCode, formGroupId, current, pageSize,controBoxBuildId, companyId);
construction, maintenance, bizOrgCode, formGroupId, current, pageSize, controBoxBuildId, companyId, nameOrCode);
List<EquipmentManageVo> dataList = (List<EquipmentManageVo>) map.get("dataList");
StringBuilder stb = new StringBuilder();
dataList.forEach(y -> {
......
......@@ -432,8 +432,8 @@ public class FormInstanceServiceImpl extends ServiceImpl<FormInstanceMapper, For
}
@Override
public List<Map<String, Object>> getSpecialChildrenList(String parentId) {
return this.baseMapper.querySpecialChildrenList(parentId);
public List<Map<String, Object>> getSpecialChildrenList(String parentId, String bizOrgCode) {
return this.baseMapper.querySpecialChildrenList(parentId, bizOrgCode);
}
@Override
......@@ -559,4 +559,9 @@ public class FormInstanceServiceImpl extends ServiceImpl<FormInstanceMapper, For
public List<Map<String, Long>> getBuildVideoCount() {
return formInstanceMapper.getBuildVideoCount();
}
@Override
public List<Map<String, Object>> getSpecialChildrenListByName(String parentId, String bizOrgCode, String name) {
return this.baseMapper.querySpecialChildrenListByName(parentId, bizOrgCode, name);
}
}
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mchange.v2.beans.swing.TestBean;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentDefectAlarm;
......@@ -57,8 +58,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
private static Map<String, TemperatureAlarmDto> temperatureMap = new HashMap<>();
static IEquipmentSpecificIndexService equipmentSpecificIndexService;
@Autowired
IEquipmentSpecificIndexService equipmentSpecificIndexService;
public void setEquipmentSpecificIndexService(IEquipmentSpecificIndexService equipmentSpecificIndexService){
MqttReceiveServiceImpl.equipmentSpecificIndexService = equipmentSpecificIndexService;
}
@Autowired
ICarPropertyService carPropertyService;
......@@ -88,11 +92,18 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Autowired
FireFightingSystemMapper FireFightingSystemMapper;
static IFireFightingSystemService fireFightingSystemService;
@Autowired
IFireFightingSystemService fireFightingSystemService;
public void setFireFightingSystemService(IFireFightingSystemService fireFightingSystemService){
MqttReceiveServiceImpl.fireFightingSystemService = fireFightingSystemService;
}
static MqttSendGateway mqttSendGateway;
@Autowired
MqttSendGateway mqttSendGateway;
public void setMqttSendGateway(MqttSendGateway mqttSendGateway){
MqttReceiveServiceImpl.mqttSendGateway = mqttSendGateway;
}
@Autowired
private RedisUtils redisUtils;
......@@ -133,8 +144,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Value("${mqtt.vehicle.topic}")
private String carTopic;
private static String canvasTopic;
@Value("${equip.point.equipmentdata.topic}")
private String canvasTopic;
public void setCanvasTopic(String canvasTopic){
MqttReceiveServiceImpl.canvasTopic = canvasTopic;
}
@Value("${equip.index.topic}")
private String indexTopic;
......@@ -308,7 +322,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
mqttSendGateway.sendToMqtt(TopicEnum.EQDQR.getTopic(), JSONArray.toJSON(action).toString());
} else {
alarmLogs.addAll(upAlarmLogStatus(action.getIotCode(), action.getEquipmentSpecificIndexKey(), action.getTraceId(),
equipmentSpecificAlarmLogService));
equipmentSpecificAlarmLogService, false));
mqttSendGateway.sendToMqtt(TopicEnum.EQYQR.getTopic(), JSONArray.toJSON(action).toString());
bool = Boolean.TRUE;
}
......@@ -386,7 +400,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
}
public static List<EquipmentSpecificAlarmLog> upAlarmLogStatus(String iotCode, String equipmentSpecificIndexKey,
String traceId, IEquipmentSpecificAlarmLogService equipmentSpecificAlarmLogService) {
String traceId, IEquipmentSpecificAlarmLogService equipmentSpecificAlarmLogService, boolean flag) {
LambdaQueryWrapper<EquipmentSpecificAlarmLog> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(EquipmentSpecificAlarmLog::getIotCode, iotCode);
queryWrapper.eq(EquipmentSpecificAlarmLog::getEquipmentSpecificIndexKey, equipmentSpecificIndexKey);
......@@ -403,6 +417,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
if (!logs.isEmpty()) {
equipmentSpecificAlarmLogService.updateBatchById(logs);
}
if (flag) {
List<EquipmentSpecificIndex> indexList = equipmentSpecificIndexService.getEquipmentSpeIndexBySpeIotCode(iotCode);
publishDataToCanvas(indexList);
}
return logs;
}
......@@ -411,7 +429,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
*
* @param indexList
*/
public void publishDataToCanvas(List<EquipmentSpecificIndex> indexList) {
public static void publishDataToCanvas(List<EquipmentSpecificIndex> indexList) {
if (!ObjectUtils.isEmpty(indexList)) {
EquipmentSpecificIndex index = indexList.stream().filter(x -> x.getUpdateDate() != null)
.sorted(Comparator.comparing(EquipmentSpecificIndex::getUpdateDate).reversed())
......
......@@ -45,5 +45,16 @@
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".apt_generated">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path=".apt_generated_tests">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
......@@ -437,7 +437,7 @@ public class FirefightersController extends BaseController {
@ApiOperation(httpMethod = "PUT", value = "获取人员详情", notes = "获取人员详情")
public ResponseModel<PeopleInfoDto> updatePeopleById(@RequestBody PeopleInfoDto firefighters, @PathVariable Long id) {
try {
if ("2".equals(firefighters.getFirefighters().getPeopleType())){
if ("1601".equals(firefighters.getFirefighters().getPeopleType())){
PeopleBasicInfoDto peopleBasicInfoDto = firefighters.getFirefighters();
Firefighters firefighter = new Firefighters();
BeanUtils.copyProperties(peopleBasicInfoDto, firefighter);
......
......@@ -208,7 +208,7 @@ public class ExcelServiceImpl {
// authFalg=true;
// }
//效验参数
boolean authFalg=getFlag(par);
boolean authFlag = getFlag(par);
switch (excelDto.getType()) {
......@@ -248,7 +248,7 @@ public class ExcelServiceImpl {
break;
case "SYXX":
// 暂时先还原代码不加 “非” ,为修改bug http://36.46.149.14:5080/zentao/task-view-6974.html 水源导出没有数据问题
if(!authFalg) {
if(!authFlag) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null,
WaterResourceDto.class, dataSourcesImpl, false);
break;
......@@ -275,7 +275,7 @@ public class ExcelServiceImpl {
AircraftDto.class, dataSourcesImpl, false);
break;
case "XFDW":
if(!authFalg) {
if(!authFlag) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null,
FireTeamDto.class, dataSourcesImpl, false);
break;
......@@ -285,7 +285,7 @@ public class ExcelServiceImpl {
FireTeamDto.class, dataSourcesImpl, false);
break;
case "WXXFZ":
if(!authFalg) {
if(!authFlag) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null,
FireStationDto.class, null, false);
break;
......@@ -301,7 +301,7 @@ public class ExcelServiceImpl {
FireStationDto.class, null, false);
break;
case "XFRY":
if(!authFalg) {
if(!authFlag) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
null, FirefightersExcelDto.class, null, false);
break;
......@@ -310,8 +310,8 @@ public class ExcelServiceImpl {
List<OrgUsrFireExcelDto> firefightersExcelDtoList = firefightersService.exportToExcelNew(false, par);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
firefightersExcelDtoList, OrgUsrFireExcelDto.class, null, false);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
firefightersExcelDtoList, FirefightersExcelDto.class, null, false);
// ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
// firefightersExcelDtoList, FirefightersExcelDto.class, null, false);
break;
case "WBRY":
List<MaintenancePersonExcleDto> maintenancePersonExcelDtoList = maintenanceCompanyService
......@@ -350,7 +350,7 @@ public class ExcelServiceImpl {
signDtos.getRecords(), SignDto.class, null, false);
break;
case "KEYSITE":
if(!authFalg) {
if(!authFlag) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null,
KeySiteExcleDto.class, null, false);
break;
......@@ -370,7 +370,7 @@ public class ExcelServiceImpl {
KeySiteExcleDto.class, null, false);
break;
case "JCDWRY":
if(!authFalg) {
if(!authFlag) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null,
OrgUsrExcelDto.class, null, false);
break;
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-biz</artifactId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>amos-boot-module-kgd-biz</artifactId>
<dependencies>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-kgd-api</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.yeejoin.amos.kgd.controller;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.TimeZone;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.DateTimeUtil;
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 com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.kgd.service.LiveDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@RestController
@Api(tags = "数据Api")
@RequestMapping(value = "/data")
public class DataManagerController extends BaseController{
@Autowired
LiveDataService liveDataService;
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "列表查询数据")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public ResponseModel query(
@RequestParam(value = "timeStart") String timeStart,
@RequestParam(value = "timeEnd") String timeEnd,
@RequestParam(value = "measurement") String measurement,
@RequestParam(value = "fieldKey", required = false) String fieldKey) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
df.setTimeZone(TimeZone.getTimeZone("UTC"));
Date start = DateTimeUtil.format(timeStart, DateTimeUtil.ISO_DATE_HOUR24_MIN_SEC);
Date end = DateTimeUtil.format(timeEnd, DateTimeUtil.ISO_DATE_HOUR24_MIN_SEC);
String startUTC = df.format(start);
String endUTC = df.format(end);
Map<String, Object> variables = new HashMap<>();
Enumeration<String> keys = request.getParameterNames();
while(keys.hasMoreElements()){
String name = (String)keys.nextElement();
String value = request.getParameter(name);
variables.put(name, value);
}
variables.remove("timeStart");
variables.remove("timeEnd");
variables.remove("measurement");
variables.remove("fieldKey");
return ResponseHelper.buildResponse(liveDataService.queryHistoryDataForList(measurement, startUTC, endUTC, fieldKey, variables));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "分页查询数据")
@RequestMapping(value = "/page", method = RequestMethod.GET)
public ResponseModel page(
@RequestParam(value = "timeStart") String timeStart,
@RequestParam(value = "timeEnd") String timeEnd,
@RequestParam(value = "measurement") String measurement,
@RequestParam(value = "fieldKey", required = false) String fieldKey,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
df.setTimeZone(TimeZone.getTimeZone("UTC"));
Date start = DateTimeUtil.format(timeStart, DateTimeUtil.ISO_DATE_HOUR24_MIN_SEC);
Date end = DateTimeUtil.format(timeEnd, DateTimeUtil.ISO_DATE_HOUR24_MIN_SEC);
String startUTC = df.format(start);
String endUTC = df.format(end);
Map<String, Object> variables = new HashMap<>();
Enumeration<String> keys = request.getParameterNames();
while(keys.hasMoreElements()){
String name = (String)keys.nextElement();
String value = request.getParameter(name);
variables.put(name, value);
}
variables.remove("timeStart");
variables.remove("timeEnd");
variables.remove("measurement");
variables.remove("fieldKey");
variables.remove("current");
variables.remove("size");
return ResponseHelper.buildResponse(liveDataService.queryHistoryDataForPage(measurement, startUTC, endUTC, fieldKey, variables, current, size));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "最新数据")
@RequestMapping(value = "/realTime", method = RequestMethod.GET)
public ResponseModel realTime(
@RequestParam(value = "measurement") String measurement) {
return ResponseHelper.buildResponse(liveDataService.queryrealTimeData(measurement));
}
}
package com.yeejoin.amos.knowledgebase.face.service;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
......@@ -255,7 +253,7 @@ public class DocAuditService {
List<ConstantCategoryModel> allCategoryModel = new ArrayList<>();
if (!allPublishedDocIds.isEmpty()) {
while (index < size) {
int num = Math.min(index + 50, size);
int num = Math.min(index + 200, size);
List<Long> curDocIds = allPublishedDocIds.subList(index, index + num);
index += num;
List<KnowledgeDocContentModel> docContentModels = docLibraryService.efficientList(curDocIds);
......@@ -275,6 +273,7 @@ public class DocAuditService {
// 推mq消息给规则服务
try {
emqKeeper.getMqttClient().publish(topic, ClazzUtils.serializableObject(definitionModel), RuleConfig.DEFAULT_QOS, false);
logger.info("知识库服务同步文档至规则消息发送成功 ("+ definitionModel +") " + new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date(System.currentTimeMillis())));
} catch (Exception e) {
logger.fatal("同步文档至规则服务出错", e);
}
......
......@@ -60,6 +60,7 @@
<module>amos-boot-module-equip-biz</module>
<module>amos-boot-module-ccs-biz</module>
<module>amos-boot-module-avic-biz</module>
<module>amos-boot-module-precontrol-biz</module>
<module>amos-boot-module-precontrol-biz</module>
<module>amos-boot-module-kgd-biz</module>
</modules>
</project>
\ No newline at end of file
This diff is collapsed.
/.apt_generated/
/.apt_generated_tests/
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>amos-boot-system-cas</artifactId>
<groupId>com.amosframework.boot</groupId>
<version>1.0.0</version>
</parent>
<artifactId>amos-boot-module-cas-api</artifactId>
<dependencies>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-common-api</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
</dependencies>
</project>
package com.yeejoin.amos.boot.module.cas.api.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* Dto
*
* @author duanwei
* @date 2022-09-14
*/
@Data
public class IdxBizXnzsDto implements Serializable {
private static final long serialVersionUID = 1L;
private String axisData;
private double one;
private double two;
private double three;
private double four;
}
package com.yeejoin.amos.boot.module.cas.api.dto;
import lombok.Data;
import java.util.List;
@Data
public class ResultDto {
List<List<Double>> seriesData;
List<String> axisData;
}
package com.yeejoin.amos.boot.module.cas.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
*
*
* @author duanwei
* @date 2022-09-14
*/
@Data
//@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="IdxBizXnzs对象", description="")
public class IdxBizXnzs implements Serializable {
private static final long serialVersionUID = 1L;
private Boolean valid;
private String record;
private LocalDateTime date;
private String creator;
@TableField("creatorName")
private String creatorName;
private String status;
@TableField("instanceId")
private String instanceId;
@ApiModelProperty(value = "年份")
private Integer cNf;
@ApiModelProperty(value = "季度")
private String cJd;
@ApiModelProperty(value = "地市")
private String cDs;
@ApiModelProperty(value = "季度代码")
private Integer cJddm;
@ApiModelProperty(value = "政务大类")
private String cZwdl;
@ApiModelProperty(value = "政务大类代码")
private String cZwdldm;
@ApiModelProperty(value = "政务子类")
private String cZwzl;
@ApiModelProperty(value = "政务子类代码")
private String cZwzldm;
@ApiModelProperty(value = "效能指数")
private Double cXnzs;
@ApiModelProperty(value = "季度权重")
private Integer cJdqz;
@ApiModelProperty(value = "地市权重")
private Integer cDsqz;
@ApiModelProperty(value = "报表权重")
private Integer cBbqz;
}
package com.yeejoin.amos.boot.module.cas.api.mapper;
import com.yeejoin.amos.boot.module.cas.api.dto.IdxBizXnzsDto;
import com.yeejoin.amos.boot.module.cas.api.entity.IdxBizXnzs;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
/**
* Mapper 接口
*
* @author duanwei
* @date 2022-09-14
*/
public interface IdxBizXnzsMapper extends BaseMapper<IdxBizXnzs> {
List<IdxBizXnzsDto> select();
List<IdxBizXnzsDto> selectZwdl();
}
package com.yeejoin.amos.boot.module.cas.api.service;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.cas.api.dto.IdxBizXnzsDto;
import com.yeejoin.amos.boot.module.cas.api.dto.ResultDto;
import com.yeejoin.amos.boot.module.cas.api.entity.IdxBizXnzs;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* 服务类
*
* @author duanwei
* @date 2022-09-14
*/
public interface IIdxBizXnzsService extends IService<IdxBizXnzs> {
JSONObject select();
JSONObject selectZwdl();
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.cas.api.mapper.IdxBizXnzsMapper">
<select id="select" resultType="com.yeejoin.amos.boot.module.cas.api.dto.IdxBizXnzsDto">
SELECT
a.c_ds as `axisData`,
a.`one`,
b.`two`,
c.`three`,
d.`four`
FROM
(
SELECT
c_ds,
round( SUM(((( `b`.`c_xnzs` * `b`.`c_jdqz` ) * `b`.`c_dsqz` ) * `b`.`c_bbqz` )), 2 ) AS "one"
FROM
idx_biz_xnzs AS b,
( SELECT c_jd, c_nf, c_jddm FROM idx_biz_xnzs GROUP BY c_jd, c_nf ORDER BY c_nf DESC, c_jddm DESC LIMIT 0, 1 ) AS a
WHERE
a.c_nf = b.c_nf
AND a.c_jddm = b.c_jddm
GROUP BY
c_ds
) AS a
LEFT JOIN (
SELECT
c_ds,
round( SUM(((( `b`.`c_xnzs` * `b`.`c_jdqz` ) * `b`.`c_dsqz` ) * `b`.`c_bbqz` )), 2 ) AS "two"
FROM
idx_biz_xnzs AS b,
( SELECT c_jd, c_nf, c_jddm FROM idx_biz_xnzs GROUP BY c_jd, c_nf ORDER BY c_nf DESC, c_jddm DESC LIMIT 1, 1 ) AS a
WHERE
a.c_nf = b.c_nf
AND a.c_jddm = b.c_jddm
GROUP BY
c_ds
) AS b ON b.c_ds = a.c_ds
LEFT JOIN (
SELECT
c_ds,
round( SUM(((( `b`.`c_xnzs` * `b`.`c_jdqz` ) * `b`.`c_dsqz` ) * `b`.`c_bbqz` )), 2 ) AS "three"
FROM
idx_biz_xnzs AS b,
( SELECT c_jd, c_nf, c_jddm FROM idx_biz_xnzs GROUP BY c_jd, c_nf ORDER BY c_nf DESC, c_jddm DESC LIMIT 2, 1 ) AS a
WHERE
a.c_nf = b.c_nf
AND a.c_jddm = b.c_jddm
GROUP BY
c_ds
) AS c ON c.c_ds = a.c_ds
LEFT JOIN (
SELECT
c_ds,
round( SUM(((( `b`.`c_xnzs` * `b`.`c_jdqz` ) * `b`.`c_dsqz` ) * `b`.`c_bbqz` )), 2 ) AS "four"
FROM
idx_biz_xnzs AS b,
( SELECT c_jd, c_nf, c_jddm FROM idx_biz_xnzs GROUP BY c_jd, c_nf ORDER BY c_nf DESC, c_jddm DESC LIMIT 3, 1 ) AS a
WHERE
a.c_nf = b.c_nf
AND a.c_jddm = b.c_jddm
GROUP BY
c_ds
) AS d ON d.c_ds = a.c_ds
</select>
<select id="selectZwdl" resultType="com.yeejoin.amos.boot.module.cas.api.dto.IdxBizXnzsDto">
SELECT
a.c_zwdl as `axisData`,
a.`one`,
b.`two`,
c.`three`,
d.`four`
FROM
(
SELECT
c_zwdl,
round( SUM(((( `b`.`c_xnzs` * `b`.`c_jdqz` ) * `b`.`c_dsqz` ) * `b`.`c_bbqz` )), 2 ) AS "one"
FROM
idx_biz_xnzs AS b,
( SELECT c_jd, c_nf, c_jddm FROM idx_biz_xnzs GROUP BY c_jd, c_nf ORDER BY c_nf DESC, c_jddm DESC LIMIT 0, 1 ) AS a
WHERE
a.c_nf = b.c_nf
AND a.c_jddm = b.c_jddm
GROUP BY
c_zwdl
) AS a
LEFT JOIN (
SELECT
c_zwdl,
round( SUM(((( `b`.`c_xnzs` * `b`.`c_jdqz` ) * `b`.`c_dsqz` ) * `b`.`c_bbqz` )), 2 ) AS "two"
FROM
idx_biz_xnzs AS b,
( SELECT c_jd, c_nf, c_jddm FROM idx_biz_xnzs GROUP BY c_jd, c_nf ORDER BY c_nf DESC, c_jddm DESC LIMIT 1, 1 ) AS a
WHERE
a.c_nf = b.c_nf
AND a.c_jddm = b.c_jddm
GROUP BY
c_zwdl
) AS b ON b.c_zwdl = a.c_zwdl
LEFT JOIN (
SELECT
c_zwdl,
round( SUM(((( `b`.`c_xnzs` * `b`.`c_jdqz` ) * `b`.`c_dsqz` ) * `b`.`c_bbqz` )), 2 ) AS "three"
FROM
idx_biz_xnzs AS b,
( SELECT c_jd, c_nf, c_jddm FROM idx_biz_xnzs GROUP BY c_jd, c_nf ORDER BY c_nf DESC, c_jddm DESC LIMIT 2, 1 ) AS a
WHERE
a.c_nf = b.c_nf
AND a.c_jddm = b.c_jddm
GROUP BY
c_zwdl
) AS c ON c.c_zwdl = a.c_zwdl
LEFT JOIN (
SELECT
c_zwdl,
round( SUM(((( `b`.`c_xnzs` * `b`.`c_jdqz` ) * `b`.`c_dsqz` ) * `b`.`c_bbqz` )), 2 ) AS "four"
FROM
idx_biz_xnzs AS b,
( SELECT c_jd, c_nf, c_jddm FROM idx_biz_xnzs GROUP BY c_jd, c_nf ORDER BY c_nf DESC, c_jddm DESC LIMIT 3, 1 ) AS a
WHERE
a.c_nf = b.c_nf
AND a.c_jddm = b.c_jddm
GROUP BY
c_zwdl
) AS d ON d.c_zwdl = a.c_zwdl
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>amos-boot-system-cas</artifactId>
<groupId>com.amosframework.boot</groupId>
<version>1.0.0</version>
</parent>
<artifactId>amos-boot-module-cas-biz</artifactId>
<dependencies>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-cas-api</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-common-biz</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import java.net.InetAddress;
/**
* <pre>
* 特种设备服务启动类
* </pre>
*
* @author DELL
*/
@SpringBootApplication
@EnableTransactionManagement
@EnableConfigurationProperties
@ServletComponentScan
@EnableDiscoveryClient
@EnableFeignClients
@EnableAsync
@EnableEurekaClient
@EnableScheduling
@MapperScan({ "org.typroject.tyboot.demo.face.orm.dao*", "org.typroject.tyboot.face.*.orm.dao*",
"org.typroject.tyboot.core.auth.face.orm.dao*", "org.typroject.tyboot.component.*.face.orm.dao*",
"com.yeejoin.amos.boot.module.**.api.mapper", "com.yeejoin.amos.boot.biz.common.dao.mapper","com.yeejoin.amos.boot.module.common.biz.*" })
@ComponentScan(basePackages = { "org.typroject", "com.yeejoin.amos" })
public class AmosCasApplication {
private static final Logger logger = LoggerFactory.getLogger(AmosCasApplication.class);
public static void main(String[] args) throws Exception {
ConfigurableApplicationContext context = SpringApplication.run(AmosCasApplication.class, args);
Environment env = context.getEnvironment();
String ip = InetAddress.getLocalHost().getHostAddress();
String port = env.getProperty("server.port");
String path = oConvertUtils.getString(env.getProperty("server.servlet.context-path"));
logger.info("\n----------------------------------------------------------\n\t"
+ "Application Amos-Biz-Boot is running! Access URLs:\n\t" + "Swagger文档: \thttp://" + ip + ":" + port
+ path + "/doc.html\n" + "----------------------------------------------------------");
}
}
package com.yeejoin.amos.boot.module.cas.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.cas.api.dto.IdxBizXnzsDto;
import com.yeejoin.amos.boot.module.cas.api.dto.ResultDto;
import com.yeejoin.amos.boot.module.cas.api.entity.IdxBizXnzs;
import com.yeejoin.amos.boot.module.cas.api.service.IIdxBizXnzsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
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 javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
import java.util.List;
/**
*
*
* @author duanwei
* @date 2022-09-14
*/
@RestController
@Api(tags = "Api")
@RequestMapping(value = "/idx-biz-xnzs", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class IdxBizXnzsController extends BaseController {
@Autowired
IIdxBizXnzsService iIdxBizXnzsService;
/**
* 新增
* @return
*/
@RequestMapping(value = "/save", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public boolean saveIdxBizXnzs(HttpServletRequest request, @RequestBody IdxBizXnzs idxBizXnzs){
return iIdxBizXnzsService.save(idxBizXnzs);
}
/**
* 根据id删除
* @param id
* @return
*/
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@ApiOperation(httpMethod = "DELETE", value = "根据id删除", notes = "根据id删除")
public boolean deleteById(HttpServletRequest request, @PathVariable Long id){
return iIdxBizXnzsService.removeById(id);
}
/**
* 修改
* @return
*/
@RequestMapping(value = "/updateById", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "修改", notes = "修改")
public boolean updateByIdIdxBizXnzs(HttpServletRequest request, @RequestBody IdxBizXnzs idxBizXnzs){
return iIdxBizXnzsService.updateById(idxBizXnzs);
}
/**
* 根据id查询
* @param id
* @return
*/
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public IdxBizXnzs selectById(HttpServletRequest request, @PathVariable Long id){
return iIdxBizXnzsService.getById(id);
}
/**
* 列表分页查询
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY ,needAuth = false)
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "列表分页查询", notes = "列表分页查询")
public IPage<IdxBizXnzs> listPage(String pageNum,String pageSize,
IdxBizXnzs idxBizXnzs){
Page<IdxBizXnzs> pageBean;
QueryWrapper<IdxBizXnzs> idxBizXnzsQueryWrapper = new QueryWrapper<>();
Class<? extends IdxBizXnzs> aClass = idxBizXnzs.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
Object o = field.get(idxBizXnzs);
if (o != null) {
Class<?> type = field.getType();
String name = NameUtils.camel2Underline(field.getName());
if (type.equals(Integer.class)) {
Integer fileValue = (Integer) field.get(idxBizXnzs);
idxBizXnzsQueryWrapper.eq(name, fileValue);
} else if (type.equals(Long.class)) {
Long fileValue = (Long) field.get(idxBizXnzs);
idxBizXnzsQueryWrapper.eq(name, fileValue);
} else if (type.equals(String.class)) {
String fileValue = (String) field.get(idxBizXnzs);
idxBizXnzsQueryWrapper.eq(name, fileValue);
} else {
String fileValue = (String) field.get(idxBizXnzs);
idxBizXnzsQueryWrapper.eq(name, fileValue);
}
}
}catch (Exception e) {
}
});
IPage<IdxBizXnzs> page;
if (StringUtils.isBlank(pageNum) ||StringUtils.isBlank(pageSize)) {
pageBean = new Page<>(0, Long.MAX_VALUE);
}else{
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
page = iIdxBizXnzsService.page(pageBean, idxBizXnzsQueryWrapper);
return page;
}
/**
* 查询
* @param
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY ,needAuth = false)
@RequestMapping(value = "/select", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "查询地市", notes = "查询地市")
public ResponseModel<JSONObject> select(){
return ResponseHelper.buildResponse(iIdxBizXnzsService.select());
}
/**
* 查询政务大列
* @author 王龙
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@RequestMapping(value = "/selectZwdl", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET",value = "查询政务大类", notes = "查询政务大类")
public ResponseModel<JSONObject> selectZwdl() {
return ResponseHelper.buildResponse(iIdxBizXnzsService.selectZwdl());
}
}
package com.yeejoin.amos.boot.module.cas.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.amos.boot.module.cas.api.dto.IdxBizXnzsDto;
import com.yeejoin.amos.boot.module.cas.api.dto.ResultDto;
import com.yeejoin.amos.boot.module.cas.api.entity.IdxBizXnzs;
import com.yeejoin.amos.boot.module.cas.api.mapper.IdxBizXnzsMapper;
import com.yeejoin.amos.boot.module.cas.api.service.IIdxBizXnzsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import springfox.documentation.spring.web.json.Json;
import java.util.*;
/**
* 服务实现类
*
* @author wanglong
* @date 2022-09-14
*/
@Service
public class IdxBizXnzsServiceImpl extends BaseService<IdxBizXnzsDto, IdxBizXnzs,IdxBizXnzsMapper> implements IIdxBizXnzsService {
@Autowired
private IdxBizXnzsMapper idxBizXnzsMapper;
private static final Logger log = LoggerFactory.getLogger(IdxBizXnzsServiceImpl.class);
@Override
public JSONObject select() {
/**
* 预返回数据
*/
JSONObject message = new JSONObject();
List<IdxBizXnzsDto> xnzsDtoList = idxBizXnzsMapper.select();
List<String> axisData = new ArrayList<>();
// List<List<Double>> seriesDataList=new ArrayList<>();
List<JSONObject> seriesDataList = new ArrayList<>();
String [] borderColor = {"#5966e6","#e7533b","#00c190","#8f57da","#f59c59","#19d3f3","#ff6692","#b6e880","#413a68","#f5c551","#4857c2","#ed553b","#01bb8d","#a561f3" };
String [] color = {"#354599","#7b393a","#047569","#584099","#835f4a","#15a7c7","#834166","#5e825c","#835a9c","#a18a49","#354599","#7b393b","#037569","#6f4ab4"};
int i = 0;
for(IdxBizXnzsDto bizXnzsDto : xnzsDtoList){
// List<Double> list=new ArrayList<>();
JSONObject firstJson = new JSONObject();
JSONObject secondJson = new JSONObject();
JSONObject thirdly = new JSONObject();
axisData.add(bizXnzsDto.getAxisData());
JSONArray json = new JSONArray();
Double[] doubles = {bizXnzsDto.getOne(),bizXnzsDto.getTwo(),bizXnzsDto.getThree(),bizXnzsDto.getFour()};
thirdly.put("borderWidth","2");
thirdly.put("borderColor",borderColor[i]);
thirdly.put("color",color[i]);
secondJson.put("normal",thirdly);
i = i+1;
Arrays.sort(doubles);
json.add(doubles[0]);
json.add((doubles[0]+doubles[1])/2);
json.add((doubles[1]+doubles[2])/2);
json.add((doubles[2]+doubles[3])/2);
json.add(doubles[3]);
firstJson.put("value",json);
firstJson.put("itemStyle",secondJson);
seriesDataList.add(firstJson);
// seriesDataList.add(list);
}
message.put("axisData",axisData);
message.put("seriesData",seriesDataList);
return message;
}
/**
* 查询政务大列
* @return
*/
@Override
public JSONObject selectZwdl() {
/**
* 预返回数据
*/
JSONObject message = new JSONObject();
List<String> axisData=new ArrayList<>();
// List<List<Double>> seriesDataList=new ArrayList<>();
List<JSONObject> seriesDataList = new ArrayList<>();
/**
* 颜色
*/
String [] borderColor = {"#5966e6","#e7533b","#00c190","#8f57da","#f59c59","#19d3f3","#ff6692","#b6e880","#413a68","#f5c551","#4857c2","#ed553b","#01bb8d","#a561f3" };
String [] color = {"#354599","#7b393a","#047569","#584099","#835f4a","#15a7c7","#834166","#5e825c","#835a9c","#a18a49","#354599","#7b393b","#037569","#6f4ab4"};
int i =0;
/**
* 获取政务大列数据
*/
List<IdxBizXnzsDto> zwdlDto = idxBizXnzsMapper.selectZwdl();
/**
* 组装返回数据
*/
for(IdxBizXnzsDto idxBizXnzsDto : zwdlDto ) {
/**
* 子数据
*/
JSONObject firstJson = new JSONObject();
JSONObject secondJson = new JSONObject();
JSONObject thirdly = new JSONObject();
//预返回箱线图数据
// List<Double> list = new ArrayList<>();
JSONArray json = new JSONArray();
//添加政务大类
axisData.add(idxBizXnzsDto.getAxisData());
//添加最近四季度
Double[] ottf = {idxBizXnzsDto.getOne(),idxBizXnzsDto.getTwo(),idxBizXnzsDto.getThree(), idxBizXnzsDto.getFour()};
thirdly.put("borderWidth","2");
thirdly.put("borderColor",borderColor[i]);
thirdly.put("color",color[i]);
secondJson.put("normal",thirdly);
i = i+1;
//排序(从小到大)
Arrays.sort(ottf);
/**
* 添加箱线图数据
*/
json.add(ottf[0]);
json.add((ottf[0]+ottf[1])/2);
json.add((ottf[1]+ottf[2])/2);
json.add((ottf[2]+ottf[3])/2);
json.add(ottf[3]);
firstJson.put("value",json);
firstJson.put("itemStyle",secondJson);
seriesDataList.add(firstJson);
}
message.put("seriesData",seriesDataList);
message.put("axisData",axisData);
return message;
}
}
#DB properties:
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://172.16.10.210:3306/amos_idx_biz?allowMultiQueries=true&serverTimezone=GMT%2B8\
&characterEncoding=utf8
spring.datasource.username=root
spring.datasource.password=Yeejoin@2020
##eureka properties:
eureka.client.service-url.defaultZone =http://172.16.10.210:10001/eureka/
eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=*
eureka.instance.health-check-url=http://172.16.3.99:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url=http://172.16.3.99:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.3.99:${server.port}${server.servlet.context-path}/swagger-ui.html
#redis properties:
spring.redis.database=1
spring.redis.host=172.16.10.210
spring.redis.port=6379
spring.redis.password=yeejoin@2020
spring.redis.lettuce.pool.max-active=200
spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time=300
spring.application.name=CAS
server.servlet.context-path=/cas
server.port=12000
spring.profiles.active=dev
spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
logging.config=classpath:logback-${spring.profiles.active}.xml
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
redis.cache.failure.time=10800
##liquibase
spring.liquibase.change-log = classpath:/db/changelog/changelog-master.xml
spring.liquibase.enabled= true
## DB properties:
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.minimum-idle=10
spring.datasource.hikari.maximum-pool-size=25
spring.datasource.hikari.auto-commit=true
spring.datasource.hikari.idle-timeout=30000
spring.datasource.hikari.pool-name=DatebookHikariCP
spring.datasource.hikari.max-lifetime=120000
spring.datasource.hikari.connection-timeout=30000
spring.datasource.hikari.connection-test-query=SELECT 1
## eureka properties:
eureka.client.registry-fetch-interval-seconds=5
eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=*
eureka.instance.health-check-url-path=/actuator/health
eureka.instance.lease-expiration-duration-in-seconds=10
eureka.instance.lease-renewal-interval-in-seconds=5
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url-path=/actuator/info
eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/doc.html
## redis properties:
spring.redis.lettuce.pool.max-active=200
spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time=300
## emqx properties:
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.10.90:1883
emqx.user-name=super
emqx.password=123456
fire-rescue=123
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">
<!-- <changeSet author="xl" id="2022-06-27-01">-->
<!-- <preConditions onFail="MARK_RAN">-->
<!-- <tableExists tableName="tz_task"/>-->
<!-- </preConditions>-->
<!-- <comment>modify table tz_task add task_type columns</comment>-->
<!-- <sql>-->
<!-- ALTER TABLE `tz_task` add task_type varchar(255) DEFAULT NULL COMMENT '任务类型';-->
<!-- </sql>-->
<!-- </changeSet>-->
</databaseChangeLog>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">
<include file="cas-1.0.0.0.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
<property name="LOG_HOME" value="log" />
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %-50.50logger{50} - %msg [%file:%line] %n" />
<!-- 按照每天生成日志文件 -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/tzs.log.%d{yyyy-MM-dd}.%i.log</FileNamePattern>
<!--日志文件保留天数-->
<MaxHistory>30</MaxHistory>
<!--日志文件大小-->
<MaxFileSize>30mb</MaxFileSize>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<!-- 控制台输出 -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<!-- show parameters for hibernate sql 专为 Hibernate 定制
<logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="TRACE" />
<logger name="org.hibernate.type.descriptor.sql.BasicExtractor" level="DEBUG" />
<logger name="org.hibernate.SQL" level="DEBUG" />
<logger name="org.hibernate.engine.QueryParameters" level="DEBUG" />
<logger name="org.hibernate.engine.query.HQLQueryPlan" level="DEBUG" />
-->
<!--myibatis log configure-->
<logger name="com.apache.ibatis" level="INFO"/>
<logger name="org.mybatis" level="INFO" />
<logger name="java.sql.Connection" level="INFO"/>
<logger name="java.sql.Statement" level="INFO"/>
<logger name="java.sql.PreparedStatement" level="INFO"/>
<logger name="org.springframework" level="INFO"/>
<logger name="com.baomidou.mybatisplus" level="INFO"/>
<logger name="org.apache.activemq" level="INFO"/>
<logger name="org.typroject" level="INFO"/>
<logger name="com.yeejoin" level="INFO"/>
<!-- 日志输出级别 -->
<root level="DEBUG">
<!-- <appender-ref ref="FILE" /> -->
<appender-ref ref="STDOUT" />
</root>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>amos-boot-system-cas</artifactId>
<parent>
<artifactId>amos-biz-boot</artifactId>
<groupId>com.amosframework.boot</groupId>
<version>1.0.0</version>
</parent>
<packaging>pom</packaging>
<modules>
<module>amos-boot-module-cas-api</module>
<module>amos-boot-module-cas-biz</module>
</modules>
<dependencies>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-biz-common</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
</dependencies>
</project>
......@@ -23,12 +23,17 @@ eureka.instance.prefer-ip-address = true
eureka.client.serviceUrl.defaultZone: http://${eureka.instance.hostname}:10001/eureka/
#security config
security.password=a1234560
security.loginId=fas_system
#security.password=a1234560
#security.loginId=fas_system
security.productApp=STUDIO_APP_MOBILE
security.productWeb=STUDIO_APP_WEB
security.appKeyApp=studio_normalapp_3056965
#security.productWeb=STUDIO_APP_WEB
#security.appKeyApp=studio_normalapp_3056965
amos.system.user.user-name=fas_system
amos.system.user.password=a1234560
amos.system.user.app-key=studio_normalapp_3056965
amos.system.user.product=STUDIO_APP_WEB
#redis
......
......@@ -17,11 +17,17 @@ eureka.instance.prefer-ip-address = true
eureka.client.serviceUrl.defaultZone: http://${eureka.instance.hostname}:10001/eureka/
#security config
security.password=a1234560
security.loginId=fas_system
#security.password=a1234560
#security.loginId=fas_system
security.productApp=STUDIO_APP_MOBILE
security.productWeb=STUDIO_APP_WEB
security.appKeyApp=studio_normalapp_3056965
#security.productWeb=STUDIO_APP_WEB
#security.appKeyApp=studio_normalapp_3056965
amos.system.user.user-name=fas_system
amos.system.user.password=a1234560
amos.system.user.app-key=studio_normalapp_3056965
amos.system.user.product=STUDIO_APP_WEB
#redis
spring.redis.database=1
......
......@@ -23,11 +23,17 @@ eureka.instance.prefer-ip-address = true
eureka.client.serviceUrl.defaultZone: http://${eureka.instance.hostname}:10001/eureka/
#security config
security.password=a1234560
security.loginId=fas_system
#security.password=a1234560
#security.loginId=fas_system
security.productApp=STUDIO_APP_MOBILE
security.productWeb=STUDIO_APP_WEB
security.appKeyApp=studio_normalapp_3157169
#security.productWeb=STUDIO_APP_WEB
#security.appKeyApp=studio_normalapp_3056965
amos.system.user.user-name=fas_system
amos.system.user.password=a1234560
amos.system.user.app-key=studio_normalapp_3157169
amos.system.user.product=STUDIO_APP_WEB
#redis
spring.redis.database=0
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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